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 gcd(int a,int b){
  if(a==0)
    return b;
  else if(b==0)
    return a;
  int i;
  while(a!=0 && b!=0){
    i=b;
    b=a%b;
    a=i;
  }
  return a;
}

int main(){
  int n,i,max=0;
  scanf("%d",&n);
  int a[n+2],l[n+2],r[n+2];
  for(i=1;i<=n;i++)
    scanf("%d",&a[i]);
  l[0]=0;
  r[n+1]=0;
  for(i=0;i<n;i++){
    l[i+1]=gcd(l[i],a[i+1]);
    r[n-i]=gcd(r[n-i+1],a[n-i]);
  }
  for(i=0;i<n;i++)
    if(max<gcd(l[i],r[i+2]))
      max=gcd(l[i],r[i+2]);
  printf("%d\n",max);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L2
	movl	-24(%rbp), %eax
	jmp	.L3
.L2:
	cmpl	$0, -24(%rbp)
	jne	.L5
	movl	-20(%rbp), %eax
	jmp	.L3
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -24(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L5:
	cmpl	$0, -20(%rbp)
	je	.L6
	cmpl	$0, -24(%rbp)
	jne	.L7
.L6:
	movl	-20(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$160, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	movl	$0, -92(%rbp)
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	leal	2(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%edx, %rax
	movq	%rax, -128(%rbp)
	movq	$0, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	-100(%rbp), %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L12:
	cmpq	%rdx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L14
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L14:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	-100(%rbp), %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -56(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	movl	$1, -96(%rbp)
	jmp	.L18
.L19:
	movl	-96(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -96(%rbp)
.L18:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jle	.L19
	movq	-64(%rbp), %rax
	movl	$0, (%rax)
	movl	-100(%rbp), %eax
	leal	1(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movl	$0, -96(%rbp)
	jmp	.L20
.L21:
	movl	-96(%rbp), %eax
	leal	1(%rax), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-96(%rbp), %ecx
	leal	1(%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movq	-64(%rbp), %rdx
	movslq	%ebx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	movl	-100(%rbp), %eax
	subl	-96(%rbp), %eax
	movl	%eax, %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-100(%rbp), %eax
	subl	-96(%rbp), %eax
	leal	1(%rax), %ecx
	movq	-48(%rbp), %rax
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-100(%rbp), %ecx
	movl	%ecx, %ebx
	subl	-96(%rbp), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movq	-48(%rbp), %rdx
	movslq	%ebx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	addl	$1, -96(%rbp)
.L20:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L21
	movl	$0, -96(%rbp)
	jmp	.L22
.L24:
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	cmpl	%eax, -92(%rbp)
	jge	.L23
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -92(%rbp)
.L23:
	addl	$1, -96(%rbp)
.L22:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L24
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	movl	%esi, %r8d
	testl	%edi, %edi
	je	.L1
	movl	%edi, %r8d
	testl	%esi, %esi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.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:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	movq	%rsp, %rcx
	leal	2(%rsi), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rcx
	cmpq	%rcx, %rsp
	je	.L12
.L65:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L65
.L12:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L66
.L13:
	leaq	3(%rsp), %rcx
	movq	%rax, %r8
	movq	%rax, %rdx
	movq	%rsp, %rdi
	movq	%rcx, %rbx
	andq	$-4096, %r8
	andq	$-4, %rcx
	andq	$-16, %rdx
	shrq	$2, %rbx
	movq	%rcx, %r15
	subq	%r8, %rdi
	movq	%rbx, -72(%rbp)
.L14:
	cmpq	%rdi, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L66:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L13
.L15:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L67
.L16:
	leaq	3(%rsp), %r12
	movq	%rax, %rdx
	movq	%rsp, %rdi
	andq	$-4096, %rax
	movq	%r12, %rbx
	andq	$-16, %rdx
	andq	$-4, %r12
	subq	%rax, %rdi
	shrq	$2, %rbx
	movq	%rbx, -80(%rbp)
.L17:
	cmpq	%rdi, %rsp
	je	.L18
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L17
.L67:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L16
.L18:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L19
	orq	$0, -8(%rsp,%rax)
.L19:
	movq	%rsp, %rbx
	testl	%esi, %esi
	jle	.L20
	leaq	4(%r15), %r13
	movl	$1, %r14d
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %edi
	addq	$4, %r13
	cmpl	%r14d, %edi
	jge	.L21
	movq	-80(%rbp), %rax
	movl	$0, 0(,%rax,4)
	leal	1(%rdi), %eax
	cltq
	movl	$0, (%rbx,%rax,4)
	testl	%edi, %edi
	jle	.L20
	movq	-72(%rbp), %rax
	movslq	%edi, %r8
	leal	-1(%rdi), %r10d
	xorl	%r9d, %r9d
	salq	$2, %r8
	salq	$2, %r10
	movl	4(,%rax,4), %esi
	.p2align 4,,10
	.p2align 3
.L36:
	movl	(%r15,%r8), %edx
	movl	4(%rbx,%r8), %eax
	movl	%esi, 4(%r12,%r9)
	movl	%edx, %r11d
	testl	%eax, %eax
	je	.L25
	movl	%eax, %r11d
	testl	%edx, %edx
	je	.L25
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%edx, %r11d
	cltd
	idivl	%r11d
	movl	%r11d, %eax
	testl	%edx, %edx
	jne	.L26
.L25:
	movl	%r11d, (%rbx,%r8)
	cmpq	%r10, %r9
	je	.L68
	movl	8(%r15,%r9), %edx
	testl	%esi, %esi
	je	.L38
	testl	%edx, %edx
	je	.L23
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%edx, %esi
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L24
.L23:
	addq	$4, %r9
	subq	$4, %r8
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%edx, %esi
	addq	$4, %r9
	subq	$4, %r8
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L68:
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L33:
	movl	(%r12,%r9,4), %r8d
	movl	8(%rbx,%r9,4), %esi
	testl	%r8d, %r8d
	je	.L28
	testl	%esi, %esi
	je	.L29
	movl	%esi, %edx
	movl	%r8d, %eax
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L30
	cmpl	%ecx, %r10d
	jl	.L32
.L34:
	addq	$1, %r9
	cmpq	%r9, %rdi
	jne	.L33
.L35:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L69
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	movl	%r8d, %eax
	movl	%esi, %r10d
	cltd
	movl	%r10d, %r8d
	idivl	%esi
	movl	%edx, %esi
	testl	%edx, %edx
	jne	.L32
	movl	%ecx, %r10d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	%esi, %r10d
	cmovl	%esi, %r10d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	%r8d, %r10d
	cmovl	%r8d, %r10d
	jmp	.L34
.L20:
	xorl	%r10d, %r10d
	jmp	.L35
.L69:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	movl	%esi, %r8d
	testl	%edi, %edi
	je	.L1
	movl	%edi, %r8d
	testl	%esi, %esi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.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:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %esi
	movq	%rsp, %rcx
	leal	2(%rsi), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rcx
	cmpq	%rcx, %rsp
	je	.L12
.L65:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L65
.L12:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L66
.L13:
	leaq	3(%rsp), %rcx
	movq	%rax, %r8
	movq	%rax, %rdx
	movq	%rsp, %rdi
	movq	%rcx, %rbx
	andq	$-4096, %r8
	andq	$-4, %rcx
	andq	$-16, %rdx
	shrq	$2, %rbx
	movq	%rcx, %r15
	subq	%r8, %rdi
	movq	%rbx, -72(%rbp)
.L14:
	cmpq	%rdi, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L66:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L13
.L15:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L67
.L16:
	leaq	3(%rsp), %r12
	movq	%rax, %rdx
	movq	%rsp, %rdi
	andq	$-4096, %rax
	movq	%r12, %rbx
	andq	$-16, %rdx
	andq	$-4, %r12
	subq	%rax, %rdi
	shrq	$2, %rbx
	movq	%rbx, -80(%rbp)
.L17:
	cmpq	%rdi, %rsp
	je	.L18
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L17
.L67:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L16
.L18:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L19
	orq	$0, -8(%rsp,%rax)
.L19:
	movq	%rsp, %rbx
	testl	%esi, %esi
	jle	.L20
	leaq	4(%r15), %r13
	movl	$1, %r14d
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r13, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %edi
	addq	$4, %r13
	cmpl	%r14d, %edi
	jge	.L21
	movq	-80(%rbp), %rax
	movl	$0, 0(,%rax,4)
	leal	1(%rdi), %eax
	cltq
	movl	$0, (%rbx,%rax,4)
	testl	%edi, %edi
	jle	.L20
	movq	-72(%rbp), %rax
	movslq	%edi, %r8
	leal	-1(%rdi), %r10d
	xorl	%r9d, %r9d
	salq	$2, %r8
	salq	$2, %r10
	movl	4(,%rax,4), %esi
	.p2align 4,,10
	.p2align 3
.L36:
	movl	(%r15,%r8), %edx
	movl	4(%rbx,%r8), %eax
	movl	%esi, 4(%r12,%r9)
	movl	%edx, %r11d
	testl	%eax, %eax
	je	.L25
	movl	%eax, %r11d
	testl	%edx, %edx
	je	.L25
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%edx, %r11d
	cltd
	idivl	%r11d
	movl	%r11d, %eax
	testl	%edx, %edx
	jne	.L26
.L25:
	movl	%r11d, (%rbx,%r8)
	cmpq	%r10, %r9
	je	.L68
	movl	8(%r15,%r9), %edx
	testl	%esi, %esi
	je	.L38
	testl	%edx, %edx
	je	.L23
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L24:
	movl	%edx, %esi
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L24
.L23:
	addq	$4, %r9
	subq	$4, %r8
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%edx, %esi
	addq	$4, %r9
	subq	$4, %r8
	jmp	.L36
	.p2align 4,,10
	.p2align 3
.L68:
	xorl	%r9d, %r9d
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L33:
	movl	(%r12,%r9,4), %r8d
	movl	8(%rbx,%r9,4), %esi
	testl	%r8d, %r8d
	je	.L28
	testl	%esi, %esi
	je	.L29
	movl	%esi, %edx
	movl	%r8d, %eax
	.p2align 4,,10
	.p2align 3
.L30:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L30
	cmpl	%ecx, %r10d
	jl	.L32
.L34:
	addq	$1, %r9
	cmpq	%r9, %rdi
	jne	.L33
.L35:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L69
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	movl	%r8d, %eax
	movl	%esi, %r10d
	cltd
	movl	%r10d, %r8d
	idivl	%esi
	movl	%edx, %esi
	testl	%edx, %edx
	jne	.L32
	movl	%ecx, %r10d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L28:
	cmpl	%esi, %r10d
	cmovl	%esi, %r10d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L29:
	cmpl	%r8d, %r10d
	cmovl	%r8d, %r10d
	jmp	.L34
.L20:
	xorl	%r10d, %r10d
	jmp	.L35
.L69:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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 gcd(int a,int b){
  if(a==0)
    return b;
  else if(b==0)
    return a;
  int i;
  while(a!=0 && b!=0){
    i=b;
    b=a%b;
    a=i;
  }
  return a;
}

int main(){
  int n,i,max=0;
  scanf("%d",&n);
  int a[n+2],l[n+2],r[n+2];
  for(i=1;i<=n;i++)
    scanf("%d",&a[i]);
  l[0]=0;
  r[n+1]=0;
  for(i=0;i<n;i++){
    l[i+1]=gcd(l[i],a[i+1]);
    r[n-i]=gcd(r[n-i+1],a[n-i]);
  }
  for(i=0;i<n;i++)
    if(max<gcd(l[i],r[i+2]))
      max=gcd(l[i],r[i+2]);
  printf("%d\n",max);
  return 0;
}

3
7 6 7
 2
1000010000 1000000000
 3
12 29 18
 2
1000000000 1000001000
 3
4 8 7
 2
1001000000 1000001000
 3
9 28 18
 3
9 28 30
 2
1001100000 1000001100
 2
1101000000 1000001100

7
 1000010000
 6
 1000001000
 4
 1001000000
 9
 3
 1001100000
 1101000000

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 gcd(int a,int b){
  if(a==0)
    return b;
  else if(b==0)
    return a;
  int i;
  while(a!=0 && b!=0){
    i=b;
    b=a%b;
    a=i;
  }
  return a;
}

int main(){
  int n,i,max=0;
  scanf("%d",&n);
  int a[n+2],l[n+2],r[n+2];
  for(i=1;i<=n;i++)
    scanf("%d",&a[i]);
  l[0]=0;
  r[n+1]=0;
  for(i=0;i<n;i++){
    l[i+1]=gcd(l[i],a[i+1]);
    r[n-i]=gcd(r[n-i+1],a[n-i]);
  }
  for(i=0;i<n;i++)
    if(max<gcd(l[i],r[i+2]))
      max=gcd(l[i],r[i+2]);
  printf("%d\n",max);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L2
	movl	-24(%rbp), %eax
	jmp	.L3
.L2:
	cmpl	$0, -24(%rbp)
	jne	.L5
	movl	-20(%rbp), %eax
	jmp	.L3
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -24(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L5:
	cmpl	$0, -20(%rbp)
	je	.L6
	cmpl	$0, -24(%rbp)
	jne	.L7
.L6:
	movl	-20(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$160, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	movl	$0, -92(%rbp)
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	leal	2(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%edx, %rax
	movq	%rax, -128(%rbp)
	movq	$0, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	-100(%rbp), %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L12:
	cmpq	%rdx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L14
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L14:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	-100(%rbp), %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -56(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	movl	$1, -96(%rbp)
	jmp	.L18
.L19:
	movl	-96(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -96(%rbp)
.L18:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jle	.L19
	movq	-64(%rbp), %rax
	movl	$0, (%rax)
	movl	-100(%rbp), %eax
	leal	1(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movl	$0, -96(%rbp)
	jmp	.L20
.L21:
	movl	-96(%rbp), %eax
	leal	1(%rax), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-96(%rbp), %ecx
	leal	1(%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movq	-64(%rbp), %rdx
	movslq	%ebx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	movl	-100(%rbp), %eax
	subl	-96(%rbp), %eax
	movl	%eax, %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-100(%rbp), %eax
	subl	-96(%rbp), %eax
	leal	1(%rax), %ecx
	movq	-48(%rbp), %rax
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-100(%rbp), %ecx
	movl	%ecx, %ebx
	subl	-96(%rbp), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movq	-48(%rbp), %rdx
	movslq	%ebx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	addl	$1, -96(%rbp)
.L20:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L21
	movl	$0, -96(%rbp)
	jmp	.L22
.L24:
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	cmpl	%eax, -92(%rbp)
	jge	.L23
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -92(%rbp)
.L23:
	addl	$1, -96(%rbp)
.L22:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L24
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L2
	movl	-24(%rbp), %eax
	jmp	.L3
.L2:
	cmpl	$0, -24(%rbp)
	jne	.L5
	movl	-20(%rbp), %eax
	jmp	.L3
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -24(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L5:
	cmpl	$0, -20(%rbp)
	je	.L6
	cmpl	$0, -24(%rbp)
	jne	.L7
.L6:
	movl	-20(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$160, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	movl	$0, -92(%rbp)
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	leal	2(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%edx, %rax
	movq	%rax, -128(%rbp)
	movq	$0, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	-100(%rbp), %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L12:
	cmpq	%rdx, %rsp
	je	.L13
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L12
.L13:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L14
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L14:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	-100(%rbp), %eax
	addl	$2, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -56(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L15:
	cmpq	%rdx, %rsp
	je	.L16
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L15
.L16:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L17
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L17:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	movl	$1, -96(%rbp)
	jmp	.L18
.L19:
	movl	-96(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -96(%rbp)
.L18:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jle	.L19
	movq	-64(%rbp), %rax
	movl	$0, (%rax)
	movl	-100(%rbp), %eax
	leal	1(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	movl	$0, -96(%rbp)
	jmp	.L20
.L21:
	movl	-96(%rbp), %eax
	leal	1(%rax), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-96(%rbp), %ecx
	leal	1(%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movq	-64(%rbp), %rdx
	movslq	%ebx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	movl	-100(%rbp), %eax
	subl	-96(%rbp), %eax
	movl	%eax, %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-100(%rbp), %eax
	subl	-96(%rbp), %eax
	leal	1(%rax), %ecx
	movq	-48(%rbp), %rax
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-100(%rbp), %ecx
	movl	%ecx, %ebx
	subl	-96(%rbp), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movq	-48(%rbp), %rdx
	movslq	%ebx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	addl	$1, -96(%rbp)
.L20:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L21
	movl	$0, -96(%rbp)
	jmp	.L22
.L24:
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	cmpl	%eax, -92(%rbp)
	jge	.L23
	movl	-96(%rbp), %eax
	leal	2(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -92(%rbp)
.L23:
	addl	$1, -96(%rbp)
.L22:
	movl	-100(%rbp), %eax
	cmpl	%eax, -96(%rbp)
	jl	.L24
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
