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>
#include<stdlib.h>
#include<string.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0)

#define MOD 1000000007 

//最大公約数
long long gcd(long long a, long long b){
    //a>bになるように入れ替え
    if(a<b){
        long tmp=a;
        a=b;
        b=tmp;
    }

    //ユークリッドの互除法
    if(a%b==0) return b;
    return gcd(b,a%b);
}

//最小公倍数
long long lcm(long long a,long long b){
    return a*(b/gcd(a,b));
}

int main(void){
    int N;
    scanf("%d",&N);

    //A[0]~A[N-1]に格納する
    long long* T;
    NEW(T,N);
    for(int i=0;i<N;i++){
        scanf("%lld",&T[i]);
    }

    long long ans=1;
    for(int i=0;i<N;i++){
        ans=lcm(ans,T[i]);
    }
    printf("%lld\n",ans);

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L3:
	cmpq	%r8, %rsi
	jg	.L2
	movq	%rsi, %rax
	movq	%r8, %rsi
	movq	%rax, %r8
.L2:
	movq	%rsi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rsi
	testq	%rdx, %rdx
	jne	.L3
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB52:
	.cfi_startproc
	endbr64
	movq	%rsi, %rdx
	movq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	cmpq	%rcx, %rdx
	jg	.L7
	movq	%rdx, %rax
	movq	%rcx, %rdx
	movq	%rax, %rcx
.L7:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L8
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	imulq	%rdi, %rax
	ret
	.cfi_endproc
.LFE52:
	.size	lcm, .-lcm
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$3, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L11
	testl	%ebx, %ebx
	jle	.L13
	movq	%rax, %r13
	movq	%rax, %rbx
	movq	%rax, %r12
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$8, %r12
	cmpl	%ebp, %eax
	jg	.L14
	testl	%eax, %eax
	jle	.L13
	leaq	0(%r13,%rax,8), %r9
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%rbx), %rdi
	movq	%r8, %rcx
	movq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpq	%rdx, %rcx
	jl	.L15
	movq	%rdx, %rsi
	movq	%rcx, %rdx
	movq	%rsi, %rcx
.L15:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L16
	movq	%rdi, %rax
	addq	$8, %rbx
	cqto
	idivq	%rcx
	imulq	%rax, %r8
	cmpq	%rbx, %r9
	jne	.L17
.L18:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movl	$1, %r8d
	jmp	.L18
.L24:
	call	__stack_chk_fail@PLT
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE53:
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L3:
	cmpq	%r8, %rsi
	jg	.L2
	movq	%rsi, %rax
	movq	%r8, %rsi
	movq	%rax, %r8
.L2:
	movq	%rsi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rsi
	testq	%rdx, %rdx
	jne	.L3
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB52:
	.cfi_startproc
	endbr64
	movq	%rsi, %rdx
	movq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	cmpq	%rcx, %rdx
	jg	.L7
	movq	%rdx, %rax
	movq	%rcx, %rdx
	movq	%rax, %rcx
.L7:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L8
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	imulq	%rdi, %rax
	ret
	.cfi_endproc
.LFE52:
	.size	lcm, .-lcm
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$3, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L11
	testl	%ebx, %ebx
	jle	.L13
	movq	%rax, %r13
	movq	%rax, %rbx
	movq	%rax, %r12
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$8, %r12
	cmpl	%ebp, %eax
	jg	.L14
	testl	%eax, %eax
	jle	.L13
	leaq	0(%r13,%rax,8), %r9
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%rbx), %rdi
	movq	%r8, %rcx
	movq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpq	%rdx, %rcx
	jl	.L15
	movq	%rdx, %rsi
	movq	%rcx, %rdx
	movq	%rsi, %rcx
.L15:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L16
	movq	%rdi, %rax
	addq	$8, %rbx
	cqto
	idivq	%rcx
	imulq	%rax, %r8
	cmpq	%rbx, %r9
	jne	.L17
.L18:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movl	$1, %r8d
	jmp	.L18
.L24:
	call	__stack_chk_fail@PLT
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE53:
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L3:
	cmpq	%r8, %rsi
	jg	.L2
	movq	%rsi, %rax
	movq	%r8, %rsi
	movq	%rax, %r8
