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>
int main()
{
	char s[100005];
	scanf("%s", s);
	int i, n = strlen(s);
	int a[100005];
	a[0] = 0;
	for (i = 1; i < n; i++)
	{
		if (s[i] == s[i - 1])
			a[i] = a[i - 1];
		else
			a[i] = i;
	}
	int ans = 1;
	for (i = 0; i < n; i++)
	{
		if (n - a[i] >= i + 1 && ans < i + 1)
			ans = i + 1;
	}
	a[n - 1] = n - 1;
	for (i = n - 2; i >= 0; i--)
	{
		if (s[i] == s[i + 1])
			a[i] = a[i + 1];
		else
			a[i] = i;
	}
	for (i = 0; i < n; i++)
	{
		if (a[i] + 1 >= n - i && ans < n - i)
			ans = n - i;
	}
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-499712(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$352, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -500052(%rbp)
	movl	$0, -500048(%rbp)
	movl	$1, -500060(%rbp)
	jmp	.L2
.L5:
	movl	-500060(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-500060(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	movl	-500060(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-500048(%rbp,%rax,4), %edx
	movl	-500060(%rbp), %eax
	cltq
	movl	%edx, -500048(%rbp,%rax,4)
	jmp	.L4
.L3:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500060(%rbp), %edx
	movl	%edx, -500048(%rbp,%rax,4)
.L4:
	addl	$1, -500060(%rbp)
.L2:
	movl	-500060(%rbp), %eax
	cmpl	-500052(%rbp), %eax
	jl	.L5
	movl	$1, -500056(%rbp)
	movl	$0, -500060(%rbp)
	jmp	.L6
.L8:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500048(%rbp,%rax,4), %edx
	movl	-500052(%rbp), %eax
	subl	%edx, %eax
	cmpl	%eax, -500060(%rbp)
	jge	.L7
	movl	-500060(%rbp), %eax
	cmpl	-500056(%rbp), %eax
	jl	.L7
	movl	-500060(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -500056(%rbp)
.L7:
	addl	$1, -500060(%rbp)
.L6:
	movl	-500060(%rbp), %eax
	cmpl	-500052(%rbp), %eax
	jl	.L8
	movl	-500052(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-500052(%rbp), %eax
	leal	-1(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -500048(%rbp,%rax,4)
	movl	-500052(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -500060(%rbp)
	jmp	.L9
.L12:
	movl	-500060(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-500060(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L10
	movl	-500060(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-500048(%rbp,%rax,4), %edx
	movl	-500060(%rbp), %eax
	cltq
	movl	%edx, -500048(%rbp,%rax,4)
	jmp	.L11
.L10:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500060(%rbp), %edx
	movl	%edx, -500048(%rbp,%rax,4)
.L11:
	subl	$1, -500060(%rbp)
.L9:
	cmpl	$0, -500060(%rbp)
	jns	.L12
	movl	$0, -500060(%rbp)
	jmp	.L13
.L15:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500048(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-500052(%rbp), %eax
	subl	-500060(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	-500052(%rbp), %eax
	subl	-500060(%rbp), %eax
	cmpl	%eax, -500056(%rbp)
	jge	.L14
	movl	-500052(%rbp), %eax
	subl	-500060(%rbp), %eax
	movl	%eax, -500056(%rbp)
.L14:
	addl	$1, -500060(%rbp)
.L13:
	movl	-500060(%rbp), %eax
	cmpl	-500052(%rbp), %eax
	jl	.L15
	movl	-500056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-499712(%rsp), %r11
	.cfi_def_cfa 11, 499744
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$336, %rsp
	.cfi_def_cfa_offset 500080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 500040(%rsp)
	xorl	%eax, %eax
	leaq	400032(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movl	$0, (%rsp)
	movq	%rax, %rcx
	movl	%eax, %esi
	cmpq	$1, %rax
	jbe	.L2
	leal	-1(%rax), %r11d
	cmpl	$3, %eax
	jle	.L30
	movq	%rsp, %rdi
	leaq	400033(%rsp), %r8
	movl	$1, %eax
	movzbl	400032(%rsp), %r10d
	movq	%rdi, %rdx
	movl	$2, %r9d
.L7:
	movzbl	(%r8), %ebp
	movl	%eax, %r12d
	cmpb	%r10b, %bpl
	jne	.L4
	movl	(%rdx), %r12d
.L4:
	movzbl	1(%r8), %r10d
	movl	%r12d, 4(%rdx)
	cmpb	%r10b, %bpl
	je	.L44
	movl	%r9d, 8(%rdx)
.L41:
	addl	$2, %r9d
	addl	$2, %eax
	addq	$2, %r8
	addq	$8, %rdx
	cmpl	%r9d, %r11d
	jg	.L7
.L3:
	cltq
	leaq	400031(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movzbl	(%rdx,%rax), %r10d
	cmpb	%r10b, (%rbx,%rax)
	je	.L45
	movl	%eax, (%rdi,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %esi
	jg	.L11
.L10:
	movq	%rdi, %r8
	movl	$1, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%esi, %r9d
	subl	(%r8), %r9d
	cmpl	%r9d, %eax
	setl	%r10b
	cmpl	%edx, %eax
	setge	%r9b
	addl	$1, %eax
	testb	%r9b, %r10b
	cmovne	%eax, %edx
	addq	$4, %r8
	cmpl	%esi, %eax
	jl	.L12
	movslq	%r11d, %r8
	movl	%ecx, %eax
	movl	%r11d, (%rsp,%r8,4)
	subl	$2, %eax
	js	.L28
	leaq	(%rbx,%r8), %r9
	leal	-3(%rcx), %r8d
	cmpl	$1, %eax
	jle	.L16
	movzbl	(%r9), %r11d
	movslq	%eax, %r9
	leaq	(%rbx,%r9), %r10
	leaq	(%rdi,%r9,4), %r9
	jmp	.L20
.L18:
	movl	%r8d, -4(%r9)
.L42:
	subl	$2, %r8d
	subl	$2, %eax
	subq	$2, %r10
	subq	$8, %r9
	testl	%r8d, %r8d
	jle	.L16
.L20:
	movzbl	(%r10), %ebp
	movl	%eax, %r12d
	cmpb	%r11b, %bpl
	jne	.L17
	movl	4(%r9), %r12d
.L17:
	movzbl	-1(%r10), %r11d
	movl	%r12d, (%r9)
	cmpb	%bpl, %r11b
	jne	.L18
	movl	%r12d, -4(%r9)
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L45:
	movl	-4(%rdi,%rax,4), %r8d
	movl	%r8d, (%rdi,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %esi
	jg	.L11
	jmp	.L10
.L16:
	cltq
	leaq	400033(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L24:
	movzbl	(%r8,%rax), %r11d
	cmpb	%r11b, (%rbx,%rax)
	je	.L46
	movl	%eax, (%rdi,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L24
.L23:
	testl	%ecx, %ecx
	je	.L13
.L28:
	movl	%ecx, %eax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L26:
	movl	(%rdi,%rcx,4), %ebx
	cmpl	%eax, %edx
	movl	%eax, %r9d
	cmovge	%edx, %r9d
	leal	1(%rbx), %r8d
	cmpl	%r8d, %eax
	cmovle	%r9d, %edx
	addq	$1, %rcx
	subl	$1, %eax
	cmpl	%ecx, %esi
	jg	.L26
.L13:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	500040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$500048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L44:
	.cfi_restore_state
	movl	%r12d, 8(%rdx)
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L46:
	movl	4(%rdi,%rax,4), %r9d
	movl	%r9d, (%rdi,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L24
	jmp	.L23
.L2:
	xorl	%r11d, %r11d
	movq	%rsp, %rdi
	cmpl	$1, %eax
	je	.L10
	movl	$1, %edx
	jmp	.L13
.L30:
	movl	$1, %eax
	movq	%rsp, %rdi
	jmp	.L3
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-499712(%rsp), %r11
	.cfi_def_cfa 11, 499744
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$336, %rsp
	.cfi_def_cfa_offset 500080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 500040(%rsp)
	xorl	%eax, %eax
	leaq	400032(%rsp), %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	movl	$0, (%rsp)
	movq	%rax, %rcx
	movl	%eax, %esi
	cmpq	$1, %rax
	jbe	.L2
	leal	-1(%rax), %r11d
	cmpl	$3, %eax
	jle	.L30
	movq	%rsp, %rdi
	leaq	400033(%rsp), %r8
	movl	$1, %eax
	movzbl	400032(%rsp), %r10d
	movq	%rdi, %rdx
	movl	$2, %r9d
.L7:
	movzbl	(%r8), %ebp
	movl	%eax, %r12d
	cmpb	%r10b, %bpl
	jne	.L4
	movl	(%rdx), %r12d
.L4:
	movzbl	1(%r8), %r10d
	movl	%r12d, 4(%rdx)
	cmpb	%r10b, %bpl
	je	.L44
	movl	%r9d, 8(%rdx)
.L41:
	addl	$2, %r9d
	addl	$2, %eax
	addq	$2, %r8
	addq	$8, %rdx
	cmpl	%r9d, %r11d
	jg	.L7
.L3:
	cltq
	leaq	400031(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movzbl	(%rdx,%rax), %r10d
	cmpb	%r10b, (%rbx,%rax)
	je	.L45
	movl	%eax, (%rdi,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %esi
	jg	.L11
.L10:
	movq	%rdi, %r8
	movl	$1, %edx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%esi, %r9d
	subl	(%r8), %r9d
	cmpl	%r9d, %eax
	setl	%r10b
	cmpl	%edx, %eax
	setge	%r9b
	addl	$1, %eax
	testb	%r9b, %r10b
	cmovne	%eax, %edx
	addq	$4, %r8
	cmpl	%esi, %eax
	jl	.L12
	movslq	%r11d, %r8
	movl	%ecx, %eax
	movl	%r11d, (%rsp,%r8,4)
	subl	$2, %eax
	js	.L28
	leaq	(%rbx,%r8), %r9
	leal	-3(%rcx), %r8d
	cmpl	$1, %eax
	jle	.L16
	movzbl	(%r9), %r11d
	movslq	%eax, %r9
	leaq	(%rbx,%r9), %r10
	leaq	(%rdi,%r9,4), %r9
	jmp	.L20
.L18:
	movl	%r8d, -4(%r9)
.L42:
	subl	$2, %r8d
	subl	$2, %eax
	subq	$2, %r10
	subq	$8, %r9
	testl	%r8d, %r8d
	jle	.L16
.L20:
	movzbl	(%r10), %ebp
	movl	%eax, %r12d
	cmpb	%r11b, %bpl
	jne	.L17
	movl	4(%r9), %r12d
.L17:
	movzbl	-1(%r10), %r11d
	movl	%r12d, (%r9)
	cmpb	%bpl, %r11b
	jne	.L18
	movl	%r12d, -4(%r9)
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L45:
	movl	-4(%rdi,%rax,4), %r8d
	movl	%r8d, (%rdi,%rax,4)
	addq	$1, %rax
	cmpl	%eax, %esi
	jg	.L11
	jmp	.L10
.L16:
	cltq
	leaq	400033(%rsp), %r8
	.p2align 4,,10
	.p2align 3
.L24:
	movzbl	(%r8,%rax), %r11d
	cmpb	%r11b, (%rbx,%rax)
	je	.L46
	movl	%eax, (%rdi,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L24
.L23:
	testl	%ecx, %ecx
	je	.L13
.L28:
	movl	%ecx, %eax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L26:
	movl	(%rdi,%rcx,4), %ebx
	cmpl	%eax, %edx
	movl	%eax, %r9d
	cmovge	%edx, %r9d
	leal	1(%rbx), %r8d
	cmpl	%r8d, %eax
	cmovle	%r9d, %edx
	addq	$1, %rcx
	subl	$1, %eax
	cmpl	%ecx, %esi
	jg	.L26
.L13:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	500040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$500048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L44:
	.cfi_restore_state
	movl	%r12d, 8(%rdx)
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L46:
	movl	4(%rdi,%rax,4), %r9d
	movl	%r9d, (%rdi,%rax,4)
	subq	$1, %rax
	testl	%eax, %eax
	jns	.L24
	jmp	.L23
.L2:
	xorl	%r11d, %r11d
	movq	%rsp, %rdi
	cmpl	$1, %eax
	je	.L10
	movl	$1, %edx
	jmp	.L13
.L30:
	movl	$1, %eax
	movq	%rsp, %rdi
	jmp	.L3
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:

#include<stdio.h>
#include<string.h>
int main()
{
	char s[100005];
	scanf("%s", s);
	int i, n = strlen(s);
	int a[100005];
	a[0] = 0;
	for (i = 1; i < n; i++)
	{
		if (s[i] == s[i - 1])
			a[i] = a[i - 1];
		else
			a[i] = i;
	}
	int ans = 1;
	for (i = 0; i < n; i++)
	{
		if (n - a[i] >= i + 1 && ans < i + 1)
			ans = i + 1;
	}
	a[n - 1] = n - 1;
	for (i = n - 2; i >= 0; i--)
	{
		if (s[i] == s[i + 1])
			a[i] = a[i + 1];
		else
			a[i] = i;
	}
	for (i = 0; i < n; i++)
	{
		if (a[i] + 1 >= n - i && ans < n - i)
			ans = n - i;
	}
	printf("%d\n", ans);
	return 0;
}
010

2

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>
int main()
{
	char s[100005];
	scanf("%s", s);
	int i, n = strlen(s);
	int a[100005];
	a[0] = 0;
	for (i = 1; i < n; i++)
	{
		if (s[i] == s[i - 1])
			a[i] = a[i - 1];
		else
			a[i] = i;
	}
	int ans = 1;
	for (i = 0; i < n; i++)
	{
		if (n - a[i] >= i + 1 && ans < i + 1)
			ans = i + 1;
	}
	a[n - 1] = n - 1;
	for (i = n - 2; i >= 0; i--)
	{
		if (s[i] == s[i + 1])
			a[i] = a[i + 1];
		else
			a[i] = i;
	}
	for (i = 0; i < n; i++)
	{
		if (a[i] + 1 >= n - i && ans < n - i)
			ans = n - i;
	}
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-499712(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$352, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -500052(%rbp)
	movl	$0, -500048(%rbp)
	movl	$1, -500060(%rbp)
	jmp	.L2
.L5:
	movl	-500060(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-500060(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	movl	-500060(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-500048(%rbp,%rax,4), %edx
	movl	-500060(%rbp), %eax
	cltq
	movl	%edx, -500048(%rbp,%rax,4)
	jmp	.L4
.L3:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500060(%rbp), %edx
	movl	%edx, -500048(%rbp,%rax,4)
.L4:
	addl	$1, -500060(%rbp)
.L2:
	movl	-500060(%rbp), %eax
	cmpl	-500052(%rbp), %eax
	jl	.L5
	movl	$1, -500056(%rbp)
	movl	$0, -500060(%rbp)
	jmp	.L6
.L8:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500048(%rbp,%rax,4), %edx
	movl	-500052(%rbp), %eax
	subl	%edx, %eax
	cmpl	%eax, -500060(%rbp)
	jge	.L7
	movl	-500060(%rbp), %eax
	cmpl	-500056(%rbp), %eax
	jl	.L7
	movl	-500060(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -500056(%rbp)
.L7:
	addl	$1, -500060(%rbp)
.L6:
	movl	-500060(%rbp), %eax
	cmpl	-500052(%rbp), %eax
	jl	.L8
	movl	-500052(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-500052(%rbp), %eax
	leal	-1(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -500048(%rbp,%rax,4)
	movl	-500052(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -500060(%rbp)
	jmp	.L9
.L12:
	movl	-500060(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-500060(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L10
	movl	-500060(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-500048(%rbp,%rax,4), %edx
	movl	-500060(%rbp), %eax
	cltq
	movl	%edx, -500048(%rbp,%rax,4)
	jmp	.L11
.L10:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500060(%rbp), %edx
	movl	%edx, -500048(%rbp,%rax,4)
.L11:
	subl	$1, -500060(%rbp)
.L9:
	cmpl	$0, -500060(%rbp)
	jns	.L12
	movl	$0, -500060(%rbp)
	jmp	.L13
.L15:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500048(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-500052(%rbp), %eax
	subl	-500060(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	-500052(%rbp), %eax
	subl	-500060(%rbp), %eax
	cmpl	%eax, -500056(%rbp)
	jge	.L14
	movl	-500052(%rbp), %eax
	subl	-500060(%rbp), %eax
	movl	%eax, -500056(%rbp)
.L14:
	addl	$1, -500060(%rbp)
.L13:
	movl	-500060(%rbp), %eax
	cmpl	-500052(%rbp), %eax
	jl	.L15
	movl	-500056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-499712(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$352, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -500052(%rbp)
	movl	$0, -500048(%rbp)
	movl	$1, -500060(%rbp)
	jmp	.L2
.L5:
	movl	-500060(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-500060(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	movl	-500060(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-500048(%rbp,%rax,4), %edx
	movl	-500060(%rbp), %eax
	cltq
	movl	%edx, -500048(%rbp,%rax,4)
	jmp	.L4
.L3:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500060(%rbp), %edx
	movl	%edx, -500048(%rbp,%rax,4)
.L4:
	addl	$1, -500060(%rbp)
.L2:
	movl	-500060(%rbp), %eax
	cmpl	-500052(%rbp), %eax
	jl	.L5
	movl	$1, -500056(%rbp)
	movl	$0, -500060(%rbp)
	jmp	.L6
.L8:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500048(%rbp,%rax,4), %edx
	movl	-500052(%rbp), %eax
	subl	%edx, %eax
	cmpl	%eax, -500060(%rbp)
	jge	.L7
	movl	-500060(%rbp), %eax
	cmpl	-500056(%rbp), %eax
	jl	.L7
	movl	-500060(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -500056(%rbp)
.L7:
	addl	$1, -500060(%rbp)
.L6:
	movl	-500060(%rbp), %eax
	cmpl	-500052(%rbp), %eax
	jl	.L8
	movl	-500052(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-500052(%rbp), %eax
	leal	-1(%rax), %edx
	movslq	%ecx, %rax
	movl	%edx, -500048(%rbp,%rax,4)
	movl	-500052(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -500060(%rbp)
	jmp	.L9
.L12:
	movl	-500060(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-500060(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L10
	movl	-500060(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-500048(%rbp,%rax,4), %edx
	movl	-500060(%rbp), %eax
	cltq
	movl	%edx, -500048(%rbp,%rax,4)
	jmp	.L11
.L10:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500060(%rbp), %edx
	movl	%edx, -500048(%rbp,%rax,4)
.L11:
	subl	$1, -500060(%rbp)
.L9:
	cmpl	$0, -500060(%rbp)
	jns	.L12
	movl	$0, -500060(%rbp)
	jmp	.L13
.L15:
	movl	-500060(%rbp), %eax
	cltq
	movl	-500048(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-500052(%rbp), %eax
	subl	-500060(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L14
	movl	-500052(%rbp), %eax
	subl	-500060(%rbp), %eax
	cmpl	%eax, -500056(%rbp)
	jge	.L14
	movl	-500052(%rbp), %eax
	subl	-500060(%rbp), %eax
	movl	%eax, -500056(%rbp)
.L14:
	addl	$1, -500060(%rbp)
.L13:
	movl	-500060(%rbp), %eax
	cmpl	-500052(%rbp), %eax
	jl	.L15
	movl	-500056(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
