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 gcd(long long a, long long b){return (a<b?a:b)==0?(a>b?a:b):gcd((a<b?a:b),(a>b?a:b)%(a<b?a:b));}
int main(void){
    long long n,x;
    scanf("%lld%lld",&n,&x);
    printf("%lld\n",3*(n-gcd(n,x)));
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	cmpq	%rsi, %rdi
	movq	%rsi, %rcx
	movq	%rdi, %rax
	movq	%rsi, %rdx
	cmovle	%rdi, %rcx
	testq	%rcx, %rcx
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rsi, %rcx
.L2:
	cmpq	%rax, %rdx
	movq	%rcx, %rsi
	cmovge	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	cmpq	%rcx, %rdx
	cmovle	%rdx, %rsi
	testq	%rsi, %rsi
	jne	.L11
	cmpq	%rcx, %rdx
	movq	%rcx, %rax
	cmovge	%rdx, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdi, %rcx
	cmpq	%rcx, %rdx
	movq	%rcx, %rax
	cmovge	%rdx, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rdx
	cmpq	%rdx, %rdi
	movq	%rdx, %rcx
	movq	%rdi, %rax
	cmovle	%rdi, %rcx
	testq	%rcx, %rcx
	jne	.L13
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rsi, %rcx
.L13:
	cmpq	%rax, %rdx
	movq	%rcx, %rsi
	cmovge	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	cmpq	%rcx, %rdx
	cmovle	%rdx, %rsi
	testq	%rsi, %rsi
	jne	.L25
.L14:
	cmpq	%rcx, %rdx
	leaq	.LC1(%rip), %rsi
	cmovl	%rcx, %rdx
	xorl	%eax, %eax
	subq	%rdx, %rdi
	leaq	(%rdi,%rdi,2), %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	movq	%rdi, %rcx
	jmp	.L14
.L26:
	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:
```

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
	cmpq	%rsi, %rdi
	movq	%rsi, %rcx
	movq	%rdi, %rax
	movq	%rsi, %rdx
	cmovle	%rdi, %rcx
	testq	%rcx, %rcx
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rsi, %rcx
.L2:
	cmpq	%rax, %rdx
	movq	%rcx, %rsi
	cmovge	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	cmpq	%rcx, %rdx
	cmovle	%rdx, %rsi
	testq	%rsi, %rsi
	jne	.L11
	cmpq	%rcx, %rdx
	movq	%rcx, %rax
	cmovge	%rdx, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdi, %rcx
	cmpq	%rcx, %rdx
	movq	%rcx, %rax
	cmovge	%rdx, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rdx
	cmpq	%rdx, %rdi
	movq	%rdx, %rcx
	movq	%rdi, %rax
	cmovle	%rdi, %rcx
	testq	%rcx, %rcx
	jne	.L13
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rsi, %rcx
.L13:
	cmpq	%rax, %rdx
	movq	%rcx, %rsi
	cmovge	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	cmpq	%rcx, %rdx
	cmovle	%rdx, %rsi
	testq	%rsi, %rsi
	jne	.L25
.L14:
	cmpq	%rcx, %rdx
	leaq	.LC1(%rip), %rsi
	cmovl	%rcx, %rdx
	xorl	%eax, %eax
	subq	%rdx, %rdi
	leaq	(%rdi,%rdi,2), %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	movq	%rdi, %rcx
	jmp	.L14
.L26:
	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
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	cmpq	%rsi, %rdi
	movq	%rsi, %rcx
	movq	%rdi, %rax
	movq	%rsi, %rdx
	cmovle	%rdi, %rcx
	testq	%rcx, %rcx
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rsi, %rcx
.L2:
	cmpq	%rax, %rdx
	movq	%rcx, %rsi
	cmovge	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	cmpq	%rcx, %rdx
	cmovle	%rdx, %rsi
	testq	%rsi, %rsi
	jne	.L11
	cmpq	%rcx, %rdx
	movq	%rcx, %rax
	cmovge	%rdx, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdi, %rcx
	cmpq	%rcx, %rdx
	movq	%rcx, %rax
	cmovge	%rdx, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rdx
	cmpq	%rdx, %rdi
	movq	%rdx, %rcx
	movq	%rdi, %rax
	cmovle	%rdi, %rcx
	testq	%rcx, %rcx
	jne	.L13
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rsi, %rcx
.L13:
	cmpq	%rax, %rdx
	movq	%rcx, %rsi
	cmovge	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	cmpq	%rcx, %rdx
	cmovle	%rdx, %rsi
	testq	%rsi, %rsi
	jne	.L25
.L14:
	cmpq	%rcx, %rdx
	leaq	.LC1(%rip), %rsi
	cmovl	%rcx, %rdx
	xorl	%eax, %eax
	subq	%rdx, %rdi
	leaq	(%rdi,%rdi,2), %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	movq	%rdi, %rcx
	jmp	.L14
.L26:
	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:
```
```c
#include <stdio.h>
long long gcd(long long a, long long b){return (a<b?a:b)==0?(a>b?a:b):gcd((a<b?a:b),(a>b?a:b)%(a<b?a:b));}
int main(void){
    long long n,x;
    scanf("%lld%lld",&n,&x);
    printf("%lld\n",3*(n-gcd(n,x)));
    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 gcd(long long a, long long b){return (a<b?a:b)==0?(a>b?a:b):gcd((a<b?a:b),(a>b?a:b)%(a<b?a:b));}
int main(void){
    long long n,x;
    scanf("%lld%lld",&n,&x);
    printf("%lld\n",3*(n-gcd(n,x)));
    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 4
 7 4
 6 1
 9 4
 6 3
 14 4
 8 1
 28 4
 15 2
 28 3

12
 18
 15
 24
 9
 36
 21
 72
 42
 81

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 gcd(long long a, long long b){return (a<b?a:b)==0?(a>b?a:b):gcd((a<b?a:b),(a>b?a:b)%(a<b?a:b));}
int main(void){
    long long n,x;
    scanf("%lld%lld",&n,&x);
    printf("%lld\n",3*(n-gcd(n,x)));
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	cmpq	%rsi, %rdi
	movq	%rsi, %rcx
	movq	%rdi, %rax
	movq	%rsi, %rdx
	cmovle	%rdi, %rcx
	testq	%rcx, %rcx
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rsi, %rcx
.L2:
	cmpq	%rax, %rdx
	movq	%rcx, %rsi
	cmovge	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	cmpq	%rcx, %rdx
	cmovle	%rdx, %rsi
	testq	%rsi, %rsi
	jne	.L11
	cmpq	%rcx, %rdx
	movq	%rcx, %rax
	cmovge	%rdx, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdi, %rcx
	cmpq	%rcx, %rdx
	movq	%rcx, %rax
	cmovge	%rdx, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rdx
	cmpq	%rdx, %rdi
	movq	%rdx, %rcx
	movq	%rdi, %rax
	cmovle	%rdi, %rcx
	testq	%rcx, %rcx
	jne	.L13
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rsi, %rcx
.L13:
	cmpq	%rax, %rdx
	movq	%rcx, %rsi
	cmovge	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	cmpq	%rcx, %rdx
	cmovle	%rdx, %rsi
	testq	%rsi, %rsi
	jne	.L25
.L14:
	cmpq	%rcx, %rdx
	leaq	.LC1(%rip), %rsi
	cmovl	%rcx, %rdx
	xorl	%eax, %eax
	subq	%rdx, %rdi
	leaq	(%rdi,%rdi,2), %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	movq	%rdi, %rcx
	jmp	.L14
.L26:
	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:
```

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
	cmpq	%rsi, %rdi
	movq	%rsi, %rcx
	movq	%rdi, %rax
	movq	%rsi, %rdx
	cmovle	%rdi, %rcx
	testq	%rcx, %rcx
	jne	.L2
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rsi, %rcx
.L2:
	cmpq	%rax, %rdx
	movq	%rcx, %rsi
	cmovge	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	cmpq	%rcx, %rdx
	cmovle	%rdx, %rsi
	testq	%rsi, %rsi
	jne	.L11
	cmpq	%rcx, %rdx
	movq	%rcx, %rax
	cmovge	%rdx, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdi, %rcx
	cmpq	%rcx, %rdx
	movq	%rcx, %rax
	cmovge	%rdx, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdi
	movq	16(%rsp), %rdx
	cmpq	%rdx, %rdi
	movq	%rdx, %rcx
	movq	%rdi, %rax
	cmovle	%rdi, %rcx
	testq	%rcx, %rcx
	jne	.L13
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%rsi, %rcx
.L13:
	cmpq	%rax, %rdx
	movq	%rcx, %rsi
	cmovge	%rdx, %rax
	cqto
	idivq	%rcx
	movq	%rcx, %rax
	cmpq	%rcx, %rdx
	cmovle	%rdx, %rsi
	testq	%rsi, %rsi
	jne	.L25
.L14:
	cmpq	%rcx, %rdx
	leaq	.LC1(%rip), %rsi
	cmovl	%rcx, %rdx
	xorl	%eax, %eax
	subq	%rdx, %rdi
	leaq	(%rdi,%rdi,2), %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	movq	%rdi, %rcx
	jmp	.L14
.L26:
	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:
```