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>

int extgcd(int a, int b, int* x, int* y) {
    int d = a;
    if (b != 0) {
        d = extgcd(b, a % b, y, x);
        *y -= (a / b) * *x;
    } else {
        *x = 1; *y = 0;
    }
    return d;
}

int main(void) {
	int a, b, x, y;
	scanf("%d %d\n", &a, &b);
	
	extgcd(a, b, &x, &y);
	printf("%d %d\n", x, y);
	
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	extgcd
	.type	extgcd, @function
extgcd:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%edi, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	testl	%esi, %esi
	jne	.L10
	movl	$1, (%rdx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%esi, 0(%rbp)
	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
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	cltd
	idivl	%esi
	movl	%edx, %r13d
	movl	%eax, %r14d
	movl	%edx, %ecx
	testl	%edx, %edx
	jne	.L11
	movl	$1, 0(%rbp)
	xorl	%edx, %edx
	movl	%esi, %eax
.L6:
	movl	%edx, (%r12)
	movl	0(%rbp), %esi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	subl	%ecx, %esi
	movl	%esi, 0(%rbp)
	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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	%esi, %eax
	cltd
	idivl	%r13d
	movl	%edx, %r8d
	movl	%eax, %ebx
	testl	%edx, %edx
	jne	.L12
	movl	$1, (%r12)
	xorl	%edx, %edx
	movl	%r13d, %eax
.L5:
	movl	%edx, 0(%rbp)
	movl	(%r12), %edx
	movl	%r14d, %ecx
	subl	%r8d, %edx
	imull	%edx, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%r13d, %eax
	movl	%r8d, %edi
	movq	%r12, %rcx
	cltd
	idivl	%r8d
	movl	%edx, %esi
	movq	%rbp, %rdx
	movl	%eax, %r13d
	call	extgcd
	imull	(%r12), %r13d
	movl	0(%rbp), %edx
	subl	%r13d, %edx
	imull	%edx, %ebx
	movl	%ebx, %r8d
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	extgcd, .-extgcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	movl	8(%rsp), %eax
	testl	%r8d, %r8d
	jne	.L18
	movl	$1, 16(%rsp)
	movl	$1, %edx
.L15:
	xorl	%eax, %eax
	movl	%r8d, %ecx
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	%r8d, 20(%rsp)
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cltd
	movl	%r8d, %edi
	leaq	16(%rsp), %rcx
	idivl	%r8d
	movl	%edx, %esi
	leaq	20(%rsp), %rdx
	movl	%eax, %r9d
	call	extgcd
	movl	16(%rsp), %edx
	movl	%r9d, %eax
	movl	20(%rsp), %r8d
	imull	%edx, %eax
	subl	%eax, %r8d
	jmp	.L15
.L19:
	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	extgcd
	.type	extgcd, @function
extgcd:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%edi, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	testl	%esi, %esi
	jne	.L10
	movl	$1, (%rdx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%esi, 0(%rbp)
	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
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	cltd
	idivl	%esi
	movl	%edx, %r13d
	movl	%eax, %r14d
	movl	%edx, %ecx
	testl	%edx, %edx
	jne	.L11
	movl	$1, 0(%rbp)
	xorl	%edx, %edx
	movl	%esi, %eax
.L6:
	movl	%edx, (%r12)
	movl	0(%rbp), %esi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	subl	%ecx, %esi
	movl	%esi, 0(%rbp)
	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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	%esi, %eax
	cltd
	idivl	%r13d
	movl	%edx, %r8d
	movl	%eax, %ebx
	testl	%edx, %edx
	jne	.L12
	movl	$1, (%r12)
	xorl	%edx, %edx
	movl	%r13d, %eax
.L5:
	movl	%edx, 0(%rbp)
	movl	(%r12), %edx
	movl	%r14d, %ecx
	subl	%r8d, %edx
	imull	%edx, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%r13d, %eax
	movl	%r8d, %edi
	movq	%r12, %rcx
	cltd
	idivl	%r8d
	movl	%edx, %esi
	movq	%rbp, %rdx
	movl	%eax, %r13d
	call	extgcd
	imull	(%r12), %r13d
	movl	0(%rbp), %edx
	subl	%r13d, %edx
	imull	%edx, %ebx
	movl	%ebx, %r8d
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	extgcd, .-extgcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	movl	8(%rsp), %eax
	testl	%r8d, %r8d
	jne	.L18
	movl	$1, 16(%rsp)
	movl	$1, %edx
.L15:
	xorl	%eax, %eax
	movl	%r8d, %ecx
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	%r8d, 20(%rsp)
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cltd
	movl	%r8d, %edi
	leaq	16(%rsp), %rcx
	idivl	%r8d
	movl	%edx, %esi
	leaq	20(%rsp), %rdx
	movl	%eax, %r9d
	call	extgcd
	movl	16(%rsp), %edx
	movl	%r9d, %eax
	movl	20(%rsp), %r8d
	imull	%edx, %eax
	subl	%eax, %r8d
	jmp	.L15
.L19:
	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	extgcd
	.type	extgcd, @function
extgcd:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%edi, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	testl	%esi, %esi
	jne	.L10
	movl	$1, (%rdx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%esi, 0(%rbp)
	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
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	cltd
	idivl	%esi
	movl	%edx, %r13d
	movl	%eax, %r14d
	movl	%edx, %ecx
	testl	%edx, %edx
	jne	.L11
	movl	$1, 0(%rbp)
	xorl	%edx, %edx
	movl	%esi, %eax
.L6:
	movl	%edx, (%r12)
	movl	0(%rbp), %esi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	subl	%ecx, %esi
	movl	%esi, 0(%rbp)
	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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	%esi, %eax
	cltd
	idivl	%r13d
	movl	%edx, %r8d
	movl	%eax, %ebx
	testl	%edx, %edx
	jne	.L12
	movl	$1, (%r12)
	xorl	%edx, %edx
	movl	%r13d, %eax
.L5:
	movl	%edx, 0(%rbp)
	movl	(%r12), %edx
	movl	%r14d, %ecx
	subl	%r8d, %edx
	imull	%edx, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%r13d, %eax
	movl	%r8d, %edi
	movq	%r12, %rcx
	cltd
	idivl	%r8d
	movl	%edx, %esi
	movq	%rbp, %rdx
	movl	%eax, %r13d
	call	extgcd
	imull	(%r12), %r13d
	movl	0(%rbp), %edx
	subl	%r13d, %edx
	imull	%edx, %ebx
	movl	%ebx, %r8d
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	extgcd, .-extgcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	movl	8(%rsp), %eax
	testl	%r8d, %r8d
	jne	.L18
	movl	$1, 16(%rsp)
	movl	$1, %edx
.L15:
	xorl	%eax, %eax
	movl	%r8d, %ecx
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	%r8d, 20(%rsp)
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cltd
	movl	%r8d, %edi
	leaq	16(%rsp), %rcx
	idivl	%r8d
	movl	%edx, %esi
	leaq	20(%rsp), %rdx
	movl	%eax, %r9d
	call	extgcd
	movl	16(%rsp), %edx
	movl	%r9d, %eax
	movl	20(%rsp), %r8d
	imull	%edx, %eax
	subl	%eax, %r8d
	jmp	.L15
.L19:
	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>

int extgcd(int a, int b, int* x, int* y) {
    int d = a;
    if (b != 0) {
        d = extgcd(b, a % b, y, x);
        *y -= (a / b) * *x;
    } else {
        *x = 1; *y = 0;
    }
    return d;
}

int main(void) {
	int a, b, x, y;
	scanf("%d %d\n", &a, &b);
	
	extgcd(a, b, &x, &y);
	printf("%d %d\n", x, y);
	
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int extgcd(int a, int b, int* x, int* y) {
    int d = a;
    if (b != 0) {
        d = extgcd(b, a % b, y, x);
        *y -= (a / b) * *x;
    } else {
        *x = 1; *y = 0;
    }
    return d;
}

int main(void) {
	int a, b, x, y;
	scanf("%d %d\n", &a, &b);
	
	extgcd(a, b, &x, &y);
	printf("%d %d\n", x, y);
	
	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 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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int extgcd(int a, int b, int* x, int* y) {
    int d = a;
    if (b != 0) {
        d = extgcd(b, a % b, y, x);
        *y -= (a / b) * *x;
    } else {
        *x = 1; *y = 0;
    }
    return d;
}

int main(void) {
	int a, b, x, y;
	scanf("%d %d\n", &a, &b);
	
	extgcd(a, b, &x, &y);
	printf("%d %d\n", x, y);
	
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	extgcd
	.type	extgcd, @function
extgcd:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%edi, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	testl	%esi, %esi
	jne	.L10
	movl	$1, (%rdx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%esi, 0(%rbp)
	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
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	cltd
	idivl	%esi
	movl	%edx, %r13d
	movl	%eax, %r14d
	movl	%edx, %ecx
	testl	%edx, %edx
	jne	.L11
	movl	$1, 0(%rbp)
	xorl	%edx, %edx
	movl	%esi, %eax
.L6:
	movl	%edx, (%r12)
	movl	0(%rbp), %esi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	subl	%ecx, %esi
	movl	%esi, 0(%rbp)
	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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	%esi, %eax
	cltd
	idivl	%r13d
	movl	%edx, %r8d
	movl	%eax, %ebx
	testl	%edx, %edx
	jne	.L12
	movl	$1, (%r12)
	xorl	%edx, %edx
	movl	%r13d, %eax
.L5:
	movl	%edx, 0(%rbp)
	movl	(%r12), %edx
	movl	%r14d, %ecx
	subl	%r8d, %edx
	imull	%edx, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%r13d, %eax
	movl	%r8d, %edi
	movq	%r12, %rcx
	cltd
	idivl	%r8d
	movl	%edx, %esi
	movq	%rbp, %rdx
	movl	%eax, %r13d
	call	extgcd
	imull	(%r12), %r13d
	movl	0(%rbp), %edx
	subl	%r13d, %edx
	imull	%edx, %ebx
	movl	%ebx, %r8d
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	extgcd, .-extgcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	movl	8(%rsp), %eax
	testl	%r8d, %r8d
	jne	.L18
	movl	$1, 16(%rsp)
	movl	$1, %edx
.L15:
	xorl	%eax, %eax
	movl	%r8d, %ecx
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	%r8d, 20(%rsp)
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cltd
	movl	%r8d, %edi
	leaq	16(%rsp), %rcx
	idivl	%r8d
	movl	%edx, %esi
	leaq	20(%rsp), %rdx
	movl	%eax, %r9d
	call	extgcd
	movl	16(%rsp), %edx
	movl	%r9d, %eax
	movl	20(%rsp), %r8d
	imull	%edx, %eax
	subl	%eax, %r8d
	jmp	.L15
.L19:
	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	extgcd
	.type	extgcd, @function
extgcd:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	%edi, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rcx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	testl	%esi, %esi
	jne	.L10
	movl	$1, (%rdx)
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%esi, 0(%rbp)
	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
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	cltd
	idivl	%esi
	movl	%edx, %r13d
	movl	%eax, %r14d
	movl	%edx, %ecx
	testl	%edx, %edx
	jne	.L11
	movl	$1, 0(%rbp)
	xorl	%edx, %edx
	movl	%esi, %eax
.L6:
	movl	%edx, (%r12)
	movl	0(%rbp), %esi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	subl	%ecx, %esi
	movl	%esi, 0(%rbp)
	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
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	%esi, %eax
	cltd
	idivl	%r13d
	movl	%edx, %r8d
	movl	%eax, %ebx
	testl	%edx, %edx
	jne	.L12
	movl	$1, (%r12)
	xorl	%edx, %edx
	movl	%r13d, %eax
.L5:
	movl	%edx, 0(%rbp)
	movl	(%r12), %edx
	movl	%r14d, %ecx
	subl	%r8d, %edx
	imull	%edx, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%r13d, %eax
	movl	%r8d, %edi
	movq	%r12, %rcx
	cltd
	idivl	%r8d
	movl	%edx, %esi
	movq	%rbp, %rdx
	movl	%eax, %r13d
	call	extgcd
	imull	(%r12), %r13d
	movl	0(%rbp), %edx
	subl	%r13d, %edx
	imull	%edx, %ebx
	movl	%ebx, %r8d
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	extgcd, .-extgcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$32, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	movl	8(%rsp), %eax
	testl	%r8d, %r8d
	jne	.L18
	movl	$1, 16(%rsp)
	movl	$1, %edx
.L15:
	xorl	%eax, %eax
	movl	%r8d, %ecx
	movq	%rbp, %rsi
	movl	$1, %edi
	movl	%r8d, 20(%rsp)
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cltd
	movl	%r8d, %edi
	leaq	16(%rsp), %rcx
	idivl	%r8d
	movl	%edx, %esi
	leaq	20(%rsp), %rdx
	movl	%eax, %r9d
	call	extgcd
	movl	16(%rsp), %edx
	movl	%r9d, %eax
	movl	20(%rsp), %r8d
	imull	%edx, %eax
	subl	%eax, %r8d
	jmp	.L15
.L19:
	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:
```