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

```c
// AOJ 0603: Illumination
// 2017.10.31 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

char a[100002];
int t[100002];
char buf[200100], *p;

int main()
{
	int n, i, k, sz, ans;

	fgets(buf, 10, stdin), n = atoi(buf);
	fgets(p=buf, sizeof(buf), stdin);
	for (i = 0; i < n; i++) a[i] = *p, p+=2;

	for (sz = 0, k = 0, i = 0; i < n; i++) {
		if (k > 0) {
			if (a[i] == a[i-1]) t[sz++] = k, k = 0;
		}
		k++;
	}
	if (k > 0) t[sz++] = k;

	for (ans = k = 0, i = 0; i < sz; i++) {
		k += t[i];
		if (i > 2) k -= t[i-3];
		if (ans < k) ans = k;
	}
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 100002
a:
	.zero	100002
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 400008
t:
	.zero	400008
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 200100
buf:
	.zero	200100
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$10, %esi
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, -4(%rbp)
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$200100, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	a(%rip), %rcx
	movb	%dl, (%rax,%rcx)
	movq	p(%rip), %rax
	addq	$2, %rax
	movq	%rax, p(%rip)
	addl	$1, -20(%rbp)
.L2:
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L3
	movl	$0, -12(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L4
.L6:
	cmpl	$0, -16(%rbp)
	jle	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L5
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	t(%rip), %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -16(%rbp)
.L5:
	addl	$1, -16(%rbp)
	addl	$1, -20(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L6
	cmpl	$0, -16(%rbp)
	jle	.L7
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	t(%rip), %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	movl	$0, -16(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L8
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -16(%rbp)
	cmpl	$2, -20(%rbp)
	jle	.L9
	movl	-20(%rbp), %eax
	subl	$3, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -16(%rbp)
.L9:
	movl	-8(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jge	.L10
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
.L10:
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L11
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$10, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	buf(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movq	stdin(%rip), %rdx
	call	fgets@PLT
	xorl	%esi, %esi
	movl	$10, %edx
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	stdin(%rip), %rdx
	movq	%rbp, %rdi
	movl	$200100, %esi
	movq	%rax, %rbx
	movq	%rbp, p(%rip)
	call	fgets@PLT
	testl	%ebx, %ebx
	jle	.L15
	movq	p(%rip), %rdx
	leaq	a(%rip), %rcx
	leal	-1(%rbx), %r8d
	movq	%rcx, %rax
	leaq	2(%rdx,%r8,2), %rdi
	.p2align 4,,10
	.p2align 3
.L3:
	movzbl	(%rdx), %esi
	addq	$2, %rdx
	addq	$1, %rax
	movq	%rdx, p(%rip)
	movb	%sil, -1(%rax)
	cmpq	%rdi, %rdx
	jne	.L3
	leaq	1+a(%rip), %rdx
	addq	$1, %rcx
	movl	$1, %eax
	xorl	%esi, %esi
	addq	%r8, %rdx
	leaq	t(%rip), %rdi
	cmpq	%rdx, %rcx
	je	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	-1(%rcx), %ebx
	cmpb	%bl, (%rcx)
	je	.L5
	addq	$1, %rcx
	addl	$1, %eax
	cmpq	%rdx, %rcx
	jne	.L6
.L7:
	movslq	%esi, %rdx
	movl	$2, %r9d
	cmpl	%r9d, %esi
	movl	%eax, (%rdi,%rdx,4)
	leaq	t(%rip), %rdi
	cmovle	%esi, %r9d
	movq	%rdi, %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	addl	(%rdx), %eax
	movl	%ecx, %r10d
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addl	$1, %ecx
	addq	$4, %rdx
	cmpl	%ecx, %r9d
	jge	.L9
	cmpl	%esi, %r10d
	jge	.L2
	movslq	%ecx, %rdx
	leal	-3(%rsi), %ebp
	leaq	0(,%rdx,4), %r9
	leaq	-12(%rdi,%r9), %rbx
	leaq	-8(%rdi,%r9), %r11
	leaq	-4(%rdi,%r9), %r10
	cmpl	%ebp, %ecx
	jge	.L10
	cmpl	%esi, %ecx
	jg	.L10
	movl	(%rbx), %r12d
	movl	(%r11), %ebx
	addq	%rdi, %r9
	movl	(%r10), %r11d
.L11:
	addl	(%r9), %eax
	movl	%eax, %edx
	subl	%r12d, %edx
	movl	4(%r9), %r12d
	leal	(%rdx,%r12), %r13d
	subl	%ebx, %r13d
	movl	8(%r9), %ebx
	leal	0(%r13,%rbx), %r10d
	subl	%r11d, %r10d
	movl	12(%r9), %r11d
	leal	(%r10,%r11), %eax
	subl	(%r9), %eax
	cmpl	%r13d, %edx
	cmovl	%r13d, %edx
	cmpl	%r10d, %edx
	cmovl	%r10d, %edx
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
	addl	$4, %ecx
	addq	$16, %r9
	cmpl	%ecx, %ebp
	jg	.L11
	movslq	%ecx, %rdx
.L10:
	leaq	-12+t(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L12:
	addl	(%rdi,%rdx,4), %eax
	subl	(%r9,%rdx,4), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$1, %rdx
	leal	-1(%rdx), %ecx
	cmpl	%ecx, %esi
	jg	.L12
.L2:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	addq	$1, %rcx
	movl	%eax, (%rdi,%rsi,4)
	leal	1(%rsi), %r8d
	movl	$1, %eax
	cmpq	%rdx, %rcx
	je	.L29
	movslq	%r8d, %rsi
	jmp	.L6
.L29:
	movl	%r8d, %esi
	jmp	.L7
.L15:
	xorl	%r8d, %r8d
	jmp	.L2
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 200100
buf:
	.zero	200100
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 400008
t:
	.zero	400008
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 100002
a:
	.zero	100002
	.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	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$10, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	buf(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movq	stdin(%rip), %rdx
	call	fgets@PLT
	xorl	%esi, %esi
	movl	$10, %edx
	movq	%rbp, %rdi
	call	strtol@PLT
	movq	stdin(%rip), %rdx
	movq	%rbp, %rdi
	movl	$200100, %esi
	movq	%rax, %rbx
	movq	%rbp, p(%rip)
	call	fgets@PLT
	testl	%ebx, %ebx
	jle	.L15
	movq	p(%rip), %rdx
	leaq	a(%rip), %rcx
	leal	-1(%rbx), %r8d
	movq	%rcx, %rax
	leaq	2(%rdx,%r8,2), %rdi
	.p2align 4,,10
	.p2align 3
.L3:
	movzbl	(%rdx), %esi
	addq	$2, %rdx
	addq	$1, %rax
	movq	%rdx, p(%rip)
	movb	%sil, -1(%rax)
	cmpq	%rdi, %rdx
	jne	.L3
	leaq	1+a(%rip), %rdx
	addq	$1, %rcx
	movl	$1, %eax
	xorl	%esi, %esi
	addq	%r8, %rdx
	leaq	t(%rip), %rdi
	cmpq	%rdx, %rcx
	je	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	-1(%rcx), %ebx
	cmpb	%bl, (%rcx)
	je	.L5
	addq	$1, %rcx
	addl	$1, %eax
	cmpq	%rdx, %rcx
	jne	.L6
.L7:
	movslq	%esi, %rdx
	movl	$2, %r9d
	cmpl	%r9d, %esi
	movl	%eax, (%rdi,%rdx,4)
	leaq	t(%rip), %rdi
	cmovle	%esi, %r9d
	movq	%rdi, %rdx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	addl	(%rdx), %eax
	movl	%ecx, %r10d
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addl	$1, %ecx
	addq	$4, %rdx
	cmpl	%ecx, %r9d
	jge	.L9
	cmpl	%esi, %r10d
	jge	.L2
	movslq	%ecx, %rdx
	leal	-3(%rsi), %ebp
	leaq	0(,%rdx,4), %r9
	leaq	-12(%rdi,%r9), %rbx
	leaq	-8(%rdi,%r9), %r11
	leaq	-4(%rdi,%r9), %r10
	cmpl	%ebp, %ecx
	jge	.L10
	cmpl	%esi, %ecx
	jg	.L10
	movl	(%rbx), %r12d
	movl	(%r11), %ebx
	addq	%rdi, %r9
	movl	(%r10), %r11d
.L11:
	addl	(%r9), %eax
	movl	%eax, %edx
	subl	%r12d, %edx
	movl	4(%r9), %r12d
	leal	(%rdx,%r12), %r13d
	subl	%ebx, %r13d
	movl	8(%r9), %ebx
	leal	0(%r13,%rbx), %r10d
	subl	%r11d, %r10d
	movl	12(%r9), %r11d
	leal	(%r10,%r11), %eax
	subl	(%r9), %eax
	cmpl	%r13d, %edx
	cmovl	%r13d, %edx
	cmpl	%r10d, %edx
	cmovl	%r10d, %edx
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	cmpl	%edx, %r8d
	cmovl	%edx, %r8d
	addl	$4, %ecx
	addq	$16, %r9
	cmpl	%ecx, %ebp
	jg	.L11
	movslq	%ecx, %rdx
.L10:
	leaq	-12+t(%rip), %r9
	.p2align 4,,10
	.p2align 3
.L12:
	addl	(%rdi,%rdx,4), %eax
	subl	(%r9,%rdx,4), %eax
	cmpl	%eax, %r8d
	cmovl	%eax, %r8d
	addq	$1, %rdx
	leal	-1(%rdx), %ecx
	cmpl	%ecx, %esi
	jg	.L12
.L2:
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	addq	$1, %rcx
	movl	%eax, (%rdi,%rsi,4)
	leal	1(%rsi), %r8d
	movl	$1, %eax
	cmpq	%rdx, %rcx
	je	.L29
	movslq	%r8d, %rsi
	jmp	.L6
.L29:
	movl	%r8d, %esi
	jmp	.L7
.L15:
	xorl	%r8d, %r8d
	jmp	.L2
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 200100
buf:
	.zero	200100
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 400008
t:
	.zero	400008
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 100002
a:
	.zero	100002
	.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:

// AOJ 0603: Illumination
// 2017.10.31 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

char a[100002];
int t[100002];
char buf[200100], *p;

int main()
{
	int n, i, k, sz, ans;

	fgets(buf, 10, stdin), n = atoi(buf);
	fgets(p=buf, sizeof(buf), stdin);
	for (i = 0; i < n; i++) a[i] = *p, p+=2;

	for (sz = 0, k = 0, i = 0; i < n; i++) {
		if (k > 0) {
			if (a[i] == a[i-1]) t[sz++] = k, k = 0;
		}
		k++;
	}
	if (k > 0) t[sz++] = k;

	for (ans = k = 0, i = 0; i < sz; i++) {
		k += t[i];
		if (i > 2) k -= t[i-3];
		if (ans < k) ans = k;
	}
	printf("%d\n", ans);
	return 0;
}
10
1 1 0 0 0 0 1 1 1 0
 10
1 1 0 0 0 0 1 1 1 1
 10
1 1 0 0 0 0 1 2 1 1
 10
1 1 0 0 -1 0 1 2 1 1
 10
1 1 0 0 -1 1 1 2 1 1
 10
1 1 0 0 -1 2 1 2 1 2
 10
-1 1 1 1 1 -1 -21 1 1 15
 10
1 1 0 0 -1 1 1 2 1 2
 10
1 1 0 0 -1 2 1 4 1 2
 10
0 1 0 0 -1 2 1 4 1 2

5
 4
 6
 6
 6
 6
 6
 6
 6
 7

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

```c
// AOJ 0603: Illumination
// 2017.10.31 bal4u@uu

