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>
int main(void)
{
int i, j, n, m, a[1000], sum, min;
 
while(scanf("%d",&n))
{
if(n==0)
break ;
for(i = 0; i < n ; i++)
{
scanf("%d",&a[i]);
}
min = 1000000;
for(i = 0; i < n ; i++)
{
for(j = i+1; j<n;j++)
{
sum = a[i]-a[j];
if(sum<0)
sum = sum*(-1);
if(sum<min)
min=sum;
}
}
printf("%d\n",min);
}

return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.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
	subq	$4048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L13:
	movl	-4036(%rbp), %eax
	testl	%eax, %eax
	je	.L16
	movl	$0, -4032(%rbp)
	jmp	.L5
.L6:
	leaq	-4016(%rbp), %rdx
	movl	-4032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4032(%rbp)
.L5:
	movl	-4036(%rbp), %eax
	cmpl	%eax, -4032(%rbp)
	jl	.L6
	movl	$1000000, -4020(%rbp)
	movl	$0, -4032(%rbp)
	jmp	.L7
.L12:
	movl	-4032(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -4028(%rbp)
	jmp	.L8
.L11:
	movl	-4032(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-4028(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4024(%rbp)
	cmpl	$0, -4024(%rbp)
	jns	.L9
	negl	-4024(%rbp)
.L9:
	movl	-4024(%rbp), %eax
	cmpl	-4020(%rbp), %eax
	jge	.L10
	movl	-4024(%rbp), %eax
	movl	%eax, -4020(%rbp)
.L10:
	addl	$1, -4028(%rbp)
.L8:
	movl	-4036(%rbp), %eax
	cmpl	%eax, -4028(%rbp)
	jl	.L11
	addl	$1, -4032(%rbp)
.L7:
	movl	-4036(%rbp), %eax
	cmpl	%eax, -4032(%rbp)
	jl	.L12
	movl	-4020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-4036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L13
	jmp	.L4
.L16:
	nop
.L4:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4096
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L3
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L3
	jle	.L4
	leaq	16(%rsp), %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r15
	pxor	%xmm5, %xmm5
	cmpl	%r14d, %edi
	jg	.L5
	testl	%edi, %edi
	jle	.L4
	cmpl	$1, %edi
	je	.L4
	leaq	20(%rsp), %r8
	movl	$1000000, %edx
	movl	$1, %esi
	leal	-1(%rdi), %r9d
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edi, %r10d
	movl	%r9d, %eax
	movl	-4(%r8), %ecx
	subl	%esi, %r10d
	cmpl	%esi, %edi
	cmovle	%ebp, %r10d
	subl	%esi, %eax
	cmpl	$2, %eax
	jbe	.L19
	cmpl	%esi, %edi
	jle	.L19
	movl	%r10d, %eax
	movd	%edx, %xmm7
	shrl	$2, %eax
	pshufd	$0, %xmm7, %xmm2
	movd	%ecx, %xmm7
	subl	$1, %eax
	pshufd	$0, %xmm7, %xmm4
	salq	$4, %rax
	leaq	16(%r8,%rax), %rdx
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rax), %xmm6
	movdqa	%xmm4, %xmm3
	movdqa	%xmm5, %xmm0
	addq	$16, %rax
	psubd	%xmm6, %xmm3
	movdqa	%xmm6, %xmm1
	pcmpgtd	%xmm3, %xmm0
	psubd	%xmm4, %xmm1
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	por	%xmm0, %xmm2
	cmpq	%rax, %rdx
	jne	.L9
	movdqa	%xmm2, %xmm1
	movl	%r10d, %r11d
	psrldq	$8, %xmm1
	andl	$-4, %r11d
	movdqa	%xmm1, %xmm0
	leal	(%r11,%rsi), %eax
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpl	%r11d, %r10d
	je	.L10
.L8:
	movslq	%eax, %r10
	movl	16(%rsp,%r10,4), %r11d
	movl	%ecx, %r10d
	movl	%r11d, %r14d
	subl	%ecx, %r14d
	subl	%r11d, %r10d
	cmovs	%r14d, %r10d
	cmpl	%r10d, %edx
	cmovg	%r10d, %edx
	leal	1(%rax), %r10d
	cmpl	%r10d, %edi
	jle	.L10
	movslq	%r10d, %r10
	movl	16(%rsp,%r10,4), %r11d
	movl	%ecx, %r10d
	movl	%r11d, %r14d
	subl	%ecx, %r14d
	subl	%r11d, %r10d
	cmovs	%r14d, %r10d
	cmpl	%r10d, %edx
	cmovg	%r10d, %edx
	addl	$2, %eax
	cmpl	%eax, %edi
	jle	.L10
	cltq
	movl	16(%rsp,%rax,4), %r10d
	movl	%ecx, %eax
	movl	%r10d, %r11d
	subl	%ecx, %r11d
	subl	%r10d, %eax
	cmovs	%r11d, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
.L10:
	addl	$1, %esi
	addq	$4, %r8
	cmpl	%esi, %edi
	jne	.L15
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L19:
	movl	%esi, %eax
	jmp	.L8
.L4:
	movl	$1000000, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L3:
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$4040, %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
.L28:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4096
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L3
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L3
	jle	.L4
	leaq	16(%rsp), %r15
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r15
	pxor	%xmm5, %xmm5
	cmpl	%r14d, %edi
	jg	.L5
	testl	%edi, %edi
	jle	.L4
	cmpl	$1, %edi
	je	.L4
	leaq	20(%rsp), %r8
	movl	$1000000, %edx
	movl	$1, %esi
	leal	-1(%rdi), %r9d
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edi, %r10d
	movl	%r9d, %eax
	movl	-4(%r8), %ecx
	subl	%esi, %r10d
	cmpl	%esi, %edi
	cmovle	%ebp, %r10d
	subl	%esi, %eax
	cmpl	$2, %eax
	jbe	.L19
	cmpl	%esi, %edi
	jle	.L19
	movl	%r10d, %eax
	movd	%edx, %xmm7
	shrl	$2, %eax
	pshufd	$0, %xmm7, %xmm2
	movd	%ecx, %xmm7
	subl	$1, %eax
	pshufd	$0, %xmm7, %xmm4
	salq	$4, %rax
	leaq	16(%r8,%rax), %rdx
	movq	%r8, %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rax), %xmm6
	movdqa	%xmm4, %xmm3
	movdqa	%xmm5, %xmm0
	addq	$16, %rax
	psubd	%xmm6, %xmm3
	movdqa	%xmm6, %xmm1
	pcmpgtd	%xmm3, %xmm0
	psubd	%xmm4, %xmm1
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	por	%xmm0, %xmm2
	cmpq	%rax, %rdx
	jne	.L9
	movdqa	%xmm2, %xmm1
	movl	%r10d, %r11d
	psrldq	$8, %xmm1
	andl	$-4, %r11d
	movdqa	%xmm1, %xmm0
	leal	(%r11,%rsi), %eax
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %edx
	cmpl	%r11d, %r10d
	je	.L10
.L8:
	movslq	%eax, %r10
	movl	16(%rsp,%r10,4), %r11d
	movl	%ecx, %r10d
	movl	%r11d, %r14d
	subl	%ecx, %r14d
	subl	%r11d, %r10d
	cmovs	%r14d, %r10d
	cmpl	%r10d, %edx
	cmovg	%r10d, %edx
	leal	1(%rax), %r10d
	cmpl	%r10d, %edi
	jle	.L10
	movslq	%r10d, %r10
	movl	16(%rsp,%r10,4), %r11d
	movl	%ecx, %r10d
	movl	%r11d, %r14d
	subl	%ecx, %r14d
	subl	%r11d, %r10d
	cmovs	%r14d, %r10d
	cmpl	%r10d, %edx
	cmovg	%r10d, %edx
	addl	$2, %eax
	cmpl	%eax, %edi
	jle	.L10
	cltq
	movl	16(%rsp,%rax,4), %r10d
	movl	%ecx, %eax
	movl	%r10d, %r11d
	subl	%ecx, %r11d
	subl	%r10d, %eax
	cmovs	%r11d, %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
.L10:
	addl	$1, %esi
	addq	$4, %r8
	cmpl	%esi, %edi
	jne	.L15
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L19:
	movl	%esi, %eax
	jmp	.L8
.L4:
	movl	$1000000, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L3:
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$4040, %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
.L28:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>
int main(void)
{
int i, j, n, m, a[1000], sum, min;
 
while(scanf("%d",&n))
{
if(n==0)
break ;
for(i = 0; i < n ; i++)
{
scanf("%d",&a[i]);
}
min = 1000000;
for(i = 0; i < n ; i++)
{
for(j = i+1; j<n;j++)
{
sum = a[i]-a[j];
if(sum<0)
sum = sum*(-1);
if(sum<min)
min=sum;
}
}
printf("%d\n",min);
}

return 0;
}

5
10 10 1 10 10
5
1 5 8 9 11
7
11 34 83 47 59 29 70
0
 5
10 10 1 10 10
5
1 5 8 9 11
7
11 34 83 47 59 29 48
0
 5
10 10 1 10 10
5
1 5 8 5 11
7
11 34 83 47 59 29 48
0
 5
10 10 1 10 10
5
1 5 8 5 11
7
11 34 83 47 54 29 2
0
 5
10 10 10 10 10
5
1 5 8 9 11
7
11 34 83 47 44 29 70
0
 5
10 10 1 10 10
5
1 5 8 5 11
0
11 34 83 47 54 29 2
0
 5
10 10 1 10 10
5
1 5 8 9 8
7
11 34 83 48 59 29 48
0
 5
10 10 10 1 10
5
1 5 8 13 11
7
11 34 83 47 44 29 70
0
 5
10 -1 1 10 10
5
1 5 8 9 11
7
11 34 83 47 59 29 85
0
 5
10 10 10 1 10
5
1 5 8 13 11
0
11 34 83 47 44 50 70
0

0
1
5
 0
1
1
 0
0
1
 0
0
5
 0
1
3
 0
0
 0
0
0
 0
2
3
 0
1
2
 0
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>
int main(void)
{
int i, j, n, m, a[1000], sum, min;
 
while(scanf("%d",&n))
{
if(n==0)
break ;
for(i = 0; i < n ; i++)
{
scanf("%d",&a[i]);
}
min = 1000000;
for(i = 0; i < n ; i++)
{
for(j = i+1; j<n;j++)
{
sum = a[i]-a[j];
if(sum<0)
sum = sum*(-1);
if(sum<min)
min=sum;
}
}
printf("%d\n",min);
}

return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.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
	subq	$4048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L13:
	movl	-4036(%rbp), %eax
	testl	%eax, %eax
	je	.L16
	movl	$0, -4032(%rbp)
	jmp	.L5
.L6:
	leaq	-4016(%rbp), %rdx
	movl	-4032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4032(%rbp)
.L5:
	movl	-4036(%rbp), %eax
	cmpl	%eax, -4032(%rbp)
	jl	.L6
	movl	$1000000, -4020(%rbp)
	movl	$0, -4032(%rbp)
	jmp	.L7
.L12:
	movl	-4032(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -4028(%rbp)
	jmp	.L8
.L11:
	movl	-4032(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-4028(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4024(%rbp)
	cmpl	$0, -4024(%rbp)
	jns	.L9
	negl	-4024(%rbp)
.L9:
	movl	-4024(%rbp), %eax
	cmpl	-4020(%rbp), %eax
	jge	.L10
	movl	-4024(%rbp), %eax
	movl	%eax, -4020(%rbp)
.L10:
	addl	$1, -4028(%rbp)
.L8:
	movl	-4036(%rbp), %eax
	cmpl	%eax, -4028(%rbp)
	jl	.L11
	addl	$1, -4032(%rbp)
.L7:
	movl	-4036(%rbp), %eax
	cmpl	%eax, -4032(%rbp)
	jl	.L12
	movl	-4020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-4036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L13
	jmp	.L4
.L16:
	nop
.L4:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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	"%d"
.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
	subq	$4048, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L13:
	movl	-4036(%rbp), %eax
	testl	%eax, %eax
	je	.L16
	movl	$0, -4032(%rbp)
	jmp	.L5
.L6:
	leaq	-4016(%rbp), %rdx
	movl	-4032(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4032(%rbp)
.L5:
	movl	-4036(%rbp), %eax
	cmpl	%eax, -4032(%rbp)
	jl	.L6
	movl	$1000000, -4020(%rbp)
	movl	$0, -4032(%rbp)
	jmp	.L7
.L12:
	movl	-4032(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -4028(%rbp)
	jmp	.L8
.L11:
	movl	-4032(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %edx
	movl	-4028(%rbp), %eax
	cltq
	movl	-4016(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -4024(%rbp)
	cmpl	$0, -4024(%rbp)
	jns	.L9
	negl	-4024(%rbp)
.L9:
	movl	-4024(%rbp), %eax
	cmpl	-4020(%rbp), %eax
	jge	.L10
	movl	-4024(%rbp), %eax
	movl	%eax, -4020(%rbp)
.L10:
	addl	$1, -4028(%rbp)
.L8:
	movl	-4036(%rbp), %eax
	cmpl	%eax, -4028(%rbp)
	jl	.L11
	addl	$1, -4032(%rbp)
.L7:
	movl	-4036(%rbp), %eax
	cmpl	%eax, -4032(%rbp)
	jl	.L12
	movl	-4020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-4036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L13
	jmp	.L4
.L16:
	nop
.L4:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
