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>

int gcd(int x,int y)
{
	int r;
	if(y>x){
		r=x;
		x=y;
		y=r;
	}
	while(y>0){
		r=x%y;
		x=y;
		y=r;
	}
	return x;
}

int lcm(int x,int y)
{
	return x*y/gcd(x,y);
}

int main(void)
{
	int n,a[10],i;
	scanf("%d",&n);
	for(i=0;i<n;++i)scanf("%d",&a[i]);
	for(i=1;i<n;++i)a[i]=lcm(a[i-1],a[i]);
	printf("%d\n",a[i-1]);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	cmpl	%edi, %esi
	jle	.L2
	movl	%esi, %eax
	movl	%edi, %edx
.L2:
	testl	%edx, %edx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jg	.L4
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%eax, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %edx
	movl	%edi, %esi
	imull	%edx, %esi
	cmpl	%edx, %edi
	jge	.L9
	movl	%edi, %eax
	movl	%edx, %edi
	movl	%eax, %edx
.L9:
	testl	%edx, %edx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edi, %eax
	movl	%edx, %edi
	cltd
	idivl	%edi
	testl	%edx, %edx
	jg	.L11
	movl	%esi, %eax
	cltd
	idivl	%edi
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	lcm, .-lcm
	.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:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L16
	movl	16(%rsp), %r8d
	cmpl	$1, %eax
	jle	.L17
	subl	$2, %eax
	leaq	20(%rsp), %rdi
	leaq	24(%rsp,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L21:
	movl	(%rdi), %r8d
	movl	-4(%rdi), %ecx
	movl	%r8d, %r9d
	imull	%ecx, %r9d
	cmpl	%ecx, %r8d
	jle	.L18
	movl	%ecx, %eax
	movl	%r8d, %ecx
	movl	%eax, %r8d
.L18:
	testl	%r8d, %r8d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%ecx, %eax
	movl	%r8d, %esi
	cltd
	movl	%esi, %ecx
	idivl	%r8d
	movl	%edx, %r8d
	testl	%edx, %edx
	jg	.L20
	movl	%r9d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r8d
.L19:
	movl	%r8d, (%rdi)
	addq	$4, %rdi
	cmpq	%rdi, %r10
	jne	.L21
.L17:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$64, %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
.L15:
	.cfi_restore_state
	movl	16(%rsp), %r8d
	jmp	.L17
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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
	movl	%edi, %eax
	movl	%esi, %edx
	cmpl	%edi, %esi
	jle	.L2
	movl	%esi, %eax
	movl	%edi, %edx
.L2:
	testl	%edx, %edx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jg	.L4
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%eax, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %edx
	movl	%edi, %esi
	imull	%edx, %esi
	cmpl	%edx, %edi
	jge	.L9
	movl	%edi, %eax
	movl	%edx, %edi
	movl	%eax, %edx
.L9:
	testl	%edx, %edx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edi, %eax
	movl	%edx, %edi
	cltd
	idivl	%edi
	testl	%edx, %edx
	jg	.L11
	movl	%esi, %eax
	cltd
	idivl	%edi
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	lcm, .-lcm
	.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:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L16
	movl	16(%rsp), %r8d
	cmpl	$1, %eax
	jle	.L17
	subl	$2, %eax
	leaq	20(%rsp), %rdi
	leaq	24(%rsp,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L21:
	movl	(%rdi), %r8d
	movl	-4(%rdi), %ecx
	movl	%r8d, %r9d
	imull	%ecx, %r9d
	cmpl	%ecx, %r8d
	jle	.L18
	movl	%ecx, %eax
	movl	%r8d, %ecx
	movl	%eax, %r8d
.L18:
	testl	%r8d, %r8d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%ecx, %eax
	movl	%r8d, %esi
	cltd
	movl	%esi, %ecx
	idivl	%r8d
	movl	%edx, %r8d
	testl	%edx, %edx
	jg	.L20
	movl	%r9d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r8d
.L19:
	movl	%r8d, (%rdi)
	addq	$4, %rdi
	cmpq	%rdi, %r10
	jne	.L21
.L17:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$64, %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
.L15:
	.cfi_restore_state
	movl	16(%rsp), %r8d
	jmp	.L17
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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
	movl	%edi, %eax
	movl	%esi, %edx
	cmpl	%edi, %esi
	jle	.L2
	movl	%esi, %eax
	movl	%edi, %edx
.L2:
	testl	%edx, %edx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jg	.L4
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%eax, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %edx
	movl	%edi, %esi
	imull	%edx, %esi
	cmpl	%edx, %edi
	jge	.L9
	movl	%edi, %eax
	movl	%edx, %edi
	movl	%eax, %edx
.L9:
	testl	%edx, %edx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edi, %eax
	movl	%edx, %edi
	cltd
	idivl	%edi
	testl	%edx, %edx
	jg	.L11
	movl	%esi, %eax
	cltd
	idivl	%edi
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	lcm, .-lcm
	.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:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L16
	movl	16(%rsp), %r8d
	cmpl	$1, %eax
	jle	.L17
	subl	$2, %eax
	leaq	20(%rsp), %rdi
	leaq	24(%rsp,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L21:
	movl	(%rdi), %r8d
	movl	-4(%rdi), %ecx
	movl	%r8d, %r9d
	imull	%ecx, %r9d
	cmpl	%ecx, %r8d
	jle	.L18
	movl	%ecx, %eax
	movl	%r8d, %ecx
	movl	%eax, %r8d
.L18:
	testl	%r8d, %r8d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%ecx, %eax
	movl	%r8d, %esi
	cltd
	movl	%esi, %ecx
	idivl	%r8d
	movl	%edx, %r8d
	testl	%edx, %edx
	jg	.L20
	movl	%r9d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r8d
.L19:
	movl	%r8d, (%rdi)
	addq	$4, %rdi
	cmpq	%rdi, %r10
	jne	.L21
.L17:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$64, %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
.L15:
	.cfi_restore_state
	movl	16(%rsp), %r8d
	jmp	.L17
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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>

int gcd(int x,int y)
{
	int r;
	if(y>x){
		r=x;
		x=y;
		y=r;
	}
	while(y>0){
		r=x%y;
		x=y;
		y=r;
	}
	return x;
}

int lcm(int x,int y)
{
	return x*y/gcd(x,y);
}

int main(void)
{
	int n,a[10],i;
	scanf("%d",&n);
	for(i=0;i<n;++i)scanf("%d",&a[i]);
	for(i=1;i<n;++i)a[i]=lcm(a[i-1],a[i]);
	printf("%d\n",a[i-1]);
	return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int gcd(int x,int y)
{
	int r;
	if(y>x){
		r=x;
		x=y;
		y=r;
	}
	while(y>0){
		r=x%y;
		x=y;
		y=r;
	}
	return x;
}

int lcm(int x,int y)
{
	return x*y/gcd(x,y);
}

int main(void)
{
	int n,a[10],i;
	scanf("%d",&n);
	for(i=0;i<n;++i)scanf("%d",&a[i]);
	for(i=1;i<n;++i)a[i]=lcm(a[i-1],a[i]);
	printf("%d\n",a[i-1]);
	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:

4
1 2 5 5
 3
3 4 3
 4
1 2 5 7
 3
3 7 3
 4
1 2 1 7
 3
3 10 3
 3
3 13 3
 4
1 2 2 11
 3
6 13 3
 3
4 13 3

10
 12
 70
 21
 14
 30
 39
 22
 78
 156

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>

int gcd(int x,int y)
{
	int r;
	if(y>x){
		r=x;
		x=y;
		y=r;
	}
	while(y>0){
		r=x%y;
		x=y;
		y=r;
	}
	return x;
}

int lcm(int x,int y)
{
	return x*y/gcd(x,y);
}

int main(void)
{
	int n,a[10],i;
	scanf("%d",&n);
	for(i=0;i<n;++i)scanf("%d",&a[i]);
	for(i=1;i<n;++i)a[i]=lcm(a[i-1],a[i]);
	printf("%d\n",a[i-1]);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	cmpl	%edi, %esi
	jle	.L2
	movl	%esi, %eax
	movl	%edi, %edx
.L2:
	testl	%edx, %edx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jg	.L4
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%eax, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %edx
	movl	%edi, %esi
	imull	%edx, %esi
	cmpl	%edx, %edi
	jge	.L9
	movl	%edi, %eax
	movl	%edx, %edi
	movl	%eax, %edx
.L9:
	testl	%edx, %edx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edi, %eax
	movl	%edx, %edi
	cltd
	idivl	%edi
	testl	%edx, %edx
	jg	.L11
	movl	%esi, %eax
	cltd
	idivl	%edi
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	lcm, .-lcm
	.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:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L16
	movl	16(%rsp), %r8d
	cmpl	$1, %eax
	jle	.L17
	subl	$2, %eax
	leaq	20(%rsp), %rdi
	leaq	24(%rsp,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L21:
	movl	(%rdi), %r8d
	movl	-4(%rdi), %ecx
	movl	%r8d, %r9d
	imull	%ecx, %r9d
	cmpl	%ecx, %r8d
	jle	.L18
	movl	%ecx, %eax
	movl	%r8d, %ecx
	movl	%eax, %r8d
.L18:
	testl	%r8d, %r8d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%ecx, %eax
	movl	%r8d, %esi
	cltd
	movl	%esi, %ecx
	idivl	%r8d
	movl	%edx, %r8d
	testl	%edx, %edx
	jg	.L20
	movl	%r9d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r8d
.L19:
	movl	%r8d, (%rdi)
	addq	$4, %rdi
	cmpq	%rdi, %r10
	jne	.L21
.L17:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$64, %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
.L15:
	.cfi_restore_state
	movl	16(%rsp), %r8d
	jmp	.L17
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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
	movl	%edi, %eax
	movl	%esi, %edx
	cmpl	%edi, %esi
	jle	.L2
	movl	%esi, %eax
	movl	%edi, %edx
.L2:
	testl	%edx, %edx
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jg	.L4
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%eax, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %edx
	movl	%edi, %esi
	imull	%edx, %esi
	cmpl	%edx, %edi
	jge	.L9
	movl	%edi, %eax
	movl	%edx, %edi
	movl	%eax, %edx
.L9:
	testl	%edx, %edx
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edi, %eax
	movl	%edx, %edi
	cltd
	idivl	%edi
	testl	%edx, %edx
	jg	.L11
	movl	%esi, %eax
	cltd
	idivl	%edi
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	lcm, .-lcm
	.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:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L15
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L16
	movl	16(%rsp), %r8d
	cmpl	$1, %eax
	jle	.L17
	subl	$2, %eax
	leaq	20(%rsp), %rdi
	leaq	24(%rsp,%rax,4), %r10
	.p2align 4,,10
	.p2align 3
.L21:
	movl	(%rdi), %r8d
	movl	-4(%rdi), %ecx
	movl	%r8d, %r9d
	imull	%ecx, %r9d
	cmpl	%ecx, %r8d
	jle	.L18
	movl	%ecx, %eax
	movl	%r8d, %ecx
	movl	%eax, %r8d
.L18:
	testl	%r8d, %r8d
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%ecx, %eax
	movl	%r8d, %esi
	cltd
	movl	%esi, %ecx
	idivl	%r8d
	movl	%edx, %r8d
	testl	%edx, %edx
	jg	.L20
	movl	%r9d, %eax
	cltd
	idivl	%esi
	movl	%eax, %r8d
.L19:
	movl	%r8d, (%rdi)
	addq	$4, %rdi
	cmpq	%rdi, %r10
	jne	.L21
.L17:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$64, %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
.L15:
	.cfi_restore_state
	movl	16(%rsp), %r8d
	jmp	.L17
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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:
```