#include <stdio.h>
#include <stdlib.h>

char a[100002];
int t[100002];
char buf[200100], *p;

int main()
{
	int n, i, k, sz, ans;

	fgets(buf, 10, stdin), n = atoi(buf);
	fgets(p=buf, sizeof(buf), stdin);
	for (i = 0; i < n; i++) a[i] = *p, p+=2;

	for (sz = 0, k = 0, i = 0; i < n; i++) {
		if (k > 0) {
			if (a[i] == a[i-1]) t[sz++] = k, k = 0;
		}
		k++;
	}
	if (k > 0) t[sz++] = k;

	for (ans = k = 0, i = 0; i < sz; i++) {
		k += t[i];
		if (i > 2) k -= t[i-3];
		if (ans < k) ans = k;
	}
	printf("%d\n", ans);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 100002
a:
	.zero	100002
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 400008
t:
	.zero	400008
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 200100
buf:
	.zero	200100
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$10, %esi
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, -4(%rbp)
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$200100, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	a(%rip), %rcx
	movb	%dl, (%rax,%rcx)
	movq	p(%rip), %rax
	addq	$2, %rax
	movq	%rax, p(%rip)
	addl	$1, -20(%rbp)
.L2:
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L3
	movl	$0, -12(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L4
.L6:
	cmpl	$0, -16(%rbp)
	jle	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L5
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	t(%rip), %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -16(%rbp)
.L5:
	addl	$1, -16(%rbp)
	addl	$1, -20(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L6
	cmpl	$0, -16(%rbp)
	jle	.L7
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	t(%rip), %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	movl	$0, -16(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L8
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -16(%rbp)
	cmpl	$2, -20(%rbp)
	jle	.L9
	movl	-20(%rbp), %eax
	subl	$3, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -16(%rbp)
.L9:
	movl	-8(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jge	.L10
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
.L10:
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L11
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 100002
a:
	.zero	100002
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 400008
t:
	.zero	400008
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 200100
buf:
	.zero	200100
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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
	movq	stdin(%rip), %rax
	movq	%rax, %rdx
	movl	$10, %esi
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	fgets@PLT
	leaq	buf(%rip), %rax
	movq	%rax, %rdi
	call	atoi@PLT
	movl	%eax, -4(%rbp)
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$200100, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -20(%rbp)
	jmp	.L2
.L3:
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	a(%rip), %rcx
	movb	%dl, (%rax,%rcx)
	movq	p(%rip), %rax
	addq	$2, %rax
	movq	%rax, p(%rip)
	addl	$1, -20(%rbp)
.L2:
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L3
	movl	$0, -12(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L4
.L6:
	cmpl	$0, -16(%rbp)
	jle	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	a(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	a(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L5
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	t(%rip), %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, -16(%rbp)
.L5:
	addl	$1, -16(%rbp)
	addl	$1, -20(%rbp)
.L4:
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L6
	cmpl	$0, -16(%rbp)
	jle	.L7
	movl	-12(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -12(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	t(%rip), %rdx
	movl	-16(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L7:
	movl	$0, -16(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L8
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -16(%rbp)
	cmpl	$2, -20(%rbp)
	jle	.L9
	movl	-20(%rbp), %eax
	subl	$3, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	t(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -16(%rbp)
.L9:
	movl	-8(%rbp), %eax
	cmpl	-16(%rbp), %eax
	jge	.L10
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
.L10:
	addl	$1, -20(%rbp)
.L8:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L11
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
