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

```c
// AOJ  0516: Maximum Sum
// 2017.8.30 bal4u@uu
// 2017.11.14

#include <stdio.h>

int a[100003], s[100003];

char buf[20], *p;
int getint()
{
	int n = 0;
	if (*p == '-') {
		p++; while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
		return -n;
	}
	while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	return n;
}

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

	while (fgets(p=buf, 20, stdin) && *p != '0') {
		n = getint(), p++, k = getint();

		fgets(p=buf, 10, stdin);
		s[0] = a[0] = getint();
		for (i = 1; i < n; i++) {
			fgets(p=buf, 10, stdin);
			a[i] = getint();
			s[i] = s[i-1] + a[i];
			if (i >= k) s[i] -= a[i-k];
		}
		for (f = 1, i = k-1; i < n; i++) {
			if (f) f = 0, ans = s[i];
			else if (s[i] > ans) ans = s[i];
		}
		printf("%d\n", ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400012
a:
	.zero	400012
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 400012
s:
	.zero	400012
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.text
	.globl	getint
	.type	getint, @function
getint:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$45, %al
	jne	.L6
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L3:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jg	.L4
	movl	-4(%rbp), %eax
	negl	%eax
	jmp	.L5
.L7:
	movl	-4(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L6:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jg	.L7
	movl	-4(%rbp), %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getint, .-getint
	.section	.rodata
.LC0:
	.string	"%d\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
	jmp	.L9
.L18:
	movl	$0, %eax
	call	getint
	movl	%eax, -8(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	$0, %eax
	call	getint
	movl	%eax, -4(%rbp)
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	movl	%eax, s(%rip)
	movl	$1, -20(%rbp)
	jmp	.L10
.L12:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L11
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	subl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L11:
	addl	$1, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L12
	movl	$1, -12(%rbp)
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L16:
	cmpl	$0, -12(%rbp)
	je	.L14
	movl	$0, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	jmp	.L15
.L14:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -16(%rbp)
	jge	.L15
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
.L15:
	addl	$1, -20(%rbp)
.L13:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L16
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$20, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L17
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	jne	.L18
.L17:
	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	getint
	.type	getint, @function
getint:
.LFB23:
	.cfi_startproc
	endbr64
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	cmpb	$45, %dl
	je	.L2
	addq	$1, %rax
	xorl	%r8d, %r8d
	cmpb	$47, %dl
	jle	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	leal	(%r8,%r8,4), %ecx
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %r8d
	jg	.L7
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	cmpb	$47, 1(%rax)
	jle	.L8
	leaq	2(%rax), %rdx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rdx, p(%rip)
	movzbl	-1(%rdx), %eax
	addq	$1, %rdx
	leal	(%r8,%r8,4), %ecx
	andl	$15, %eax
	cmpb	$47, -1(%rdx)
	leal	(%rax,%rcx,2), %r8d
	jg	.L6
	negl	%r8d
	movl	%r8d, %eax
	ret
.L8:
	xorl	%r8d, %r8d
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	getint, .-getint
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	buf(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	s(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.p2align 4,,10
	.p2align 3
.L14:
	movq	stdin(%rip), %rdx
	movl	$20, %esi
	movq	%r13, %rdi
	movq	%r13, p(%rip)
	call	fgets@PLT
	testq	%rax, %rax
	je	.L56
	movq	p(%rip), %rdx
	movzbl	(%rdx), %ecx
	cmpb	$48, %cl
	je	.L56
	leaq	1(%rdx), %rax
	cmpb	$45, %cl
	je	.L15
	xorl	%r12d, %r12d
	cmpb	$47, %cl
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %ecx
	movq	%rax, %rdx
	addq	$1, %rax
	leal	(%r12,%r12,4), %esi
	andl	$15, %ecx
	cmpb	$47, -1(%rax)
	leal	(%rcx,%rsi,2), %r12d
	jg	.L20
.L17:
	leaq	1(%rdx), %rax
	movq	%rax, p(%rip)
	movzbl	1(%rdx), %esi
	leaq	2(%rdx), %rax
	cmpb	$45, %sil
	je	.L21
	xorl	%r14d, %r14d
	cmpb	$47, %sil
	jle	.L87
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	leal	(%r14,%r14,4), %ecx
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %r14d
	jg	.L26
	leal	-1(%r14), %eax
	movl	%eax, 28(%rsp)
.L23:
	movq	stdin(%rip), %rdx
	movl	$10, %esi
	movq	%r13, %rdi
	movq	%r13, p(%rip)
	call	fgets@PLT
	movq	p(%rip), %rax
	movzbl	(%rax), %esi
	cmpb	$45, %sil
	je	.L27
	addq	$1, %rax
	xorl	%edx, %edx
	cmpb	$47, %sil
	jle	.L29
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %esi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rsi,2), %edx
	jg	.L32
.L29:
	leaq	a(%rip), %rax
	movl	%edx, 0(%rbp)
	movl	%edx, (%rax)
	cmpl	$1, %r12d
	jle	.L44
	cmpl	$1, %r14d
	jle	.L61
	cmpl	%r12d, %r14d
	movl	%r12d, %eax
	movl	$1, %r15d
	cmovle	%r14d, %eax
	movl	%eax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L43:
	movq	stdin(%rip), %rdx
	movl	$10, %esi
	movq	%r13, %rdi
	movq	%r13, p(%rip)
	call	fgets@PLT
	movq	p(%rip), %rax
	movzbl	(%rax), %esi
	cmpb	$45, %sil
	je	.L37
	addq	$1, %rax
	xorl	%edx, %edx
	cmpb	$47, %sil
	jle	.L39
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %esi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rsi,2), %edx
	jg	.L42
.L39:
	leaq	a(%rip), %rax
	movl	%edx, (%rax,%r15,4)
	leaq	-4+s(%rip), %rax
	addl	(%rax,%r15,4), %edx
	leal	1(%r15), %eax
	movl	%edx, 0(%rbp,%r15,4)
	addq	$1, %r15
	cmpl	%r15d, 8(%rsp)
	jg	.L43
	cmpl	%eax, %r12d
	jle	.L44
.L36:
	movslq	%eax, %r15
	subl	%r14d, %eax
	leaq	a(%rip), %rdi
	cltq
	leaq	0(,%r15,4), %rdx
	leaq	(%rdi,%rax,4), %rax
	leaq	0(%rbp,%rdx), %r8
	subq	%rdx, %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L51:
	movq	stdin(%rip), %rdx
	movl	$10, %esi
	movq	%r13, %rdi
	movq	%r8, 8(%rsp)
	movq	%r13, p(%rip)
	call	fgets@PLT
	movq	p(%rip), %rax
	movq	8(%rsp), %r8
	movzbl	(%rax), %edx
	cmpb	$45, %dl
	je	.L45
	cmpb	$47, %dl
	jle	.L63
	addq	$1, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L47:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %esi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rsi,2), %edx
	jg	.L47
.L46:
	leaq	a(%rip), %rax
	addq	$4, %r8
	movl	%edx, (%rax,%r15,4)
	movq	16(%rsp), %rax
	addl	-8(%r8), %edx
	subl	(%rax,%r15,4), %edx
	addq	$1, %r15
	movl	%edx, -4(%r8)
	cmpl	%r15d, %r12d
	jg	.L51
.L44:
	cmpl	%r12d, 28(%rsp)
	jge	.L35
	movslq	28(%rsp), %rax
	movl	0(%rbp,%rax,4), %ebx
	cmpl	%r12d, %r14d
	jge	.L35
	movl	%r12d, %edi
	subl	%r14d, %edi
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L53
	movslq	%r14d, %rax
	movd	%ebx, %xmm3
	leaq	0(%rbp,%rax,4), %rsi
	movl	%edi, %eax
	pshufd	$0, %xmm3, %xmm1
	shrl	$2, %eax
	leaq	16(%rsi), %rdx
	subl	$1, %eax
	salq	$4, %rax
	addq	%rdx, %rax
.L54:
	movdqu	(%rsi), %xmm0
	movq	%rdx, %rsi
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm0
	pandn	%xmm1, %xmm2
	movdqa	%xmm2, %xmm1
	por	%xmm0, %xmm1
	cmpq	%rdx, %rax
	je	.L85
	addq	$16, %rdx
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L85:
	movdqa	%xmm1, %xmm2
	movl	%edi, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm0
	addl	%eax, %r14d
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %ebx
	cmpl	%eax, %edi
	je	.L35
.L53:
	movslq	%r14d, %rax
	movl	0(%rbp,%rax,4), %eax
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	leal	1(%r14), %eax
	cmpl	%r12d, %eax
	jge	.L35
	cltq
	leal	2(%r14), %ecx
	movl	0(%rbp,%rax,4), %eax
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	cmpl	%ecx, %r12d
	jle	.L35
	movslq	%ecx, %rcx
	movl	0(%rbp,%rcx,4), %eax
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
.L35:
	movl	%ebx, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L45:
	leaq	1(%rax), %rdx
	leaq	2(%rax), %rsi
	movq	%rdx, p(%rip)
	xorl	%edx, %edx
	cmpb	$47, 1(%rax)
	jle	.L46
	.p2align 4,,10
	.p2align 3
.L49:
	movq	%rsi, p(%rip)
	movzbl	-1(%rsi), %eax
	addq	$1, %rsi
	leal	(%rdx,%rdx,4), %edx
	andl	$15, %eax
	cmpb	$47, -1(%rsi)
	leal	(%rax,%rdx,2), %edx
	jg	.L49
	negl	%edx
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	cmpb	$47, 1(%rax)
	jle	.L62
	addq	$2, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L41:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %esi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rsi,2), %edx
	jg	.L41
	negl	%edx
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L61:
	movl	$1, %eax
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L63:
	xorl	%edx, %edx
	jmp	.L46
.L27:
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	cmpb	$47, 1(%rax)
	jle	.L60
	addq	$2, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %esi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rsi,2), %edx
	jg	.L31
	negl	%edx
	jmp	.L29
.L21:
	movq	%rax, p(%rip)
	cmpb	$47, 2(%rdx)
	jle	.L59
	leaq	3(%rdx), %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %ecx
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %edx
	jg	.L25
.L24:
	movl	%edx, %r14d
	notl	%edx
	movl	%edx, 28(%rsp)
	negl	%r14d
	jmp	.L23
.L15:
	movq	%rax, p(%rip)
	cmpb	$47, 1(%rdx)
	jle	.L58
	leaq	2(%rdx), %rax
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %ecx
	movq	%rax, %rdx
	addq	$1, %rax
	leal	(%r9,%r9,4), %esi
	andl	$15, %ecx
	cmpb	$47, -1(%rax)
	leal	(%rcx,%rsi,2), %r9d
	jg	.L19
.L18:
	negl	%r9d
	movl	%r9d, %r12d
	jmp	.L17
.L62:
	xorl	%edx, %edx
	jmp	.L39
.L56:
	addq	$40, %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
.L87:
	.cfi_restore_state
	movl	$-1, 28(%rsp)
	jmp	.L23
.L60:
	xorl	%edx, %edx
	negl	%edx
	jmp	.L29
.L59:
	xorl	%edx, %edx
	jmp	.L24
.L58:
	movq	%rax, %rdx
	xorl	%r9d, %r9d
	jmp	.L18
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 400012
s:
	.zero	400012
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400012
a:
	.zero	400012
	.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	getint
	.type	getint, @function
getint:
.LFB23:
	.cfi_startproc
	endbr64
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	cmpb	$45, %dl
	je	.L2
	addq	$1, %rax
	xorl	%r8d, %r8d
	cmpb	$47, %dl
	jle	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	leal	(%r8,%r8,4), %ecx
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %r8d
	jg	.L7
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	cmpb	$47, 1(%rax)
	jle	.L8
	leaq	2(%rax), %rdx
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rdx, p(%rip)
	movzbl	-1(%rdx), %eax
	addq	$1, %rdx
	leal	(%r8,%r8,4), %ecx
	andl	$15, %eax
	cmpb	$47, -1(%rdx)
	leal	(%rax,%rcx,2), %r8d
	jg	.L6
	negl	%r8d
	movl	%r8d, %eax
	ret
.L8:
	xorl	%r8d, %r8d
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	getint, .-getint
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	buf(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	s(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	.p2align 4,,10
	.p2align 3
.L14:
	movq	stdin(%rip), %rdx
	movl	$20, %esi
	movq	%r13, %rdi
	movq	%r13, p(%rip)
	call	fgets@PLT
	testq	%rax, %rax
	je	.L56
	movq	p(%rip), %rdx
	movzbl	(%rdx), %ecx
	cmpb	$48, %cl
	je	.L56
	leaq	1(%rdx), %rax
	cmpb	$45, %cl
	je	.L15
	xorl	%r12d, %r12d
	cmpb	$47, %cl
	jle	.L17
	.p2align 4,,10
	.p2align 3
.L20:
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %ecx
	movq	%rax, %rdx
	addq	$1, %rax
	leal	(%r12,%r12,4), %esi
	andl	$15, %ecx
	cmpb	$47, -1(%rax)
	leal	(%rcx,%rsi,2), %r12d
	jg	.L20
.L17:
	leaq	1(%rdx), %rax
	movq	%rax, p(%rip)
	movzbl	1(%rdx), %esi
	leaq	2(%rdx), %rax
	cmpb	$45, %sil
	je	.L21
	xorl	%r14d, %r14d
	cmpb	$47, %sil
	jle	.L87
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	leal	(%r14,%r14,4), %ecx
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %r14d
	jg	.L26
	leal	-1(%r14), %eax
	movl	%eax, 28(%rsp)
.L23:
	movq	stdin(%rip), %rdx
	movl	$10, %esi
	movq	%r13, %rdi
	movq	%r13, p(%rip)
	call	fgets@PLT
	movq	p(%rip), %rax
	movzbl	(%rax), %esi
	cmpb	$45, %sil
	je	.L27
	addq	$1, %rax
	xorl	%edx, %edx
	cmpb	$47, %sil
	jle	.L29
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %esi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rsi,2), %edx
	jg	.L32
.L29:
	leaq	a(%rip), %rax
	movl	%edx, 0(%rbp)
	movl	%edx, (%rax)
	cmpl	$1, %r12d
	jle	.L44
	cmpl	$1, %r14d
	jle	.L61
	cmpl	%r12d, %r14d
	movl	%r12d, %eax
	movl	$1, %r15d
	cmovle	%r14d, %eax
	movl	%eax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L43:
	movq	stdin(%rip), %rdx
	movl	$10, %esi
	movq	%r13, %rdi
	movq	%r13, p(%rip)
	call	fgets@PLT
	movq	p(%rip), %rax
	movzbl	(%rax), %esi
	cmpb	$45, %sil
	je	.L37
	addq	$1, %rax
	xorl	%edx, %edx
	cmpb	$47, %sil
	jle	.L39
	.p2align 4,,10
	.p2align 3
.L42:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %esi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rsi,2), %edx
	jg	.L42
.L39:
	leaq	a(%rip), %rax
	movl	%edx, (%rax,%r15,4)
	leaq	-4+s(%rip), %rax
	addl	(%rax,%r15,4), %edx
	leal	1(%r15), %eax
	movl	%edx, 0(%rbp,%r15,4)
	addq	$1, %r15
	cmpl	%r15d, 8(%rsp)
	jg	.L43
	cmpl	%eax, %r12d
	jle	.L44
.L36:
	movslq	%eax, %r15
	subl	%r14d, %eax
	leaq	a(%rip), %rdi
	cltq
	leaq	0(,%r15,4), %rdx
	leaq	(%rdi,%rax,4), %rax
	leaq	0(%rbp,%rdx), %r8
	subq	%rdx, %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L51:
	movq	stdin(%rip), %rdx
	movl	$10, %esi
	movq	%r13, %rdi
	movq	%r8, 8(%rsp)
	movq	%r13, p(%rip)
	call	fgets@PLT
	movq	p(%rip), %rax
	movq	8(%rsp), %r8
	movzbl	(%rax), %edx
	cmpb	$45, %dl
	je	.L45
	cmpb	$47, %dl
	jle	.L63
	addq	$1, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L47:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %esi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rsi,2), %edx
	jg	.L47
.L46:
	leaq	a(%rip), %rax
	addq	$4, %r8
	movl	%edx, (%rax,%r15,4)
	movq	16(%rsp), %rax
	addl	-8(%r8), %edx
	subl	(%rax,%r15,4), %edx
	addq	$1, %r15
	movl	%edx, -4(%r8)
	cmpl	%r15d, %r12d
	jg	.L51
.L44:
	cmpl	%r12d, 28(%rsp)
	jge	.L35
	movslq	28(%rsp), %rax
	movl	0(%rbp,%rax,4), %ebx
	cmpl	%r12d, %r14d
	jge	.L35
	movl	%r12d, %edi
	subl	%r14d, %edi
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L53
	movslq	%r14d, %rax
	movd	%ebx, %xmm3
	leaq	0(%rbp,%rax,4), %rsi
	movl	%edi, %eax
	pshufd	$0, %xmm3, %xmm1
	shrl	$2, %eax
	leaq	16(%rsi), %rdx
	subl	$1, %eax
	salq	$4, %rax
	addq	%rdx, %rax
.L54:
	movdqu	(%rsi), %xmm0
	movq	%rdx, %rsi
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm0
	pandn	%xmm1, %xmm2
	movdqa	%xmm2, %xmm1
	por	%xmm0, %xmm1
	cmpq	%rdx, %rax
	je	.L85
	addq	$16, %rdx
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L85:
	movdqa	%xmm1, %xmm2
	movl	%edi, %eax
	psrldq	$8, %xmm2
	andl	$-4, %eax
	movdqa	%xmm2, %xmm0
	addl	%eax, %r14d
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %ebx
	cmpl	%eax, %edi
	je	.L35
.L53:
	movslq	%r14d, %rax
	movl	0(%rbp,%rax,4), %eax
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	leal	1(%r14), %eax
	cmpl	%r12d, %eax
	jge	.L35
	cltq
	leal	2(%r14), %ecx
	movl	0(%rbp,%rax,4), %eax
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
	cmpl	%ecx, %r12d
	jle	.L35
	movslq	%ecx, %rcx
	movl	0(%rbp,%rcx,4), %eax
	cmpl	%eax, %ebx
	cmovl	%eax, %ebx
.L35:
	movl	%ebx, %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L45:
	leaq	1(%rax), %rdx
	leaq	2(%rax), %rsi
	movq	%rdx, p(%rip)
	xorl	%edx, %edx
	cmpb	$47, 1(%rax)
	jle	.L46
	.p2align 4,,10
	.p2align 3
.L49:
	movq	%rsi, p(%rip)
	movzbl	-1(%rsi), %eax
	addq	$1, %rsi
	leal	(%rdx,%rdx,4), %edx
	andl	$15, %eax
	cmpb	$47, -1(%rsi)
	leal	(%rax,%rdx,2), %edx
	jg	.L49
	negl	%edx
	jmp	.L46
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	cmpb	$47, 1(%rax)
	jle	.L62
	addq	$2, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L41:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %esi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rsi,2), %edx
	jg	.L41
	negl	%edx
	jmp	.L39
	.p2align 4,,10
	.p2align 3
.L61:
	movl	$1, %eax
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L63:
	xorl	%edx, %edx
	jmp	.L46
.L27:
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	cmpb	$47, 1(%rax)
	jle	.L60
	addq	$2, %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %esi
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rsi,2), %edx
	jg	.L31
	negl	%edx
	jmp	.L29
.L21:
	movq	%rax, p(%rip)
	cmpb	$47, 2(%rdx)
	jle	.L59
	leaq	3(%rdx), %rax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rax, p(%rip)
	leal	(%rdx,%rdx,4), %ecx
	movzbl	-1(%rax), %edx
	addq	$1, %rax
	andl	$15, %edx
	cmpb	$47, -1(%rax)
	leal	(%rdx,%rcx,2), %edx
	jg	.L25
.L24:
	movl	%edx, %r14d
	notl	%edx
	movl	%edx, 28(%rsp)
	negl	%r14d
	jmp	.L23
.L15:
	movq	%rax, p(%rip)
	cmpb	$47, 1(%rdx)
	jle	.L58
	leaq	2(%rdx), %rax
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %ecx
	movq	%rax, %rdx
	addq	$1, %rax
	leal	(%r9,%r9,4), %esi
	andl	$15, %ecx
	cmpb	$47, -1(%rax)
	leal	(%rcx,%rsi,2), %r9d
	jg	.L19
.L18:
	negl	%r9d
	movl	%r9d, %r12d
	jmp	.L17
.L62:
	xorl	%edx, %edx
	jmp	.L39
.L56:
	addq	$40, %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
.L87:
	.cfi_restore_state
	movl	$-1, 28(%rsp)
	jmp	.L23
.L60:
	xorl	%edx, %edx
	negl	%edx
	jmp	.L29
.L59:
	xorl	%edx, %edx
	jmp	.L24
.L58:
	movq	%rax, %rdx
	xorl	%r9d, %r9d
	jmp	.L18
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 400012
s:
	.zero	400012
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400012
a:
	.zero	400012
	.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  0516: Maximum Sum
// 2017.8.30 bal4u@uu
// 2017.11.14

#include <stdio.h>

int a[100003], s[100003];

char buf[20], *p;
int getint()
{
	int n = 0;
	if (*p == '-') {
		p++; while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
		return -n;
	}
	while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	return n;
}

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

	while (fgets(p=buf, 20, stdin) && *p != '0') {
		n = getint(), p++, k = getint();

		fgets(p=buf, 10, stdin);
		s[0] = a[0] = getint();
		for (i = 1; i < n; i++) {
			fgets(p=buf, 10, stdin);
			a[i] = getint();
			s[i] = s[i-1] + a[i];
			if (i >= k) s[i] -= a[i-k];
		}
		for (f = 1, i = k-1; i < n; i++) {
			if (f) f = 0, ans = s[i];
			else if (s[i] > ans) ans = s[i];
		}
		printf("%d\n", ans);
	}
	return 0;
}
5 3
2
5
-4
8
3
0 0
 5 3
2
5
-4
12
3
0 0
 5 3
2
5
-4
14
3
0 0
 5 3
2
9
-4
14
1
0 0
 5 3
1
9
-4
2
1
0 0
 5 3
2
8
-4
12
3
0 0
 5 1
2
9
-4
14
1
0 0
 5 3
1
9
-4
13
1
0 0
 5 3
1
2
-4
13
1
0 0
 5 3
2
5
-4
5
3
0 0

9
 13
 15
 19
 7
 16
 14
 18
 11
 6

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

```c
// AOJ  0516: Maximum Sum
// 2017.8.30 bal4u@uu
// 2017.11.14

#include <stdio.h>

int a[100003], s[100003];

char buf[20], *p;
int getint()
{
	int n = 0;
	if (*p == '-') {
		p++; while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
		return -n;
	}
	while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	return n;
}

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

	while (fgets(p=buf, 20, stdin) && *p != '0') {
		n = getint(), p++, k = getint();

		fgets(p=buf, 10, stdin);
		s[0] = a[0] = getint();
		for (i = 1; i < n; i++) {
			fgets(p=buf, 10, stdin);
			a[i] = getint();
			s[i] = s[i-1] + a[i];
			if (i >= k) s[i] -= a[i-k];
		}
		for (f = 1, i = k-1; i < n; i++) {
			if (f) f = 0, ans = s[i];
			else if (s[i] > ans) ans = s[i];
		}
		printf("%d\n", ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400012
a:
	.zero	400012
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 400012
s:
	.zero	400012
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.text
	.globl	getint
	.type	getint, @function
getint:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$45, %al
	jne	.L6
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L3:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jg	.L4
	movl	-4(%rbp), %eax
	negl	%eax
	jmp	.L5
.L7:
	movl	-4(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L6:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jg	.L7
	movl	-4(%rbp), %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getint, .-getint
	.section	.rodata
.LC0:
	.string	"%d\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
	jmp	.L9
.L18:
	movl	$0, %eax
	call	getint
	movl	%eax, -8(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	$0, %eax
	call	getint
	movl	%eax, -4(%rbp)
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	movl	%eax, s(%rip)
	movl	$1, -20(%rbp)
	jmp	.L10
.L12:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L11
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	subl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L11:
	addl	$1, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L12
	movl	$1, -12(%rbp)
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L16:
	cmpl	$0, -12(%rbp)
	je	.L14
	movl	$0, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	jmp	.L15
.L14:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -16(%rbp)
	jge	.L15
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
.L15:
	addl	$1, -20(%rbp)
.L13:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L16
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$20, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L17
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	jne	.L18
.L17:
	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.
train
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400012
a:
	.zero	400012
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 400012
s:
	.zero	400012
	.globl	buf
	.align 16
	.type	buf, @object
	.size	buf, 20
buf:
	.zero	20
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.text
	.globl	getint
	.type	getint, @function
getint:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -4(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$45, %al
	jne	.L6
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L3:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jg	.L4
	movl	-4(%rbp), %eax
	negl	%eax
	jmp	.L5
.L7:
	movl	-4(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -4(%rbp)
.L6:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jg	.L7
	movl	-4(%rbp), %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getint, .-getint
	.section	.rodata
.LC0:
	.string	"%d\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
	jmp	.L9
.L18:
	movl	$0, %eax
	call	getint
	movl	%eax, -8(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	$0, %eax
	call	getint
	movl	%eax, -4(%rbp)
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	movl	%eax, s(%rip)
	movl	$1, -20(%rbp)
	jmp	.L10
.L12:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$10, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, %eax
	call	getint
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jl	.L11
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	subl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L11:
	addl	$1, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L12
	movl	$1, -12(%rbp)
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L13
.L16:
	cmpl	$0, -12(%rbp)
	je	.L14
	movl	$0, -12(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
	jmp	.L15
.L14:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -16(%rbp)
	jge	.L15
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -16(%rbp)
.L15:
	addl	$1, -20(%rbp)
.L13:
	movl	-20(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jl	.L16
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$20, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	testq	%rax, %rax
	je	.L17
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$48, %al
	jne	.L18
.L17:
	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:
