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>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define FOR(n) for(int i=0;i<n;i++)
#define FORJ(n) for(int j=0;j<n;j++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define mod 1000000007
typedef long long int ll;
int u(const void *a, const void *b){
    return *(ll*)a-*(ll*)b;
}
int d(const void *a, const void *b){
    return *(ll*)b-*(ll*)a;
}
int z(int a){
  if(a<1)a*=-1;
  return a;
}
int min(int a,int b){
  if(a>b)return b;
  return a;
}
int max(int a,int b){
  if(a>b)return a;
  return b;
}
int gcd(int a,int b){
  if(!b)return a;
  return gcd(b,a%b);
}
int kt(ll a){
  int sum=0;
  while(a){
    a/=10;
    sum++;
  }
  return sum;
}
int ks(ll a){
  int sum=0;
  while(a){
    sum+=a%10;
    a/=10;
  }
  return sum;
}
int n;
int f(int b,int c){
  return c*((n-1)/b+1);
}
int main(void){
  int n;
  ll a[105],x[105];
  while(1){
    scanf("%d",&n);
    if(!n)break;
    FOR(n+1)scanf("%lld",&x[i]);
    FOR(n+1){
      int l=0;
      FORJ(n+1){
        a[l]=x[j];
        if(i!=j)l++;
      }
      a[n]=x[i];
      int flg=1;
      FORJ(n-2)if(a[j]-a[j+1]!=a[j+1]-a[j+2])flg=0;
      if(flg){
        PRL(a[n]);
        break;
      }
    }
  }
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	u
	.type	u, @function
u:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	u, .-u
	.globl	d
	.type	d, @function
d:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	d, .-d
	.globl	z
	.type	z, @function
z:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jg	.L6
	negl	-4(%rbp)
.L6:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	z, .-z
	.globl	min
	.type	min, @function
min:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L9
	movl	-8(%rbp), %eax
	jmp	.L10
.L9:
	movl	-4(%rbp), %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L12
	movl	-4(%rbp), %eax
	jmp	.L13
.L12:
	movl	-8(%rbp), %eax
.L13:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	max, .-max
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB11:
	.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)
	cmpl	$0, -8(%rbp)
	jne	.L15
	movl	-4(%rbp), %eax
	jmp	.L16
.L15:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	gcd, .-gcd
	.globl	kt
	.type	kt, @function
kt:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L18
.L19:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -4(%rbp)
.L18:
	cmpq	$0, -24(%rbp)
	jne	.L19
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	kt, .-kt
	.globl	ks
	.type	ks, @function
ks:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L22
.L23:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
.L22:
	cmpq	$0, -24(%rbp)
	jne	.L23
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	ks, .-ks
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	f
	.type	f, @function
f:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	n(%rip), %eax
	subl	$1, %eax
	cltd
	idivl	-4(%rbp)
	addl	$1, %eax
	imull	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L42:
	leaq	-1724(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1724(%rbp), %eax
	testl	%eax, %eax
	je	.L46
	movl	$0, -1720(%rbp)
	jmp	.L30
.L31:
	leaq	-848(%rbp), %rdx
	movl	-1720(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1720(%rbp)
.L30:
	movl	-1724(%rbp), %eax
	cmpl	%eax, -1720(%rbp)
	jle	.L31
	movl	$0, -1716(%rbp)
	jmp	.L32
.L41:
	movl	$0, -1712(%rbp)
	movl	$0, -1708(%rbp)
	jmp	.L33
.L35:
	movl	-1708(%rbp), %eax
	cltq
	movq	-848(%rbp,%rax,8), %rdx
	movl	-1712(%rbp), %eax
	cltq
	movq	%rdx, -1696(%rbp,%rax,8)
	movl	-1716(%rbp), %eax
	cmpl	-1708(%rbp), %eax
	je	.L34
	addl	$1, -1712(%rbp)
.L34:
	addl	$1, -1708(%rbp)
.L33:
	movl	-1724(%rbp), %eax
	cmpl	%eax, -1708(%rbp)
	jle	.L35
	movl	-1724(%rbp), %ecx
	movl	-1716(%rbp), %eax
	cltq
	movq	-848(%rbp,%rax,8), %rdx
	movslq	%ecx, %rax
	movq	%rdx, -1696(%rbp,%rax,8)
	movl	$1, -1704(%rbp)
	movl	$0, -1700(%rbp)
	jmp	.L36
.L38:
	movl	-1700(%rbp), %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rdx
	movl	-1700(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rax
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movl	-1700(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rdx
	movl	-1700(%rbp), %eax
	addl	$2, %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rsi
	movq	%rdx, %rax
	subq	%rsi, %rax
	cmpq	%rax, %rcx
	je	.L37
	movl	$0, -1704(%rbp)
.L37:
	addl	$1, -1700(%rbp)
.L36:
	movl	-1724(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -1700(%rbp)
	jl	.L38
	cmpl	$0, -1704(%rbp)
	je	.L39
	movl	-1724(%rbp), %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L40
.L39:
	addl	$1, -1716(%rbp)
.L32:
	movl	-1724(%rbp), %eax
	cmpl	%eax, -1716(%rbp)
	jle	.L41
.L40:
	jmp	.L42
.L46:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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
	.p2align 4
	.globl	u
	.type	u, @function
u:
.LFB51:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	u, .-u
	.p2align 4
	.globl	d
	.type	d, @function
d:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	d, .-d
	.p2align 4
	.globl	z
	.type	z, @function
z:
.LFB53:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	negl	%eax
	cmovs	%edi, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	z, .-z
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB54:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	min, .-min
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB55:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	max, .-max
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB56:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %r8d
	testl	%esi, %esi
	jne	.L8
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%edx, %r8d
.L8:
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L16
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	gcd, .-gcd
	.p2align 4
	.globl	kt
	.type	kt, @function
kt:
.LFB57:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testq	%rdi, %rdi
	je	.L17
	movabsq	$7378697629483820647, %rcx
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%rdi, %rax
	addl	$1, %r8d
	imulq	%rcx
	movq	%rdi, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	movq	%rdx, %rdi
	subq	%rax, %rdi
	jne	.L19
.L17:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE57:
	.size	kt, .-kt
	.p2align 4
	.globl	ks
	.type	ks, @function
ks:
.LFB58:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testq	%rdi, %rdi
	je	.L22
	movabsq	$7378697629483820647, %rcx
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%rdi, %rax
	imulq	%rcx
	movq	%rdi, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rdi
	addl	%edi, %r8d
	movq	%rdx, %rdi
	testq	%rdx, %rdx
	jne	.L24
.L22:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE58:
	.size	ks, .-ks
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB59:
	.cfi_startproc
	endbr64
	movl	n(%rip), %eax
	subl	$1, %eax
	cltd
	idivl	%edi
	addl	$1, %eax
	imull	%esi, %eax
	ret
	.cfi_endproc
.LFE59:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB60:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC1(%rip), %r14
	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	$1752, %rsp
	.cfi_def_cfa_offset 1808
	movq	%fs:40, %rax
	movq	%rax, 1736(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L44:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L29
	js	.L44
	leaq	896(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r11d
	addq	$8, %r12
	cmpl	%ebp, %r11d
	jge	.L31
	testl	%r11d, %r11d
	js	.L44
	leal	-3(%r11), %eax
	movl	%r11d, 12(%rsp)
	leal	1(%r11), %edi
	xorl	%ecx, %ecx
	movl	%eax, 8(%rsp)
	movslq	%r11d, %rax
	leal	-2(%r11), %esi
	movslq	%edi, %rdi
	movq	%rax, (%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L43:
	xorl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L33:
	movq	(%rbx,%rax,8), %r9
	movslq	%edx, %r8
	movq	%r9, 48(%rsp,%r8,8)
	xorl	%r8d, %r8d
	cmpl	%ecx, %eax
	setne	%r8b
	addq	$1, %rax
	addl	%r8d, %edx
	cmpq	%rdi, %rax
	jne	.L33
	movq	(%rbx,%rcx,8), %r13
	movq	(%rsp), %rax
	movq	%r13, 48(%rsp,%rax,8)
	testl	%esi, %esi
	jle	.L34
	cmpl	$1, 8(%rsp)
	jle	.L46
	movq	48(%rsp), %r10
	movq	56(%rsp), %r9
	leaq	72(%rsp), %r8
	xorl	%eax, %eax
	movl	$1, %edx
.L38:
	subq	%r9, %r10
	movq	%r10, %r11
	movq	-8(%r8), %r10
	subq	%r10, %r9
	movq	%r10, %r12
	cmpq	%r11, %r9
	movq	%r9, %rbp
	movq	(%r8), %r9
	movl	%eax, %r11d
	cmovne	%r15d, %edx
	addl	$2, %eax
	subq	%r9, %r12
	cmpq	%r12, %rbp
	cmovne	%r15d, %edx
	addq	$16, %r8
	addl	$3, %r11d
	cmpl	%r11d, 8(%rsp)
	jg	.L38
.L35:
	movq	16(%rsp), %r10
	movslq	%eax, %r8
	leaq	(%r10,%r8,8), %r8
	.p2align 4,,10
	.p2align 3
.L40:
	movq	8(%r8), %r10
	movq	(%r8), %r9
	addl	$1, %eax
	movq	%r10, %r11
	subq	%r10, %r9
	subq	16(%r8), %r11
	cmpq	%r9, %r11
	cmovne	%r15d, %edx
	addq	$8, %r8
	cmpl	%eax, %esi
	jg	.L40
	testl	%edx, %edx
	jne	.L34
	addq	$1, %rcx
	cmpl	%ecx, 12(%rsp)
	jge	.L43
	jmp	.L44
.L46:
	xorl	%eax, %eax
	movl	$1, %edx
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L34:
	movq	%r13, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L44
.L29:
	movq	1736(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	addq	$1752, %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
.L54:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE60:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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
	.p2align 4
	.globl	u
	.type	u, @function
u:
.LFB51:
	.cfi_startproc
	endbr64
	movq	(%rdi), %rax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	u, .-u
	.p2align 4
	.globl	d
	.type	d, @function
d:
.LFB52:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	d, .-d
	.p2align 4
	.globl	z
	.type	z, @function
z:
.LFB53:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	negl	%eax
	cmovs	%edi, %eax
	ret
	.cfi_endproc
.LFE53:
	.size	z, .-z
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB54:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	min, .-min
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB55:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	max, .-max
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB56:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %r8d
	testl	%esi, %esi
	jne	.L8
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%edx, %r8d
.L8:
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L16
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE56:
	.size	gcd, .-gcd
	.p2align 4
	.globl	kt
	.type	kt, @function
kt:
.LFB57:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testq	%rdi, %rdi
	je	.L17
	movabsq	$7378697629483820647, %rcx
	.p2align 4,,10
	.p2align 3
.L19:
	movq	%rdi, %rax
	addl	$1, %r8d
	imulq	%rcx
	movq	%rdi, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	movq	%rdx, %rdi
	subq	%rax, %rdi
	jne	.L19
.L17:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE57:
	.size	kt, .-kt
	.p2align 4
	.globl	ks
	.type	ks, @function
ks:
.LFB58:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testq	%rdi, %rdi
	je	.L22
	movabsq	$7378697629483820647, %rcx
	.p2align 4,,10
	.p2align 3
.L24:
	movq	%rdi, %rax
	imulq	%rcx
	movq	%rdi, %rax
	sarq	$63, %rax
	sarq	$2, %rdx
	subq	%rax, %rdx
	leaq	(%rdx,%rdx,4), %rax
	addq	%rax, %rax
	subq	%rax, %rdi
	addl	%edi, %r8d
	movq	%rdx, %rdi
	testq	%rdx, %rdx
	jne	.L24
.L22:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE58:
	.size	ks, .-ks
	.p2align 4
	.globl	f
	.type	f, @function
f:
.LFB59:
	.cfi_startproc
	endbr64
	movl	n(%rip), %eax
	subl	$1, %eax
	cltd
	idivl	%edi
	addl	$1, %eax
	imull	%esi, %eax
	ret
	.cfi_endproc
.LFE59:
	.size	f, .-f
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB60:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%r15d, %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC1(%rip), %r14
	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	$1752, %rsp
	.cfi_def_cfa_offset 1808
	movq	%fs:40, %rax
	movq	%rax, 1736(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L44:
	movq	24(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	je	.L29
	js	.L44
	leaq	896(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r11d
	addq	$8, %r12
	cmpl	%ebp, %r11d
	jge	.L31
	testl	%r11d, %r11d
	js	.L44
	leal	-3(%r11), %eax
	movl	%r11d, 12(%rsp)
	leal	1(%r11), %edi
	xorl	%ecx, %ecx
	movl	%eax, 8(%rsp)
	movslq	%r11d, %rax
	leal	-2(%r11), %esi
	movslq	%edi, %rdi
	movq	%rax, (%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L43:
	xorl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L33:
	movq	(%rbx,%rax,8), %r9
	movslq	%edx, %r8
	movq	%r9, 48(%rsp,%r8,8)
	xorl	%r8d, %r8d
	cmpl	%ecx, %eax
	setne	%r8b
	addq	$1, %rax
	addl	%r8d, %edx
	cmpq	%rdi, %rax
	jne	.L33
	movq	(%rbx,%rcx,8), %r13
	movq	(%rsp), %rax
	movq	%r13, 48(%rsp,%rax,8)
	testl	%esi, %esi
	jle	.L34
	cmpl	$1, 8(%rsp)
	jle	.L46
	movq	48(%rsp), %r10
	movq	56(%rsp), %r9
	leaq	72(%rsp), %r8
	xorl	%eax, %eax
	movl	$1, %edx
.L38:
	subq	%r9, %r10
	movq	%r10, %r11
	movq	-8(%r8), %r10
	subq	%r10, %r9
	movq	%r10, %r12
	cmpq	%r11, %r9
	movq	%r9, %rbp
	movq	(%r8), %r9
	movl	%eax, %r11d
	cmovne	%r15d, %edx
	addl	$2, %eax
	subq	%r9, %r12
	cmpq	%r12, %rbp
	cmovne	%r15d, %edx
	addq	$16, %r8
	addl	$3, %r11d
	cmpl	%r11d, 8(%rsp)
	jg	.L38
.L35:
	movq	16(%rsp), %r10
	movslq	%eax, %r8
	leaq	(%r10,%r8,8), %r8
	.p2align 4,,10
	.p2align 3
.L40:
	movq	8(%r8), %r10
	movq	(%r8), %r9
	addl	$1, %eax
	movq	%r10, %r11
	subq	%r10, %r9
	subq	16(%r8), %r11
	cmpq	%r9, %r11
	cmovne	%r15d, %edx
	addq	$8, %r8
	cmpl	%eax, %esi
	jg	.L40
	testl	%edx, %edx
	jne	.L34
	addq	$1, %rcx
	cmpl	%ecx, 12(%rsp)
	jge	.L43
	jmp	.L44
.L46:
	xorl	%eax, %eax
	movl	$1, %edx
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L34:
	movq	%r13, %rdx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L44
.L29:
	movq	1736(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	addq	$1752, %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
.L54:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE60:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define FOR(n) for(int i=0;i<n;i++)
#define FORJ(n) for(int j=0;j<n;j++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define mod 1000000007
typedef long long int ll;
int u(const void *a, const void *b){
    return *(ll*)a-*(ll*)b;
}
int d(const void *a, const void *b){
    return *(ll*)b-*(ll*)a;
}
int z(int a){
  if(a<1)a*=-1;
  return a;
}
int min(int a,int b){
  if(a>b)return b;
  return a;
}
int max(int a,int b){
  if(a>b)return a;
  return b;
}
int gcd(int a,int b){
  if(!b)return a;
  return gcd(b,a%b);
}
int kt(ll a){
  int sum=0;
  while(a){
    a/=10;
    sum++;
  }
  return sum;
}
int ks(ll a){
  int sum=0;
  while(a){
    sum+=a%10;
    a/=10;
  }
  return sum;
}
int n;
int f(int b,int c){
  return c*((n-1)/b+1);
}
int main(void){
  int n;
  ll a[105],x[105];
  while(1){
    scanf("%d",&n);
    if(!n)break;
    FOR(n+1)scanf("%lld",&x[i]);
    FOR(n+1){
      int l=0;
      FORJ(n+1){
        a[l]=x[j];
        if(i!=j)l++;
      }
      a[n]=x[i];
      int flg=1;
      FORJ(n-2)if(a[j]-a[j+1]!=a[j+1]-a[j+2])flg=0;
      if(flg){
        PRL(a[n]);
        break;
      }
    }
  }
  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>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define FOR(n) for(int i=0;i<n;i++)
#define FORJ(n) for(int j=0;j<n;j++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define mod 1000000007
typedef long long int ll;
int u(const void *a, const void *b){
    return *(ll*)a-*(ll*)b;
}
int d(const void *a, const void *b){
    return *(ll*)b-*(ll*)a;
}
int z(int a){
  if(a<1)a*=-1;
  return a;
}
int min(int a,int b){
  if(a>b)return b;
  return a;
}
int max(int a,int b){
  if(a>b)return a;
  return b;
}
int gcd(int a,int b){
  if(!b)return a;
  return gcd(b,a%b);
}
int kt(ll a){
  int sum=0;
  while(a){
    a/=10;
    sum++;
  }
  return sum;
}
int ks(ll a){
  int sum=0;
  while(a){
    sum+=a%10;
    a/=10;
  }
  return sum;
}
int n;
int f(int b,int c){
  return c*((n-1)/b+1);
}
int main(void){
  int n;
  ll a[105],x[105];
  while(1){
    scanf("%d",&n);
    if(!n)break;
    FOR(n+1)scanf("%lld",&x[i]);
    FOR(n+1){
      int l=0;
      FORJ(n+1){
        a[l]=x[j];
        if(i!=j)l++;
      }
      a[n]=x[i];
      int flg=1;
      FORJ(n-2)if(a[j]-a[j+1]!=a[j+1]-a[j+2])flg=0;
      if(flg){
        PRL(a[n]);
        break;
      }
    }
  }
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	u
	.type	u, @function
u:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	u, .-u
	.globl	d
	.type	d, @function
d:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	d, .-d
	.globl	z
	.type	z, @function
z:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jg	.L6
	negl	-4(%rbp)
.L6:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	z, .-z
	.globl	min
	.type	min, @function
min:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L9
	movl	-8(%rbp), %eax
	jmp	.L10
.L9:
	movl	-4(%rbp), %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L12
	movl	-4(%rbp), %eax
	jmp	.L13
.L12:
	movl	-8(%rbp), %eax
.L13:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	max, .-max
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB11:
	.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)
	cmpl	$0, -8(%rbp)
	jne	.L15
	movl	-4(%rbp), %eax
	jmp	.L16
.L15:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	gcd, .-gcd
	.globl	kt
	.type	kt, @function
kt:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L18
.L19:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -4(%rbp)
.L18:
	cmpq	$0, -24(%rbp)
	jne	.L19
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	kt, .-kt
	.globl	ks
	.type	ks, @function
ks:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L22
.L23:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
.L22:
	cmpq	$0, -24(%rbp)
	jne	.L23
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	ks, .-ks
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	f
	.type	f, @function
f:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	n(%rip), %eax
	subl	$1, %eax
	cltd
	idivl	-4(%rbp)
	addl	$1, %eax
	imull	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L42:
	leaq	-1724(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1724(%rbp), %eax
	testl	%eax, %eax
	je	.L46
	movl	$0, -1720(%rbp)
	jmp	.L30
.L31:
	leaq	-848(%rbp), %rdx
	movl	-1720(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1720(%rbp)
.L30:
	movl	-1724(%rbp), %eax
	cmpl	%eax, -1720(%rbp)
	jle	.L31
	movl	$0, -1716(%rbp)
	jmp	.L32
.L41:
	movl	$0, -1712(%rbp)
	movl	$0, -1708(%rbp)
	jmp	.L33
.L35:
	movl	-1708(%rbp), %eax
	cltq
	movq	-848(%rbp,%rax,8), %rdx
	movl	-1712(%rbp), %eax
	cltq
	movq	%rdx, -1696(%rbp,%rax,8)
	movl	-1716(%rbp), %eax
	cmpl	-1708(%rbp), %eax
	je	.L34
	addl	$1, -1712(%rbp)
.L34:
	addl	$1, -1708(%rbp)
.L33:
	movl	-1724(%rbp), %eax
	cmpl	%eax, -1708(%rbp)
	jle	.L35
	movl	-1724(%rbp), %ecx
	movl	-1716(%rbp), %eax
	cltq
	movq	-848(%rbp,%rax,8), %rdx
	movslq	%ecx, %rax
	movq	%rdx, -1696(%rbp,%rax,8)
	movl	$1, -1704(%rbp)
	movl	$0, -1700(%rbp)
	jmp	.L36
.L38:
	movl	-1700(%rbp), %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rdx
	movl	-1700(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rax
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movl	-1700(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rdx
	movl	-1700(%rbp), %eax
	addl	$2, %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rsi
	movq	%rdx, %rax
	subq	%rsi, %rax
	cmpq	%rax, %rcx
	je	.L37
	movl	$0, -1704(%rbp)
.L37:
	addl	$1, -1700(%rbp)
.L36:
	movl	-1724(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -1700(%rbp)
	jl	.L38
	cmpl	$0, -1704(%rbp)
	je	.L39
	movl	-1724(%rbp), %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L40
.L39:
	addl	$1, -1716(%rbp)
.L32:
	movl	-1724(%rbp), %eax
	cmpl	%eax, -1716(%rbp)
	jle	.L41
.L40:
	jmp	.L42
.L46:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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	u
	.type	u, @function
u:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	u, .-u
	.globl	d
	.type	d, @function
d:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	d, .-d
	.globl	z
	.type	z, @function
z:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jg	.L6
	negl	-4(%rbp)
.L6:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	z, .-z
	.globl	min
	.type	min, @function
min:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L9
	movl	-8(%rbp), %eax
	jmp	.L10
.L9:
	movl	-4(%rbp), %eax
.L10:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L12
	movl	-4(%rbp), %eax
	jmp	.L13
.L12:
	movl	-8(%rbp), %eax
.L13:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	max, .-max
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB11:
	.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)
	cmpl	$0, -8(%rbp)
	jne	.L15
	movl	-4(%rbp), %eax
	jmp	.L16
.L15:
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	gcd, .-gcd
	.globl	kt
	.type	kt, @function
kt:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L18
.L19:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -4(%rbp)
.L18:
	cmpq	$0, -24(%rbp)
	jne	.L19
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	kt, .-kt
	.globl	ks
	.type	ks, @function
ks:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L22
.L23:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
.L22:
	cmpq	$0, -24(%rbp)
	jne	.L23
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	ks, .-ks
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	f
	.type	f, @function
f:
.LFB14:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	n(%rip), %eax
	subl	$1, %eax
	cltd
	idivl	-4(%rbp)
	addl	$1, %eax
	imull	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	f, .-f
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L42:
	leaq	-1724(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1724(%rbp), %eax
	testl	%eax, %eax
	je	.L46
	movl	$0, -1720(%rbp)
	jmp	.L30
.L31:
	leaq	-848(%rbp), %rdx
	movl	-1720(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1720(%rbp)
.L30:
	movl	-1724(%rbp), %eax
	cmpl	%eax, -1720(%rbp)
	jle	.L31
	movl	$0, -1716(%rbp)
	jmp	.L32
.L41:
	movl	$0, -1712(%rbp)
	movl	$0, -1708(%rbp)
	jmp	.L33
.L35:
	movl	-1708(%rbp), %eax
	cltq
	movq	-848(%rbp,%rax,8), %rdx
	movl	-1712(%rbp), %eax
	cltq
	movq	%rdx, -1696(%rbp,%rax,8)
	movl	-1716(%rbp), %eax
	cmpl	-1708(%rbp), %eax
	je	.L34
	addl	$1, -1712(%rbp)
.L34:
	addl	$1, -1708(%rbp)
.L33:
	movl	-1724(%rbp), %eax
	cmpl	%eax, -1708(%rbp)
	jle	.L35
	movl	-1724(%rbp), %ecx
	movl	-1716(%rbp), %eax
	cltq
	movq	-848(%rbp,%rax,8), %rdx
	movslq	%ecx, %rax
	movq	%rdx, -1696(%rbp,%rax,8)
	movl	$1, -1704(%rbp)
	movl	$0, -1700(%rbp)
	jmp	.L36
.L38:
	movl	-1700(%rbp), %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rdx
	movl	-1700(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rax
	movq	%rdx, %rcx
	subq	%rax, %rcx
	movl	-1700(%rbp), %eax
	addl	$1, %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rdx
	movl	-1700(%rbp), %eax
	addl	$2, %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rsi
	movq	%rdx, %rax
	subq	%rsi, %rax
	cmpq	%rax, %rcx
	je	.L37
	movl	$0, -1704(%rbp)
.L37:
	addl	$1, -1700(%rbp)
.L36:
	movl	-1724(%rbp), %eax
	subl	$2, %eax
	cmpl	%eax, -1700(%rbp)
	jl	.L38
	cmpl	$0, -1704(%rbp)
	je	.L39
	movl	-1724(%rbp), %eax
	cltq
	movq	-1696(%rbp,%rax,8), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L40
.L39:
	addl	$1, -1716(%rbp)
.L32:
	movl	-1724(%rbp), %eax
	cmpl	%eax, -1716(%rbp)
	jle	.L41
.L40:
	jmp	.L42
.L46:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L44
	call	__stack_chk_fail@PLT
.L44:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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:
