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

```c
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<stdlib.h>
//#define lli long long int
int gcd(int, int);
void Exgcd(int, int,int*,int*,int);
int main() {
	int a, b, c, i, j, x=1, y=0;
	scanf("%d%d", &a,&b);
	c = gcd(a, b);
	Exgcd(a, b, &x, &y, c);
	printf("%d %d\n", x, y);
	return 0;
}

int gcd(int x, int y) {
	int tmp;
	if (x < y) { tmp = x; x = y; y = tmp; }
	if (x%y == 0) return y;
	gcd(x%y, y);
}

void Exgcd(int a, int b,int *x,int *y,int c){
	int tmp,x2=0,y2=1,q;
	while (c!=b) {
		q = a / b;
		tmp = x2; x2 = *x - q*x2; *x = tmp;
		tmp = y2; y2 = *y - q*y2; *y = tmp;
		tmp = b; b = a - q*b; a = tmp;
	}
	*x = x2;
	*y = y2;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -20(%rbp)
	movl	$0, -16(%rbp)
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %esi
	movl	-28(%rbp), %eax
	movl	-12(%rbp), %edi
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	movl	%edi, %r8d
	movl	%eax, %edi
	call	Exgcd
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L5
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L6
	movl	-24(%rbp), %eax
	jmp	.L4
.L6:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	gcd
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	gcd, .-gcd
	.globl	Exgcd
	.type	Exgcd, @function
Exgcd:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movq	%rcx, -40(%rbp)
	movl	%r8d, -44(%rbp)
	movl	$0, -16(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%eax, -8(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	movq	-40(%rbp), %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movq	-40(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	movl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	imull	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jne	.L10
	movq	-32(%rbp), %rax
	movl	-16(%rbp), %edx
	movl	%edx, (%rax)
	movq	-40(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Exgcd, .-Exgcd
	.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.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	movl	(%rsp), %esi
	movl	%r8d, %edi
	movl	%esi, %ecx
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	%ecx, %edi
	jle	.L2
	movl	%ecx, %eax
	movl	%edi, %ecx
	movl	%eax, %edi
.L2:
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%edx, %ecx
	testl	%edx, %edx
	jne	.L3
	cmpl	%edi, %r8d
	je	.L8
	xorl	%r10d, %r10d
	movl	$1, %r11d
	movl	$1, %r9d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r13d, %r9d
	movl	%r12d, %r10d
.L5:
	movl	%esi, %eax
	cltd
	idivl	%r8d
	movl	%eax, %esi
	imull	%r9d, %eax
	imull	%r10d, %esi
	subl	%eax, %ecx
	subl	%esi, %r11d
	movl	%ecx, %r13d
	movl	%r8d, %esi
	movl	%r9d, %ecx
	movl	%r11d, %r12d
	movl	%edx, %r8d
	movl	%r10d, %r11d
	cmpl	%edx, %edi
	jne	.L9
.L4:
	xorl	%eax, %eax
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	xorl	%r12d, %r12d
	movl	$1, %r13d
	jmp	.L4
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB40:
	.cfi_startproc
	endbr64
	movl	%esi, %r8d
	.p2align 4,,10
	.p2align 3
.L16:
	cmpl	%edi, %r8d
	jle	.L15
	movl	%edi, %eax
	movl	%r8d, %edi
	movl	%eax, %r8d
.L15:
	movl	%edi, %eax
	cltd
	idivl	%r8d
	movl	%edx, %edi
	testl	%edx, %edx
	jne	.L16
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE40:
	.size	gcd, .-gcd
	.p2align 4
	.globl	Exgcd
	.type	Exgcd, @function
Exgcd:
.LFB41:
	.cfi_startproc
	endbr64
	movq	%rdx, %r10
	movq	%rcx, %r9
	cmpl	%r8d, %esi
	je	.L22
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %eax
	movl	$1, %ecx
	movl	%esi, %edi
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L21:
	cltd
	movl	%esi, %r11d
	idivl	%edi
	movl	%eax, %ebx
	imull	%ecx, %eax
	imull	%esi, %ebx
	movl	(%r10), %esi
	movl	%r11d, (%r10)
	movl	%ecx, %r11d
	movl	(%r9), %ecx
	movl	%r11d, (%r9)
	subl	%eax, %ecx
	subl	%ebx, %esi
	movl	%edi, %eax
	movl	%edx, %edi
	cmpl	%r8d, %edx
	jne	.L21
	movl	%esi, (%r10)
	popq	%rbx
	.cfi_def_cfa_offset 8
	movl	%ecx, (%r9)
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore 3
	movl	$1, %ecx
	xorl	%esi, %esi
	movl	%esi, (%rdx)
	movl	%ecx, (%r9)
	ret
	.cfi_endproc
.LFE41:
	.size	Exgcd, .-Exgcd
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r8d
	movl	(%rsp), %esi
	movl	%r8d, %edi
	movl	%esi, %ecx
	.p2align 4,,10
	.p2align 3
.L3:
	cmpl	%ecx, %edi
	jle	.L2
	movl	%ecx, %eax
	movl	%edi, %ecx
	movl	%eax, %edi
.L2:
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%edx, %ecx
	testl	%edx, %edx
	jne	.L3
	cmpl	%edi, %r8d
	je	.L8
	xorl	%r10d, %r10d
	movl	$1, %r11d
	movl	$1, %r9d
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r13d, %r9d
	movl	%r12d, %r10d
.L5:
	movl	%esi, %eax
	cltd
	idivl	%r8d
	movl	%eax, %esi
	imull	%r9d, %eax
	imull	%r10d, %esi
	subl	%eax, %ecx
	subl	%esi, %r11d
	movl	%ecx, %r13d
	movl	%r8d, %esi
	movl	%r9d, %ecx
	movl	%r11d, %r12d
	movl	%edx, %r8d
	movl	%r10d, %r11d
	cmpl	%edx, %edi
	jne	.L9
.L4:
	xorl	%eax, %eax
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L8:
	.cfi_restore_state
	xorl	%r12d, %r12d
	movl	$1, %r13d
	jmp	.L4
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB40:
	.cfi_startproc
	endbr64
	movl	%esi, %r8d
	.p2align 4,,10
	.p2align 3
.L16:
	cmpl	%edi, %r8d
	jle	.L15
	movl	%edi, %eax
	movl	%r8d, %edi
	movl	%eax, %r8d
.L15:
	movl	%edi, %eax
	cltd
	idivl	%r8d
	movl	%edx, %edi
	testl	%edx, %edx
	jne	.L16
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE40:
	.size	gcd, .-gcd
	.p2align 4
	.globl	Exgcd
	.type	Exgcd, @function
Exgcd:
.LFB41:
	.cfi_startproc
	endbr64
	movq	%rdx, %r10
	movq	%rcx, %r9
	cmpl	%r8d, %esi
	je	.L22
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%edi, %eax
	movl	$1, %ecx
	movl	%esi, %edi
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L21:
	cltd
	movl	%esi, %r11d
	idivl	%edi
	movl	%eax, %ebx
	imull	%ecx, %eax
	imull	%esi, %ebx
	movl	(%r10), %esi
	movl	%r11d, (%r10)
	movl	%ecx, %r11d
	movl	(%r9), %ecx
	movl	%r11d, (%r9)
	subl	%eax, %ecx
	subl	%ebx, %esi
	movl	%edi, %eax
	movl	%edx, %edi
	cmpl	%r8d, %edx
	jne	.L21
	movl	%esi, (%r10)
	popq	%rbx
	.cfi_def_cfa_offset 8
	movl	%ecx, (%r9)
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore 3
	movl	$1, %ecx
	xorl	%esi, %esi
	movl	%esi, (%rdx)
	movl	%ecx, (%r9)
	ret
	.cfi_endproc
.LFE41:
	.size	Exgcd, .-Exgcd
	.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:

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<stdlib.h>
//#define lli long long int
int gcd(int, int);
void Exgcd(int, int,int*,int*,int);
int main() {
	int a, b, c, i, j, x=1, y=0;
	scanf("%d%d", &a,&b);
	c = gcd(a, b);
	Exgcd(a, b, &x, &y, c);
	printf("%d %d\n", x, y);
	return 0;
}

int gcd(int x, int y) {
	int tmp;
	if (x < y) { tmp = x; x = y; y = tmp; }
	if (x%y == 0) return y;
	gcd(x%y, y);
}

void Exgcd(int a, int b,int *x,int *y,int c){
	int tmp,x2=0,y2=1,q;
	while (c!=b) {
		q = a / b;
		tmp = x2; x2 = *x - q*x2; *x = tmp;
		tmp = y2; y2 = *y - q*y2; *y = tmp;
		tmp = b; b = a - q*b; a = tmp;
	}
	*x = x2;
	*y = y2;
}
5 8
 5 15
 5 1
 5 2
 15 2
 55 2
 61 2
 47 2
 11 2
 6 8

-3 2
 1 0
 0 1
 1 -2
 1 -7
 1 -27
 1 -30
 1 -23
 1 -5
 -1 1

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

```c
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<stdlib.h>
//#define lli long long int
int gcd(int, int);
void Exgcd(int, int,int*,int*,int);
int main() {
	int a, b, c, i, j, x=1, y=0;
	scanf("%d%d", &a,&b);
	c = gcd(a, b);
	Exgcd(a, b, &x, &y, c);
	printf("%d %d\n", x, y);
	return 0;
}

