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,w,cnt,n,h[101],sa[5];
	while(scanf("%d",&n),n!=0){
		for(i=cnt=w=0;i<=n;i++)scanf("%d",&h[i]);
		sa[0]=h[1]-h[0];
		sa[1]=h[i-1]-h[i-2];
		sa[2]=h[(i-1)/2]-h[(i-1)/2-1];
		sa[3]=h[(i-1)/2+1]-h[(i-1)/2];
		if(sa[0]==sa[1] || sa[1]==sa[2] || sa[1]==sa[3])sa[4]=sa[1];
		if(sa[0]==sa[2] || sa[0]==sa[3])sa[4]=sa[0];
		for(i=1;i<=n;i++){
			if(h[i]-h[i-1]!=sa[4]){
				cnt++;
				if(cnt>1)w=h[i-1];
				if(h[i+1]-h[i]==sa[4])w=h[i-1];
				if(i==n && w<1)w=h[i];
			}
		}
		printf("%d\n",w);
	}
	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	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L14:
	movl	$0, -456(%rbp)
	movl	-456(%rbp), %eax
	movl	%eax, -452(%rbp)
	movl	-452(%rbp), %eax
	movl	%eax, -460(%rbp)
	jmp	.L3
.L4:
	leaq	-416(%rbp), %rdx
	movl	-460(%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, -460(%rbp)
.L3:
	movl	-464(%rbp), %eax
	cmpl	%eax, -460(%rbp)
	jle	.L4
	movl	-412(%rbp), %eax
	movl	-416(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -448(%rbp)
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -444(%rbp)
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -440(%rbp)
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -436(%rbp)
	movl	-448(%rbp), %edx
	movl	-444(%rbp), %eax
	cmpl	%eax, %edx
	je	.L5
	movl	-444(%rbp), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	je	.L5
	movl	-444(%rbp), %edx
	movl	-436(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L6
.L5:
	movl	-444(%rbp), %eax
	movl	%eax, -432(%rbp)
.L6:
	movl	-448(%rbp), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	je	.L7
	movl	-448(%rbp), %edx
	movl	-436(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L8
.L7:
	movl	-448(%rbp), %eax
	movl	%eax, -432(%rbp)
.L8:
	movl	$1, -460(%rbp)
	jmp	.L9
.L13:
	movl	-460(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	subl	%eax, %edx
	movl	-432(%rbp), %eax
	cmpl	%eax, %edx
	je	.L10
	addl	$1, -452(%rbp)
	cmpl	$1, -452(%rbp)
	jle	.L11
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -456(%rbp)
.L11:
	movl	-460(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	subl	%eax, %edx
	movl	-432(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -456(%rbp)
.L12:
	movl	-464(%rbp), %eax
	cmpl	%eax, -460(%rbp)
	jne	.L10
	cmpl	$0, -456(%rbp)
	jg	.L10
	movl	-460(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -456(%rbp)
.L10:
	addl	$1, -460(%rbp)
.L9:
	movl	-464(%rbp), %eax
	cmpl	%eax, -460(%rbp)
	jle	.L13
	movl	-456(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-464(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-464(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L14
	leaq	16(%rsp), %r15
	movl	$0, %r14d
	js	.L39
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	movslq	%r14d, %rax
	movl	12(%rsp), %esi
	leal	1(%rax), %r14d
	cmpl	%r14d, %esi
	jge	.L3
	movl	%eax, %ecx
	leal	-1(%rax), %edi
	sarl	%ecx
	leal	-1(%rcx), %r9d
	leal	1(%rcx), %r8d
.L16:
	movslq	%edi, %rdi
	movslq	%ecx, %rcx
	movl	16(%rsp,%rax,4), %eax
	movl	20(%rsp), %edx
	subl	16(%rsp,%rdi,4), %eax
	movl	16(%rsp,%rcx,4), %edi
	movslq	%r9d, %rcx
	subl	16(%rsp), %edx
	movl	%edi, %r9d
	subl	16(%rsp,%rcx,4), %r9d
	movslq	%r8d, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	subl	%edi, %ecx
	cmpl	%eax, %edx
	sete	%dil
	cmpl	%r9d, %eax
	sete	%r8b
	orb	%r8b, %dil
	jne	.L20
	cmpl	%ecx, %eax
	jne	.L4
.L20:
	movl	%eax, %ebx
.L4:
	cmpl	%ecx, %edx
	je	.L21
	cmpl	%r9d, %edx
	je	.L21
	testl	%esi, %esi
	jle	.L18
.L40:
	leaq	16(%rsp), %rax
	leal	1(%rsi), %r11d
	xorl	%r10d, %r10d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	4(%rax), %edi
	movl	(%rax), %edx
	movl	%edi, %r9d
	subl	%edx, %r9d
	cmpl	%ebx, %r9d
	je	.L9
	movl	8(%rax), %r9d
	addl	$1, %r10d
	cmpl	$1, %r10d
	cmovne	%edx, %r8d
	subl	%edi, %r9d
	cmpl	%ebx, %r9d
	cmovne	%r8d, %edx
	cmpl	%ecx, %esi
	jne	.L22
	movl	%edi, %r8d
	testl	%edx, %edx
	jg	.L22
.L9:
	addq	$1, %rcx
	addq	$4, %rax
	cmpq	%r11, %rcx
	jne	.L13
.L8:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	movl	%edx, %r8d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	movl	%edx, %ebx
	testl	%esi, %esi
	jg	.L40
.L18:
	xorl	%r8d, %r8d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L14:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$440, %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
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	movl	$1, %r8d
	movl	$-1, %r9d
	xorl	%ecx, %ecx
	movl	$-2, %edi
	movq	$-1, %rax
	jmp	.L16
.L41:
	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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$440, %rsp
	.cfi_def_cfa_offset 496
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L14
	leaq	16(%rsp), %r15
	movl	$0, %r14d
	js	.L39
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	movslq	%r14d, %rax
	movl	12(%rsp), %esi
	leal	1(%rax), %r14d
	cmpl	%r14d, %esi
	jge	.L3
	movl	%eax, %ecx
	leal	-1(%rax), %edi
	sarl	%ecx
	leal	-1(%rcx), %r9d
	leal	1(%rcx), %r8d
.L16:
	movslq	%edi, %rdi
	movslq	%ecx, %rcx
	movl	16(%rsp,%rax,4), %eax
	movl	20(%rsp), %edx
	subl	16(%rsp,%rdi,4), %eax
	movl	16(%rsp,%rcx,4), %edi
	movslq	%r9d, %rcx
	subl	16(%rsp), %edx
	movl	%edi, %r9d
	subl	16(%rsp,%rcx,4), %r9d
	movslq	%r8d, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	subl	%edi, %ecx
	cmpl	%eax, %edx
	sete	%dil
	cmpl	%r9d, %eax
	sete	%r8b
	orb	%r8b, %dil
	jne	.L20
	cmpl	%ecx, %eax
	jne	.L4
.L20:
	movl	%eax, %ebx
.L4:
	cmpl	%ecx, %edx
	je	.L21
	cmpl	%r9d, %edx
	je	.L21
	testl	%esi, %esi
	jle	.L18
.L40:
	leaq	16(%rsp), %rax
	leal	1(%rsi), %r11d
	xorl	%r10d, %r10d
	xorl	%r8d, %r8d
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	4(%rax), %edi
	movl	(%rax), %edx
	movl	%edi, %r9d
	subl	%edx, %r9d
	cmpl	%ebx, %r9d
	je	.L9
	movl	8(%rax), %r9d
	addl	$1, %r10d
	cmpl	$1, %r10d
	cmovne	%edx, %r8d
	subl	%edi, %r9d
	cmpl	%ebx, %r9d
	cmovne	%r8d, %edx
	cmpl	%ecx, %esi
	jne	.L22
	movl	%edi, %r8d
	testl	%edx, %edx
	jg	.L22
.L9:
	addq	$1, %rcx
	addq	$4, %rax
	cmpq	%r11, %rcx
	jne	.L13
.L8:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	movl	%edx, %r8d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	movl	%edx, %ebx
	testl	%esi, %esi
	jg	.L40
.L18:
	xorl	%r8d, %r8d
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L14:
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$440, %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
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	movl	$1, %r8d
	movl	$-1, %r9d
	xorl	%ecx, %ecx
	movl	$-2, %edi
	movq	$-1, %rax
	jmp	.L16
.L41:
	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,w,cnt,n,h[101],sa[5];
	while(scanf("%d",&n),n!=0){
		for(i=cnt=w=0;i<=n;i++)scanf("%d",&h[i]);
		sa[0]=h[1]-h[0];
		sa[1]=h[i-1]-h[i-2];
		sa[2]=h[(i-1)/2]-h[(i-1)/2-1];
		sa[3]=h[(i-1)/2+1]-h[(i-1)/2];
		if(sa[0]==sa[1] || sa[1]==sa[2] || sa[1]==sa[3])sa[4]=sa[1];
		if(sa[0]==sa[2] || sa[0]==sa[3])sa[4]=sa[0];
		for(i=1;i<=n;i++){
			if(h[i]-h[i-1]!=sa[4]){
				cnt++;
				if(cnt>1)w=h[i-1];
				if(h[i+1]-h[i]==sa[4])w=h[i-1];
				if(i==n && w<1)w=h[i];
			}
		}
		printf("%d\n",w);
	}
	return 0;
}
5
1 2 3 6 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 6
0
 5
1 2 3 2 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 6
0
 5
1 2 3 2 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 7
0
 5
1 2 3 6 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 8
0
 5
1 2 3 6 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 5
0
 5
1 2 3 11 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 12
0
 5
1 2 3 9 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 6
0
 5
1 2 3 14 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 12
0
 5
1 2 3 2 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 5
0
 5
1 2 3 25 4 5
6
1 3 6 9 12 15 18
4
5 7 9 11 12
0

6
1
6
 2
1
6
 2
1
7
 6
1
8
 6
1
5
 11
1
12
 9
1
6
 14
1
12
 2
1
5
 25
1
12

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,w,cnt,n,h[101],sa[5];
	while(scanf("%d",&n),n!=0){
		for(i=cnt=w=0;i<=n;i++)scanf("%d",&h[i]);
		sa[0]=h[1]-h[0];
		sa[1]=h[i-1]-h[i-2];
		sa[2]=h[(i-1)/2]-h[(i-1)/2-1];
		sa[3]=h[(i-1)/2+1]-h[(i-1)/2];
		if(sa[0]==sa[1] || sa[1]==sa[2] || sa[1]==sa[3])sa[4]=sa[1];
		if(sa[0]==sa[2] || sa[0]==sa[3])sa[4]=sa[0];
		for(i=1;i<=n;i++){
			if(h[i]-h[i-1]!=sa[4]){
				cnt++;
				if(cnt>1)w=h[i-1];
				if(h[i+1]-h[i]==sa[4])w=h[i-1];
				if(i==n && w<1)w=h[i];
			}
		}
		printf("%d\n",w);
	}
	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	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L14:
	movl	$0, -456(%rbp)
	movl	-456(%rbp), %eax
	movl	%eax, -452(%rbp)
	movl	-452(%rbp), %eax
	movl	%eax, -460(%rbp)
	jmp	.L3
.L4:
	leaq	-416(%rbp), %rdx
	movl	-460(%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, -460(%rbp)
.L3:
	movl	-464(%rbp), %eax
	cmpl	%eax, -460(%rbp)
	jle	.L4
	movl	-412(%rbp), %eax
	movl	-416(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -448(%rbp)
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -444(%rbp)
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -440(%rbp)
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -436(%rbp)
	movl	-448(%rbp), %edx
	movl	-444(%rbp), %eax
	cmpl	%eax, %edx
	je	.L5
	movl	-444(%rbp), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	je	.L5
	movl	-444(%rbp), %edx
	movl	-436(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L6
.L5:
	movl	-444(%rbp), %eax
	movl	%eax, -432(%rbp)
.L6:
	movl	-448(%rbp), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	je	.L7
	movl	-448(%rbp), %edx
	movl	-436(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L8
.L7:
	movl	-448(%rbp), %eax
	movl	%eax, -432(%rbp)
.L8:
	movl	$1, -460(%rbp)
	jmp	.L9
.L13:
	movl	-460(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	subl	%eax, %edx
	movl	-432(%rbp), %eax
	cmpl	%eax, %edx
	je	.L10
	addl	$1, -452(%rbp)
	cmpl	$1, -452(%rbp)
	jle	.L11
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -456(%rbp)
.L11:
	movl	-460(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	subl	%eax, %edx
	movl	-432(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -456(%rbp)
.L12:
	movl	-464(%rbp), %eax
	cmpl	%eax, -460(%rbp)
	jne	.L10
	cmpl	$0, -456(%rbp)
	jg	.L10
	movl	-460(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -456(%rbp)
.L10:
	addl	$1, -460(%rbp)
.L9:
	movl	-464(%rbp), %eax
	cmpl	%eax, -460(%rbp)
	jle	.L13
	movl	-456(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-464(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-464(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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.
val
	.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	$464, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L14:
	movl	$0, -456(%rbp)
	movl	-456(%rbp), %eax
	movl	%eax, -452(%rbp)
	movl	-452(%rbp), %eax
	movl	%eax, -460(%rbp)
	jmp	.L3
.L4:
	leaq	-416(%rbp), %rdx
	movl	-460(%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, -460(%rbp)
.L3:
	movl	-464(%rbp), %eax
	cmpl	%eax, -460(%rbp)
	jle	.L4
	movl	-412(%rbp), %eax
	movl	-416(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -448(%rbp)
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$2, %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -444(%rbp)
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -440(%rbp)
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -436(%rbp)
	movl	-448(%rbp), %edx
	movl	-444(%rbp), %eax
	cmpl	%eax, %edx
	je	.L5
	movl	-444(%rbp), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	je	.L5
	movl	-444(%rbp), %edx
	movl	-436(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L6
.L5:
	movl	-444(%rbp), %eax
	movl	%eax, -432(%rbp)
.L6:
	movl	-448(%rbp), %edx
	movl	-440(%rbp), %eax
	cmpl	%eax, %edx
	je	.L7
	movl	-448(%rbp), %edx
	movl	-436(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L8
.L7:
	movl	-448(%rbp), %eax
	movl	%eax, -432(%rbp)
.L8:
	movl	$1, -460(%rbp)
	jmp	.L9
.L13:
	movl	-460(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	subl	%eax, %edx
	movl	-432(%rbp), %eax
	cmpl	%eax, %edx
	je	.L10
	addl	$1, -452(%rbp)
	cmpl	$1, -452(%rbp)
	jle	.L11
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -456(%rbp)
.L11:
	movl	-460(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-460(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	subl	%eax, %edx
	movl	-432(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-460(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -456(%rbp)
.L12:
	movl	-464(%rbp), %eax
	cmpl	%eax, -460(%rbp)
	jne	.L10
	cmpl	$0, -456(%rbp)
	jg	.L10
	movl	-460(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, -456(%rbp)
.L10:
	addl	$1, -460(%rbp)
.L9:
	movl	-464(%rbp), %eax
	cmpl	%eax, -460(%rbp)
	jle	.L13
	movl	-456(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-464(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-464(%rbp), %eax
	testl	%eax, %eax
	jne	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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:
