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

```c
#include <stdio.h>

/* 最大公約数を返す */
int gcd(int a, int b) {
	int r;
	while (b != 0) { r = a % b; a = b; b = r; }
	return (a < 0) ? -a : a;
}

/* 値を入れ換える */
void swap(int *a, int *b) {
	int c = *a; *a = *b; *b = c;
}

int main(void) {
	int a, b, c; /* 与えられる値 */
	int p, q, r, s;
	int f; /* 解が存在するか */

	/* データセット毎の処理 */
	while (scanf("%d%d%d", &a, &b, &c) == 3 && a > 0) {
		int d = b * b - 4 * a * c; /* 二次方程式の判別式D */
		f = 0;

		if (d == 0) {
			int g;
			/* 重解 -b / 2a */
			f = 1;
			p = 2 * a;
			q = b; /* 符号に注意 */
			/* 約分 */
			g = gcd(p, q);
			p /= g;
			q /= g;

			r = p;
			s = q;
		} else if (d > 0) {
			/* 異なる二つの実数解 (-b +- √d) / 2a */
			int i;
			for (i = 1; i * i < d; i++); /* D の正整数平方根を求める */

			/* Dの平方根が整数であるなら整数 p, q, r, s が存在する */
			if (i * i == d) {
				int g;
				f = 1;

				p = 2 * a;
				r = 2 * a;
				q = -(-b - i);
				s = -(-b + i);

				/* 約分 */
				g = gcd(p, q);
				p /= g;
				q /= g;
				g = gcd(r, s);
				r /= g;
				s /= g;

				/* 問題の条件に合わせて解の順番を入れ換える */
				if (!(p > r || (p == r && q >= s))) {
					swap(&p, &r);
					swap(&q, &s);
				}
			}
		}

		/* 結果を出力する */
		if (f) printf("%d %d %d %d\n", p, q, r, s);
		else printf("Impossible\n");
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.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)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L2:
	cmpl	$0, -24(%rbp)
	jne	.L3
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.globl	swap
	.type	swap, @function
swap:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	"%d %d %d %d\n"
.LC1:
	.string	"Impossible"
.LC2:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L7
.L15:
	movl	-52(%rbp), %edx
	movl	-52(%rbp), %eax
	imull	%edx, %eax
	movl	-56(%rbp), %ecx
	movl	-48(%rbp), %edx
	imull	%ecx, %edx
	sall	$2, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	$0, -28(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L8
	movl	$1, -28(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -44(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -12(%rbp)
	movl	-44(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -40(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L9
.L8:
	cmpl	$0, -20(%rbp)
	jle	.L9
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	addl	$1, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L11
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	cmpl	%eax, -20(%rbp)
	jne	.L9
	movl	$1, -28(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -44(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -36(%rbp)
	movl	-52(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -40(%rbp)
	movl	-52(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -40(%rbp)
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -36(%rbp)
	movl	-32(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -32(%rbp)
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L9
.L12:
	leaq	-36(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L9:
	cmpl	$0, -28(%rbp)
	je	.L13
	movl	-32(%rbp), %esi
	movl	-36(%rbp), %ecx
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L14
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jg	.L15
.L14:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	testl	%esi, %esi
	je	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L3
	movl	%ecx, %eax
	negl	%eax
	cmovs	%ecx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edi, %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovs	%ecx, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB24:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE24:
	.size	swap, .-swap
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d %d\n"
.LC1:
	.string	"Impossible"
.LC2:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC1(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %r13
	leaq	32(%rsp), %r12
	leaq	28(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L23
	movl	28(%rsp), %esi
	testl	%esi, %esi
	jle	.L23
	movl	32(%rsp), %ecx
	movl	36(%rsp), %eax
	movl	%ecx, %edi
	imull	%esi, %eax
	imull	%ecx, %edi
	sall	$2, %eax
	subl	%eax, %edi
	testl	%edi, %edi
	je	.L39
	jg	.L40
.L14:
	movq	%r14, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L39:
	leal	(%rsi,%rsi), %r10d
	testl	%ecx, %ecx
	je	.L26
	movl	%ecx, %edx
	movl	%r10d, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, %edi
	cltd
	idivl	%edi
	movl	%edi, %eax
	testl	%edx, %edx
	jne	.L12
.L11:
	movl	%edi, %eax
	negl	%eax
	cmovns	%eax, %edi
	movl	%r10d, %eax
	cltd
	idivl	%edi
	movl	%eax, %r10d
	movl	%ecx, %eax
	cltd
	movl	%r10d, %r8d
	idivl	%edi
	movl	%eax, %ecx
	movl	%eax, %r9d
.L13:
	movl	%r10d, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L40:
	movl	$1, %edx
	cmpl	$1, %edi
	je	.L27
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %edx
	movl	%edx, %eax
	imull	%edx, %eax
	cmpl	%edi, %eax
	jl	.L16
.L15:
	cmpl	%eax, %edi
	jne	.L14
	movl	%ecx, %edi
	addl	%esi, %esi
	subl	%edx, %edi
	addl	%edx, %ecx
	je	.L28
	movl	%ecx, %edx
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L18
.L17:
	movl	%r8d, %eax
	negl	%eax
	cmovns	%eax, %r8d
	movl	%esi, %eax
	cltd
	idivl	%r8d
	movl	%eax, %r11d
	movl	%eax, %r10d
	movl	%ecx, %eax
	cltd
	idivl	%r8d
	movl	%eax, 12(%rsp)
	movl	%eax, %ecx
	testl	%edi, %edi
	je	.L29
	movl	%edi, %edx
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L20
.L19:
	movl	%r8d, %r9d
	movl	%esi, %eax
	negl	%r9d
	cmovs	%r8d, %r9d
	cltd
	idivl	%r9d
	movl	%eax, %esi
	movl	%eax, %r8d
	movl	%edi, %eax
	cltd
	idivl	%r9d
	movl	%eax, %r9d
	cmpl	%esi, %r11d
	jg	.L13
	jne	.L30
	cmpl	%eax, 12(%rsp)
	jge	.L13
.L30:
	movl	12(%rsp), %r9d
	movl	%eax, %ecx
	movl	%esi, %r10d
	movl	%r11d, %r8d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L23:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	movl	%r10d, %edi
	jmp	.L11
.L27:
	movl	$1, %eax
	jmp	.L15
.L29:
	movl	%esi, %r8d
	jmp	.L19
.L28:
	movl	%esi, %r8d
	jmp	.L17
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %edx
	testl	%esi, %esi
	je	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %ecx
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L3
	movl	%ecx, %eax
	negl	%eax
	cmovs	%ecx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edi, %ecx
	movl	%ecx, %eax
	negl	%eax
	cmovs	%ecx, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	gcd, .-gcd
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB24:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE24:
	.size	swap, .-swap
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d %d\n"
.LC1:
	.string	"Impossible"
.LC2:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC1(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC2(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %r13
	leaq	32(%rsp), %r12
	leaq	28(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L23
	movl	28(%rsp), %esi
	testl	%esi, %esi
	jle	.L23
	movl	32(%rsp), %ecx
	movl	36(%rsp), %eax
	movl	%ecx, %edi
	imull	%esi, %eax
	imull	%ecx, %edi
	sall	$2, %eax
	subl	%eax, %edi
	testl	%edi, %edi
	je	.L39
	jg	.L40
.L14:
	movq	%r14, %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L39:
	leal	(%rsi,%rsi), %r10d
	testl	%ecx, %ecx
	je	.L26
	movl	%ecx, %edx
	movl	%r10d, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edx, %edi
	cltd
	idivl	%edi
	movl	%edi, %eax
	testl	%edx, %edx
	jne	.L12
.L11:
	movl	%edi, %eax
	negl	%eax
	cmovns	%eax, %edi
	movl	%r10d, %eax
	cltd
	idivl	%edi
	movl	%eax, %r10d
	movl	%ecx, %eax
	cltd
	movl	%r10d, %r8d
	idivl	%edi
	movl	%eax, %ecx
	movl	%eax, %r9d
.L13:
	movl	%r10d, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L40:
	movl	$1, %edx
	cmpl	$1, %edi
	je	.L27
	.p2align 4,,10
	.p2align 3
.L16:
	addl	$1, %edx
	movl	%edx, %eax
	imull	%edx, %eax
	cmpl	%edi, %eax
	jl	.L16
.L15:
	cmpl	%eax, %edi
	jne	.L14
	movl	%ecx, %edi
	addl	%esi, %esi
	subl	%edx, %edi
	addl	%edx, %ecx
	je	.L28
	movl	%ecx, %edx
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L18
.L17:
	movl	%r8d, %eax
	negl	%eax
	cmovns	%eax, %r8d
	movl	%esi, %eax
	cltd
	idivl	%r8d
	movl	%eax, %r11d
	movl	%eax, %r10d
	movl	%ecx, %eax
	cltd
	idivl	%r8d
	movl	%eax, 12(%rsp)
	movl	%eax, %ecx
	testl	%edi, %edi
	je	.L29
	movl	%edi, %edx
	movl	%esi, %eax
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, %r8d
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L20
.L19:
	movl	%r8d, %r9d
	movl	%esi, %eax
	negl	%r9d
	cmovs	%r8d, %r9d
	cltd
	idivl	%r9d
	movl	%eax, %esi
	movl	%eax, %r8d
	movl	%edi, %eax
	cltd
	idivl	%r9d
	movl	%eax, %r9d
	cmpl	%esi, %r11d
	jg	.L13
	jne	.L30
	cmpl	%eax, 12(%rsp)
	jge	.L13
.L30:
	movl	12(%rsp), %r9d
	movl	%eax, %ecx
	movl	%esi, %r10d
	movl	%r11d, %r8d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L23:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L41
	addq	$56, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	movl	%r10d, %edi
	jmp	.L11
.L27:
	movl	$1, %eax
	jmp	.L15
.L29:
	movl	%esi, %r8d
	jmp	.L19
.L28:
	movl	%esi, %r8d
	jmp	.L17
.L41:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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:

#include <stdio.h>

/* 最大公約数を返す */
int gcd(int a, int b) {
	int r;
	while (b != 0) { r = a % b; a = b; b = r; }
	return (a < 0) ? -a : a;
}

/* 値を入れ換える */
void swap(int *a, int *b) {
	int c = *a; *a = *b; *b = c;
}

int main(void) {
	int a, b, c; /* 与えられる値 */
	int p, q, r, s;
	int f; /* 解が存在するか */

	/* データセット毎の処理 */
	while (scanf("%d%d%d", &a, &b, &c) == 3 && a > 0) {
		int d = b * b - 4 * a * c; /* 二次方程式の判別式D */
		f = 0;

		if (d == 0) {
			int g;
			/* 重解 -b / 2a */
			f = 1;
			p = 2 * a;
			q = b; /* 符号に注意 */
			/* 約分 */
			g = gcd(p, q);
			p /= g;
			q /= g;

			r = p;
			s = q;
		} else if (d > 0) {
			/* 異なる二つの実数解 (-b +- √d) / 2a */
			int i;
			for (i = 1; i * i < d; i++); /* D の正整数平方根を求める */

			/* Dの平方根が整数であるなら整数 p, q, r, s が存在する */
			if (i * i == d) {
				int g;
				f = 1;

				p = 2 * a;
				r = 2 * a;
				q = -(-b - i);
				s = -(-b + i);

				/* 約分 */
				g = gcd(p, q);
				p /= g;
				q /= g;
				g = gcd(r, s);
				r /= g;
				s /= g;

				/* 問題の条件に合わせて解の順番を入れ換える */
				if (!(p > r || (p == r && q >= s))) {
					swap(&p, &r);
					swap(&q, &s);
				}
			}
		}

		/* 結果を出力する */
		if (f) printf("%d %d %d %d\n", p, q, r, s);
		else printf("Impossible\n");
	}

	return 0;
}
2 5 4
1 1 1
10 -7 0
1 0 -3
0 0 0
 2 5 2
1 1 1
9 -7 0
1 0 -3
0 0 0
 2 5 4
1 2 1
10 -7 0
1 0 -3
0 0 0
 2 5 2
1 1 1
11 -7 0
1 0 -3
0 0 0
 2 5 4
1 2 1
10 -7 -1
1 0 -3
0 0 0
 2 5 2
1 1 1
10 -7 1
1 0 -3
0 0 0
 2 7 2
1 1 1
9 -7 0
1 0 -3
0 0 0
 2 5 4
1 2 1
10 -11 0
1 0 -3
0 0 0
 2 5 2
1 1 1
11 -10 0
1 0 -3
0 0 0
 2 5 4
1 0 1
10 -7 -1
2 0 -5
0 0 0

Impossible
Impossible
10 -7 1 0
Impossible
 2 1 1 2
Impossible
9 -7 1 0
Impossible
 Impossible
1 1 1 1
10 -7 1 0
Impossible
 2 1 1 2
Impossible
11 -7 1 0
Impossible
 Impossible
1 1 1 1
Impossible
Impossible
 2 1 1 2
Impossible
5 -1 2 -1
Impossible
 Impossible
Impossible
9 -7 1 0
Impossible
 Impossible
1 1 1 1
10 -11 1 0
Impossible
 2 1 1 2
Impossible
11 -10 1 0
Impossible
 Impossible
Impossible
Impossible
Impossible

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

```c
#include <stdio.h>

