Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>
char str[500000];
int a[500001];

void dac(int le, int ri){
  if(ri<le) return;
  if(le>ri) return;
  int i, mina, minidx;
  mina=a[le];
  minidx=le;
  for(i=le+1;i<=ri;i++){
    if(a[i]<mina){
      mina=a[i];
      minidx=i;
    }
  }
  for(i=le;i<=ri;i++){
    a[i]-=mina;
  }
  
  int nle = minidx - 1;
  int nri = minidx;
  while (str[nle] == '>' && nle) nle--;
  if (!(nle == 0 && str[nle] == '>')) nle++; //le is last >
  while (str[nri] == '<') nri++;
  nri--; //ri is last <
  dac(le, nle - 1);
  dac(nri + 2, ri);
  return;
}

int main()
{
  scanf("%s", str);
  int len=strlen(str);
  int i;
  a[0]=0;
  for(i=0;i<len;i++){
    if(str[i]=='<'){
      a[i+1]=a[i]+1;
    }else{
      a[i+1]=a[i]-1;
    }
  }
  int mina, minidx;
  mina=0;
  minidx=0;
  for(i=1;i<=len;i++){
    if(a[i]<mina){
      mina=a[i];
      minidx=i;
    }
  }
  for(i=0;i<=len;i++){
    a[i]-=mina;
  }
  int le=minidx-1;
  int ri=minidx;
  while(str[le]=='>' && le) le--;
  if(!(le==0 && str[le]=='>')){
    le++; //le is last >
    dac(0,le-1);
  }
  while(str[ri]=='<') ri++;
  ri--; //ri is last <
  dac(ri+2,len);
  
  long sum=0;
  for(i=0;i<=len;i++){
    sum+=a[i];
  }
  printf("%ld\n",sum);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	str
	.bss
	.align 32
	.type	str, @object
	.size	str, 500000
str:
	.zero	500000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 2000004
a:
	.zero	2000004
	.text
	.globl	dac
	.type	dac, @function
dac:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L17
	movl	-36(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jg	.L18
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L5
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
.L6:
	addl	$1, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L7
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-16(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L9
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L10
.L12:
	subl	$1, -8(%rbp)
.L10:
	movl	-8(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	jne	.L11
	cmpl	$0, -8(%rbp)
	jne	.L12
.L11:
	cmpl	$0, -8(%rbp)
	jne	.L13
	movl	-8(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	je	.L15
.L13:
	addl	$1, -8(%rbp)
	jmp	.L15
.L16:
	addl	$1, -4(%rbp)
.L15:
	movl	-4(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$60, %al
	je	.L16
	subl	$1, -4(%rbp)
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dac
	movl	-4(%rbp), %eax
	leal	2(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dac
	jmp	.L1
.L17:
	nop
	jmp	.L1
.L18:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dac, .-dac
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	leaq	str(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	str(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -12(%rbp)
	movl	$0, a(%rip)
	movl	$0, -32(%rbp)
	jmp	.L20
.L23:
	movl	-32(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$60, %al
	jne	.L21
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	addl	$1, %edx
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L22
.L21:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	addl	$1, %edx
	leal	-1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L22:
	addl	$1, -32(%rbp)
.L20:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L23
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L24
.L26:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L25
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
.L25:
	addl	$1, -32(%rbp)
.L24:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L26
	movl	$0, -32(%rbp)
	jmp	.L27
.L28:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-28(%rbp), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L27:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L28
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L29
.L31:
	subl	$1, -20(%rbp)
.L29:
	movl	-20(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	jne	.L30
	cmpl	$0, -20(%rbp)
	jne	.L31
.L30:
	cmpl	$0, -20(%rbp)
	jne	.L32
	movl	-20(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	je	.L34
.L32:
	addl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	dac
	jmp	.L34
.L35:
	addl	$1, -16(%rbp)
.L34:
	movl	-16(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$60, %al
	je	.L35
	subl	$1, -16(%rbp)
	movl	-16(%rbp), %eax
	leal	2(%rax), %edx
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dac
	movq	$0, -8(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L36
.L37:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -8(%rbp)
	addl	$1, -32(%rbp)
.L36:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L37
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	dac
	.type	dac, @function
dac:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	jl	.L30
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	str(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	-1(%r12), %r13
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	a(%rip), %rbx
.L2:
	movslq	%edi, %r10
	leal	1(%rdi), %r8d
	movl	(%rbx,%r10,4), %esi
	movl	%r8d, %r14d
	cmpl	%r8d, %ebp
	jl	.L3
	movslq	%r8d, %rax
	movl	%edi, %edx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rbx,%rax,4), %ecx
	cmpl	%esi, %ecx
	jge	.L4
	movl	%eax, %edx
	movl	%ecx, %esi
.L4:
	addq	$1, %rax
	cmpl	%eax, %ebp
	jge	.L5
	movl	%ebp, %eax
	subl	%edi, %eax
	leal	1(%rax), %r9d
	cmpl	$2, %eax
	jbe	.L6
	movl	%r9d, %eax
	leaq	(%rbx,%r10,4), %rcx
	movd	%esi, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm2, %xmm1
	leal	-1(%rax), %r8d
	leaq	16(%rcx), %rax
	salq	$4, %r8
	addq	%rax, %r8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L35:
	addq	$16, %rax
.L7:
	movdqu	(%rcx), %xmm0
	psubd	%xmm1, %xmm0
	movups	%xmm0, (%rcx)
	movq	%rax, %rcx
	cmpq	%r8, %rax
	jne	.L35
	movl	%r9d, %eax
	andl	$-4, %eax
	leal	(%rax,%rdi), %r8d
	cmpl	%eax, %r9d
	je	.L8
	movslq	%r8d, %rax
	addl	$1, %r8d
	subl	%esi, (%rbx,%rax,4)
	cmpl	%r8d, %ebp
	jl	.L8
.L17:
	movslq	%r8d, %rax
	addl	$1, %r8d
	subl	%esi, (%rbx,%rax,4)
	cmpl	%ebp, %r8d
	jg	.L8
	movslq	%r8d, %r8
	subl	%esi, (%rbx,%r8,4)
.L8:
	leal	-1(%rdx), %esi
	leal	1(%rdx), %r14d
	movslq	%esi, %rax
	cmpb	$62, (%r12,%rax)
	jne	.L33
.L28:
	testl	%esi, %esi
	je	.L18
	leal	-2(%rdx), %esi
	movslq	%edx, %r8
	movslq	%esi, %rax
	leaq	-3(%r8), %rcx
	movl	%esi, %esi
	subq	%rsi, %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L37:
	subq	$1, %rax
	cmpq	%rcx, %rax
	je	.L36
.L11:
	cmpb	$62, (%r12,%rax)
	movl	%eax, %esi
	je	.L37
.L10:
	leal	1(%rdx), %eax
	cmpb	$60, (%r12,%r8)
	cltq
	jne	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, %r14d
	addq	$1, %rax
	cmpb	$60, 0(%r13,%rax)
	je	.L12
	addl	$1, %r14d
.L13:
	call	dac
	cmpl	%r14d, %ebp
	jl	.L1
	movl	%r14d, %edi
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	movl	$-1, %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movl	%edi, %edx
	movl	$0, (%rbx,%r10,4)
	leal	-1(%rdx), %esi
	movslq	%esi, %rax
	cmpb	$62, (%r12,%rax)
	je	.L28
.L33:
	movslq	%edx, %r8
	jmp	.L10
.L6:
	subl	%esi, (%rbx,%r10,4)
	jmp	.L17
.L30:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	ret
.L18:
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	.cfi_offset 6, -40
	.cfi_offset 12, -32
	.cfi_offset 13, -24
	.cfi_offset 14, -16
	movl	$-1, %esi
	movslq	%edx, %r8
	jmp	.L10
	.cfi_endproc
.LFE35:
	.size	dac, .-dac
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	str(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movq	%r13, %rdi
	call	strlen@PLT
	leaq	a(%rip), %r11
	movl	$0, a(%rip)
	movq	%rax, %rbx
	movl	%eax, %r12d
	testq	%rax, %rax
	je	.L57
	leal	-1(%rbx), %esi
	leaq	4(%r11), %rcx
	movq	%r13, %rdx
	movq	%r11, %rax
	leaq	(%rcx,%rsi,4), %rdi
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L40:
	subl	$1, %ecx
	addq	$4, %rax
	addq	$1, %rdx
	movl	%ecx, (%rax)
	cmpq	%rdi, %rax
	je	.L70
.L43:
	cmpb	$60, (%rdx)
	movl	(%rax), %ecx
	jne	.L40
	addl	$1, %ecx
	addq	$4, %rax
	addq	$1, %rdx
	movl	%ecx, (%rax)
	cmpq	%rdi, %rax
	jne	.L43
.L70:
	addq	$2, %rsi
	movl	$1, %eax
	xorl	%ebp, %ebp
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L45:
	movl	(%r11,%rax,4), %edx
	cmpl	%ecx, %edx
	jge	.L44
	movl	%eax, %ebp
	movl	%edx, %ecx
.L44:
	addq	$1, %rax
	cmpq	%rsi, %rax
	jne	.L45
.L39:
	leal	1(%rbx), %r14d
	testl	%ebx, %ebx
	movl	$1, %eax
	cmovs	%eax, %r14d
	cmpl	$2, %ebx
	jbe	.L58
	leaq	a(%rip), %rax
	movd	%ecx, %xmm5
	movl	%r14d, %edx
	shrl	$2, %edx
	leaq	16(%rax), %rsi
	pshufd	$0, %xmm5, %xmm1
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L47:
	movdqa	(%rax), %xmm0
	addq	$16, %rax
	psubd	%xmm1, %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L47
	movl	%r14d, %eax
	andl	$-4, %eax
	testb	$3, %r14b
	je	.L48
.L46:
	movslq	%eax, %rdx
	subl	%ecx, (%r11,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%ebx, %edx
	jg	.L48
	movslq	%edx, %rdx
	addl	$2, %eax
	subl	%ecx, (%r11,%rdx,4)
	cmpl	%eax, %ebx
	jl	.L48
	cltq
	subl	%ecx, (%r11,%rax,4)
.L48:
	leal	-1(%rbp), %esi
	movslq	%ebp, %r15
	movslq	%esi, %rax
	cmpb	$62, 0(%r13,%rax)
	jne	.L49
	testl	%esi, %esi
	je	.L59
	leal	-2(%rbp), %ecx
	movslq	%ebp, %r15
	movslq	%ecx, %rax
	leaq	-3(%r15), %rdx
	movl	%ecx, %ecx
	subq	%rcx, %rdx
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L71:
	subq	$1, %rax
	cmpq	%rax, %rdx
	je	.L50
.L51:
	cmpb	$62, 0(%r13,%rax)
	movl	%eax, %esi
	je	.L71
.L49:
	xorl	%edi, %edi
	call	dac
.L50:
	cmpb	$60, 0(%r13,%r15)
	jne	.L52
	leal	1(%rbp), %eax
	leaq	-1+str(%rip), %rdx
	cltq
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%eax, %ebp
	addq	$1, %rax
	cmpb	$60, (%rdx,%rax)
	je	.L53
.L52:
	leal	1(%rbp), %edi
	movl	%r12d, %esi
	call	dac
	cmpl	$2, %ebx
	jbe	.L60
	movl	%r14d, %edx
	leaq	a(%rip), %rax
	pxor	%xmm1, %xmm1
	shrl	$2, %edx
	leaq	16(%rax), %rcx
	pxor	%xmm4, %xmm4
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L55:
	movdqa	(%rax), %xmm0
	movdqa	%xmm4, %xmm2
	addq	$16, %rax
	pcmpgtd	%xmm0, %xmm2
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm0
	paddq	%xmm3, %xmm1
	paddq	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L55
	movdqa	%xmm1, %xmm0
	movl	%r14d, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	andl	$3, %r14d
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rdx
	je	.L56
.L54:
	movslq	%eax, %rcx
	movslq	(%r11,%rcx,4), %rcx
	addq	%rcx, %rdx
	leal	1(%rax), %ecx
	cmpl	%ecx, %ebx
	jl	.L56
	movslq	%ecx, %rcx
	addl	$2, %eax
	movslq	(%r11,%rcx,4), %rcx
	addq	%rcx, %rdx
	cmpl	%ebx, %eax
	jg	.L56
	cltq
	movslq	(%r11,%rax,4), %rax
	addq	%rax, %rdx
.L56:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L57:
	.cfi_restore_state
	xorl	%ebp, %ebp
	xorl	%ecx, %ecx
	jmp	.L39
.L58:
	xorl	%eax, %eax
	jmp	.L46
.L60:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L54
.L59:
	movl	$1, %ebp
	movl	$1, %r15d
	jmp	.L50
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 2000004
a:
	.zero	2000004
	.globl	str
	.align 32
	.type	str, @object
	.size	str, 500000
str:
	.zero	500000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	dac
	.type	dac, @function
dac:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	%edi, %esi
	jl	.L30
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	str(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	-1(%r12), %r13
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	a(%rip), %rbx
.L2:
	movslq	%edi, %r10
	leal	1(%rdi), %r8d
	movl	(%rbx,%r10,4), %esi
	movl	%r8d, %r14d
	cmpl	%r8d, %ebp
	jl	.L3
	movslq	%r8d, %rax
	movl	%edi, %edx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	(%rbx,%rax,4), %ecx
	cmpl	%esi, %ecx
	jge	.L4
	movl	%eax, %edx
	movl	%ecx, %esi
.L4:
	addq	$1, %rax
	cmpl	%eax, %ebp
	jge	.L5
	movl	%ebp, %eax
	subl	%edi, %eax
	leal	1(%rax), %r9d
	cmpl	$2, %eax
	jbe	.L6
	movl	%r9d, %eax
	leaq	(%rbx,%r10,4), %rcx
	movd	%esi, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm2, %xmm1
	leal	-1(%rax), %r8d
	leaq	16(%rcx), %rax
	salq	$4, %r8
	addq	%rax, %r8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L35:
	addq	$16, %rax
.L7:
	movdqu	(%rcx), %xmm0
	psubd	%xmm1, %xmm0
	movups	%xmm0, (%rcx)
	movq	%rax, %rcx
	cmpq	%r8, %rax
	jne	.L35
	movl	%r9d, %eax
	andl	$-4, %eax
	leal	(%rax,%rdi), %r8d
	cmpl	%eax, %r9d
	je	.L8
	movslq	%r8d, %rax
	addl	$1, %r8d
	subl	%esi, (%rbx,%rax,4)
	cmpl	%r8d, %ebp
	jl	.L8
.L17:
	movslq	%r8d, %rax
	addl	$1, %r8d
	subl	%esi, (%rbx,%rax,4)
	cmpl	%ebp, %r8d
	jg	.L8
	movslq	%r8d, %r8
	subl	%esi, (%rbx,%r8,4)
.L8:
	leal	-1(%rdx), %esi
	leal	1(%rdx), %r14d
	movslq	%esi, %rax
	cmpb	$62, (%r12,%rax)
	jne	.L33
.L28:
	testl	%esi, %esi
	je	.L18
	leal	-2(%rdx), %esi
	movslq	%edx, %r8
	movslq	%esi, %rax
	leaq	-3(%r8), %rcx
	movl	%esi, %esi
	subq	%rsi, %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L37:
	subq	$1, %rax
	cmpq	%rcx, %rax
	je	.L36
.L11:
	cmpb	$62, (%r12,%rax)
	movl	%eax, %esi
	je	.L37
.L10:
	leal	1(%rdx), %eax
	cmpb	$60, (%r12,%r8)
	cltq
	jne	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, %r14d
	addq	$1, %rax
	cmpb	$60, 0(%r13,%rax)
	je	.L12
	addl	$1, %r14d
.L13:
	call	dac
	cmpl	%r14d, %ebp
	jl	.L1
	movl	%r14d, %edi
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L36:
	movl	$-1, %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	movl	%edi, %edx
	movl	$0, (%rbx,%r10,4)
	leal	-1(%rdx), %esi
	movslq	%esi, %rax
	cmpb	$62, (%r12,%rax)
	je	.L28
.L33:
	movslq	%edx, %r8
	jmp	.L10
.L6:
	subl	%esi, (%rbx,%r10,4)
	jmp	.L17
.L30:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	ret
.L18:
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	.cfi_offset 6, -40
	.cfi_offset 12, -32
	.cfi_offset 13, -24
	.cfi_offset 14, -16
	movl	$-1, %esi
	movslq	%edx, %r8
	jmp	.L10
	.cfi_endproc
.LFE35:
	.size	dac, .-dac
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	str(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rsi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	__isoc99_scanf@PLT
	movq	%r13, %rdi
	call	strlen@PLT
	leaq	a(%rip), %r11
	movl	$0, a(%rip)
	movq	%rax, %rbx
	movl	%eax, %r12d
	testq	%rax, %rax
	je	.L57
	leal	-1(%rbx), %esi
	leaq	4(%r11), %rcx
	movq	%r13, %rdx
	movq	%r11, %rax
	leaq	(%rcx,%rsi,4), %rdi
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L40:
	subl	$1, %ecx
	addq	$4, %rax
	addq	$1, %rdx
	movl	%ecx, (%rax)
	cmpq	%rdi, %rax
	je	.L70
.L43:
	cmpb	$60, (%rdx)
	movl	(%rax), %ecx
	jne	.L40
	addl	$1, %ecx
	addq	$4, %rax
	addq	$1, %rdx
	movl	%ecx, (%rax)
	cmpq	%rdi, %rax
	jne	.L43
.L70:
	addq	$2, %rsi
	movl	$1, %eax
	xorl	%ebp, %ebp
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L45:
	movl	(%r11,%rax,4), %edx
	cmpl	%ecx, %edx
	jge	.L44
	movl	%eax, %ebp
	movl	%edx, %ecx
.L44:
	addq	$1, %rax
	cmpq	%rsi, %rax
	jne	.L45
.L39:
	leal	1(%rbx), %r14d
	testl	%ebx, %ebx
	movl	$1, %eax
	cmovs	%eax, %r14d
	cmpl	$2, %ebx
	jbe	.L58
	leaq	a(%rip), %rax
	movd	%ecx, %xmm5
	movl	%r14d, %edx
	shrl	$2, %edx
	leaq	16(%rax), %rsi
	pshufd	$0, %xmm5, %xmm1
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L47:
	movdqa	(%rax), %xmm0
	addq	$16, %rax
	psubd	%xmm1, %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L47
	movl	%r14d, %eax
	andl	$-4, %eax
	testb	$3, %r14b
	je	.L48
.L46:
	movslq	%eax, %rdx
	subl	%ecx, (%r11,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%ebx, %edx
	jg	.L48
	movslq	%edx, %rdx
	addl	$2, %eax
	subl	%ecx, (%r11,%rdx,4)
	cmpl	%eax, %ebx
	jl	.L48
	cltq
	subl	%ecx, (%r11,%rax,4)
.L48:
	leal	-1(%rbp), %esi
	movslq	%ebp, %r15
	movslq	%esi, %rax
	cmpb	$62, 0(%r13,%rax)
	jne	.L49
	testl	%esi, %esi
	je	.L59
	leal	-2(%rbp), %ecx
	movslq	%ebp, %r15
	movslq	%ecx, %rax
	leaq	-3(%r15), %rdx
	movl	%ecx, %ecx
	subq	%rcx, %rdx
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L71:
	subq	$1, %rax
	cmpq	%rax, %rdx
	je	.L50
.L51:
	cmpb	$62, 0(%r13,%rax)
	movl	%eax, %esi
	je	.L71
.L49:
	xorl	%edi, %edi
	call	dac
.L50:
	cmpb	$60, 0(%r13,%r15)
	jne	.L52
	leal	1(%rbp), %eax
	leaq	-1+str(%rip), %rdx
	cltq
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%eax, %ebp
	addq	$1, %rax
	cmpb	$60, (%rdx,%rax)
	je	.L53
.L52:
	leal	1(%rbp), %edi
	movl	%r12d, %esi
	call	dac
	cmpl	$2, %ebx
	jbe	.L60
	movl	%r14d, %edx
	leaq	a(%rip), %rax
	pxor	%xmm1, %xmm1
	shrl	$2, %edx
	leaq	16(%rax), %rcx
	pxor	%xmm4, %xmm4
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L55:
	movdqa	(%rax), %xmm0
	movdqa	%xmm4, %xmm2
	addq	$16, %rax
	pcmpgtd	%xmm0, %xmm2
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm0
	paddq	%xmm3, %xmm1
	paddq	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L55
	movdqa	%xmm1, %xmm0
	movl	%r14d, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	andl	$3, %r14d
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rdx
	je	.L56
.L54:
	movslq	%eax, %rcx
	movslq	(%r11,%rcx,4), %rcx
	addq	%rcx, %rdx
	leal	1(%rax), %ecx
	cmpl	%ecx, %ebx
	jl	.L56
	movslq	%ecx, %rcx
	addl	$2, %eax
	movslq	(%r11,%rcx,4), %rcx
	addq	%rcx, %rdx
	cmpl	%ebx, %eax
	jg	.L56
	cltq
	movslq	(%r11,%rax,4), %rax
	addq	%rax, %rdx
.L56:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L57:
	.cfi_restore_state
	xorl	%ebp, %ebp
	xorl	%ecx, %ecx
	jmp	.L39
.L58:
	xorl	%eax, %eax
	jmp	.L46
.L60:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L54
.L59:
	movl	$1, %ebp
	movl	$1, %r15d
	jmp	.L50
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 2000004
a:
	.zero	2000004
	.globl	str
	.align 32
	.type	str, @object
	.size	str, 500000
str:
	.zero	500000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <string.h>
char str[500000];
int a[500001];

void dac(int le, int ri){
  if(ri<le) return;
  if(le>ri) return;
  int i, mina, minidx;
  mina=a[le];
  minidx=le;
  for(i=le+1;i<=ri;i++){
    if(a[i]<mina){
      mina=a[i];
      minidx=i;
    }
  }
  for(i=le;i<=ri;i++){
    a[i]-=mina;
  }
  
  int nle = minidx - 1;
  int nri = minidx;
  while (str[nle] == '>' && nle) nle--;
  if (!(nle == 0 && str[nle] == '>')) nle++; //le is last >
  while (str[nri] == '<') nri++;
  nri--; //ri is last <
  dac(le, nle - 1);
  dac(nri + 2, ri);
  return;
}

int main()
{
  scanf("%s", str);
  int len=strlen(str);
  int i;
  a[0]=0;
  for(i=0;i<len;i++){
    if(str[i]=='<'){
      a[i+1]=a[i]+1;
    }else{
      a[i+1]=a[i]-1;
    }
  }
  int mina, minidx;
  mina=0;
  minidx=0;
  for(i=1;i<=len;i++){
    if(a[i]<mina){
      mina=a[i];
      minidx=i;
    }
  }
  for(i=0;i<=len;i++){
    a[i]-=mina;
  }
  int le=minidx-1;
  int ri=minidx;
  while(str[le]=='>' && le) le--;
  if(!(le==0 && str[le]=='>')){
    le++; //le is last >
    dac(0,le-1);
  }
  while(str[ri]=='<') ri++;
  ri--; //ri is last <
  dac(ri+2,len);
  
  long sum=0;
  for(i=0;i<=len;i++){
    sum+=a[i];
  }
  printf("%ld\n",sum);
  return 0;
}

>><
 <>>><<<<<><<>>><
 ><>
 <>>>><<<<><<<>><
 <>><<<><<<<>>>><
 <<>><<><<<<>>>><
 <>>>><<<<><<>><<
 <>>>>><<<><<<><<
 <>>><>><<><<<><<
 <<><<<><<>><>>><

4
 29
 2
 28
 26
 24
 27
 30
 21
 20

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>
char str[500000];
int a[500001];

void dac(int le, int ri){
  if(ri<le) return;
  if(le>ri) return;
  int i, mina, minidx;
  mina=a[le];
  minidx=le;
  for(i=le+1;i<=ri;i++){
    if(a[i]<mina){
      mina=a[i];
      minidx=i;
    }
  }
  for(i=le;i<=ri;i++){
    a[i]-=mina;
  }
  
  int nle = minidx - 1;
  int nri = minidx;
  while (str[nle] == '>' && nle) nle--;
  if (!(nle == 0 && str[nle] == '>')) nle++; //le is last >
  while (str[nri] == '<') nri++;
  nri--; //ri is last <
  dac(le, nle - 1);
  dac(nri + 2, ri);
  return;
}

int main()
{
  scanf("%s", str);
  int len=strlen(str);
  int i;
  a[0]=0;
  for(i=0;i<len;i++){
    if(str[i]=='<'){
      a[i+1]=a[i]+1;
    }else{
      a[i+1]=a[i]-1;
    }
  }
  int mina, minidx;
  mina=0;
  minidx=0;
  for(i=1;i<=len;i++){
    if(a[i]<mina){
      mina=a[i];
      minidx=i;
    }
  }
  for(i=0;i<=len;i++){
    a[i]-=mina;
  }
  int le=minidx-1;
  int ri=minidx;
  while(str[le]=='>' && le) le--;
  if(!(le==0 && str[le]=='>')){
    le++; //le is last >
    dac(0,le-1);
  }
  while(str[ri]=='<') ri++;
  ri--; //ri is last <
  dac(ri+2,len);
  
  long sum=0;
  for(i=0;i<=len;i++){
    sum+=a[i];
  }
  printf("%ld\n",sum);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	str
	.bss
	.align 32
	.type	str, @object
	.size	str, 500000
str:
	.zero	500000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 2000004
a:
	.zero	2000004
	.text
	.globl	dac
	.type	dac, @function
dac:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L17
	movl	-36(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jg	.L18
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L5
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
.L6:
	addl	$1, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L7
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-16(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L9
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L10
.L12:
	subl	$1, -8(%rbp)
.L10:
	movl	-8(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	jne	.L11
	cmpl	$0, -8(%rbp)
	jne	.L12
.L11:
	cmpl	$0, -8(%rbp)
	jne	.L13
	movl	-8(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	je	.L15
.L13:
	addl	$1, -8(%rbp)
	jmp	.L15
.L16:
	addl	$1, -4(%rbp)
.L15:
	movl	-4(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$60, %al
	je	.L16
	subl	$1, -4(%rbp)
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dac
	movl	-4(%rbp), %eax
	leal	2(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dac
	jmp	.L1
.L17:
	nop
	jmp	.L1
.L18:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dac, .-dac
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	leaq	str(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	str(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -12(%rbp)
	movl	$0, a(%rip)
	movl	$0, -32(%rbp)
	jmp	.L20
.L23:
	movl	-32(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$60, %al
	jne	.L21
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	addl	$1, %edx
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L22
.L21:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	addl	$1, %edx
	leal	-1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L22:
	addl	$1, -32(%rbp)
.L20:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L23
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L24
.L26:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L25
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
.L25:
	addl	$1, -32(%rbp)
.L24:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L26
	movl	$0, -32(%rbp)
	jmp	.L27
.L28:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-28(%rbp), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L27:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L28
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L29
.L31:
	subl	$1, -20(%rbp)
.L29:
	movl	-20(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	jne	.L30
	cmpl	$0, -20(%rbp)
	jne	.L31
.L30:
	cmpl	$0, -20(%rbp)
	jne	.L32
	movl	-20(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	je	.L34
.L32:
	addl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	dac
	jmp	.L34
.L35:
	addl	$1, -16(%rbp)
.L34:
	movl	-16(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$60, %al
	je	.L35
	subl	$1, -16(%rbp)
	movl	-16(%rbp), %eax
	leal	2(%rax), %edx
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dac
	movq	$0, -8(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L36
.L37:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -8(%rbp)
	addl	$1, -32(%rbp)
.L36:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L37
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
val
	.file	"temp.c"
	.text
	.globl	str
	.bss
	.align 32
	.type	str, @object
	.size	str, 500000
str:
	.zero	500000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 2000004
a:
	.zero	2000004
	.text
	.globl	dac
	.type	dac, @function
dac:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-40(%rbp), %eax
	cmpl	-36(%rbp), %eax
	jl	.L17
	movl	-36(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jg	.L18
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -12(%rbp)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L5
.L7:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L6
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
.L6:
	addl	$1, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L7
	movl	-36(%rbp), %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L9:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-16(%rbp), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L9
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L10
.L12:
	subl	$1, -8(%rbp)
.L10:
	movl	-8(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	jne	.L11
	cmpl	$0, -8(%rbp)
	jne	.L12
.L11:
	cmpl	$0, -8(%rbp)
	jne	.L13
	movl	-8(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	je	.L15
.L13:
	addl	$1, -8(%rbp)
	jmp	.L15
.L16:
	addl	$1, -4(%rbp)
.L15:
	movl	-4(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$60, %al
	je	.L16
	subl	$1, -4(%rbp)
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	dac
	movl	-4(%rbp), %eax
	leal	2(%rax), %edx
	movl	-40(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dac
	jmp	.L1
.L17:
	nop
	jmp	.L1
.L18:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	dac, .-dac
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	leaq	str(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	str(%rip), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -12(%rbp)
	movl	$0, a(%rip)
	movl	$0, -32(%rbp)
	jmp	.L20
.L23:
	movl	-32(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$60, %al
	jne	.L21
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	addl	$1, %edx
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L22
.L21:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-32(%rbp), %edx
	addl	$1, %edx
	leal	-1(%rax), %ecx
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L22:
	addl	$1, -32(%rbp)
.L20:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L23
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$1, -32(%rbp)
	jmp	.L24
.L26:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L25
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -24(%rbp)
.L25:
	addl	$1, -32(%rbp)
.L24:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L26
	movl	$0, -32(%rbp)
	jmp	.L27
.L28:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	-28(%rbp), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -32(%rbp)
.L27:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L28
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L29
.L31:
	subl	$1, -20(%rbp)
.L29:
	movl	-20(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	jne	.L30
	cmpl	$0, -20(%rbp)
	jne	.L31
.L30:
	cmpl	$0, -20(%rbp)
	jne	.L32
	movl	-20(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$62, %al
	je	.L34
.L32:
	addl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	dac
	jmp	.L34
.L35:
	addl	$1, -16(%rbp)
.L34:
	movl	-16(%rbp), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$60, %al
	je	.L35
	subl	$1, -16(%rbp)
	movl	-16(%rbp), %eax
	leal	2(%rax), %edx
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	dac
	movq	$0, -8(%rbp)
	movl	$0, -32(%rbp)
	jmp	.L36
.L37:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -8(%rbp)
	addl	$1, -32(%rbp)
.L36:
	movl	-32(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L37
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