.L2:
	movq	%rsi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rsi
	testq	%rdx, %rdx
	jne	.L3
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB52:
	.cfi_startproc
	endbr64
	movq	%rsi, %rdx
	movq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	cmpq	%rcx, %rdx
	jg	.L7
	movq	%rdx, %rax
	movq	%rcx, %rdx
	movq	%rax, %rcx
.L7:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L8
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	imulq	%rdi, %rax
	ret
	.cfi_endproc
.LFE52:
	.size	lcm, .-lcm
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$3, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L11
	testl	%ebx, %ebx
	jle	.L13
	movq	%rax, %r13
	movq	%rax, %rbx
	movq	%rax, %r12
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$8, %r12
	cmpl	%ebp, %eax
	jg	.L14
	testl	%eax, %eax
	jle	.L13
	leaq	0(%r13,%rax,8), %r9
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%rbx), %rdi
	movq	%r8, %rcx
	movq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpq	%rdx, %rcx
	jl	.L15
	movq	%rdx, %rsi
	movq	%rcx, %rdx
	movq	%rsi, %rcx
.L15:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L16
	movq	%rdi, %rax
	addq	$8, %rbx
	cqto
	idivq	%rcx
	imulq	%rax, %r8
	cmpq	%rbx, %r9
	jne	.L17
.L18:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movl	$1, %r8d
	jmp	.L18
.L24:
	call	__stack_chk_fail@PLT
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE53:
	.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>
#include<stdlib.h>
#include<string.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0)

#define MOD 1000000007 

//最大公約数
long long gcd(long long a, long long b){
    //a>bになるように入れ替え
    if(a<b){
        long tmp=a;
        a=b;
        b=tmp;
    }

    //ユークリッドの互除法
    if(a%b==0) return b;
    return gcd(b,a%b);
}

//最小公倍数
long long lcm(long long a,long long b){
    return a*(b/gcd(a,b));
}

int main(void){
    int N;
    scanf("%d",&N);

    //A[0]~A[N-1]に格納する
    long long* T;
    NEW(T,N);
    for(int i=0;i<N;i++){
        scanf("%lld",&T[i]);
    }

    long long ans=1;
    for(int i=0;i<N;i++){
        ans=lcm(ans,T[i]);
    }
    printf("%lld\n",ans);

    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0)

#define MOD 1000000007 

//最大公約数
long long gcd(long long a, long long b){
    //a>bになるように入れ替え
    if(a<b){
        long tmp=a;
        a=b;
        b=tmp;
    }

    //ユークリッドの互除法
    if(a%b==0) return b;
    return gcd(b,a%b);
}

//最小公倍数
long long lcm(long long a,long long b){
    return a*(b/gcd(a,b));
}

