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>
a[99],b[99];main(i,n){
	for(;scanf("%d",&n),n;){
		//if(n>90)exit(1);
		for(i=0;i<=n;i++)scanf("%d",a+i);
		for(i=1;i<=n;i++)b[i]=a[i]-a[i-1];
		if(b[1]==b[2]&&b[2]==b[3]&&b[3]==b[4]){
			for(i=5;i<=n;i++)if(b[i]!=b[1])break;
			printf("%d\n",a[i]);
		}
		else if(b[2]==b[3]&&b[3]==b[4])printf("%d\n",a[0]);
		else if(b[1]==b[2]&&b[2]==b[3])printf("%d\n",a[4]);
		else if(a[2]-a[0]==b[3]&&b[3]==b[4])printf("%d\n",a[1]);
		else if(b[1]==b[2]&&b[2]==a[4]-a[2])printf("%d\n",a[3]);
		else if(b[1]==a[3]-a[1]&&a[3]-a[1]==b[4])printf("%d\n",a[2]);
		else exit(1);
	}
exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 396
a:
	.zero	396
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 396
b:
	.zero	396
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	jmp	.L2
.L17:
	movl	$0, -4(%rbp)
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L4
	movl	$1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L5:
	movl	-8(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L6
	movl	4+b(%rip), %edx
	movl	8+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	12+b(%rip), %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	$5, -4(%rbp)
	jmp	.L8
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	4+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L18
	addl	$1, -4(%rbp)
.L8:
	movl	-8(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L11
	jmp	.L10
.L18:
	nop
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L7:
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	12+b(%rip), %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L12:
	movl	4+b(%rip), %edx
	movl	8+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	16+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L13:
	movl	8+a(%rip), %eax
	movl	a(%rip), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L14
	movl	12+b(%rip), %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L14
	movl	4+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L14:
	movl	4+b(%rip), %edx
	movl	8+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L15
	movl	8+b(%rip), %eax
	movl	16+a(%rip), %edx
	movl	8+a(%rip), %ecx
	subl	%ecx, %edx
	cmpl	%edx, %eax
	jne	.L15
	movl	12+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L15:
	movl	4+b(%rip), %eax
	movl	12+a(%rip), %edx
	movl	4+a(%rip), %ecx
	subl	%ecx, %edx
	cmpl	%edx, %eax
	jne	.L16
	movl	12+a(%rip), %eax
	movl	4+a(%rip), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L16
	movl	8+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L16:
	movl	$1, %edi
	call	exit@PLT
.L2:
	leaq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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	-4+a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	b(%rip), %r12
	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
	leaq	4(%r13), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	leaq	12(%rsp), %rax
	movl	%esi, 12(%rsp)
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L22
	leaq	a(%rip), %r14
	movl	$0, %r15d
	js	.L24
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$4, %r14
	cmpl	%r15d, %esi
	jge	.L3
.L24:
	testl	%esi, %esi
	jle	.L10
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L30
	movl	%esi, %ecx
	leaq	a(%rip), %rax
	leaq	4+b(%rip), %rdx
	shrl	$2, %ecx
	leaq	16(%rax), %rdi
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	4(%rax), %xmm0
	psubd	(%rax), %xmm0
	addq	$16, %rax
	addq	$16, %rdx
	movups	%xmm0, -16(%rdx)
	cmpq	%rax, %rcx
	jne	.L8
	movl	%esi, %eax
	andl	$-4, %eax
	leal	1(%rax), %r15d
	cmpl	%esi, %eax
	je	.L10
.L7:
	movl	%esi, %ecx
	subl	%eax, %ecx
	cmpl	$1, %ecx
	je	.L12
	addl	$1, %eax
	movq	(%rbx,%rax,4), %xmm0
	movq	0(%r13,%rax,4), %xmm1
	psubd	%xmm1, %xmm0
	movq	%xmm0, (%r12,%rax,4)
	movl	%ecx, %eax
	andl	$-2, %eax
	addl	%eax, %r15d
	cmpl	%eax, %ecx
	je	.L10
.L12:
	leal	-1(%r15), %edx
	movslq	%r15d, %rcx
	movslq	%edx, %rdx
	movl	(%rbx,%rcx,4), %eax
	subl	(%rbx,%rdx,4), %eax
	movl	%eax, (%r12,%rcx,4)
.L10:
	movl	4+b(%rip), %eax
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %ecx
	cmpl	%edx, %eax
	je	.L42
	cmpl	%ecx, %edx
	je	.L43
.L19:
	movl	8+a(%rip), %r8d
	movl	%r8d, %edx
	subl	(%rbx), %edx
	cmpl	%ecx, %edx
	je	.L44
.L20:
	movl	12+a(%rip), %edx
	subl	4+a(%rip), %edx
	cmpl	%edx, %eax
	jne	.L21
	cmpl	16+b(%rip), %eax
	jne	.L21
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L42:
	cmpl	%ecx, %eax
	je	.L45
	movl	8+a(%rip), %r8d
	movl	%r8d, %esi
	subl	(%rbx), %esi
	cmpl	%ecx, %esi
	je	.L46
.L27:
	movl	16+a(%rip), %ecx
	subl	%r8d, %ecx
	cmpl	%ecx, %edx
	jne	.L20
	movl	12+a(%rip), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L43:
	cmpl	%edx, 16+b(%rip)
	jne	.L19
	movl	(%rbx), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L44:
	cmpl	%ecx, 16+b(%rip)
	jne	.L20
.L26:
	movl	4+a(%rip), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L45:
	cmpl	%eax, 16+b(%rip)
	je	.L47
	movl	16+a(%rip), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L30:
	xorl	%eax, %eax
	movl	$1, %r15d
	jmp	.L7
.L46:
	cmpl	%esi, 16+b(%rip)
	jne	.L27
	jmp	.L26
.L21:
	movl	$1, %edi
	call	exit@PLT
.L22:
	xorl	%edi, %edi
	call	exit@PLT
.L47:
	cmpl	$4, %esi
	jle	.L31
	leaq	20+b(%rip), %rcx
	movl	$5, %r15d
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L48:
	addl	$1, %r15d
	addq	$4, %rcx
	cmpl	%esi, %r15d
	jg	.L16
.L17:
	cmpl	(%rcx), %eax
	je	.L48
.L16:
	movslq	%r15d, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx,%rdx,4), %edx
	call	__printf_chk@PLT
	jmp	.L2
.L31:
	movl	$5, %r15d
	jmp	.L16
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	b
	.bss
	.align 32
	.type	b, @object
	.size	b, 396
b:
	.zero	396
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 396
a:
	.zero	396
	.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	-4+a(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	b(%rip), %r12
	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
	leaq	4(%r13), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	leaq	12(%rsp), %rax
	movl	%esi, 12(%rsp)
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L22
	leaq	a(%rip), %r14
	movl	$0, %r15d
	js	.L24
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$4, %r14
	cmpl	%r15d, %esi
	jge	.L3
.L24:
	testl	%esi, %esi
	jle	.L10
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L30
	movl	%esi, %ecx
	leaq	a(%rip), %rax
	leaq	4+b(%rip), %rdx
	shrl	$2, %ecx
	leaq	16(%rax), %rdi
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	4(%rax), %xmm0
	psubd	(%rax), %xmm0
	addq	$16, %rax
	addq	$16, %rdx
	movups	%xmm0, -16(%rdx)
	cmpq	%rax, %rcx
	jne	.L8
	movl	%esi, %eax
	andl	$-4, %eax
	leal	1(%rax), %r15d
	cmpl	%esi, %eax
	je	.L10
.L7:
	movl	%esi, %ecx
	subl	%eax, %ecx
	cmpl	$1, %ecx
	je	.L12
	addl	$1, %eax
	movq	(%rbx,%rax,4), %xmm0
	movq	0(%r13,%rax,4), %xmm1
	psubd	%xmm1, %xmm0
	movq	%xmm0, (%r12,%rax,4)
	movl	%ecx, %eax
	andl	$-2, %eax
	addl	%eax, %r15d
	cmpl	%eax, %ecx
	je	.L10
.L12:
	leal	-1(%r15), %edx
	movslq	%r15d, %rcx
	movslq	%edx, %rdx
	movl	(%rbx,%rcx,4), %eax
	subl	(%rbx,%rdx,4), %eax
	movl	%eax, (%r12,%rcx,4)
.L10:
	movl	4+b(%rip), %eax
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %ecx
	cmpl	%edx, %eax
	je	.L42
	cmpl	%ecx, %edx
	je	.L43
.L19:
	movl	8+a(%rip), %r8d
	movl	%r8d, %edx
	subl	(%rbx), %edx
	cmpl	%ecx, %edx
	je	.L44
.L20:
	movl	12+a(%rip), %edx
	subl	4+a(%rip), %edx
	cmpl	%edx, %eax
	jne	.L21
	cmpl	16+b(%rip), %eax
	jne	.L21
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L42:
	cmpl	%ecx, %eax
	je	.L45
	movl	8+a(%rip), %r8d
	movl	%r8d, %esi
	subl	(%rbx), %esi
	cmpl	%ecx, %esi
	je	.L46
.L27:
	movl	16+a(%rip), %ecx
	subl	%r8d, %ecx
	cmpl	%ecx, %edx
	jne	.L20
	movl	12+a(%rip), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L43:
	cmpl	%edx, 16+b(%rip)
	jne	.L19
	movl	(%rbx), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L44:
	cmpl	%ecx, 16+b(%rip)
	jne	.L20
.L26:
	movl	4+a(%rip), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L45:
	cmpl	%eax, 16+b(%rip)
	je	.L47
	movl	16+a(%rip), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L30:
	xorl	%eax, %eax
	movl	$1, %r15d
	jmp	.L7
.L46:
	cmpl	%esi, 16+b(%rip)
	jne	.L27
	jmp	.L26
.L21:
	movl	$1, %edi
	call	exit@PLT
.L22:
	xorl	%edi, %edi
	call	exit@PLT
.L47:
	cmpl	$4, %esi
	jle	.L31
	leaq	20+b(%rip), %rcx
	movl	$5, %r15d
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L48:
	addl	$1, %r15d
	addq	$4, %rcx
	cmpl	%esi, %r15d
	jg	.L16
.L17:
	cmpl	(%rcx), %eax
	je	.L48
.L16:
	movslq	%r15d, %rdx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	(%rbx,%rdx,4), %edx
	call	__printf_chk@PLT
	jmp	.L2
.L31:
	movl	$5, %r15d
	jmp	.L16
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	b
	.bss
	.align 32
	.type	b, @object
	.size	b, 396
b:
	.zero	396
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 396
a:
	.zero	396
	.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>
a[99],b[99];main(i,n){
	for(;scanf("%d",&n),n;){
		//if(n>90)exit(1);
		for(i=0;i<=n;i++)scanf("%d",a+i);
		for(i=1;i<=n;i++)b[i]=a[i]-a[i-1];
		if(b[1]==b[2]&&b[2]==b[3]&&b[3]==b[4]){
			for(i=5;i<=n;i++)if(b[i]!=b[1])break;
			printf("%d\n",a[i]);
		}
		else if(b[2]==b[3]&&b[3]==b[4])printf("%d\n",a[0]);
		else if(b[1]==b[2]&&b[2]==b[3])printf("%d\n",a[4]);
		else if(a[2]-a[0]==b[3]&&b[3]==b[4])printf("%d\n",a[1]);
		else if(b[1]==b[2]&&b[2]==a[4]-a[2])printf("%d\n",a[3]);
		else if(b[1]==a[3]-a[1]&&a[3]-a[1]==b[4])printf("%d\n",a[2]);
		else exit(1);
	}
exit(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>
a[99],b[99];main(i,n){
	for(;scanf("%d",&n),n;){
		//if(n>90)exit(1);
		for(i=0;i<=n;i++)scanf("%d",a+i);
		for(i=1;i<=n;i++)b[i]=a[i]-a[i-1];
		if(b[1]==b[2]&&b[2]==b[3]&&b[3]==b[4]){
			for(i=5;i<=n;i++)if(b[i]!=b[1])break;
			printf("%d\n",a[i]);
		}
		else if(b[2]==b[3]&&b[3]==b[4])printf("%d\n",a[0]);
		else if(b[1]==b[2]&&b[2]==b[3])printf("%d\n",a[4]);
		else if(a[2]-a[0]==b[3]&&b[3]==b[4])printf("%d\n",a[1]);
		else if(b[1]==b[2]&&b[2]==a[4]-a[2])printf("%d\n",a[3]);
		else if(b[1]==a[3]-a[1]&&a[3]-a[1]==b[4])printf("%d\n",a[2]);
		else exit(1);
	}
exit(0);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 396
a:
	.zero	396
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 396
b:
	.zero	396
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	jmp	.L2
.L17:
	movl	$0, -4(%rbp)
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L4
	movl	$1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L5:
	movl	-8(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L6
	movl	4+b(%rip), %edx
	movl	8+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	12+b(%rip), %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	$5, -4(%rbp)
	jmp	.L8
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	4+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L18
	addl	$1, -4(%rbp)
.L8:
	movl	-8(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L11
	jmp	.L10
.L18:
	nop
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L7:
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	12+b(%rip), %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L12:
	movl	4+b(%rip), %edx
	movl	8+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	16+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L13:
	movl	8+a(%rip), %eax
	movl	a(%rip), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L14
	movl	12+b(%rip), %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L14
	movl	4+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L14:
	movl	4+b(%rip), %edx
	movl	8+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L15
	movl	8+b(%rip), %eax
	movl	16+a(%rip), %edx
	movl	8+a(%rip), %ecx
	subl	%ecx, %edx
	cmpl	%edx, %eax
	jne	.L15
	movl	12+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L15:
	movl	4+b(%rip), %eax
	movl	12+a(%rip), %edx
	movl	4+a(%rip), %ecx
	subl	%ecx, %edx
	cmpl	%edx, %eax
	jne	.L16
	movl	12+a(%rip), %eax
	movl	4+a(%rip), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L16
	movl	8+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L16:
	movl	$1, %edi
	call	exit@PLT
.L2:
	leaq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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, 396
a:
	.zero	396
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 396
b:
	.zero	396
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	jmp	.L2
.L17:
	movl	$0, -4(%rbp)
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L3:
	movl	-8(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L4
	movl	$1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-4(%rbp), %edx
	subl	$1, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -4(%rbp)
.L5:
	movl	-8(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L6
	movl	4+b(%rip), %edx
	movl	8+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	12+b(%rip), %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L7
	movl	$5, -4(%rbp)
	jmp	.L8
.L11:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	4+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L18
	addl	$1, -4(%rbp)
.L8:
	movl	-8(%rbp), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L11
	jmp	.L10
.L18:
	nop
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L7:
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	12+b(%rip), %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L12:
	movl	4+b(%rip), %edx
	movl	8+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	8+b(%rip), %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	16+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L13:
	movl	8+a(%rip), %eax
	movl	a(%rip), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	12+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L14
	movl	12+b(%rip), %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L14
	movl	4+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L14:
	movl	4+b(%rip), %edx
	movl	8+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L15
	movl	8+b(%rip), %eax
	movl	16+a(%rip), %edx
	movl	8+a(%rip), %ecx
	subl	%ecx, %edx
	cmpl	%edx, %eax
	jne	.L15
	movl	12+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L15:
	movl	4+b(%rip), %eax
	movl	12+a(%rip), %edx
	movl	4+a(%rip), %ecx
	subl	%ecx, %edx
	cmpl	%edx, %eax
	jne	.L16
	movl	12+a(%rip), %eax
	movl	4+a(%rip), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	16+b(%rip), %eax
	cmpl	%eax, %edx
	jne	.L16
	movl	8+a(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L2
.L16:
	movl	$1, %edi
	call	exit@PLT
.L2:
	leaq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-8(%rbp), %eax
	testl	%eax, %eax
	jne	.L17
	movl	$0, %edi
	call	exit@PLT
	.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:
