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 t,i,n,b[1234],a[1234],h,c[1234];
	
	while(1){
		scanf("%d",&n);
		if(n==0){
			return 0;
		}
		for(t=0;t<=n;t++){
			scanf("%d",&c[t]);
		}
		for(i=0;i<=n;i++){
			h=0;
			for(t=0;t<=n;t++){
				a[t]=c[t];
			}
			for(t=i;t<n;t++){
				a[t]=a[t+1];
			}
			for(t=1;t<n;t++){
				b[t-1]=a[t]-a[t-1];
			}
			for(t=1;t<n-1;t++){
				if(b[t-1]==b[t]){
					h++;
				}
			}
			if(h==n-2){
				break;
			}
		}
		printf("%d\n",c[i]);
	}
					

}```

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	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2560, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L19:
	leaq	-14848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-14848(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	jmp	.L21
.L2:
	movl	$0, -14844(%rbp)
	jmp	.L4
.L5:
	leaq	-4944(%rbp), %rdx
	movl	-14844(%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, -14844(%rbp)
.L4:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jle	.L5
	movl	$0, -14840(%rbp)
	jmp	.L6
.L18:
	movl	$0, -14836(%rbp)
	movl	$0, -14844(%rbp)
	jmp	.L7
.L8:
	movl	-14844(%rbp), %eax
	cltq
	movl	-4944(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	cltq
	movl	%edx, -9888(%rbp,%rax,4)
	addl	$1, -14844(%rbp)
.L7:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jle	.L8
	movl	-14840(%rbp), %eax
	movl	%eax, -14844(%rbp)
	jmp	.L9
.L10:
	movl	-14844(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-9888(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	cltq
	movl	%edx, -9888(%rbp,%rax,4)
	addl	$1, -14844(%rbp)
.L9:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jl	.L10
	movl	$1, -14844(%rbp)
	jmp	.L11
.L12:
	movl	-14844(%rbp), %eax
	cltq
	movl	-9888(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-9888(%rbp,%rax,4), %ecx
	movl	-14844(%rbp), %eax
	subl	$1, %eax
	subl	%ecx, %edx
	cltq
	movl	%edx, -14832(%rbp,%rax,4)
	addl	$1, -14844(%rbp)
.L11:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jl	.L12
	movl	$1, -14844(%rbp)
	jmp	.L13
.L15:
	movl	-14844(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-14832(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	cltq
	movl	-14832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L14
	addl	$1, -14836(%rbp)
.L14:
	addl	$1, -14844(%rbp)
.L13:
	movl	-14848(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -14844(%rbp)
	jl	.L15
	movl	-14848(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -14836(%rbp)
	je	.L22
	addl	$1, -14840(%rbp)
.L6:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14840(%rbp)
	jle	.L18
	jmp	.L17
.L22:
	nop
.L17:
	movl	-14840(%rbp), %eax
	cltq
	movl	-4944(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L21:
	call	__stack_chk_fail@PLT
.L20:
	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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 12344
	orq	$0, (%rsp)
	subq	$2632, %rsp
	.cfi_def_cfa_offset 14976
	movq	%fs:40, %rax
	movq	%rax, 14904(%rsp)
	xorl	%eax, %eax
	leaq	76(%rsp), %rax
	movq	%rax, 56(%rsp)
	leaq	9968(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L27:
	movq	56(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	76(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	16(%rsp), %rbp
	movl	$0, %ebx
	js	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	76(%rsp), %r12d
	addq	$4, %rbp
	cmpl	%ebx, %r12d
	jge	.L5
	testl	%r12d, %r12d
	js	.L6
	leal	1(%r12), %r14d
	leal	-1(%r12), %ebx
	xorl	%r13d, %r13d
	movslq	%r14d, %r14
	leal	-2(%r12), %ecx
	leaq	5024(%rsp), %r15
	leaq	0(,%r14,4), %rax
	movl	%ecx, 32(%rsp)
	movq	%rax, 24(%rsp)
	movl	%ebx, %eax
	shrl	$2, %eax
	movq	%r15, (%rsp)
	subl	$1, %eax
	salq	$4, %rax
	leaq	5040(%rsp,%rax), %rbp
	movl	%ebx, %eax
	andl	$-4, %eax
	movl	%eax, 44(%rsp)
	addl	$1, %eax
	movl	%eax, 52(%rsp)
	leal	-3(%r12), %eax
	movl	%eax, 36(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 8(%rsp)
	movl	%ecx, %eax
	andl	$-4, %ecx
	shrl	$2, %eax
	movl	%ecx, 40(%rsp)
	subl	$1, %eax
	salq	$4, %rax
	leaq	96(%rsp,%rax), %r14
	leal	1(%rcx), %eax
	movl	%eax, 48(%rsp)
	movq	%r15, %rax
	movq	%rbp, %r15
	movq	%rax, %rbp
	.p2align 4,,10
	.p2align 3
.L26:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movq	(%rsp), %rdi
	call	memcpy@PLT
	cmpl	%r13d, %r12d
	jle	.L10
	movl	%ebx, %eax
	leaq	4(%rbp), %rsi
	movq	%rbp, %rdi
	subl	%r13d, %eax
	leaq	4(,%rax,4), %rdx
	call	memmove@PLT
.L10:
	cmpl	$1, %r12d
	jle	.L9
	cmpl	$2, 32(%rsp)
	jbe	.L29
	movq	8(%rsp), %rdx
	movq	(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L14:
	movdqu	4(%rax), %xmm0
	psubd	(%rax), %xmm0
	addq	$16, %rax
	addq	$16, %rdx
	movaps	%xmm0, -16(%rdx)
	cmpq	%rax, %r15
	jne	.L14
	movl	44(%rsp), %eax
	cmpl	%eax, %ebx
	je	.L9
	movl	52(%rsp), %edx
.L13:
	movl	%r12d, %edi
	subl	%eax, %edi
	leal	-1(%rdi), %esi
	cmpl	$2, %edi
	je	.L16
	addl	$1, %eax
	salq	$2, %rax
	movq	5024(%rsp,%rax), %xmm0
	movq	5020(%rsp,%rax), %xmm1
	psubd	%xmm1, %xmm0
	movq	%xmm0, 76(%rsp,%rax)
	movl	%esi, %eax
	andl	$-2, %eax
	addl	%eax, %edx
	cmpl	%eax, %esi
	je	.L9
.L16:
	leal	-1(%rdx), %eax
	movslq	%edx, %rdx
	cltq
	movl	5024(%rsp,%rdx,4), %edx
	subl	5024(%rsp,%rax,4), %edx
	movl	%edx, 80(%rsp,%rax,4)
.L9:
	xorl	%eax, %eax
	cmpl	$1, %ebx
	jle	.L12
	cmpl	$2, 36(%rsp)
	jbe	.L30
	movq	8(%rsp), %rax
	pxor	%xmm1, %xmm1
	.p2align 4,,10
	.p2align 3
.L19:
	movdqu	4(%rax), %xmm0
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%r14, %rax
	jne	.L19
	movdqa	%xmm1, %xmm0
	movl	32(%rsp), %edi
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%edi, 40(%rsp)
	je	.L12
	movl	48(%rsp), %edx
.L18:
	movslq	%edx, %rsi
	movl	80(%rsp,%rsi,4), %edi
	cmpl	76(%rsp,%rsi,4), %edi
	jne	.L22
	addl	$1, %eax
.L22:
	leal	1(%rdx), %esi
	cmpl	%ebx, %esi
	jge	.L12
	movslq	%esi, %rsi
	movl	80(%rsp,%rsi,4), %esi
	cmpl	%esi, %edi
	sete	%dil
	addl	$2, %edx
	movzbl	%dil, %edi
	addl	%edi, %eax
	cmpl	%edx, %ebx
	jle	.L12
	movslq	%edx, %rdx
	cmpl	80(%rsp,%rdx,4), %esi
	jne	.L12
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	cmpl	%eax, 32(%rsp)
	je	.L4
	addl	$1, %r13d
	addq	$4, %rbp
	cmpl	%r13d, %r12d
	jge	.L26
.L4:
	movslq	%r13d, %r8
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	9968(%rsp,%r8,4), %edx
	call	__printf_chk@PLT
	jmp	.L27
.L30:
	xorl	%eax, %eax
	movl	$1, %edx
	jmp	.L18
.L29:
	xorl	%eax, %eax
	movl	$1, %edx
	jmp	.L13
.L2:
	movq	14904(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$14920, %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
.L6:
	.cfi_restore_state
	xorl	%r13d, %r13d
	jmp	.L4
.L44:
	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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 12344
	orq	$0, (%rsp)
	subq	$2632, %rsp
	.cfi_def_cfa_offset 14976
	movq	%fs:40, %rax
	movq	%rax, 14904(%rsp)
	xorl	%eax, %eax
	leaq	76(%rsp), %rax
	movq	%rax, 56(%rsp)
	leaq	9968(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L27:
	movq	56(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	76(%rsp), %eax
	testl	%eax, %eax
	je	.L2
	movq	16(%rsp), %rbp
	movl	$0, %ebx
	js	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	76(%rsp), %r12d
	addq	$4, %rbp
	cmpl	%ebx, %r12d
	jge	.L5
	testl	%r12d, %r12d
	js	.L6
	leal	1(%r12), %r14d
	leal	-1(%r12), %ebx
	xorl	%r13d, %r13d
	movslq	%r14d, %r14
	leal	-2(%r12), %ecx
	leaq	5024(%rsp), %r15
	leaq	0(,%r14,4), %rax
	movl	%ecx, 32(%rsp)
	movq	%rax, 24(%rsp)
	movl	%ebx, %eax
	shrl	$2, %eax
	movq	%r15, (%rsp)
	subl	$1, %eax
	salq	$4, %rax
	leaq	5040(%rsp,%rax), %rbp
	movl	%ebx, %eax
	andl	$-4, %eax
	movl	%eax, 44(%rsp)
	addl	$1, %eax
	movl	%eax, 52(%rsp)
	leal	-3(%r12), %eax
	movl	%eax, 36(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 8(%rsp)
	movl	%ecx, %eax
	andl	$-4, %ecx
	shrl	$2, %eax
	movl	%ecx, 40(%rsp)
	subl	$1, %eax
	salq	$4, %rax
	leaq	96(%rsp,%rax), %r14
	leal	1(%rcx), %eax
	movl	%eax, 48(%rsp)
	movq	%r15, %rax
	movq	%rbp, %r15
	movq	%rax, %rbp
	.p2align 4,,10
	.p2align 3
.L26:
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rsi
	movq	(%rsp), %rdi
	call	memcpy@PLT
	cmpl	%r13d, %r12d
	jle	.L10
	movl	%ebx, %eax
	leaq	4(%rbp), %rsi
	movq	%rbp, %rdi
	subl	%r13d, %eax
	leaq	4(,%rax,4), %rdx
	call	memmove@PLT
.L10:
	cmpl	$1, %r12d
	jle	.L9
	cmpl	$2, 32(%rsp)
	jbe	.L29
	movq	8(%rsp), %rdx
	movq	(%rsp), %rax
	.p2align 4,,10
	.p2align 3
.L14:
	movdqu	4(%rax), %xmm0
	psubd	(%rax), %xmm0
	addq	$16, %rax
	addq	$16, %rdx
	movaps	%xmm0, -16(%rdx)
	cmpq	%rax, %r15
	jne	.L14
	movl	44(%rsp), %eax
	cmpl	%eax, %ebx
	je	.L9
	movl	52(%rsp), %edx
.L13:
	movl	%r12d, %edi
	subl	%eax, %edi
	leal	-1(%rdi), %esi
	cmpl	$2, %edi
	je	.L16
	addl	$1, %eax
	salq	$2, %rax
	movq	5024(%rsp,%rax), %xmm0
	movq	5020(%rsp,%rax), %xmm1
	psubd	%xmm1, %xmm0
	movq	%xmm0, 76(%rsp,%rax)
	movl	%esi, %eax
	andl	$-2, %eax
	addl	%eax, %edx
	cmpl	%eax, %esi
	je	.L9
.L16:
	leal	-1(%rdx), %eax
	movslq	%edx, %rdx
	cltq
	movl	5024(%rsp,%rdx,4), %edx
	subl	5024(%rsp,%rax,4), %edx
	movl	%edx, 80(%rsp,%rax,4)
.L9:
	xorl	%eax, %eax
	cmpl	$1, %ebx
	jle	.L12
	cmpl	$2, 36(%rsp)
	jbe	.L30
	movq	8(%rsp), %rax
	pxor	%xmm1, %xmm1
	.p2align 4,,10
	.p2align 3
.L19:
	movdqu	4(%rax), %xmm0
	addq	$16, %rax
	pcmpeqd	-16(%rax), %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%r14, %rax
	jne	.L19
	movdqa	%xmm1, %xmm0
	movl	32(%rsp), %edi
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%edi, 40(%rsp)
	je	.L12
	movl	48(%rsp), %edx
.L18:
	movslq	%edx, %rsi
	movl	80(%rsp,%rsi,4), %edi
	cmpl	76(%rsp,%rsi,4), %edi
	jne	.L22
	addl	$1, %eax
.L22:
	leal	1(%rdx), %esi
	cmpl	%ebx, %esi
	jge	.L12
	movslq	%esi, %rsi
	movl	80(%rsp,%rsi,4), %esi
	cmpl	%esi, %edi
	sete	%dil
	addl	$2, %edx
	movzbl	%dil, %edi
	addl	%edi, %eax
	cmpl	%edx, %ebx
	jle	.L12
	movslq	%edx, %rdx
	cmpl	80(%rsp,%rdx,4), %esi
	jne	.L12
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	cmpl	%eax, 32(%rsp)
	je	.L4
	addl	$1, %r13d
	addq	$4, %rbp
	cmpl	%r13d, %r12d
	jge	.L26
.L4:
	movslq	%r13d, %r8
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	9968(%rsp,%r8,4), %edx
	call	__printf_chk@PLT
	jmp	.L27
.L30:
	xorl	%eax, %eax
	movl	$1, %edx
	jmp	.L18
.L29:
	xorl	%eax, %eax
	movl	$1, %edx
	jmp	.L13
.L2:
	movq	14904(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L44
	addq	$14920, %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
.L6:
	.cfi_restore_state
	xorl	%r13d, %r13d
	jmp	.L4
.L44:
	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 t,i,n,b[1234],a[1234],h,c[1234];
	
	while(1){
		scanf("%d",&n);
		if(n==0){
			return 0;
		}
		for(t=0;t<=n;t++){
			scanf("%d",&c[t]);
		}
		for(i=0;i<=n;i++){
			h=0;
			for(t=0;t<=n;t++){
				a[t]=c[t];
			}
			for(t=i;t<n;t++){
				a[t]=a[t+1];
			}
			for(t=1;t<n;t++){
				b[t-1]=a[t]-a[t-1];
			}
			for(t=1;t<n-1;t++){
				if(b[t-1]==b[t]){
					h++;
				}
			}
			if(h==n-2){
				break;
			}
		}
		printf("%d\n",c[i]);
	}
					

}
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 t,i,n,b[1234],a[1234],h,c[1234];
	
	while(1){
		scanf("%d",&n);
		if(n==0){
			return 0;
		}
		for(t=0;t<=n;t++){
			scanf("%d",&c[t]);
		}
		for(i=0;i<=n;i++){
			h=0;
			for(t=0;t<=n;t++){
				a[t]=c[t];
			}
			for(t=i;t<n;t++){
				a[t]=a[t+1];
			}
			for(t=1;t<n;t++){
				b[t-1]=a[t]-a[t-1];
			}
			for(t=1;t<n-1;t++){
				if(b[t-1]==b[t]){
					h++;
				}
			}
			if(h==n-2){
				break;
			}
		}
		printf("%d\n",c[i]);
	}
					

}```

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	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2560, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L19:
	leaq	-14848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-14848(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	jmp	.L21
.L2:
	movl	$0, -14844(%rbp)
	jmp	.L4
.L5:
	leaq	-4944(%rbp), %rdx
	movl	-14844(%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, -14844(%rbp)
.L4:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jle	.L5
	movl	$0, -14840(%rbp)
	jmp	.L6
.L18:
	movl	$0, -14836(%rbp)
	movl	$0, -14844(%rbp)
	jmp	.L7
.L8:
	movl	-14844(%rbp), %eax
	cltq
	movl	-4944(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	cltq
	movl	%edx, -9888(%rbp,%rax,4)
	addl	$1, -14844(%rbp)
.L7:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jle	.L8
	movl	-14840(%rbp), %eax
	movl	%eax, -14844(%rbp)
	jmp	.L9
.L10:
	movl	-14844(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-9888(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	cltq
	movl	%edx, -9888(%rbp,%rax,4)
	addl	$1, -14844(%rbp)
.L9:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jl	.L10
	movl	$1, -14844(%rbp)
	jmp	.L11
.L12:
	movl	-14844(%rbp), %eax
	cltq
	movl	-9888(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-9888(%rbp,%rax,4), %ecx
	movl	-14844(%rbp), %eax
	subl	$1, %eax
	subl	%ecx, %edx
	cltq
	movl	%edx, -14832(%rbp,%rax,4)
	addl	$1, -14844(%rbp)
.L11:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jl	.L12
	movl	$1, -14844(%rbp)
	jmp	.L13
.L15:
	movl	-14844(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-14832(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	cltq
	movl	-14832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L14
	addl	$1, -14836(%rbp)
.L14:
	addl	$1, -14844(%rbp)
.L13:
	movl	-14848(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -14844(%rbp)
	jl	.L15
	movl	-14848(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -14836(%rbp)
	je	.L22
	addl	$1, -14840(%rbp)
.L6:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14840(%rbp)
	jle	.L18
	jmp	.L17
.L22:
	nop
.L17:
	movl	-14840(%rbp), %eax
	cltq
	movl	-4944(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L21:
	call	__stack_chk_fail@PLT
.L20:
	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	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2560, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L19:
	leaq	-14848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-14848(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	jmp	.L21
.L2:
	movl	$0, -14844(%rbp)
	jmp	.L4
.L5:
	leaq	-4944(%rbp), %rdx
	movl	-14844(%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, -14844(%rbp)
.L4:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jle	.L5
	movl	$0, -14840(%rbp)
	jmp	.L6
.L18:
	movl	$0, -14836(%rbp)
	movl	$0, -14844(%rbp)
	jmp	.L7
.L8:
	movl	-14844(%rbp), %eax
	cltq
	movl	-4944(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	cltq
	movl	%edx, -9888(%rbp,%rax,4)
	addl	$1, -14844(%rbp)
.L7:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jle	.L8
	movl	-14840(%rbp), %eax
	movl	%eax, -14844(%rbp)
	jmp	.L9
.L10:
	movl	-14844(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-9888(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	cltq
	movl	%edx, -9888(%rbp,%rax,4)
	addl	$1, -14844(%rbp)
.L9:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jl	.L10
	movl	$1, -14844(%rbp)
	jmp	.L11
.L12:
	movl	-14844(%rbp), %eax
	cltq
	movl	-9888(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-9888(%rbp,%rax,4), %ecx
	movl	-14844(%rbp), %eax
	subl	$1, %eax
	subl	%ecx, %edx
	cltq
	movl	%edx, -14832(%rbp,%rax,4)
	addl	$1, -14844(%rbp)
.L11:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14844(%rbp)
	jl	.L12
	movl	$1, -14844(%rbp)
	jmp	.L13
.L15:
	movl	-14844(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-14832(%rbp,%rax,4), %edx
	movl	-14844(%rbp), %eax
	cltq
	movl	-14832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L14
	addl	$1, -14836(%rbp)
.L14:
	addl	$1, -14844(%rbp)
.L13:
	movl	-14848(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -14844(%rbp)
	jl	.L15
	movl	-14848(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -14836(%rbp)
	je	.L22
	addl	$1, -14840(%rbp)
.L6:
	movl	-14848(%rbp), %eax
	cmpl	%eax, -14840(%rbp)
	jle	.L18
	jmp	.L17
.L22:
	nop
.L17:
	movl	-14840(%rbp), %eax
	cltq
	movl	-4944(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L19
.L21:
	call	__stack_chk_fail@PLT
.L20:
	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:
