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 gcd2(long a, long b){
	long t;
	if(a<b){
		t = a;
		a = b;
		b = t;
	}
	t = a % b;
	while(t!=0){
		a = b;
		b = t;
		t = a % b;
	}
	return b;
}
long n, x;
int main(void){
  scanf("%ld%ld", &n, &x);
  printf("%ld\n", (n-gcd2(n,x))*3);
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd2
	.type	gcd2, @function
gcd2:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cmpq	%rsi, %rdi
	jge	.L2
	movq	%rsi, %rax
	movq	%rdi, %rsi
.L2:
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	je	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %rax
	movq	%rdx, %r8
	cqto
	movq	%r8, %rsi
	idivq	%r8
	testq	%rdx, %rdx
	jne	.L4
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rsi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd2, .-gcd2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	leaq	.LC0(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	x(%rip), %rdx
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rdi
	movq	x(%rip), %rcx
	movq	%rdi, %rax
	cmpq	%rcx, %rdi
	jge	.L9
	movq	%rcx, %rax
	movq	%rdi, %rcx
.L9:
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rdx, %rcx
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L11
.L10:
	subq	%rsi, %rdi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	leaq	(%rdi,%rdi,2), %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movq	%rcx, %rsi
	jmp	.L10
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	x
	.bss
	.align 8
	.type	x, @object
	.size	x, 8
x:
	.zero	8
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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	gcd2
	.type	gcd2, @function
gcd2:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cmpq	%rsi, %rdi
	jge	.L2
	movq	%rsi, %rax
	movq	%rdi, %rsi
.L2:
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	je	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %rax
	movq	%rdx, %r8
	cqto
	movq	%r8, %rsi
	idivq	%r8
	testq	%rdx, %rdx
	jne	.L4
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rsi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd2, .-gcd2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	leaq	.LC0(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	x(%rip), %rdx
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rdi
	movq	x(%rip), %rcx
	movq	%rdi, %rax
	cmpq	%rcx, %rdi
	jge	.L9
	movq	%rcx, %rax
	movq	%rdi, %rcx
.L9:
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rdx, %rcx
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L11
.L10:
	subq	%rsi, %rdi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	leaq	(%rdi,%rdi,2), %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movq	%rcx, %rsi
	jmp	.L10
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	x
	.bss
	.align 8
	.type	x, @object
	.size	x, 8
x:
	.zero	8
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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	gcd2
	.type	gcd2, @function
gcd2:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cmpq	%rsi, %rdi
	jge	.L2
	movq	%rsi, %rax
	movq	%rdi, %rsi
.L2:
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	je	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %rax
	movq	%rdx, %r8
	cqto
	movq	%r8, %rsi
	idivq	%r8
	testq	%rdx, %rdx
	jne	.L4
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rsi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd2, .-gcd2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	leaq	.LC0(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	x(%rip), %rdx
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rdi
	movq	x(%rip), %rcx
	movq	%rdi, %rax
	cmpq	%rcx, %rdi
	jge	.L9
	movq	%rcx, %rax
	movq	%rdi, %rcx
.L9:
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rdx, %rcx
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L11
.L10:
	subq	%rsi, %rdi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	leaq	(%rdi,%rdi,2), %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movq	%rcx, %rsi
	jmp	.L10
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	x
	.bss
	.align 8
	.type	x, @object
	.size	x, 8
x:
	.zero	8
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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 gcd2(long a, long b){
	long t;
	if(a<b){
		t = a;
		a = b;
		b = t;
	}
	t = a % b;
	while(t!=0){
		a = b;
		b = t;
		t = a % b;
	}
	return b;
}
long n, x;
int main(void){
  scanf("%ld%ld", &n, &x);
  printf("%ld\n", (n-gcd2(n,x))*3);
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
long gcd2(long a, long b){
	long t;
	if(a<b){
		t = a;
		a = b;
		b = t;
	}
	t = a % b;
	while(t!=0){
		a = b;
		b = t;
		t = a % b;
	}
	return b;
}
long n, x;
int main(void){
  scanf("%ld%ld", &n, &x);
  printf("%ld\n", (n-gcd2(n,x))*3);
}
```

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 gcd2(long a, long b){
	long t;
	if(a<b){
		t = a;
		a = b;
		b = t;
	}
	t = a % b;
	while(t!=0){
		a = b;
		b = t;
		t = a % b;
	}
	return b;
}
long n, x;
int main(void){
  scanf("%ld%ld", &n, &x);
  printf("%ld\n", (n-gcd2(n,x))*3);
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd2
	.type	gcd2, @function
gcd2:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cmpq	%rsi, %rdi
	jge	.L2
	movq	%rsi, %rax
	movq	%rdi, %rsi
.L2:
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	je	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %rax
	movq	%rdx, %r8
	cqto
	movq	%r8, %rsi
	idivq	%r8
	testq	%rdx, %rdx
	jne	.L4
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rsi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd2, .-gcd2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	leaq	.LC0(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	x(%rip), %rdx
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rdi
	movq	x(%rip), %rcx
	movq	%rdi, %rax
	cmpq	%rcx, %rdi
	jge	.L9
	movq	%rcx, %rax
	movq	%rdi, %rcx
.L9:
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rdx, %rcx
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L11
.L10:
	subq	%rsi, %rdi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	leaq	(%rdi,%rdi,2), %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movq	%rcx, %rsi
	jmp	.L10
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	x
	.bss
	.align 8
	.type	x, @object
	.size	x, 8
x:
	.zero	8
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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	gcd2
	.type	gcd2, @function
gcd2:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	cmpq	%rsi, %rdi
	jge	.L2
	movq	%rsi, %rax
	movq	%rdi, %rsi
.L2:
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	je	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsi, %rax
	movq	%rdx, %r8
	cqto
	movq	%r8, %rsi
	idivq	%r8
	testq	%rdx, %rdx
	jne	.L4
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rsi, %r8
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd2, .-gcd2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld%ld"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	leaq	.LC0(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	x(%rip), %rdx
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rdi
	movq	x(%rip), %rcx
	movq	%rdi, %rax
	cmpq	%rcx, %rdi
	jge	.L9
	movq	%rcx, %rax
	movq	%rdi, %rcx
.L9:
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	je	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rdx, %rcx
	cqto
	idivq	%rsi
	testq	%rdx, %rdx
	jne	.L11
.L10:
	subq	%rsi, %rdi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	leaq	(%rdi,%rdi,2), %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movq	%rcx, %rsi
	jmp	.L10
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	x
	.bss
	.align 8
	.type	x, @object
	.size	x, 8
x:
	.zero	8
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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:
```