int main(void){
    int N;
    scanf("%d",&N);

    //A[0]~A[N-1]に格納する
    long long* T;
    NEW(T,N);
    for(int i=0;i<N;i++){
        scanf("%lld",&T[i]);
    }

    long long ans=1;
    for(int i=0;i<N;i++){
        ans=lcm(ans,T[i]);
    }
    printf("%lld\n",ans);

    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:

5
2
5
10
1000000001000000000
1000000000000000000
 2
2
5
 5
2
6
10
1000000001000000000
1000000000000000000
 2
3
5
 5
2
6
10
1001000001000000000
1000000000000000000
 2
3
3
 5
2
6
10
1001000001000000000
1100000000000000000
 2
3
7
 2
3
9
 2
3
4

-5930898827444486144
 10
 654047591376093184
 15
 -3927134622237589504
 3
 -6164522491832303616
 21
 9
 12

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>
#include<stdlib.h>
#include<string.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0)

#define MOD 1000000007 

//最大公約数
long long gcd(long long a, long long b){
    //a>bになるように入れ替え
    if(a<b){
        long tmp=a;
        a=b;
        b=tmp;
    }

    //ユークリッドの互除法
    if(a%b==0) return b;
    return gcd(b,a%b);
}

//最小公倍数
long long lcm(long long a,long long b){
    return a*(b/gcd(a,b));
}

int main(void){
    int N;
    scanf("%d",&N);

    //A[0]~A[N-1]に格納する
    long long* T;
    NEW(T,N);
    for(int i=0;i<N;i++){
        scanf("%lld",&T[i]);
    }

    long long ans=1;
    for(int i=0;i<N;i++){
        ans=lcm(ans,T[i]);
    }
    printf("%lld\n",ans);

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L3:
	cmpq	%r8, %rsi
	jg	.L2
	movq	%rsi, %rax
	movq	%r8, %rsi
	movq	%rax, %r8
.L2:
	movq	%rsi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rsi
	testq	%rdx, %rdx
	jne	.L3
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB52:
	.cfi_startproc
	endbr64
	movq	%rsi, %rdx
	movq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	cmpq	%rcx, %rdx
	jg	.L7
	movq	%rdx, %rax
	movq	%rcx, %rdx
	movq	%rax, %rcx
.L7:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L8
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	imulq	%rdi, %rax
	ret
	.cfi_endproc
.LFE52:
	.size	lcm, .-lcm
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$3, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L11
	testl	%ebx, %ebx
	jle	.L13
	movq	%rax, %r13
	movq	%rax, %rbx
	movq	%rax, %r12
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$8, %r12
	cmpl	%ebp, %eax
	jg	.L14
	testl	%eax, %eax
	jle	.L13
	leaq	0(%r13,%rax,8), %r9
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%rbx), %rdi
	movq	%r8, %rcx
	movq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpq	%rdx, %rcx
	jl	.L15
	movq	%rdx, %rsi
	movq	%rcx, %rdx
	movq	%rsi, %rcx
.L15:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L16
	movq	%rdi, %rax
	addq	$8, %rbx
	cqto
	idivq	%rcx
	imulq	%rax, %r8
	cmpq	%rbx, %r9
	jne	.L17
.L18:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movl	$1, %r8d
	jmp	.L18
.L24:
	call	__stack_chk_fail@PLT
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE53:
	.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:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	.p2align 4,,10
	.p2align 3
.L3:
	cmpq	%r8, %rsi
	jg	.L2
	movq	%rsi, %rax
	movq	%r8, %rsi
	movq	%rax, %r8
.L2:
	movq	%rsi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rsi
	testq	%rdx, %rdx
	jne	.L3
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	gcd, .-gcd
	.p2align 4
	.globl	lcm
	.type	lcm, @function
lcm:
.LFB52:
	.cfi_startproc
	endbr64
	movq	%rsi, %rdx
	movq	%rdi, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	cmpq	%rcx, %rdx
	jg	.L7
	movq	%rdx, %rax
	movq	%rcx, %rdx
	movq	%rax, %rcx
.L7:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L8
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	imulq	%rdi, %rax
	ret
	.cfi_endproc
.LFE52:
	.size	lcm, .-lcm
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"not enough memory"
.LC2:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$3, %rdi
	call	malloc@PLT
	testq	%rax, %rax
	je	.L11
	testl	%ebx, %ebx
	jle	.L13
	movq	%rax, %r13
	movq	%rax, %rbx
	movq	%rax, %r12
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$8, %r12
	cmpl	%ebp, %eax
	jg	.L14
	testl	%eax, %eax
	jle	.L13
	leaq	0(%r13,%rax,8), %r9
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L17:
	movq	(%rbx), %rdi
	movq	%r8, %rcx
	movq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpq	%rdx, %rcx
	jl	.L15
	movq	%rdx, %rsi
	movq	%rcx, %rdx
	movq	%rsi, %rcx
.L15:
	movq	%rdx, %rax
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L16
	movq	%rdi, %rax
	addq	$8, %rbx
	cqto
	idivq	%rcx
	imulq	%rax, %r8
	cmpq	%rbx, %r9
	jne	.L17
.L18:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movl	$1, %r8d
	jmp	.L18
.L24:
	call	__stack_chk_fail@PLT
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	movl	$1, %edi
	call	exit@PLT
	.cfi_endproc
.LFE53:
	.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:
```