/* 最大公約数を返す */
int gcd(int a, int b) {
	int r;
	while (b != 0) { r = a % b; a = b; b = r; }
	return (a < 0) ? -a : a;
}

/* 値を入れ換える */
void swap(int *a, int *b) {
	int c = *a; *a = *b; *b = c;
}

int main(void) {
	int a, b, c; /* 与えられる値 */
	int p, q, r, s;
	int f; /* 解が存在するか */

	/* データセット毎の処理 */
	while (scanf("%d%d%d", &a, &b, &c) == 3 && a > 0) {
		int d = b * b - 4 * a * c; /* 二次方程式の判別式D */
		f = 0;

		if (d == 0) {
			int g;
			/* 重解 -b / 2a */
			f = 1;
			p = 2 * a;
			q = b; /* 符号に注意 */
			/* 約分 */
			g = gcd(p, q);
			p /= g;
			q /= g;

			r = p;
			s = q;
		} else if (d > 0) {
			/* 異なる二つの実数解 (-b +- √d) / 2a */
			int i;
			for (i = 1; i * i < d; i++); /* D の正整数平方根を求める */

			/* Dの平方根が整数であるなら整数 p, q, r, s が存在する */
			if (i * i == d) {
				int g;
				f = 1;

				p = 2 * a;
				r = 2 * a;
				q = -(-b - i);
				s = -(-b + i);

				/* 約分 */
				g = gcd(p, q);
				p /= g;
				q /= g;
				g = gcd(r, s);
				r /= g;
				s /= g;

				/* 問題の条件に合わせて解の順番を入れ換える */
				if (!(p > r || (p == r && q >= s))) {
					swap(&p, &r);
					swap(&q, &s);
				}
			}
		}

		/* 結果を出力する */
		if (f) printf("%d %d %d %d\n", p, q, r, s);
		else printf("Impossible\n");
	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.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)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L2:
	cmpl	$0, -24(%rbp)
	jne	.L3
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.globl	swap
	.type	swap, @function
swap:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	"%d %d %d %d\n"
.LC1:
	.string	"Impossible"
.LC2:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L7
.L15:
	movl	-52(%rbp), %edx
	movl	-52(%rbp), %eax
	imull	%edx, %eax
	movl	-56(%rbp), %ecx
	movl	-48(%rbp), %edx
	imull	%ecx, %edx
	sall	$2, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	$0, -28(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L8
	movl	$1, -28(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -44(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -12(%rbp)
	movl	-44(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -40(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L9
.L8:
	cmpl	$0, -20(%rbp)
	jle	.L9
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	addl	$1, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L11
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	cmpl	%eax, -20(%rbp)
	jne	.L9
	movl	$1, -28(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -44(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -36(%rbp)
	movl	-52(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -40(%rbp)
	movl	-52(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -40(%rbp)
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -36(%rbp)
	movl	-32(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -32(%rbp)
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L9
.L12:
	leaq	-36(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L9:
	cmpl	$0, -28(%rbp)
	je	.L13
	movl	-32(%rbp), %esi
	movl	-36(%rbp), %ecx
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L14
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jg	.L15
.L14:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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.
train
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB0:
	.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)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltd
	idivl	-24(%rbp)
	movl	%edx, -4(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -24(%rbp)
.L2:
	cmpl	$0, -24(%rbp)
	jne	.L3
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.globl	swap
	.type	swap, @function
swap:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	"%d %d %d %d\n"
.LC1:
	.string	"Impossible"
.LC2:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L7
.L15:
	movl	-52(%rbp), %edx
	movl	-52(%rbp), %eax
	imull	%edx, %eax
	movl	-56(%rbp), %ecx
	movl	-48(%rbp), %edx
	imull	%ecx, %edx
	sall	$2, %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	$0, -28(%rbp)
	cmpl	$0, -20(%rbp)
	jne	.L8
	movl	$1, -28(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -44(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -12(%rbp)
	movl	-44(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	cltd
	idivl	-12(%rbp)
	movl	%eax, -40(%rbp)
	movl	-44(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -32(%rbp)
	jmp	.L9
.L8:
	cmpl	$0, -20(%rbp)
	jle	.L9
	movl	$1, -24(%rbp)
	jmp	.L10
.L11:
	addl	$1, -24(%rbp)
.L10:
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L11
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	cmpl	%eax, -20(%rbp)
	jne	.L9
	movl	$1, -28(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -44(%rbp)
	movl	-56(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -36(%rbp)
	movl	-52(%rbp), %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -40(%rbp)
	movl	-52(%rbp), %eax
	subl	-24(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -16(%rbp)
	movl	-44(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -40(%rbp)
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -36(%rbp)
	movl	-32(%rbp), %eax
	cltd
	idivl	-16(%rbp)
	movl	%eax, -32(%rbp)
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L9
	movl	-44(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-40(%rbp), %edx
	movl	-32(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L9
.L12:
	leaq	-36(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L9:
	cmpl	$0, -28(%rbp)
	je	.L13
	movl	-32(%rbp), %esi
	movl	-36(%rbp), %ecx
	movl	-40(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%esi, %r8d
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L7:
	leaq	-48(%rbp), %rcx
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$3, %eax
	jne	.L14
	movl	-56(%rbp), %eax
	testl	%eax, %eax
	jg	.L15
.L14:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