int gcd(int x, int y) {
	int tmp;
	if (x < y) { tmp = x; x = y; y = tmp; }
	if (x%y == 0) return y;
	gcd(x%y, y);
}

void Exgcd(int a, int b,int *x,int *y,int c){
	int tmp,x2=0,y2=1,q;
	while (c!=b) {
		q = a / b;
		tmp = x2; x2 = *x - q*x2; *x = tmp;
		tmp = y2; y2 = *y - q*y2; *y = tmp;
		tmp = b; b = a - q*b; a = tmp;
	}
	*x = x2;
	*y = y2;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -20(%rbp)
	movl	$0, -16(%rbp)
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %esi
	movl	-28(%rbp), %eax
	movl	-12(%rbp), %edi
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	movl	%edi, %r8d
	movl	%eax, %edi
	call	Exgcd
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L5
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L6
	movl	-24(%rbp), %eax
	jmp	.L4
.L6:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	gcd
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	gcd, .-gcd
	.globl	Exgcd
	.type	Exgcd, @function
Exgcd:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movq	%rcx, -40(%rbp)
	movl	%r8d, -44(%rbp)
	movl	$0, -16(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%eax, -8(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	movq	-40(%rbp), %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movq	-40(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	movl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	imull	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jne	.L10
	movq	-32(%rbp), %rax
	movl	-16(%rbp), %edx
	movl	%edx, (%rax)
	movq	-40(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Exgcd, .-Exgcd
	.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.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -20(%rbp)
	movl	$0, -16(%rbp)
	leaq	-24(%rbp), %rdx
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %esi
	movl	-28(%rbp), %eax
	movl	-12(%rbp), %edi
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	movl	%edi, %r8d
	movl	%eax, %edi
	call	Exgcd
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L3
	call	__stack_chk_fail@PLT
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jge	.L5
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L6
	movl	-24(%rbp), %eax
	jmp	.L4
.L6:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	gcd
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	gcd, .-gcd
	.globl	Exgcd
	.type	Exgcd, @function
Exgcd:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	movq	%rcx, -40(%rbp)
	movl	%r8d, -44(%rbp)
	movl	$0, -16(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L9
.L10:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%eax, -8(%rbp)
	movl	-16(%rbp), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	imull	-16(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	movl	-12(%rbp), %eax
	movl	%eax, -4(%rbp)
	movq	-40(%rbp), %rax
	movl	(%rax), %edx
	movl	-8(%rbp), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movq	-40(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	movl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	imull	-24(%rbp), %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -24(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -20(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jne	.L10
	movq	-32(%rbp), %rax
	movl	-16(%rbp), %edx
	movl	%edx, (%rax)
	movq	-40(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	Exgcd, .-Exgcd
	.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:
