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

```c
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	char s[500001];
	int a[500000], b[500000];
	scanf("%s", s);
	int n=strnlen(s, 500000)+1, i;
	a[0]=0;
	for(i=0; i<=n-2; i++){
		if(s[i]=='<'){
			a[i+1] = a[i]+1;
		}else{
			a[i+1] = 0;
		}
	}
	b[n-1]=0;
	for(i=n-2; i>=0; i--){
		if(s[i]=='>'){
			b[i] = b[i+1]+1;
		}else{
			b[i] = 0;
		}
	}
	long sum=0;
	for(i=0; i<n; i++){
		sum+=a[i]<b[i]?b[i]:a[i];
	}
	printf("%ld\n", sum);
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-4497408(%rsp), %r11
	.cfi_def_cfa 11, 4497424
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2608, %rsp
	.cfi_def_cfa_offset 4500032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 4500008(%rsp)
	xorl	%eax, %eax
	leaq	4000000(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	movl	$500000, %esi
	call	strnlen@PLT
	movl	$0, (%rsp)
	movq	%rax, %r8
	leal	1(%rax), %edi
	testq	%rax, %rax
	je	.L24
	leal	-1(%r8), %r9d
	movq	%rbx, %rax
	leaq	4(%rsp), %rdx
	movl	%r9d, %ecx
	leaq	4000001(%rsp,%rcx), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	cmpb	$60, (%rax)
	je	.L25
	addq	$1, %rax
	movl	$0, (%rdx)
	addq	$4, %rdx
	cmpq	%rsi, %rax
	jne	.L8
.L7:
	movslq	%r8d, %rax
	leaq	2000000(%rsp), %rdx
	movl	$0, 2000000(%rsp,%rax,4)
	movslq	%r9d, %rax
	cmpl	$-1, %r9d
	je	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$62, (%rbx,%rax)
	je	.L26
	movl	$0, (%rdx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L11
.L4:
	cmpq	$2, %r8
	jbe	.L27
	movl	%edi, %ecx
	xorl	%eax, %eax
	pxor	%xmm2, %xmm2
	movq	%rsp, %rsi
	shrl	$2, %ecx
	leaq	2000000(%rsp), %rdx
	pxor	%xmm4, %xmm4
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L12:
	movdqa	(%rsi,%rax), %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	(%rdx,%rax), %xmm0
	pand	%xmm0, %xmm1
	pandn	(%rdx,%rax), %xmm0
	addq	$16, %rax
	por	%xmm1, %xmm0
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm1, %xmm3
	punpckhdq	%xmm1, %xmm0
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	cmpq	%rax, %rcx
	jne	.L12
	movdqa	%xmm2, %xmm0
	movl	%edi, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm2
	movq	%xmm2, %rdx
	testb	$3, %dil
	je	.L13
.L14:
	movslq	%eax, %rsi
	movslq	2000000(%rsp,%rsi,4), %rcx
	movslq	(%rsp,%rsi,4), %rsi
	cmpl	%esi, %ecx
	cmovl	%rsi, %rcx
	addq	%rcx, %rdx
	leal	1(%rax), %ecx
	cmpl	%ecx, %edi
	jle	.L13
	movslq	%ecx, %rsi
	movslq	2000000(%rsp,%rsi,4), %rcx
	movslq	(%rsp,%rsi,4), %rsi
	cmpl	%esi, %ecx
	cmovl	%rsi, %rcx
	addl	$2, %eax
	addq	%rcx, %rdx
	cmpl	%edi, %eax
	jge	.L13
	cltq
	movslq	2000000(%rsp,%rax,4), %rcx
	movslq	(%rsp,%rax,4), %rax
	cmpl	%eax, %ecx
	cmovl	%rax, %rcx
	addq	%rcx, %rdx
.L13:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4500008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$4500016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movl	-4(%rdx), %ecx
	addq	$1, %rax
	addq	$4, %rdx
	addl	$1, %ecx
	movl	%ecx, -4(%rdx)
	cmpq	%rsi, %rax
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	leal	1(%rax), %ecx
	movslq	%ecx, %rcx
	movl	2000000(%rsp,%rcx,4), %ecx
	addl	$1, %ecx
	movl	%ecx, (%rdx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L11
	jmp	.L4
.L24:
	orl	$-1, %r9d
	jmp	.L7
.L27:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L14
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-4497408(%rsp), %r11
	.cfi_def_cfa 11, 4497424
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2608, %rsp
	.cfi_def_cfa_offset 4500032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 4500008(%rsp)
	xorl	%eax, %eax
	leaq	4000000(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	movl	$500000, %esi
	call	strnlen@PLT
	movl	$0, (%rsp)
	movq	%rax, %r8
	leal	1(%rax), %edi
	testq	%rax, %rax
	je	.L24
	leal	-1(%r8), %r9d
	movq	%rbx, %rax
	leaq	4(%rsp), %rdx
	movl	%r9d, %ecx
	leaq	4000001(%rsp,%rcx), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	cmpb	$60, (%rax)
	je	.L25
	addq	$1, %rax
	movl	$0, (%rdx)
	addq	$4, %rdx
	cmpq	%rsi, %rax
	jne	.L8
.L7:
	movslq	%r8d, %rax
	leaq	2000000(%rsp), %rdx
	movl	$0, 2000000(%rsp,%rax,4)
	movslq	%r9d, %rax
	cmpl	$-1, %r9d
	je	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$62, (%rbx,%rax)
	je	.L26
	movl	$0, (%rdx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L11
.L4:
	cmpq	$2, %r8
	jbe	.L27
	movl	%edi, %ecx
	xorl	%eax, %eax
	pxor	%xmm2, %xmm2
	movq	%rsp, %rsi
	shrl	$2, %ecx
	leaq	2000000(%rsp), %rdx
	pxor	%xmm4, %xmm4
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L12:
	movdqa	(%rsi,%rax), %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	(%rdx,%rax), %xmm0
	pand	%xmm0, %xmm1
	pandn	(%rdx,%rax), %xmm0
	addq	$16, %rax
	por	%xmm1, %xmm0
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm1, %xmm3
	punpckhdq	%xmm1, %xmm0
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	cmpq	%rax, %rcx
	jne	.L12
	movdqa	%xmm2, %xmm0
	movl	%edi, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm2
	movq	%xmm2, %rdx
	testb	$3, %dil
	je	.L13
.L14:
	movslq	%eax, %rsi
	movslq	2000000(%rsp,%rsi,4), %rcx
	movslq	(%rsp,%rsi,4), %rsi
	cmpl	%esi, %ecx
	cmovl	%rsi, %rcx
	addq	%rcx, %rdx
	leal	1(%rax), %ecx
	cmpl	%ecx, %edi
	jle	.L13
	movslq	%ecx, %rsi
	movslq	2000000(%rsp,%rsi,4), %rcx
	movslq	(%rsp,%rsi,4), %rsi
	cmpl	%esi, %ecx
	cmovl	%rsi, %rcx
	addl	$2, %eax
	addq	%rcx, %rdx
	cmpl	%edi, %eax
	jge	.L13
	cltq
	movslq	2000000(%rsp,%rax,4), %rcx
	movslq	(%rsp,%rax,4), %rax
	cmpl	%eax, %ecx
	cmovl	%rax, %rcx
	addq	%rcx, %rdx
.L13:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4500008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$4500016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movl	-4(%rdx), %ecx
	addq	$1, %rax
	addq	$4, %rdx
	addl	$1, %ecx
	movl	%ecx, -4(%rdx)
	cmpq	%rsi, %rax
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	leal	1(%rax), %ecx
	movslq	%ecx, %rcx
	movl	2000000(%rsp,%rcx,4), %ecx
	addl	$1, %ecx
	movl	%ecx, (%rdx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L11
	jmp	.L4
.L24:
	orl	$-1, %r9d
	jmp	.L7
.L27:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L14
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-4497408(%rsp), %r11
	.cfi_def_cfa 11, 4497424
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2608, %rsp
	.cfi_def_cfa_offset 4500032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 4500008(%rsp)
	xorl	%eax, %eax
	leaq	4000000(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	movl	$500000, %esi
	call	strnlen@PLT
	movl	$0, (%rsp)
	movq	%rax, %r8
	leal	1(%rax), %edi
	testq	%rax, %rax
	je	.L24
	leal	-1(%r8), %r9d
	movq	%rbx, %rax
	leaq	4(%rsp), %rdx
	movl	%r9d, %ecx
	leaq	4000001(%rsp,%rcx), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	cmpb	$60, (%rax)
	je	.L25
	addq	$1, %rax
	movl	$0, (%rdx)
	addq	$4, %rdx
	cmpq	%rsi, %rax
	jne	.L8
.L7:
	movslq	%r8d, %rax
	leaq	2000000(%rsp), %rdx
	movl	$0, 2000000(%rsp,%rax,4)
	movslq	%r9d, %rax
	cmpl	$-1, %r9d
	je	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$62, (%rbx,%rax)
	je	.L26
	movl	$0, (%rdx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L11
.L4:
	cmpq	$2, %r8
	jbe	.L27
	movl	%edi, %ecx
	xorl	%eax, %eax
	pxor	%xmm2, %xmm2
	movq	%rsp, %rsi
	shrl	$2, %ecx
	leaq	2000000(%rsp), %rdx
	pxor	%xmm4, %xmm4
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L12:
	movdqa	(%rsi,%rax), %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	(%rdx,%rax), %xmm0
	pand	%xmm0, %xmm1
	pandn	(%rdx,%rax), %xmm0
	addq	$16, %rax
	por	%xmm1, %xmm0
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm1, %xmm3
	punpckhdq	%xmm1, %xmm0
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	cmpq	%rax, %rcx
	jne	.L12
	movdqa	%xmm2, %xmm0
	movl	%edi, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm2
	movq	%xmm2, %rdx
	testb	$3, %dil
	je	.L13
.L14:
	movslq	%eax, %rsi
	movslq	2000000(%rsp,%rsi,4), %rcx
	movslq	(%rsp,%rsi,4), %rsi
	cmpl	%esi, %ecx
	cmovl	%rsi, %rcx
	addq	%rcx, %rdx
	leal	1(%rax), %ecx
	cmpl	%ecx, %edi
	jle	.L13
	movslq	%ecx, %rsi
	movslq	2000000(%rsp,%rsi,4), %rcx
	movslq	(%rsp,%rsi,4), %rsi
	cmpl	%esi, %ecx
	cmovl	%rsi, %rcx
	addl	$2, %eax
	addq	%rcx, %rdx
	cmpl	%edi, %eax
	jge	.L13
	cltq
	movslq	2000000(%rsp,%rax,4), %rcx
	movslq	(%rsp,%rax,4), %rax
	cmpl	%eax, %ecx
	cmovl	%rax, %rcx
	addq	%rcx, %rdx
.L13:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4500008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$4500016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movl	-4(%rdx), %ecx
	addq	$1, %rax
	addq	$4, %rdx
	addl	$1, %ecx
	movl	%ecx, -4(%rdx)
	cmpq	%rsi, %rax
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	leal	1(%rax), %ecx
	movslq	%ecx, %rcx
	movl	2000000(%rsp,%rcx,4), %ecx
	addl	$1, %ecx
	movl	%ecx, (%rdx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L11
	jmp	.L4
.L24:
	orl	$-1, %r9d
	jmp	.L7
.L27:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L14
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```
```c
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	char s[500001];
	int a[500000], b[500000];
	scanf("%s", s);
	int n=strnlen(s, 500000)+1, i;
	a[0]=0;
	for(i=0; i<=n-2; i++){
		if(s[i]=='<'){
			a[i+1] = a[i]+1;
		}else{
			a[i+1] = 0;
		}
	}
	b[n-1]=0;
	for(i=n-2; i>=0; i--){
		if(s[i]=='>'){
			b[i] = b[i+1]+1;
		}else{
			b[i] = 0;
		}
	}
	long sum=0;
	for(i=0; i<n; i++){
		sum+=a[i]<b[i]?b[i]:a[i];
	}
	printf("%ld\n", sum);
}

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

```c
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	char s[500001];
	int a[500000], b[500000];
	scanf("%s", s);
	int n=strnlen(s, 500000)+1, i;
	a[0]=0;
	for(i=0; i<=n-2; i++){
		if(s[i]=='<'){
			a[i+1] = a[i]+1;
		}else{
			a[i+1] = 0;
		}
	}
	b[n-1]=0;
	for(i=n-2; i>=0; i--){
		if(s[i]=='>'){
			b[i] = b[i+1]+1;
		}else{
			b[i] = 0;
		}
	}
	long sum=0;
	for(i=0; i<n; i++){
		sum+=a[i]<b[i]?b[i]:a[i];
	}
	printf("%ld\n", sum);
}

```

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.
Optimized Assembly Code:

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

4
 29
 2
 28
 26
 24
 27
 30
 21
 20

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

```c
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void){
	char s[500001];
	int a[500000], b[500000];
	scanf("%s", s);
	int n=strnlen(s, 500000)+1, i;
	a[0]=0;
	for(i=0; i<=n-2; i++){
		if(s[i]=='<'){
			a[i+1] = a[i]+1;
		}else{
			a[i+1] = 0;
		}
	}
	b[n-1]=0;
	for(i=n-2; i>=0; i--){
		if(s[i]=='>'){
			b[i] = b[i+1]+1;
		}else{
			b[i] = 0;
		}
	}
	long sum=0;
	for(i=0; i<n; i++){
		sum+=a[i]<b[i]?b[i]:a[i];
	}
	printf("%ld\n", sum);
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-4497408(%rsp), %r11
	.cfi_def_cfa 11, 4497424
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2608, %rsp
	.cfi_def_cfa_offset 4500032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 4500008(%rsp)
	xorl	%eax, %eax
	leaq	4000000(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	movl	$500000, %esi
	call	strnlen@PLT
	movl	$0, (%rsp)
	movq	%rax, %r8
	leal	1(%rax), %edi
	testq	%rax, %rax
	je	.L24
	leal	-1(%r8), %r9d
	movq	%rbx, %rax
	leaq	4(%rsp), %rdx
	movl	%r9d, %ecx
	leaq	4000001(%rsp,%rcx), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	cmpb	$60, (%rax)
	je	.L25
	addq	$1, %rax
	movl	$0, (%rdx)
	addq	$4, %rdx
	cmpq	%rsi, %rax
	jne	.L8
.L7:
	movslq	%r8d, %rax
	leaq	2000000(%rsp), %rdx
	movl	$0, 2000000(%rsp,%rax,4)
	movslq	%r9d, %rax
	cmpl	$-1, %r9d
	je	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$62, (%rbx,%rax)
	je	.L26
	movl	$0, (%rdx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L11
.L4:
	cmpq	$2, %r8
	jbe	.L27
	movl	%edi, %ecx
	xorl	%eax, %eax
	pxor	%xmm2, %xmm2
	movq	%rsp, %rsi
	shrl	$2, %ecx
	leaq	2000000(%rsp), %rdx
	pxor	%xmm4, %xmm4
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L12:
	movdqa	(%rsi,%rax), %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	(%rdx,%rax), %xmm0
	pand	%xmm0, %xmm1
	pandn	(%rdx,%rax), %xmm0
	addq	$16, %rax
	por	%xmm1, %xmm0
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm1, %xmm3
	punpckhdq	%xmm1, %xmm0
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	cmpq	%rax, %rcx
	jne	.L12
	movdqa	%xmm2, %xmm0
	movl	%edi, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm2
	movq	%xmm2, %rdx
	testb	$3, %dil
	je	.L13
.L14:
	movslq	%eax, %rsi
	movslq	2000000(%rsp,%rsi,4), %rcx
	movslq	(%rsp,%rsi,4), %rsi
	cmpl	%esi, %ecx
	cmovl	%rsi, %rcx
	addq	%rcx, %rdx
	leal	1(%rax), %ecx
	cmpl	%ecx, %edi
	jle	.L13
	movslq	%ecx, %rsi
	movslq	2000000(%rsp,%rsi,4), %rcx
	movslq	(%rsp,%rsi,4), %rsi
	cmpl	%esi, %ecx
	cmovl	%rsi, %rcx
	addl	$2, %eax
	addq	%rcx, %rdx
	cmpl	%edi, %eax
	jge	.L13
	cltq
	movslq	2000000(%rsp,%rax,4), %rcx
	movslq	(%rsp,%rax,4), %rax
	cmpl	%eax, %ecx
	cmovl	%rax, %rcx
	addq	%rcx, %rdx
.L13:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4500008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$4500016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movl	-4(%rdx), %ecx
	addq	$1, %rax
	addq	$4, %rdx
	addl	$1, %ecx
	movl	%ecx, -4(%rdx)
	cmpq	%rsi, %rax
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	leal	1(%rax), %ecx
	movslq	%ecx, %rcx
	movl	2000000(%rsp,%rcx,4), %ecx
	addl	$1, %ecx
	movl	%ecx, (%rdx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L11
	jmp	.L4
.L24:
	orl	$-1, %r9d
	jmp	.L7
.L27:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L14
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-4497408(%rsp), %r11
	.cfi_def_cfa 11, 4497424
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2608, %rsp
	.cfi_def_cfa_offset 4500032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 4500008(%rsp)
	xorl	%eax, %eax
	leaq	4000000(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	movl	$500000, %esi
	call	strnlen@PLT
	movl	$0, (%rsp)
	movq	%rax, %r8
	leal	1(%rax), %edi
	testq	%rax, %rax
	je	.L24
	leal	-1(%r8), %r9d
	movq	%rbx, %rax
	leaq	4(%rsp), %rdx
	movl	%r9d, %ecx
	leaq	4000001(%rsp,%rcx), %rsi
	.p2align 4,,10
	.p2align 3
.L8:
	cmpb	$60, (%rax)
	je	.L25
	addq	$1, %rax
	movl	$0, (%rdx)
	addq	$4, %rdx
	cmpq	%rsi, %rax
	jne	.L8
.L7:
	movslq	%r8d, %rax
	leaq	2000000(%rsp), %rdx
	movl	$0, 2000000(%rsp,%rax,4)
	movslq	%r9d, %rax
	cmpl	$-1, %r9d
	je	.L4
	.p2align 4,,10
	.p2align 3
.L11:
	cmpb	$62, (%rbx,%rax)
	je	.L26
	movl	$0, (%rdx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L11
.L4:
	cmpq	$2, %r8
	jbe	.L27
	movl	%edi, %ecx
	xorl	%eax, %eax
	pxor	%xmm2, %xmm2
	movq	%rsp, %rsi
	shrl	$2, %ecx
	leaq	2000000(%rsp), %rdx
	pxor	%xmm4, %xmm4
	salq	$4, %rcx
	.p2align 4,,10
	.p2align 3
.L12:
	movdqa	(%rsi,%rax), %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	(%rdx,%rax), %xmm0
	pand	%xmm0, %xmm1
	pandn	(%rdx,%rax), %xmm0
	addq	$16, %rax
	por	%xmm1, %xmm0
	movdqa	%xmm4, %xmm1
	pcmpgtd	%xmm0, %xmm1
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm1, %xmm3
	punpckhdq	%xmm1, %xmm0
	paddq	%xmm3, %xmm2
	paddq	%xmm0, %xmm2
	cmpq	%rax, %rcx
	jne	.L12
	movdqa	%xmm2, %xmm0
	movl	%edi, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm2
	movq	%xmm2, %rdx
	testb	$3, %dil
	je	.L13
.L14:
	movslq	%eax, %rsi
	movslq	2000000(%rsp,%rsi,4), %rcx
	movslq	(%rsp,%rsi,4), %rsi
	cmpl	%esi, %ecx
	cmovl	%rsi, %rcx
	addq	%rcx, %rdx
	leal	1(%rax), %ecx
	cmpl	%ecx, %edi
	jle	.L13
	movslq	%ecx, %rsi
	movslq	2000000(%rsp,%rsi,4), %rcx
	movslq	(%rsp,%rsi,4), %rsi
	cmpl	%esi, %ecx
	cmovl	%rsi, %rcx
	addl	$2, %eax
	addq	%rcx, %rdx
	cmpl	%edi, %eax
	jge	.L13
	cltq
	movslq	2000000(%rsp,%rax,4), %rcx
	movslq	(%rsp,%rax,4), %rax
	cmpl	%eax, %ecx
	cmovl	%rax, %rcx
	addq	%rcx, %rdx
.L13:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4500008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$4500016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	movl	-4(%rdx), %ecx
	addq	$1, %rax
	addq	$4, %rdx
	addl	$1, %ecx
	movl	%ecx, -4(%rdx)
	cmpq	%rsi, %rax
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	leal	1(%rax), %ecx
	movslq	%ecx, %rcx
	movl	2000000(%rsp,%rcx,4), %ecx
	addl	$1, %ecx
	movl	%ecx, (%rdx,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L11
	jmp	.L4
.L24:
	orl	$-1, %r9d
	jmp	.L7
.L27:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L14
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```