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 n1,int n2)
{
	int r=1;
	if(n2 == 0)
		return n1;
	if(n1 == 0)
		return n2;
	while(r!=0){
		r=n1%n2;
		n1=n2;
		n2=r;
	}
	return n1;
}

int main(void)
{
	int i,n,m;
	scanf("%d",&n);
	int a[n];
	int l[n];
	int r[n];
	int max=0;
	
	l[0]=0;
	r[0]=0;
	
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	
	for(i=0;i<n;i++)
		l[i+1]=gcd(l[i],a[i]);
	for(i=0;i<n;i++)
		r[i+1]=gcd(r[i],a[n-1-i]);

	for(i=0;i<n;i++)
	{
		m=gcd(l[i],r[n-1-i]);
		if(m>max)
			max=m;
	}
	printf("%d",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)
	movl	$1, -4(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L2
	movl	-20(%rbp), %eax
	jmp	.L3
.L2:
	cmpl	$0, -20(%rbp)
	jne	.L5
	movl	-24(%rbp), %eax
	jmp	.L3
.L6:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L5:
	cmpl	$0, -4(%rbp)
	jne	.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"
	.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
	leaq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-104(%rbp), %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, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	-104(%rbp), %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, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	-104(%rbp), %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, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	movl	$0, -96(%rbp)
	movq	-64(%rbp), %rax
	movl	$0, (%rax)
	movq	-48(%rbp), %rax
	movl	$0, (%rax)
	movl	$0, -100(%rbp)
	jmp	.L17
.L18:
	movl	-100(%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, -100(%rbp)
.L17:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L18
	movl	$0, -100(%rbp)
	jmp	.L19
.L20:
	movq	-80(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-100(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-100(%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)
	addl	$1, -100(%rbp)
.L19:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L20
	movl	$0, -100(%rbp)
	jmp	.L21
.L22:
	movl	-104(%rbp), %eax
	subl	$1, %eax
	subl	-100(%rbp), %eax
	movl	%eax, %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-48(%rbp), %rax
	movl	-100(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-100(%rbp), %ecx
	leal	1(%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movq	-48(%rbp), %rdx
	movslq	%ebx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	addl	$1, -100(%rbp)
.L21:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L22
	movl	$0, -100(%rbp)
	jmp	.L23
.L25:
	movl	-104(%rbp), %eax
	subl	$1, %eax
	subl	-100(%rbp), %eax
	movl	%eax, %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-100(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -92(%rbp)
	movl	-92(%rbp), %eax
	cmpl	-96(%rbp), %eax
	jle	.L24
	movl	-92(%rbp), %eax
	movl	%eax, -96(%rbp)
.L24:
	addl	$1, -100(%rbp)
.L23:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L25
	movl	-96(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%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	.L27
	call	__stack_chk_fail@PLT
.L27:
	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	%edi, %r8d
	testl	%esi, %esi
	je	.L1
	movl	%esi, %r8d
	testl	%edi, %edi
	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"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L12
.L63:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L63
.L12:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L64
.L13:
	movq	%rax, %rdi
	movq	%rax, %rdx
	movq	%rsp, %rsi
	movq	%rsp, %r12
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
.L14:
	cmpq	%rsi, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L64:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L13
.L15:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L65
.L16:
	leaq	3(%rsp), %r14
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%r14, %rdi
	andq	$-16, %rdx
	andq	$-4, %r14
	subq	%rax, %rsi
	shrq	$2, %rdi
.L17:
	cmpq	%rsi, %rsp
	je	.L18
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L17
.L65:
	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:
	movl	$0, 0(,%rdi,4)
	leaq	3(%rsp), %rbx
	movq	%rbx, %rax
	andq	$-4, %rbx
	shrq	$2, %rax
	movq	%rbx, -72(%rbp)
	movl	$0, 0(,%rax,4)
	testl	%ecx, %ecx
	jle	.L20
	movq	%r12, %rbx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %edi
	addq	$4, %rbx
	cmpl	%r15d, %edi
	jg	.L21
	testl	%edi, %edi
	jle	.L20
	leal	-1(%rdi), %r8d
	movl	%edi, %r9d
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L24:
	movl	(%r14,%rsi,4), %eax
	movl	(%r12,%rsi,4), %edx
	movl	%eax, %ecx
	testl	%edx, %edx
	je	.L22
	movl	%edx, %ecx
	testl	%eax, %eax
	je	.L22
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L23
.L22:
	movl	%ecx, 4(%r14,%rsi,4)
	addq	$1, %rsi
	cmpq	%r9, %rsi
	jne	.L24
	movq	-72(%rbp), %rax
	movslq	%edi, %rdi
	salq	$2, %r8
	salq	$2, %rdi
	addq	%rdi, %r12
	leaq	4(%rax), %rsi
	leaq	8(%rax,%r8), %r9
	.p2align 4,,10
	.p2align 3
.L27:
	movl	-4(%rsi), %eax
	movl	-4(%r12), %edx
	movl	%eax, %ecx
	testl	%edx, %edx
	je	.L25
	movl	%edx, %ecx
	testl	%eax, %eax
	je	.L25
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L26
.L25:
	movl	%ecx, (%rsi)
	addq	$4, %rsi
	subq	$4, %r12
	cmpq	%r9, %rsi
	jne	.L27
	movq	-72(%rbp), %rax
	leaq	-4(%rax,%rdi), %rsi
	leaq	4(%r14,%r8), %rdi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L30:
	movl	(%r14), %eax
	movl	(%rsi), %edx
	movl	%eax, %ecx
	testl	%edx, %edx
	je	.L28
	movl	%edx, %ecx
	testl	%eax, %eax
	je	.L28
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L29
.L28:
	cmpl	%ecx, %r8d
	cmovl	%ecx, %r8d
	addq	$4, %r14
	subq	$4, %rsi
	cmpq	%rdi, %r14
	jne	.L30
.L31:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L66
	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
.L20:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L31
.L66:
	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	%edi, %r8d
	testl	%esi, %esi
	je	.L1
	movl	%esi, %r8d
	testl	%edi, %edi
	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"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L12
.L63:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L63
.L12:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L64
.L13:
	movq	%rax, %rdi
	movq	%rax, %rdx
	movq	%rsp, %rsi
	movq	%rsp, %r12
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
.L14:
	cmpq	%rsi, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L64:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L13
.L15:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L65
.L16:
	leaq	3(%rsp), %r14
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%r14, %rdi
	andq	$-16, %rdx
	andq	$-4, %r14
	subq	%rax, %rsi
	shrq	$2, %rdi
.L17:
	cmpq	%rsi, %rsp
	je	.L18
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L17
.L65:
	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:
	movl	$0, 0(,%rdi,4)
	leaq	3(%rsp), %rbx
	movq	%rbx, %rax
	andq	$-4, %rbx
	shrq	$2, %rax
	movq	%rbx, -72(%rbp)
	movl	$0, 0(,%rax,4)
	testl	%ecx, %ecx
	jle	.L20
	movq	%r12, %rbx
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %edi
	addq	$4, %rbx
	cmpl	%r15d, %edi
	jg	.L21
	testl	%edi, %edi
	jle	.L20
	leal	-1(%rdi), %r8d
	movl	%edi, %r9d
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L24:
	movl	(%r14,%rsi,4), %eax
	movl	(%r12,%rsi,4), %edx
	movl	%eax, %ecx
	testl	%edx, %edx
	je	.L22
	movl	%edx, %ecx
	testl	%eax, %eax
	je	.L22
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L23
.L22:
	movl	%ecx, 4(%r14,%rsi,4)
	addq	$1, %rsi
	cmpq	%r9, %rsi
	jne	.L24
	movq	-72(%rbp), %rax
	movslq	%edi, %rdi
	salq	$2, %r8
	salq	$2, %rdi
	addq	%rdi, %r12
	leaq	4(%rax), %rsi
	leaq	8(%rax,%r8), %r9
	.p2align 4,,10
	.p2align 3
.L27:
	movl	-4(%rsi), %eax
	movl	-4(%r12), %edx
	movl	%eax, %ecx
	testl	%edx, %edx
	je	.L25
	movl	%edx, %ecx
	testl	%eax, %eax
	je	.L25
	.p2align 4,,10
	.p2align 3
.L26:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L26
.L25:
	movl	%ecx, (%rsi)
	addq	$4, %rsi
	subq	$4, %r12
	cmpq	%r9, %rsi
	jne	.L27
	movq	-72(%rbp), %rax
	leaq	-4(%rax,%rdi), %rsi
	leaq	4(%r14,%r8), %rdi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L30:
	movl	(%r14), %eax
	movl	(%rsi), %edx
	movl	%eax, %ecx
	testl	%edx, %edx
	je	.L28
	movl	%edx, %ecx
	testl	%eax, %eax
	je	.L28
	.p2align 4,,10
	.p2align 3
.L29:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L29
.L28:
	cmpl	%ecx, %r8d
	cmovl	%ecx, %r8d
	addq	$4, %r14
	subq	$4, %rsi
	cmpq	%rdi, %r14
	jne	.L30
.L31:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L66
	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
.L20:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L31
.L66:
	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 n1,int n2)
{
	int r=1;
	if(n2 == 0)
		return n1;
	if(n1 == 0)
		return n2;
	while(r!=0){
		r=n1%n2;
		n1=n2;
		n2=r;
	}
	return n1;
}

int main(void)
{
	int i,n,m;
	scanf("%d",&n);
	int a[n];
	int l[n];
	int r[n];
	int max=0;
	
	l[0]=0;
	r[0]=0;
	
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	
	for(i=0;i<n;i++)
		l[i+1]=gcd(l[i],a[i]);
	for(i=0;i<n;i++)
		r[i+1]=gcd(r[i],a[n-1-i]);

	for(i=0;i<n;i++)
	{
		m=gcd(l[i],r[n-1-i]);
		if(m>max)
			max=m;
	}
	printf("%d",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 n1,int n2)
{
	int r=1;
	if(n2 == 0)
		return n1;
	if(n1 == 0)
		return n2;
	while(r!=0){
		r=n1%n2;
		n1=n2;
		n2=r;
	}
	return n1;
}

int main(void)
{
	int i,n,m;
	scanf("%d",&n);
	int a[n];
	int l[n];
	int r[n];
	int max=0;
	
	l[0]=0;
	r[0]=0;
	
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	
	for(i=0;i<n;i++)
		l[i+1]=gcd(l[i],a[i]);
	for(i=0;i<n;i++)
		r[i+1]=gcd(r[i],a[n-1-i]);

	for(i=0;i<n;i++)
	{
		m=gcd(l[i],r[n-1-i]);
		if(m>max)
			max=m;
	}
	printf("%d",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)
	movl	$1, -4(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L2
	movl	-20(%rbp), %eax
	jmp	.L3
.L2:
	cmpl	$0, -20(%rbp)
	jne	.L5
	movl	-24(%rbp), %eax
	jmp	.L3
.L6:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L5:
	cmpl	$0, -4(%rbp)
	jne	.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"
	.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
	leaq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-104(%rbp), %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, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	-104(%rbp), %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, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	-104(%rbp), %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, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	movl	$0, -96(%rbp)
	movq	-64(%rbp), %rax
	movl	$0, (%rax)
	movq	-48(%rbp), %rax
	movl	$0, (%rax)
	movl	$0, -100(%rbp)
	jmp	.L17
.L18:
	movl	-100(%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, -100(%rbp)
.L17:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L18
	movl	$0, -100(%rbp)
	jmp	.L19
.L20:
	movq	-80(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-100(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-100(%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)
	addl	$1, -100(%rbp)
.L19:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L20
	movl	$0, -100(%rbp)
	jmp	.L21
.L22:
	movl	-104(%rbp), %eax
	subl	$1, %eax
	subl	-100(%rbp), %eax
	movl	%eax, %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-48(%rbp), %rax
	movl	-100(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-100(%rbp), %ecx
	leal	1(%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movq	-48(%rbp), %rdx
	movslq	%ebx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	addl	$1, -100(%rbp)
.L21:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L22
	movl	$0, -100(%rbp)
	jmp	.L23
.L25:
	movl	-104(%rbp), %eax
	subl	$1, %eax
	subl	-100(%rbp), %eax
	movl	%eax, %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-100(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -92(%rbp)
	movl	-92(%rbp), %eax
	cmpl	-96(%rbp), %eax
	jle	.L24
	movl	-92(%rbp), %eax
	movl	%eax, -96(%rbp)
.L24:
	addl	$1, -100(%rbp)
.L23:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L25
	movl	-96(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%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	.L27
	call	__stack_chk_fail@PLT
.L27:
	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)
	movl	$1, -4(%rbp)
	cmpl	$0, -24(%rbp)
	jne	.L2
	movl	-20(%rbp), %eax
	jmp	.L3
.L2:
	cmpl	$0, -20(%rbp)
	jne	.L5
	movl	-24(%rbp), %eax
	jmp	.L3
.L6:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L5:
	cmpl	$0, -4(%rbp)
	jne	.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"
	.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
	leaq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-104(%rbp), %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, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L8:
	cmpq	%rdx, %rsp
	je	.L9
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L8
.L9:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L10
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L10:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	-104(%rbp), %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, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L11:
	cmpq	%rdx, %rsp
	je	.L12
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L11
.L12:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L13
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L13:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	-104(%rbp), %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, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -48(%rbp)
	movl	$0, -96(%rbp)
	movq	-64(%rbp), %rax
	movl	$0, (%rax)
	movq	-48(%rbp), %rax
	movl	$0, (%rax)
	movl	$0, -100(%rbp)
	jmp	.L17
.L18:
	movl	-100(%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, -100(%rbp)
.L17:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L18
	movl	$0, -100(%rbp)
	jmp	.L19
.L20:
	movq	-80(%rbp), %rax
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-100(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-100(%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)
	addl	$1, -100(%rbp)
.L19:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L20
	movl	$0, -100(%rbp)
	jmp	.L21
.L22:
	movl	-104(%rbp), %eax
	subl	$1, %eax
	subl	-100(%rbp), %eax
	movl	%eax, %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-48(%rbp), %rax
	movl	-100(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	-100(%rbp), %ecx
	leal	1(%rcx), %ebx
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movq	-48(%rbp), %rdx
	movslq	%ebx, %rcx
	movl	%eax, (%rdx,%rcx,4)
	addl	$1, -100(%rbp)
.L21:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L22
	movl	$0, -100(%rbp)
	jmp	.L23
.L25:
	movl	-104(%rbp), %eax
	subl	$1, %eax
	subl	-100(%rbp), %eax
	movl	%eax, %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-64(%rbp), %rax
	movl	-100(%rbp), %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -92(%rbp)
	movl	-92(%rbp), %eax
	cmpl	-96(%rbp), %eax
	jle	.L24
	movl	-92(%rbp), %eax
	movl	%eax, -96(%rbp)
.L24:
	addl	$1, -100(%rbp)
.L23:
	movl	-104(%rbp), %eax
	cmpl	%eax, -100(%rbp)
	jl	.L25
	movl	-96(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%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	.L27
	call	__stack_chk_fail@PLT
.L27:
	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:
