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

```c
i,n,x,X,d;int gcd(int a,int b){if(a%b==0)return b;return(gcd(b,a%b));}main(){scanf("%d%d",&n,&X);for(i=0;i<n;i++){scanf("%d",&x);if(!i)d=abs(X-x);else d=gcd(d,abs(X-x));}printf("%d",d);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L2
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	X(%rip), %rdx
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC0(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	scanf@PLT
	movl	n(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L6
	leaq	x(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%eax, %esi
	negl	%esi
	cmovs	%eax, %esi
.L8:
	addl	$1, %ecx
	cmpl	n(%rip), %ecx
	movl	%esi, d(%rip)
	movl	%ecx, i(%rip)
	jge	.L11
.L10:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %ecx
	movl	X(%rip), %eax
	subl	x(%rip), %eax
	testl	%ecx, %ecx
	je	.L15
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	d(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edx, %esi
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L9
	jmp	.L8
.L6:
	movl	d(%rip), %esi
	leaq	.LC1(%rip), %rbp
.L11:
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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:
.LFB0:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L2
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	X(%rip), %rdx
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC0(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	scanf@PLT
	movl	n(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L6
	leaq	x(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%eax, %esi
	negl	%esi
	cmovs	%eax, %esi
.L8:
	addl	$1, %ecx
	cmpl	n(%rip), %ecx
	movl	%esi, d(%rip)
	movl	%ecx, i(%rip)
	jge	.L11
.L10:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %ecx
	movl	X(%rip), %eax
	subl	x(%rip), %eax
	testl	%ecx, %ecx
	je	.L15
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	d(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edx, %esi
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L9
	jmp	.L8
.L6:
	movl	d(%rip), %esi
	leaq	.LC1(%rip), %rbp
.L11:
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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:
.LFB0:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L2
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	X(%rip), %rdx
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC0(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	scanf@PLT
	movl	n(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L6
	leaq	x(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%eax, %esi
	negl	%esi
	cmovs	%eax, %esi
.L8:
	addl	$1, %ecx
	cmpl	n(%rip), %ecx
	movl	%esi, d(%rip)
	movl	%ecx, i(%rip)
	jge	.L11
.L10:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %ecx
	movl	X(%rip), %eax
	subl	x(%rip), %eax
	testl	%ecx, %ecx
	je	.L15
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	d(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edx, %esi
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L9
	jmp	.L8
.L6:
	movl	d(%rip), %esi
	leaq	.LC1(%rip), %rbp
.L11:
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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
i,n,x,X,d;int gcd(int a,int b){if(a%b==0)return b;return(gcd(b,a%b));}main(){scanf("%d%d",&n,&X);for(i=0;i<n;i++){scanf("%d",&x);if(!i)d=abs(X-x);else d=gcd(d,abs(X-x));}printf("%d",d);}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
i,n,x,X,d;int gcd(int a,int b){if(a%b==0)return b;return(gcd(b,a%b));}main(){scanf("%d%d",&n,&X);for(i=0;i<n;i++){scanf("%d",&x);if(!i)d=abs(X-x);else d=gcd(d,abs(X-x));}printf("%d",d);}```

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 81
33 79 57
 1 1
1010000000
 3 81
33 70 57
 1 1
1010000100
 3 81
33 42 57
 1 0
1010000100
 1 0
1010010100
 1 1
1010010100
 1 1
1000000100
 1 0
1010000000

2 1009999999 1 1010000099 3 1010000100 1010010100 1010010099 1000000099 1010000000
Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
i,n,x,X,d;int gcd(int a,int b){if(a%b==0)return b;return(gcd(b,a%b));}main(){scanf("%d%d",&n,&X);for(i=0;i<n;i++){scanf("%d",&x);if(!i)d=abs(X-x);else d=gcd(d,abs(X-x));}printf("%d",d);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L2
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	X(%rip), %rdx
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC0(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	scanf@PLT
	movl	n(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L6
	leaq	x(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%eax, %esi
	negl	%esi
	cmovs	%eax, %esi
.L8:
	addl	$1, %ecx
	cmpl	n(%rip), %ecx
	movl	%esi, d(%rip)
	movl	%ecx, i(%rip)
	jge	.L11
.L10:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %ecx
	movl	X(%rip), %eax
	subl	x(%rip), %eax
	testl	%ecx, %ecx
	je	.L15
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	d(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edx, %esi
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L9
	jmp	.L8
.L6:
	movl	d(%rip), %esi
	leaq	.LC1(%rip), %rbp
.L11:
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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:
.LFB0:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L2
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	X(%rip), %rdx
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC0(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	scanf@PLT
	movl	n(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L6
	leaq	x(%rip), %rbx
	leaq	.LC1(%rip), %rbp
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%eax, %esi
	negl	%esi
	cmovs	%eax, %esi
.L8:
	addl	$1, %ecx
	cmpl	n(%rip), %ecx
	movl	%esi, d(%rip)
	movl	%ecx, i(%rip)
	jge	.L11
.L10:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	i(%rip), %ecx
	movl	X(%rip), %eax
	subl	x(%rip), %eax
	testl	%ecx, %ecx
	je	.L15
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	d(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edx, %esi
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L9
	jmp	.L8
.L6:
	movl	d(%rip), %esi
	leaq	.LC1(%rip), %rbp
.L11:
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	X
	.align 4
	.type	X, @object
	.size	X, 4
X:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.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:
```