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%b){return gcd(b,a%b);}
	else{return b;}
}
int main(void){
	int n,m,i,ans;
	int x[100000];
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++){
		scanf("%d",&x[i]);
		x[i]=m<x[i]?x[i]-m:m-x[i];
	}
	if(n==1){printf("%d",x[0]);}
	else{
		ans=gcd(x[0],x[1]);
		for(i=2;i<n;i++){
			ans=gcd(ans,x[i]);
		}
		printf("%d",ans);
	}
	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
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L2
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400028(%rbp), %rdx
	leaq	-400032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400024(%rbp)
	jmp	.L5
.L8:
	leaq	-400016(%rbp), %rdx
	movl	-400024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400028(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L6
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	-400028(%rbp), %edx
	subl	%edx, %eax
	jmp	.L7
.L6:
	movl	-400028(%rbp), %edx
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L7:
	movl	-400024(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400016(%rbp,%rdx,4)
	addl	$1, -400024(%rbp)
.L5:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400024(%rbp)
	jl	.L8
	movl	-400032(%rbp), %eax
	cmpl	$1, %eax
	jne	.L9
	movl	-400016(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L9:
	movl	-400012(%rbp), %edx
	movl	-400016(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -400020(%rbp)
	movl	$2, -400024(%rbp)
	jmp	.L11
.L12:
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400020(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -400020(%rbp)
	addl	$1, -400024(%rbp)
.L11:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400024(%rbp)
	jl	.L12
	movl	-400020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.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
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L2
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400064
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	12(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %esi
	testl	%esi, %esi
	jle	.L6
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %ecx
	movl	12(%rsp), %edx
	movl	%ecx, %esi
	movl	%edx, %eax
	subl	%edx, %esi
	subl	%ecx, %eax
	cmpl	%edx, %ecx
	cmovg	%esi, %eax
	movl	8(%rsp), %esi
	addl	$1, %r12d
	addq	$4, %rbx
	movl	%eax, -4(%rbx)
	cmpl	%r12d, %esi
	jg	.L9
	movl	16(%rsp), %eax
	cmpl	$1, %esi
	je	.L23
.L10:
	movl	20(%rsp), %edx
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L12
	cmpl	$2, %esi
	jle	.L13
	leal	-3(%rsi), %eax
	leaq	24(%rsp), %rcx
	leaq	28(%rsp,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L15:
	movl	(%rcx), %edx
	movl	%r8d, %eax
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L14
	addq	$4, %rcx
	cmpq	%rsi, %rcx
	jne	.L15
.L13:
	movl	%r8d, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L11:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$400032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	movl	%eax, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
.L6:
	movl	16(%rsp), %eax
	leaq	.LC1(%rip), %rbp
	jmp	.L10
.L24:
	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
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L2
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400064
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	12(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %esi
	testl	%esi, %esi
	jle	.L6
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %ecx
	movl	12(%rsp), %edx
	movl	%ecx, %esi
	movl	%edx, %eax
	subl	%edx, %esi
	subl	%ecx, %eax
	cmpl	%edx, %ecx
	cmovg	%esi, %eax
	movl	8(%rsp), %esi
	addl	$1, %r12d
	addq	$4, %rbx
	movl	%eax, -4(%rbx)
	cmpl	%r12d, %esi
	jg	.L9
	movl	16(%rsp), %eax
	cmpl	$1, %esi
	je	.L23
.L10:
	movl	20(%rsp), %edx
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L12
	cmpl	$2, %esi
	jle	.L13
	leal	-3(%rsi), %eax
	leaq	24(%rsp), %rcx
	leaq	28(%rsp,%rax,4), %rsi
	.p2align 4,,10
	.p2align 3
.L15:
	movl	(%rcx), %edx
	movl	%r8d, %eax
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L14
	addq	$4, %rcx
	cmpq	%rsi, %rcx
	jne	.L15
.L13:
	movl	%r8d, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L11:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$400032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	movl	%eax, %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
.L6:
	movl	16(%rsp), %eax
	leaq	.LC1(%rip), %rbp
	jmp	.L10
.L24:
	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%b){return gcd(b,a%b);}
	else{return b;}
}
int main(void){
	int n,m,i,ans;
	int x[100000];
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++){
		scanf("%d",&x[i]);
		x[i]=m<x[i]?x[i]-m:m-x[i];
	}
	if(n==1){printf("%d",x[0]);}
	else{
		ans=gcd(x[0],x[1]);
		for(i=2;i<n;i++){
			ans=gcd(ans,x[i]);
		}
		printf("%d",ans);
	}
	return 0;
}
3 81
33 79 57
 1 1
1010000000
 3 81
33 70 57
 1 1
1010000100
 3 81
33 42 57
 1 0
1010000100
 1 0
1010010100
 1 1
1010010100
 1 1
1000000100
 1 0
1010000000

2 1009999999 1 1010000099 3 1010000100 1010010100 1010010099 1000000099 1010000000
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%b){return gcd(b,a%b);}
	else{return b;}
}
int main(void){
	int n,m,i,ans;
	int x[100000];
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++){
		scanf("%d",&x[i]);
		x[i]=m<x[i]?x[i]-m:m-x[i];
	}
	if(n==1){printf("%d",x[0]);}
	else{
		ans=gcd(x[0],x[1]);
		for(i=2;i<n;i++){
			ans=gcd(ans,x[i]);
		}
		printf("%d",ans);
	}
	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
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L2
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400028(%rbp), %rdx
	leaq	-400032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400024(%rbp)
	jmp	.L5
.L8:
	leaq	-400016(%rbp), %rdx
	movl	-400024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400028(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L6
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	-400028(%rbp), %edx
	subl	%edx, %eax
	jmp	.L7
.L6:
	movl	-400028(%rbp), %edx
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L7:
	movl	-400024(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400016(%rbp,%rdx,4)
	addl	$1, -400024(%rbp)
.L5:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400024(%rbp)
	jl	.L8
	movl	-400032(%rbp), %eax
	cmpl	$1, %eax
	jne	.L9
	movl	-400016(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L9:
	movl	-400012(%rbp), %edx
	movl	-400016(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -400020(%rbp)
	movl	$2, -400024(%rbp)
	jmp	.L11
.L12:
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400020(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -400020(%rbp)
	addl	$1, -400024(%rbp)
.L11:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400024(%rbp)
	jl	.L12
	movl	-400020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.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
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L2
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	jmp	.L3
.L2:
	movl	-8(%rbp), %eax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2720, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-400028(%rbp), %rdx
	leaq	-400032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400024(%rbp)
	jmp	.L5
.L8:
	leaq	-400016(%rbp), %rdx
	movl	-400024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400028(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L6
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	-400028(%rbp), %edx
	subl	%edx, %eax
	jmp	.L7
.L6:
	movl	-400028(%rbp), %edx
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L7:
	movl	-400024(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400016(%rbp,%rdx,4)
	addl	$1, -400024(%rbp)
.L5:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400024(%rbp)
	jl	.L8
	movl	-400032(%rbp), %eax
	cmpl	$1, %eax
	jne	.L9
	movl	-400016(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L9:
	movl	-400012(%rbp), %edx
	movl	-400016(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -400020(%rbp)
	movl	$2, -400024(%rbp)
	jmp	.L11
.L12:
	movl	-400024(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-400020(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -400020(%rbp)
	addl	$1, -400024(%rbp)
.L11:
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400024(%rbp)
	jl	.L12
	movl	-400020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.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:
