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>
#define MAX(a,b) (((a)>(b))?(a):(b))
#define FOR(i,a,n) for(int i=a;i<n;i++)
#define ll long long

ll a[100001];
ll b[100001];
 int main(void)
 {
 	int n,k;
 	ll res=0;
 	scanf("%d %d",&n,&k);
 	FOR(i,1,n+1){
 		scanf("%lld",&a[i]);
 		b[i]=MAX(0,a[i]);
 		a[i]+=a[i-1],b[i]+=b[i-1];
 	}
 	FOR(i,k,n+1){
 		ll p=a[i]-a[i-k];
 		ll q=b[n]-b[i]+b[i-k];
 		if(p>0) res=MAX(res,p+q);
 		else res=MAX(res,q);
 	}
 	printf("%lld",res);
 	return 0;
 }
    
    ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800008
a:
	.zero	800008
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800008
b:
	.zero	800008
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -32(%rbp)
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -40(%rbp)
	jmp	.L2
.L3:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	$0, %edx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	b(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -40(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jle	.L3
	movl	-44(%rbp), %eax
	movl	%eax, -36(%rbp)
	jmp	.L4
.L7:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-44(%rbp), %ecx
	movl	-36(%rbp), %edx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	b(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rcx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L5
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	cmpq	%rdx, %rax
	cmovl	%rdx, %rax
	movq	%rax, -32(%rbp)
	jmp	.L6
.L5:
	movq	-32(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -32(%rbp)
.L6:
	addl	$1, -36(%rbp)
.L4:
	movl	-48(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L7
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	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	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	"%d %d"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edi
	testl	%edi, %edi
	jle	.L2
	leaq	8+a(%rip), %rbx
	leaq	8+b(%rip), %r12
	movl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rbx), %rax
	movq	-8(%rbx), %rdx
	movl	(%rsp), %edi
	addq	%rax, %rdx
	movq	%rdx, (%rbx)
	xorl	%edx, %edx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	addl	$1, %r13d
	addq	$8, %rbx
	addq	$8, %r12
	addq	-16(%r12), %rax
	movq	%rax, -8(%r12)
	cmpl	%r13d, %edi
	jge	.L3
.L2:
	movslq	4(%rsp), %r9
	cmpl	%edi, %r9d
	jg	.L9
	leaq	b(%rip), %r10
	movslq	%edi, %rax
	subl	%r9d, %edi
	xorl	%edx, %edx
	salq	$3, %r9
	leaq	a(%rip), %r11
	movq	(%r10,%rax,8), %r12
	xorl	%r8d, %r8d
	leaq	(%r11,%r9), %rbx
	addq	%r10, %r9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rax, %rdx
.L7:
	movq	(%rbx,%rdx,8), %rsi
	movq	%r12, %rax
	subq	(%r11,%rdx,8), %rsi
	subq	(%r9,%rdx,8), %rax
	addq	(%r10,%rdx,8), %rax
	leaq	(%rax,%rsi), %rcx
	cmpq	%rcx, %r8
	cmovge	%r8, %rcx
	cmpq	%rax, %r8
	cmovge	%r8, %rax
	testq	%rsi, %rsi
	cmovle	%rax, %rcx
	leaq	1(%rdx), %rax
	movq	%rcx, %r8
	cmpq	%rdx, %rdi
	jne	.L10
.L4:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$24, %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
.L9:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	b
	.bss
	.align 32
	.type	b, @object
	.size	b, 800008
b:
	.zero	800008
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800008
a:
	.zero	800008
	.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 %d"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edi
	testl	%edi, %edi
	jle	.L2
	leaq	8+a(%rip), %rbx
	leaq	8+b(%rip), %r12
	movl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rbx), %rax
	movq	-8(%rbx), %rdx
	movl	(%rsp), %edi
	addq	%rax, %rdx
	movq	%rdx, (%rbx)
	xorl	%edx, %edx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	addl	$1, %r13d
	addq	$8, %rbx
	addq	$8, %r12
	addq	-16(%r12), %rax
	movq	%rax, -8(%r12)
	cmpl	%r13d, %edi
	jge	.L3
.L2:
	movslq	4(%rsp), %r9
	cmpl	%edi, %r9d
	jg	.L9
	leaq	b(%rip), %r10
	movslq	%edi, %rax
	subl	%r9d, %edi
	xorl	%edx, %edx
	salq	$3, %r9
	leaq	a(%rip), %r11
	movq	(%r10,%rax,8), %r12
	xorl	%r8d, %r8d
	leaq	(%r11,%r9), %rbx
	addq	%r10, %r9
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rax, %rdx
.L7:
	movq	(%rbx,%rdx,8), %rsi
	movq	%r12, %rax
	subq	(%r11,%rdx,8), %rsi
	subq	(%r9,%rdx,8), %rax
	addq	(%r10,%rdx,8), %rax
	leaq	(%rax,%rsi), %rcx
	cmpq	%rcx, %r8
	cmovge	%r8, %rcx
	cmpq	%rax, %r8
	cmovge	%r8, %rax
	testq	%rsi, %rsi
	cmovle	%rax, %rcx
	leaq	1(%rdx), %rax
	movq	%rcx, %r8
	cmpq	%rdx, %rdi
	jne	.L10
.L4:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$24, %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
.L9:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L4
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	b
	.bss
	.align 32
	.type	b, @object
	.size	b, 800008
b:
	.zero	800008
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800008
a:
	.zero	800008
	.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>
#define MAX(a,b) (((a)>(b))?(a):(b))
#define FOR(i,a,n) for(int i=a;i<n;i++)
#define ll long long

ll a[100001];
ll b[100001];
 int main(void)
 {
 	int n,k;
 	ll res=0;
 	scanf("%d %d",&n,&k);
 	FOR(i,1,n+1){
 		scanf("%lld",&a[i]);
 		b[i]=MAX(0,a[i]);
 		a[i]+=a[i-1],b[i]+=b[i-1];
 	}
 	FOR(i,k,n+1){
 		ll p=a[i]-a[i-k];
 		ll q=b[n]-b[i]+b[i-k];
 		if(p>0) res=MAX(res,p+q);
 		else res=MAX(res,q);
 	}
 	printf("%lld",res);
 	return 0;
 }
    
    
1 1
-16
 5 3
-10 10 -18 10 -10
 4 2
7 -10 -10 10
 4 2
7 -6 -10 12
 4 2
7 -6 -10 20
 4 2
9 -1 -10 20
 4 2
13 -1 -10 20
 4 2
3 -1 -10 20
 4 3
3 -1 -10 20
 4 3
3 -1 -1 20

0 10 17 19 27 29 33 23 20 21
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>
#define MAX(a,b) (((a)>(b))?(a):(b))
#define FOR(i,a,n) for(int i=a;i<n;i++)
#define ll long long

ll a[100001];
ll b[100001];
 int main(void)
 {
 	int n,k;
 	ll res=0;
 	scanf("%d %d",&n,&k);
 	FOR(i,1,n+1){
 		scanf("%lld",&a[i]);
 		b[i]=MAX(0,a[i]);
 		a[i]+=a[i-1],b[i]+=b[i-1];
 	}
 	FOR(i,k,n+1){
 		ll p=a[i]-a[i-k];
 		ll q=b[n]-b[i]+b[i-k];
 		if(p>0) res=MAX(res,p+q);
 		else res=MAX(res,q);
 	}
 	printf("%lld",res);
 	return 0;
 }
    
    ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800008
a:
	.zero	800008
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800008
b:
	.zero	800008
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -32(%rbp)
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -40(%rbp)
	jmp	.L2
.L3:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	$0, %edx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	b(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -40(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jle	.L3
	movl	-44(%rbp), %eax
	movl	%eax, -36(%rbp)
	jmp	.L4
.L7:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-44(%rbp), %ecx
	movl	-36(%rbp), %edx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	b(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rcx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L5
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	cmpq	%rdx, %rax
	cmovl	%rdx, %rax
	movq	%rax, -32(%rbp)
	jmp	.L6
.L5:
	movq	-32(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -32(%rbp)
.L6:
	addl	$1, -36(%rbp)
.L4:
	movl	-48(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L7
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	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	.L9
	call	__stack_chk_fail@PLT
.L9:
	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
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800008
a:
	.zero	800008
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 800008
b:
	.zero	800008
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -32(%rbp)
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -40(%rbp)
	jmp	.L2
.L3:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	$0, %edx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	b(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rcx
	movl	-40(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, %rcx
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -40(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jle	.L3
	movl	-44(%rbp), %eax
	movl	%eax, -36(%rbp)
	jmp	.L4
.L7:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-44(%rbp), %ecx
	movl	-36(%rbp), %edx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	a(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rax
	movl	-36(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	b(%rip), %rdx
	movq	(%rcx,%rdx), %rdx
	subq	%rdx, %rax
	movq	%rax, %rcx
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	b(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rcx, %rax
	movq	%rax, -16(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L5
	movq	-24(%rbp), %rdx
	movq	-16(%rbp), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	cmpq	%rdx, %rax
	cmovl	%rdx, %rax
	movq	%rax, -32(%rbp)
	jmp	.L6
.L5:
	movq	-32(%rbp), %rdx
	movq	-16(%rbp), %rax
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -32(%rbp)
.L6:
	addl	$1, -36(%rbp)
.L4:
	movl	-48(%rbp), %eax
	cmpl	%eax, -36(%rbp)
	jle	.L7
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	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	.L9
	call	__stack_chk_fail@PLT
.L9:
	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:
