Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
long long int gcd(long long int a, long long int b)
{
	long long int r = a % b;
	while (r > 0)
	{
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}
int main()
{
	long long int n, m;
	scanf("%lld %lld", &n, &m);
	long long int i;
	long long int a[100005];
	for (i = 0; i < n; i++)
	{
		scanf("%lld", &a[i]);
		a[i] /= 2;
	}
	long long int l = a[0];
	for (i = 0; i < n; i++)
		l = l / gcd(l, a[i]) * a[i];
	for (i = 0; i < n; i++)
	{
		if (l / a[i] % 2 == 0)
		{
			printf("0\n");
			return 0;
		}
	}
	printf("%lld\n", (m / l + 1) / 2);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rsi, %rax
	movq	%rdx, %r8
	cqto
	movq	%r8, %rsi
	idivq	%r8
	testq	%rdx, %rdx
	jg	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %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	$1352, %rsp
	.cfi_def_cfa_offset 800112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, (%rsp)
	jle	.L8
	leaq	16(%rsp), %rbx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	movq	%rbx, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	0(%rbp), %rdx
	movq	(%rsp), %r9
	addq	$8, %rbp
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	cmpq	%r13, %r9
	jg	.L9
	movq	16(%rsp), %rsi
	testq	%r9, %r9
	jle	.L18
	cmpq	$1, %r9
	je	.L11
	leaq	24(%rsp), %r8
	leaq	(%rbx,%r9,8), %r10
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rsi, %rax
	movq	(%r8), %rdi
	cqto
	idivq	%rdi
	testq	%rdx, %rdx
	jle	.L20
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rdx, %rcx
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jg	.L13
.L12:
	movq	%rsi, %rax
	addq	$8, %r8
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	imulq	%rdi, %rsi
	cmpq	%r10, %r8
	jne	.L14
.L11:
	xorl	%ecx, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rcx
	cmpq	%rcx, %r9
	je	.L18
.L17:
	movq	%rsi, %rax
	cqto
	idivq	(%rbx,%rcx,8)
	testb	$1, %al
	jne	.L15
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L16
.L8:
	movq	16(%rsp), %rsi
.L18:
	movq	8(%rsp), %rax
	movl	$2, %ecx
	movl	$1, %edi
	cqto
	idivq	%rsi
	leaq	.LC3(%rip), %rsi
	addq	$1, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$800072, %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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
.L20:
	movq	%rdi, %rcx
	jmp	.L12
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rsi, %rax
	movq	%rdx, %r8
	cqto
	movq	%r8, %rsi
	idivq	%r8
	testq	%rdx, %rdx
	jg	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %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	$1352, %rsp
	.cfi_def_cfa_offset 800112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, (%rsp)
	jle	.L8
	leaq	16(%rsp), %rbx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	movq	%rbx, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	0(%rbp), %rdx
	movq	(%rsp), %r9
	addq	$8, %rbp
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	cmpq	%r13, %r9
	jg	.L9
	movq	16(%rsp), %rsi
	testq	%r9, %r9
	jle	.L18
	cmpq	$1, %r9
	je	.L11
	leaq	24(%rsp), %r8
	leaq	(%rbx,%r9,8), %r10
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rsi, %rax
	movq	(%r8), %rdi
	cqto
	idivq	%rdi
	testq	%rdx, %rdx
	jle	.L20
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rdx, %rcx
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jg	.L13
.L12:
	movq	%rsi, %rax
	addq	$8, %r8
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	imulq	%rdi, %rsi
	cmpq	%r10, %r8
	jne	.L14
.L11:
	xorl	%ecx, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rcx
	cmpq	%rcx, %r9
	je	.L18
.L17:
	movq	%rsi, %rax
	cqto
	idivq	(%rbx,%rcx,8)
	testb	$1, %al
	jne	.L15
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L16
.L8:
	movq	16(%rsp), %rsi
.L18:
	movq	8(%rsp), %rax
	movl	$2, %ecx
	movl	$1, %edi
	cqto
	idivq	%rsi
	leaq	.LC3(%rip), %rsi
	addq	$1, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$800072, %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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
.L20:
	movq	%rdi, %rcx
	jmp	.L12
	.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
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rsi, %rax
	movq	%rdx, %r8
	cqto
	movq	%r8, %rsi
	idivq	%r8
	testq	%rdx, %rdx
	jg	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %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	$1352, %rsp
	.cfi_def_cfa_offset 800112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, (%rsp)
	jle	.L8
	leaq	16(%rsp), %rbx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	movq	%rbx, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	0(%rbp), %rdx
	movq	(%rsp), %r9
	addq	$8, %rbp
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	cmpq	%r13, %r9
	jg	.L9
	movq	16(%rsp), %rsi
	testq	%r9, %r9
	jle	.L18
	cmpq	$1, %r9
	je	.L11
	leaq	24(%rsp), %r8
	leaq	(%rbx,%r9,8), %r10
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rsi, %rax
	movq	(%r8), %rdi
	cqto
	idivq	%rdi
	testq	%rdx, %rdx
	jle	.L20
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rdx, %rcx
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jg	.L13
.L12:
	movq	%rsi, %rax
	addq	$8, %r8
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	imulq	%rdi, %rsi
	cmpq	%r10, %r8
	jne	.L14
.L11:
	xorl	%ecx, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rcx
	cmpq	%rcx, %r9
	je	.L18
.L17:
	movq	%rsi, %rax
	cqto
	idivq	(%rbx,%rcx,8)
	testb	$1, %al
	jne	.L15
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L16
.L8:
	movq	16(%rsp), %rsi
.L18:
	movq	8(%rsp), %rax
	movl	$2, %ecx
	movl	$1, %edi
	cqto
	idivq	%rsi
	leaq	.LC3(%rip), %rsi
	addq	$1, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$800072, %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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
.L20:
	movq	%rdi, %rcx
	jmp	.L12
	.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:
```
```c
#include<stdio.h>
long long int gcd(long long int a, long long int b)
{
	long long int r = a % b;
	while (r > 0)
	{
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}
int main()
{
	long long int n, m;
	scanf("%lld %lld", &n, &m);
	long long int i;
	long long int a[100005];
	for (i = 0; i < n; i++)
	{
		scanf("%lld", &a[i]);
		a[i] /= 2;
	}
	long long int l = a[0];
	for (i = 0; i < n; i++)
		l = l / gcd(l, a[i]) * a[i];
	for (i = 0; i < n; i++)
	{
		if (l / a[i] % 2 == 0)
		{
			printf("0\n");
			return 0;
		}
	}
	printf("%lld\n", (m / l + 1) / 2);
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
long long int gcd(long long int a, long long int b)
{
	long long int r = a % b;
	while (r > 0)
	{
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}
int main()
{
	long long int n, m;
	scanf("%lld %lld", &n, &m);
	long long int i;
	long long int a[100005];
	for (i = 0; i < n; i++)
	{
		scanf("%lld", &a[i]);
		a[i] /= 2;
	}
	long long int l = a[0];
	for (i = 0; i < n; i++)
		l = l / gcd(l, a[i]) * a[i];
	for (i = 0; i < n; i++)
	{
		if (l / a[i] % 2 == 0)
		{
			printf("0\n");
			return 0;
		}
	}
	printf("%lld\n", (m / l + 1) / 2);
	return 0;
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
long long int gcd(long long int a, long long int b)
{
	long long int r = a % b;
	while (r > 0)
	{
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}
int main()
{
	long long int n, m;
	scanf("%lld %lld", &n, &m);
	long long int i;
	long long int a[100005];
	for (i = 0; i < n; i++)
	{
		scanf("%lld", &a[i]);
		a[i] /= 2;
	}
	long long int l = a[0];
	for (i = 0; i < n; i++)
		l = l / gcd(l, a[i]) * a[i];
	for (i = 0; i < n; i++)
	{
		if (l / a[i] % 2 == 0)
		{
			printf("0\n");
			return 0;
		}
	}
	printf("%lld\n", (m / l + 1) / 2);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rsi, %rax
	movq	%rdx, %r8
	cqto
	movq	%r8, %rsi
	idivq	%r8
	testq	%rdx, %rdx
	jg	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %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	$1352, %rsp
	.cfi_def_cfa_offset 800112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, (%rsp)
	jle	.L8
	leaq	16(%rsp), %rbx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	movq	%rbx, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	0(%rbp), %rdx
	movq	(%rsp), %r9
	addq	$8, %rbp
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	cmpq	%r13, %r9
	jg	.L9
	movq	16(%rsp), %rsi
	testq	%r9, %r9
	jle	.L18
	cmpq	$1, %r9
	je	.L11
	leaq	24(%rsp), %r8
	leaq	(%rbx,%r9,8), %r10
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rsi, %rax
	movq	(%r8), %rdi
	cqto
	idivq	%rdi
	testq	%rdx, %rdx
	jle	.L20
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rdx, %rcx
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jg	.L13
.L12:
	movq	%rsi, %rax
	addq	$8, %r8
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	imulq	%rdi, %rsi
	cmpq	%r10, %r8
	jne	.L14
.L11:
	xorl	%ecx, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rcx
	cmpq	%rcx, %r9
	je	.L18
.L17:
	movq	%rsi, %rax
	cqto
	idivq	(%rbx,%rcx,8)
	testb	$1, %al
	jne	.L15
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L16
.L8:
	movq	16(%rsp), %rsi
.L18:
	movq	8(%rsp), %rax
	movl	$2, %ecx
	movl	$1, %edi
	cqto
	idivq	%rsi
	leaq	.LC3(%rip), %rsi
	addq	$1, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$800072, %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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
.L20:
	movq	%rdi, %rcx
	jmp	.L12
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rsi, %rax
	movq	%rdx, %r8
	cqto
	movq	%r8, %rsi
	idivq	%r8
	testq	%rdx, %rdx
	jg	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %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	$1352, %rsp
	.cfi_def_cfa_offset 800112
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, (%rsp)
	jle	.L8
	leaq	16(%rsp), %rbx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	movq	%rbx, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r13
	call	__isoc99_scanf@PLT
	movq	0(%rbp), %rdx
	movq	(%rsp), %r9
	addq	$8, %rbp
	movq	%rdx, %rax
	shrq	$63, %rax
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, -8(%rbp)
	cmpq	%r13, %r9
	jg	.L9
	movq	16(%rsp), %rsi
	testq	%r9, %r9
	jle	.L18
	cmpq	$1, %r9
	je	.L11
	leaq	24(%rsp), %r8
	leaq	(%rbx,%r9,8), %r10
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%rsi, %rax
	movq	(%r8), %rdi
	cqto
	idivq	%rdi
	testq	%rdx, %rdx
	jle	.L20
	movq	%rdi, %rax
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rdx, %rcx
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	testq	%rdx, %rdx
	jg	.L13
.L12:
	movq	%rsi, %rax
	addq	$8, %r8
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	imulq	%rdi, %rsi
	cmpq	%r10, %r8
	jne	.L14
.L11:
	xorl	%ecx, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rcx
	cmpq	%rcx, %r9
	je	.L18
.L17:
	movq	%rsi, %rax
	cqto
	idivq	(%rbx,%rcx,8)
	testb	$1, %al
	jne	.L15
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L16
.L8:
	movq	16(%rsp), %rsi
.L18:
	movq	8(%rsp), %rax
	movl	$2, %ecx
	movl	$1, %edi
	cqto
	idivq	%rsi
	leaq	.LC3(%rip), %rsi
	addq	$1, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$800072, %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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
.L20:
	movq	%rdi, %rcx
	jmp	.L12
	.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:
```