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>

long long gcd(long long a, long long b)
{
	if (a > b) {
		a ^= b;
		b ^= a;
		a ^= b;
	}
	if (b % a == 0) return a;
	else return gcd(b % a, a);
}

int main()
{
	int i, N;
	long long M, a[100001];
	scanf("%d %lld", &N, &M);
	for (i = 1; i <= N; i++) scanf("%lld", &(a[i]));
	
	long long g = a[1], l, b;
	for (i = 2; i <= N; i++) g = gcd(g, a[i]);
	for (b = 2; (g & b) == 0; b <<= 1);
	for (i = 1, l = b >> 1; i <= N; i++) {
		a[i] /= b;
		if (a[i] % 2 == 0) break;
		l *= a[i] / gcd(a[i], l);
		if (l > M) break;
	}
	
	if (i <= N) printf("0\n");
	else printf("%lld\n", (M + l) / l / 2);
	fflush(stdout);
	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
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jle	.L2
	movq	-16(%rbp), %rax
	xorq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	xorq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	xorq	%rax, -8(%rbp)
.L2:
	movq	-16(%rbp), %rax
	cqto
	idivq	-8(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	-8(%rbp), %rax
	jmp	.L4
.L3:
	movq	-16(%rbp), %rax
	cqto
	idivq	-8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	gcd
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"0"
.LC3:
	.string	"%lld\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	%rbx
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1352, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-800064(%rbp), %rdx
	leaq	-800072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -800068(%rbp)
	jmp	.L6
.L7:
	leaq	-800032(%rbp), %rdx
	movl	-800068(%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, -800068(%rbp)
.L6:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jle	.L7
	movq	-800024(%rbp), %rax
	movq	%rax, -800056(%rbp)
	movl	$2, -800068(%rbp)
	jmp	.L8
.L9:
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rdx
	movq	-800056(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, -800056(%rbp)
	addl	$1, -800068(%rbp)
.L8:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jle	.L9
	movq	$2, -800040(%rbp)
	jmp	.L10
.L11:
	salq	-800040(%rbp)
.L10:
	movq	-800056(%rbp), %rax
	andq	-800040(%rbp), %rax
	testq	%rax, %rax
	je	.L11
	movl	$1, -800068(%rbp)
	movq	-800040(%rbp), %rax
	sarq	%rax
	movq	%rax, -800048(%rbp)
	jmp	.L12
.L16:
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rax
	cqto
	idivq	-800040(%rbp)
	movq	%rax, %rdx
	movl	-800068(%rbp), %eax
	cltq
	movq	%rdx, -800032(%rbp,%rax,8)
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L21
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rbx
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rax
	movq	-800048(%rbp), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	movq	-800048(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -800048(%rbp)
	movq	-800064(%rbp), %rax
	cmpq	%rax, -800048(%rbp)
	jg	.L22
	addl	$1, -800068(%rbp)
.L12:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jle	.L16
	jmp	.L14
.L21:
	nop
	jmp	.L14
.L22:
	nop
.L14:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jg	.L17
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L18
.L17:
	movq	-800064(%rbp), %rdx
	movq	-800048(%rbp), %rax
	addq	%rdx, %rax
	cqto
	idivq	-800048(%rbp)
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L18:
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	movq	-8(%rbp), %rbx
	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
	movq	%rsi, %r8
	.p2align 4,,10
	.p2align 3
.L3:
	cmpq	%rdi, %r8
	jl	.L2
	movq	%r8, %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
.L2:
	movq	%rdi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rdi
	testq	%rdx, %rdx
	jne	.L3
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"0"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L7
	leaq	24(%rsp), %rbx
	movl	$1, %ebp
	leaq	.LC1(%rip), %r13
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$8, %r12
	cmpl	%ebp, %r8d
	jge	.L8
	movq	24(%rsp), %rcx
	cmpl	$1, %r8d
	jle	.L9
	leal	-2(%r8), %eax
	leaq	32(%rsp), %rsi
	leaq	40(%rsp,%rax,8), %rdi
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rcx, %rdx
	movq	(%rsi), %rcx
	.p2align 4,,10
	.p2align 3
.L11:
	cmpq	%rdx, %rcx
	jl	.L10
	movq	%rcx, %rax
	movq	%rdx, %rcx
	movq	%rax, %rdx
.L10:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L11
	addq	$8, %rsi
	cmpq	%rdi, %rsi
	jne	.L12
	movl	$2, %edi
	movl	$1, %r9d
	testb	$2, %cl
	jne	.L23
.L22:
	movl	$2, %edi
	.p2align 4,,10
	.p2align 3
.L15:
	addq	%rdi, %rdi
	testq	%rcx, %rdi
	je	.L15
.L14:
	movq	%rdi, %r9
	movq	8(%rsp), %r11
	sarq	%r9
	testl	%r8d, %r8d
	jle	.L16
	leaq	24(%rsp), %rbx
.L23:
	movq	8(%rsp), %r11
	movl	$1, %r10d
	.p2align 4,,10
	.p2align 3
.L20:
	movq	(%rbx), %rax
	cqto
	idivq	%rdi
	movq	%rax, (%rbx)
	movq	%rax, %rsi
	testb	$1, %al
	je	.L17
	movq	%r9, %rcx
	movq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L19:
	cmpq	%rdx, %rcx
	jl	.L18
	movq	%rcx, %rax
	movq	%rdx, %rcx
	movq	%rax, %rdx
.L18:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L19
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	imulq	%rax, %r9
	cmpq	%r9, %r11
	jl	.L17
	addl	$1, %r10d
	addq	$8, %rbx
	cmpl	%r8d, %r10d
	jle	.L20
.L16:
	leaq	(%r9,%r11), %rax
	movl	$2, %ecx
	movl	$1, %edi
	cqto
	leaq	.LC3(%rip), %rsi
	idivq	%r9
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L21:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$800040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	cmpl	%r8d, %r10d
	jg	.L16
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L21
.L7:
	movq	24(%rsp), %rcx
.L9:
	testb	$2, %cl
	je	.L22
	movl	$2, %edi
	jmp	.L14
.L45:
	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
	movq	%rsi, %r8
	.p2align 4,,10
	.p2align 3
.L3:
	cmpq	%rdi, %r8
	jl	.L2
	movq	%r8, %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
.L2:
	movq	%rdi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rdi
	testq	%rdx, %rdx
	jne	.L3
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"0"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L7
	leaq	24(%rsp), %rbx
	movl	$1, %ebp
	leaq	.LC1(%rip), %r13
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	addq	$8, %r12
	cmpl	%ebp, %r8d
	jge	.L8
	movq	24(%rsp), %rcx
	cmpl	$1, %r8d
	jle	.L9
	leal	-2(%r8), %eax
	leaq	32(%rsp), %rsi
	leaq	40(%rsp,%rax,8), %rdi
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rcx, %rdx
	movq	(%rsi), %rcx
	.p2align 4,,10
	.p2align 3
.L11:
	cmpq	%rdx, %rcx
	jl	.L10
	movq	%rcx, %rax
	movq	%rdx, %rcx
	movq	%rax, %rdx
.L10:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L11
	addq	$8, %rsi
	cmpq	%rdi, %rsi
	jne	.L12
	movl	$2, %edi
	movl	$1, %r9d
	testb	$2, %cl
	jne	.L23
.L22:
	movl	$2, %edi
	.p2align 4,,10
	.p2align 3
.L15:
	addq	%rdi, %rdi
	testq	%rcx, %rdi
	je	.L15
.L14:
	movq	%rdi, %r9
	movq	8(%rsp), %r11
	sarq	%r9
	testl	%r8d, %r8d
	jle	.L16
	leaq	24(%rsp), %rbx
.L23:
	movq	8(%rsp), %r11
	movl	$1, %r10d
	.p2align 4,,10
	.p2align 3
.L20:
	movq	(%rbx), %rax
	cqto
	idivq	%rdi
	movq	%rax, (%rbx)
	movq	%rax, %rsi
	testb	$1, %al
	je	.L17
	movq	%r9, %rcx
	movq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L19:
	cmpq	%rdx, %rcx
	jl	.L18
	movq	%rcx, %rax
	movq	%rdx, %rcx
	movq	%rax, %rdx
.L18:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L19
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	imulq	%rax, %r9
	cmpq	%r9, %r11
	jl	.L17
	addl	$1, %r10d
	addq	$8, %rbx
	cmpl	%r8d, %r10d
	jle	.L20
.L16:
	leaq	(%r9,%r11), %rax
	movl	$2, %ecx
	movl	$1, %edi
	cqto
	leaq	.LC3(%rip), %rsi
	idivq	%r9
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L21:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L45
	addq	$800040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L17:
	.cfi_restore_state
	cmpl	%r8d, %r10d
	jg	.L16
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L21
.L7:
	movq	24(%rsp), %rcx
.L9:
	testb	$2, %cl
	je	.L22
	movl	$2, %edi
	jmp	.L14
.L45:
	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>

long long gcd(long long a, long long b)
{
	if (a > b) {
		a ^= b;
		b ^= a;
		a ^= b;
	}
	if (b % a == 0) return a;
	else return gcd(b % a, a);
}

int main()
{
	int i, N;
	long long M, a[100001];
	scanf("%d %lld", &N, &M);
	for (i = 1; i <= N; i++) scanf("%lld", &(a[i]));
	
	long long g = a[1], l, b;
	for (i = 2; i <= N; i++) g = gcd(g, a[i]);
	for (b = 2; (g & b) == 0; b <<= 1);
	for (i = 1, l = b >> 1; i <= N; i++) {
		a[i] /= b;
		if (a[i] % 2 == 0) break;
		l *= a[i] / gcd(a[i], l);
		if (l > M) break;
	}
	
	if (i <= N) printf("0\n");
	else printf("%lld\n", (M + l) / l / 2);
	fflush(stdout);
	return 0;
}
3 000
14 22 40
 2 46
6 10
 2 46
10 10
 2 12
10 10
 2 85
6 10
 3 101
14 2 2
 3 000
14 16 40
 3 010
14 16 40
 3 010
14 16 4
 3 110
14 16 4

0
 2
 5
 1
 3
 7
 0
 0
 0
 0

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>

long long gcd(long long a, long long b)
{
	if (a > b) {
		a ^= b;
		b ^= a;
		a ^= b;
	}
	if (b % a == 0) return a;
	else return gcd(b % a, a);
}

int main()
{
	int i, N;
	long long M, a[100001];
	scanf("%d %lld", &N, &M);
	for (i = 1; i <= N; i++) scanf("%lld", &(a[i]));
	
	long long g = a[1], l, b;
	for (i = 2; i <= N; i++) g = gcd(g, a[i]);
	for (b = 2; (g & b) == 0; b <<= 1);
	for (i = 1, l = b >> 1; i <= N; i++) {
		a[i] /= b;
		if (a[i] % 2 == 0) break;
		l *= a[i] / gcd(a[i], l);
		if (l > M) break;
	}
	
	if (i <= N) printf("0\n");
	else printf("%lld\n", (M + l) / l / 2);
	fflush(stdout);
	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
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jle	.L2
	movq	-16(%rbp), %rax
	xorq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	xorq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	xorq	%rax, -8(%rbp)
.L2:
	movq	-16(%rbp), %rax
	cqto
	idivq	-8(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	-8(%rbp), %rax
	jmp	.L4
.L3:
	movq	-16(%rbp), %rax
	cqto
	idivq	-8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	gcd
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"0"
.LC3:
	.string	"%lld\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	%rbx
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1352, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-800064(%rbp), %rdx
	leaq	-800072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -800068(%rbp)
	jmp	.L6
.L7:
	leaq	-800032(%rbp), %rdx
	movl	-800068(%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, -800068(%rbp)
.L6:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jle	.L7
	movq	-800024(%rbp), %rax
	movq	%rax, -800056(%rbp)
	movl	$2, -800068(%rbp)
	jmp	.L8
.L9:
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rdx
	movq	-800056(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, -800056(%rbp)
	addl	$1, -800068(%rbp)
.L8:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jle	.L9
	movq	$2, -800040(%rbp)
	jmp	.L10
.L11:
	salq	-800040(%rbp)
.L10:
	movq	-800056(%rbp), %rax
	andq	-800040(%rbp), %rax
	testq	%rax, %rax
	je	.L11
	movl	$1, -800068(%rbp)
	movq	-800040(%rbp), %rax
	sarq	%rax
	movq	%rax, -800048(%rbp)
	jmp	.L12
.L16:
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rax
	cqto
	idivq	-800040(%rbp)
	movq	%rax, %rdx
	movl	-800068(%rbp), %eax
	cltq
	movq	%rdx, -800032(%rbp,%rax,8)
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L21
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rbx
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rax
	movq	-800048(%rbp), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	movq	-800048(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -800048(%rbp)
	movq	-800064(%rbp), %rax
	cmpq	%rax, -800048(%rbp)
	jg	.L22
	addl	$1, -800068(%rbp)
.L12:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jle	.L16
	jmp	.L14
.L21:
	nop
	jmp	.L14
.L22:
	nop
.L14:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jg	.L17
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L18
.L17:
	movq	-800064(%rbp), %rdx
	movq	-800048(%rbp), %rax
	addq	%rdx, %rax
	cqto
	idivq	-800048(%rbp)
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L18:
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	movq	-8(%rbp), %rbx
	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
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jle	.L2
	movq	-16(%rbp), %rax
	xorq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	xorq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	xorq	%rax, -8(%rbp)
.L2:
	movq	-16(%rbp), %rax
	cqto
	idivq	-8(%rbp)
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	-8(%rbp), %rax
	jmp	.L4
.L3:
	movq	-16(%rbp), %rax
	cqto
	idivq	-8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	gcd
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"0"
.LC3:
	.string	"%lld\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	%rbx
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1352, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-800064(%rbp), %rdx
	leaq	-800072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -800068(%rbp)
	jmp	.L6
.L7:
	leaq	-800032(%rbp), %rdx
	movl	-800068(%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, -800068(%rbp)
.L6:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jle	.L7
	movq	-800024(%rbp), %rax
	movq	%rax, -800056(%rbp)
	movl	$2, -800068(%rbp)
	jmp	.L8
.L9:
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rdx
	movq	-800056(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, -800056(%rbp)
	addl	$1, -800068(%rbp)
.L8:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jle	.L9
	movq	$2, -800040(%rbp)
	jmp	.L10
.L11:
	salq	-800040(%rbp)
.L10:
	movq	-800056(%rbp), %rax
	andq	-800040(%rbp), %rax
	testq	%rax, %rax
	je	.L11
	movl	$1, -800068(%rbp)
	movq	-800040(%rbp), %rax
	sarq	%rax
	movq	%rax, -800048(%rbp)
	jmp	.L12
.L16:
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rax
	cqto
	idivq	-800040(%rbp)
	movq	%rax, %rdx
	movl	-800068(%rbp), %eax
	cltq
	movq	%rdx, -800032(%rbp,%rax,8)
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L21
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rbx
	movl	-800068(%rbp), %eax
	cltq
	movq	-800032(%rbp,%rax,8), %rax
	movq	-800048(%rbp), %rdx
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	gcd
	movq	%rax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	movq	-800048(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -800048(%rbp)
	movq	-800064(%rbp), %rax
	cmpq	%rax, -800048(%rbp)
	jg	.L22
	addl	$1, -800068(%rbp)
.L12:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jle	.L16
	jmp	.L14
.L21:
	nop
	jmp	.L14
.L22:
	nop
.L14:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jg	.L17
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L18
.L17:
	movq	-800064(%rbp), %rdx
	movq	-800048(%rbp), %rax
	addq	%rdx, %rax
	cqto
	idivq	-800048(%rbp)
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L18:
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	movq	-8(%rbp), %rbx
	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:
