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

```c
// AOJ 3002: Factorization
// 2017.11.29 bal4u@uu

#include <stdio.h>

int a[6], n;
int ans[6];

char buf[100], *p;
int getint()
{
	int n = 1;
	int minus = 0;

	if (*p == '-') p++, minus = 1;
	else if (*p == '+') p++;
	if (*p >= '0' && *p <= '9') {
		n = 0;
		while (*p >= '0' && *p <= '9') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	}
	if (minus) n = -n;
	return n;
}

long long pow(int x, int k)
{
	long long t = 1;
	while (k--) t = t * x;
	return t;
}

int check(int v)
{
	int i;
	long long s = 0;
	for (i = 0; i <= n; i++) {
		if (a[i] == 0) continue;
		s += a[i] * pow(v, i);
	}
	return s == 0;
}

int main()
{
	int i, k, c;

    fgets(p=buf, 100, stdin);
	p += 2, n = *p++ & 0xf, a[n] = 1;
	while (*p >= ' ') {
		k = getint(), i = 0;
		if (*p == 'x') {
			i = 1, p++;
			if (*p == '^') p++, i = *p++ & 0xf;
		}
		a[i] = k;
	}

	c = a[0]; if (c < 0) c = -c;
	for (i = 0, k = -c; k <= c; k++) if (k != 0) {
		if (a[0] % k == 0 && check(-k)) {
			ans[i] = k;	if (++i >= n) break;
		}
	}
	for (i = 0; i < n; i++) printf("(x%+d)", ans[i]);
	putchar('\n');
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 16
	.type	a, @object
	.size	a, 24
a:
	.zero	24
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ans
	.align 16
	.type	ans, @object
	.size	ans, 24
ans:
	.zero	24
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 100
buf:
	.zero	100
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.text
	.globl	getint
	.type	getint, @function
getint:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$1, -8(%rbp)
	movl	$0, -4(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$45, %al
	jne	.L2
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	$1, -4(%rbp)
	jmp	.L3
.L2:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$43, %al
	jne	.L3
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
.L3:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jle	.L4
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$57, %al
	jg	.L4
	movl	$0, -8(%rbp)
	jmp	.L5
.L6:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -8(%rbp)
.L5:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jle	.L4
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$57, %al
	jle	.L6
.L4:
	cmpl	$0, -4(%rbp)
	je	.L7
	negl	-8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getint, .-getint
	.globl	pow
	.type	pow, @function
pow:
.LFB1:
	.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	$1, -8(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L10:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L11
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	pow, .-pow
	.globl	check
	.type	check, @function
check:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -28(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L14
.L17:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L19
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rbx
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	pow
	imulq	%rbx, %rax
	addq	%rax, -16(%rbp)
	jmp	.L16
.L19:
	nop
.L16:
	addl	$1, -20(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L17
	cmpq	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	check, .-check
	.section	.rodata
.LC0:
	.string	"(x%+d)"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$100, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movq	p(%rip), %rax
	addq	$2, %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	movl	%eax, n(%rip)
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L21
.L23:
	movl	$0, %eax
	call	getint
	movl	%eax, -8(%rbp)
	movl	$0, -12(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	jne	.L22
	movl	$1, -12(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$94, %al
	jne	.L22
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	movl	%eax, -12(%rbp)
.L22:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L21:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$31, %al
	jg	.L23
	movl	a(%rip), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L24
	negl	-4(%rbp)
.L24:
	movl	$0, -12(%rbp)
	movl	-4(%rbp), %eax
	negl	%eax
	movl	%eax, -8(%rbp)
	jmp	.L25
.L28:
	cmpl	$0, -8(%rbp)
	je	.L26
	movl	a(%rip), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L26
	movl	-8(%rbp), %eax
	negl	%eax
	movl	%eax, %edi
	call	check
	testl	%eax, %eax
	je	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ans(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L32
.L26:
	addl	$1, -8(%rbp)
.L25:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L28
	jmp	.L27
.L32:
	nop
.L27:
	movl	$0, -12(%rbp)
	jmp	.L29
.L30:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L29:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L30
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	getint
	.type	getint, @function
getint:
.LFB23:
	.cfi_startproc
	endbr64
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	cmpb	$45, %dl
	je	.L16
	cmpb	$43, %dl
	je	.L17
	subl	$48, %edx
	cmpb	$9, %dl
	ja	.L7
.L14:
	xorl	%edi, %edi
.L3:
	addq	$1, %rax
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %edx
	movq	%rax, %rcx
	leal	(%r8,%r8,4), %esi
	addq	$1, %rax
	andl	$15, %edx
	leal	(%rdx,%rsi,2), %r8d
	movzbl	(%rcx), %edx
	subl	$48, %edx
	cmpb	$9, %dl
	jbe	.L8
	movl	%r8d, %eax
	negl	%eax
	testl	%edi, %edi
	cmovne	%eax, %r8d
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %eax
	subl	$48, %eax
	cmpb	$9, %al
	jbe	.L10
.L7:
	movl	$1, %r8d
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	leaq	1(%rax), %rdx
	movl	$-1, %r8d
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %eax
	subl	$48, %eax
	cmpb	$9, %al
	ja	.L1
	movq	%rdx, %rax
	movl	$1, %edi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdx, %rax
	jmp	.L14
	.cfi_endproc
.LFE23:
	.size	getint, .-getint
	.p2align 4
	.globl	pow
	.type	pow, @function
pow:
.LFB24:
	.cfi_startproc
	endbr64
	leal	-1(%rsi), %eax
	testl	%esi, %esi
	je	.L21
	movslq	%edi, %rdi
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L20:
	imulq	%rdi, %r8
	subl	$1, %eax
	jnb	.L20
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE24:
	.size	pow, .-pow
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB25:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	movslq	%edi, %rax
	testl	%ecx, %ecx
	js	.L31
	movslq	a(%rip), %rsi
	je	.L25
	movslq	4+a(%rip), %rdx
	testl	%edx, %edx
	jne	.L62
.L26:
	cmpl	$1, %ecx
	je	.L25
	movslq	8+a(%rip), %rdx
	testl	%edx, %edx
	jne	.L63
.L27:
	cmpl	$2, %ecx
	je	.L25
	movslq	12+a(%rip), %rdx
	testl	%edx, %edx
	jne	.L64
	cmpl	$3, %ecx
	je	.L25
.L66:
	movslq	16+a(%rip), %rdi
	testl	%edi, %edi
	je	.L29
	movslq	%eax, %rdx
	imulq	%rdx, %rdx
	imulq	%rdx, %rdx
	imulq	%rdi, %rdx
	addq	%rdx, %rsi
.L29:
	cmpl	$4, %ecx
	je	.L25
	movslq	20+a(%rip), %rcx
	testl	%ecx, %ecx
	jne	.L65
.L25:
	xorl	%eax, %eax
	testq	%rsi, %rsi
	sete	%al
	ret
	.p2align 4,,10
	.p2align 3
.L62:
	movslq	%eax, %rdi
	imulq	%rdi, %rdx
	addq	%rdx, %rsi
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L63:
	movslq	%eax, %rdi
	imulq	%rdi, %rdi
	imulq	%rdx, %rdi
	addq	%rdi, %rsi
	jmp	.L27
.L64:
	movslq	%eax, %rdi
	movq	%rdi, %r8
	imulq	%rdi, %r8
	imulq	%r8, %rdi
	imulq	%rdx, %rdi
	addq	%rdi, %rsi
	cmpl	$3, %ecx
	jne	.L66
	jmp	.L25
.L65:
	movq	%rax, %rdx
	imulq	%rax, %rdx
	imulq	%rdx, %rdx
	imulq	%rdx, %rax
	imulq	%rcx, %rax
	addq	%rax, %rsi
	xorl	%eax, %eax
	testq	%rsi, %rsi
	sete	%al
	ret
.L31:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	check, .-check
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"(x%+d)"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	buf(%rip), %rdi
	movl	$100, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	stdin(%rip), %rdx
	movq	%rdi, p(%rip)
	call	fgets@PLT
	movq	p(%rip), %rdx
	leaq	a(%rip), %rdi
	leaq	3(%rdx), %rax
	movq	%rax, p(%rip)
	movzbl	2(%rdx), %r8d
	movl	%r8d, %r11d
	andl	$15, %r8d
	movslq	%r8d, %rcx
	movl	%r8d, n(%rip)
	andl	$15, %r11d
	movl	$1, (%rdi,%rcx,4)
	movzbl	3(%rdx), %ecx
	cmpb	$31, %cl
	jle	.L68
	.p2align 4,,10
	.p2align 3
.L76:
	cmpb	$45, %cl
	je	.L134
	cmpb	$43, %cl
	je	.L135
	leal	-48(%rcx), %esi
	movl	$1, %edx
	cmpb	$9, %sil
	ja	.L73
.L89:
	xorl	%r9d, %r9d
.L70:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L74:
	addq	$1, %rax
	leal	(%rdx,%rdx,4), %ecx
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %edx
	movzbl	(%rax), %ecx
	leal	-48(%rcx), %esi
	cmpb	$9, %sil
	jbe	.L74
	movl	%edx, %esi
	negl	%esi
	testl	%r9d, %r9d
	cmovne	%esi, %edx
.L73:
	xorl	%esi, %esi
	cmpb	$120, %cl
	je	.L136
.L75:
	movslq	%esi, %rsi
	movl	%edx, (%rdi,%rsi,4)
	movzbl	(%rax), %ecx
	cmpb	$31, %cl
	jg	.L76
.L68:
	movslq	a(%rip), %r9
	movl	%r9d, %edi
	movq	%r9, %rsi
	negl	%edi
	cmovs	%r9d, %edi
	xorl	%eax, %eax
	movl	%edi, %ecx
	negl	%ecx
	testl	%r9d, %r9d
	cmove	%rax, %r9
	movslq	4+a(%rip), %rax
	xorl	%r10d, %r10d
	movq	%rax, 8(%rsp)
	movq	%rax, %rbx
	movslq	8+a(%rip), %rax
	movq	%rax, 16(%rsp)
	movq	%rax, %rbp
	movslq	12+a(%rip), %rax
	movq	%rax, 24(%rsp)
	movq	%rax, %r12
	movslq	16+a(%rip), %rax
	movq	%rax, 32(%rsp)
	movq	%rax, %r13
	movslq	20+a(%rip), %rax
	movq	%rax, 40(%rsp)
	movl	%eax, 4(%rsp)
	jmp	.L86
	.p2align 4,,10
	.p2align 3
.L77:
	addl	$1, %ecx
	cmpl	%edi, %ecx
	jg	.L87
.L86:
	testl	%ecx, %ecx
	je	.L77
	movl	%esi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	.L77
	movl	%ecx, %edx
	movq	%r9, %rax
	negl	%edx
	testb	%r11b, %r11b
	je	.L78
	testl	%ebx, %ebx
	je	.L79
	movslq	%edx, %rax
	imulq	8(%rsp), %rax
	addq	%r9, %rax
.L79:
	cmpl	$1, %r8d
	je	.L78
	testl	%ebp, %ebp
	je	.L80
	movslq	%edx, %r14
	imulq	%r14, %r14
	imulq	16(%rsp), %r14
	addq	%r14, %rax
.L80:
	cmpl	$2, %r8d
	je	.L78
	testl	%r12d, %r12d
	je	.L81
	movslq	%edx, %r14
	movq	%r14, %r15
	imulq	%r14, %r15
	imulq	%r15, %r14
	imulq	24(%rsp), %r14
	addq	%r14, %rax
.L81:
	cmpl	$3, %r8d
	je	.L78
	testl	%r13d, %r13d
	je	.L82
	movslq	%edx, %r14
	imulq	%r14, %r14
	imulq	%r14, %r14
	imulq	32(%rsp), %r14
	addq	%r14, %rax
.L82:
	cmpl	$4, %r8d
	je	.L78
	movl	4(%rsp), %r14d
	testl	%r14d, %r14d
	je	.L78
	movslq	%edx, %r15
	movq	%r15, %r14
	imulq	%r15, %r14
	movq	%r14, %rdx
	imulq	%r14, %rdx
	imulq	%r15, %rdx
	imulq	40(%rsp), %rdx
	addq	%rdx, %rax
	.p2align 4,,10
	.p2align 3
.L78:
	testq	%rax, %rax
	jne	.L77
	movslq	%r10d, %rax
	leaq	ans(%rip), %rdx
	addl	$1, %r10d
	movl	%ecx, (%rdx,%rax,4)
	cmpl	%r10d, %r8d
	jg	.L77
	.p2align 4,,10
	.p2align 3
.L87:
	xorl	%ebx, %ebx
	leaq	ans(%rip), %r12
	leaq	.LC0(%rip), %rbp
	testb	%r11b, %r11b
	je	.L85
	.p2align 4,,10
	.p2align 3
.L84:
	movl	(%r12,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L84
.L85:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	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
	.p2align 4,,10
	.p2align 3
.L134:
	.cfi_restore_state
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %ecx
	leal	-48(%rcx), %eax
	cmpb	$9, %al
	movq	%rdx, %rax
	movl	$-1, %edx
	ja	.L73
	movl	$1, %r9d
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L136:
	leaq	1(%rax), %rcx
	movq	%rcx, p(%rip)
	cmpb	$94, 1(%rax)
	je	.L137
	movq	%rcx, %rax
	movl	$1, %esi
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L135:
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %ecx
	leal	-48(%rcx), %eax
	cmpb	$9, %al
	movq	%rdx, %rax
	movl	$1, %edx
	ja	.L73
	jmp	.L89
	.p2align 4,,10
	.p2align 3
.L137:
	leaq	3(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	2(%rax), %esi
	movq	%rcx, %rax
	andl	$15, %esi
	jmp	.L75
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 100
buf:
	.zero	100
	.globl	ans
	.align 16
	.type	ans, @object
	.size	ans, 24
ans:
	.zero	24
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 16
	.type	a, @object
	.size	a, 24
a:
	.zero	24
	.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	getint
	.type	getint, @function
getint:
.LFB23:
	.cfi_startproc
	endbr64
	movq	p(%rip), %rax
	movzbl	(%rax), %edx
	cmpb	$45, %dl
	je	.L16
	cmpb	$43, %dl
	je	.L17
	subl	$48, %edx
	cmpb	$9, %dl
	ja	.L7
.L14:
	xorl	%edi, %edi
.L3:
	addq	$1, %rax
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %edx
	movq	%rax, %rcx
	leal	(%r8,%r8,4), %esi
	addq	$1, %rax
	andl	$15, %edx
	leal	(%rdx,%rsi,2), %r8d
	movzbl	(%rcx), %edx
	subl	$48, %edx
	cmpb	$9, %dl
	jbe	.L8
	movl	%r8d, %eax
	negl	%eax
	testl	%edi, %edi
	cmovne	%eax, %r8d
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %eax
	subl	$48, %eax
	cmpb	$9, %al
	jbe	.L10
.L7:
	movl	$1, %r8d
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	leaq	1(%rax), %rdx
	movl	$-1, %r8d
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %eax
	subl	$48, %eax
	cmpb	$9, %al
	ja	.L1
	movq	%rdx, %rax
	movl	$1, %edi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdx, %rax
	jmp	.L14
	.cfi_endproc
.LFE23:
	.size	getint, .-getint
	.p2align 4
	.globl	pow
	.type	pow, @function
pow:
.LFB24:
	.cfi_startproc
	endbr64
	leal	-1(%rsi), %eax
	testl	%esi, %esi
	je	.L21
	movslq	%edi, %rdi
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L20:
	imulq	%rdi, %r8
	subl	$1, %eax
	jnb	.L20
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE24:
	.size	pow, .-pow
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB25:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	movslq	%edi, %rax
	testl	%ecx, %ecx
	js	.L31
	movslq	a(%rip), %rsi
	je	.L25
	movslq	4+a(%rip), %rdx
	testl	%edx, %edx
	jne	.L62
.L26:
	cmpl	$1, %ecx
	je	.L25
	movslq	8+a(%rip), %rdx
	testl	%edx, %edx
	jne	.L63
.L27:
	cmpl	$2, %ecx
	je	.L25
	movslq	12+a(%rip), %rdx
	testl	%edx, %edx
	jne	.L64
	cmpl	$3, %ecx
	je	.L25
.L66:
	movslq	16+a(%rip), %rdi
	testl	%edi, %edi
	je	.L29
	movslq	%eax, %rdx
	imulq	%rdx, %rdx
	imulq	%rdx, %rdx
	imulq	%rdi, %rdx
	addq	%rdx, %rsi
.L29:
	cmpl	$4, %ecx
	je	.L25
	movslq	20+a(%rip), %rcx
	testl	%ecx, %ecx
	jne	.L65
.L25:
	xorl	%eax, %eax
	testq	%rsi, %rsi
	sete	%al
	ret
	.p2align 4,,10
	.p2align 3
.L62:
	movslq	%eax, %rdi
	imulq	%rdi, %rdx
	addq	%rdx, %rsi
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L63:
	movslq	%eax, %rdi
	imulq	%rdi, %rdi
	imulq	%rdx, %rdi
	addq	%rdi, %rsi
	jmp	.L27
.L64:
	movslq	%eax, %rdi
	movq	%rdi, %r8
	imulq	%rdi, %r8
	imulq	%r8, %rdi
	imulq	%rdx, %rdi
	addq	%rdi, %rsi
	cmpl	$3, %ecx
	jne	.L66
	jmp	.L25
.L65:
	movq	%rax, %rdx
	imulq	%rax, %rdx
	imulq	%rdx, %rdx
	imulq	%rdx, %rax
	imulq	%rcx, %rax
	addq	%rax, %rsi
	xorl	%eax, %eax
	testq	%rsi, %rsi
	sete	%al
	ret
.L31:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	check, .-check
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"(x%+d)"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	buf(%rip), %rdi
	movl	$100, %esi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	stdin(%rip), %rdx
	movq	%rdi, p(%rip)
	call	fgets@PLT
	movq	p(%rip), %rdx
	leaq	a(%rip), %rdi
	leaq	3(%rdx), %rax
	movq	%rax, p(%rip)
	movzbl	2(%rdx), %r8d
	movl	%r8d, %r11d
	andl	$15, %r8d
	movslq	%r8d, %rcx
	movl	%r8d, n(%rip)
	andl	$15, %r11d
	movl	$1, (%rdi,%rcx,4)
	movzbl	3(%rdx), %ecx
	cmpb	$31, %cl
	jle	.L68
	.p2align 4,,10
	.p2align 3
.L76:
	cmpb	$45, %cl
	je	.L134
	cmpb	$43, %cl
	je	.L135
	leal	-48(%rcx), %esi
	movl	$1, %edx
	cmpb	$9, %sil
	ja	.L73
.L89:
	xorl	%r9d, %r9d
.L70:
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L74:
	addq	$1, %rax
	leal	(%rdx,%rdx,4), %ecx
	movq	%rax, p(%rip)
	movzbl	-1(%rax), %edx
	andl	$15, %edx
	leal	(%rdx,%rcx,2), %edx
	movzbl	(%rax), %ecx
	leal	-48(%rcx), %esi
	cmpb	$9, %sil
	jbe	.L74
	movl	%edx, %esi
	negl	%esi
	testl	%r9d, %r9d
	cmovne	%esi, %edx
.L73:
	xorl	%esi, %esi
	cmpb	$120, %cl
	je	.L136
.L75:
	movslq	%esi, %rsi
	movl	%edx, (%rdi,%rsi,4)
	movzbl	(%rax), %ecx
	cmpb	$31, %cl
	jg	.L76
.L68:
	movslq	a(%rip), %r9
	movl	%r9d, %edi
	movq	%r9, %rsi
	negl	%edi
	cmovs	%r9d, %edi
	xorl	%eax, %eax
	movl	%edi, %ecx
	negl	%ecx
	testl	%r9d, %r9d
	cmove	%rax, %r9
	movslq	4+a(%rip), %rax
	xorl	%r10d, %r10d
	movq	%rax, 8(%rsp)
	movq	%rax, %rbx
	movslq	8+a(%rip), %rax
	movq	%rax, 16(%rsp)
	movq	%rax, %rbp
	movslq	12+a(%rip), %rax
	movq	%rax, 24(%rsp)
	movq	%rax, %r12
	movslq	16+a(%rip), %rax
	movq	%rax, 32(%rsp)
	movq	%rax, %r13
	movslq	20+a(%rip), %rax
	movq	%rax, 40(%rsp)
	movl	%eax, 4(%rsp)
	jmp	.L86
	.p2align 4,,10
	.p2align 3
.L77:
	addl	$1, %ecx
	cmpl	%edi, %ecx
	jg	.L87
.L86:
	testl	%ecx, %ecx
	je	.L77
	movl	%esi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	jne	.L77
	movl	%ecx, %edx
	movq	%r9, %rax
	negl	%edx
	testb	%r11b, %r11b
	je	.L78
	testl	%ebx, %ebx
	je	.L79
	movslq	%edx, %rax
	imulq	8(%rsp), %rax
	addq	%r9, %rax
.L79:
	cmpl	$1, %r8d
	je	.L78
	testl	%ebp, %ebp
	je	.L80
	movslq	%edx, %r14
	imulq	%r14, %r14
	imulq	16(%rsp), %r14
	addq	%r14, %rax
.L80:
	cmpl	$2, %r8d
	je	.L78
	testl	%r12d, %r12d
	je	.L81
	movslq	%edx, %r14
	movq	%r14, %r15
	imulq	%r14, %r15
	imulq	%r15, %r14
	imulq	24(%rsp), %r14
	addq	%r14, %rax
.L81:
	cmpl	$3, %r8d
	je	.L78
	testl	%r13d, %r13d
	je	.L82
	movslq	%edx, %r14
	imulq	%r14, %r14
	imulq	%r14, %r14
	imulq	32(%rsp), %r14
	addq	%r14, %rax
.L82:
	cmpl	$4, %r8d
	je	.L78
	movl	4(%rsp), %r14d
	testl	%r14d, %r14d
	je	.L78
	movslq	%edx, %r15
	movq	%r15, %r14
	imulq	%r15, %r14
	movq	%r14, %rdx
	imulq	%r14, %rdx
	imulq	%r15, %rdx
	imulq	40(%rsp), %rdx
	addq	%rdx, %rax
	.p2align 4,,10
	.p2align 3
.L78:
	testq	%rax, %rax
	jne	.L77
	movslq	%r10d, %rax
	leaq	ans(%rip), %rdx
	addl	$1, %r10d
	movl	%ecx, (%rdx,%rax,4)
	cmpl	%r10d, %r8d
	jg	.L77
	.p2align 4,,10
	.p2align 3
.L87:
	xorl	%ebx, %ebx
	leaq	ans(%rip), %r12
	leaq	.LC0(%rip), %rbp
	testb	%r11b, %r11b
	je	.L85
	.p2align 4,,10
	.p2align 3
.L84:
	movl	(%r12,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L84
.L85:
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	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
	.p2align 4,,10
	.p2align 3
.L134:
	.cfi_restore_state
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %ecx
	leal	-48(%rcx), %eax
	cmpb	$9, %al
	movq	%rdx, %rax
	movl	$-1, %edx
	ja	.L73
	movl	$1, %r9d
	jmp	.L70
	.p2align 4,,10
	.p2align 3
.L136:
	leaq	1(%rax), %rcx
	movq	%rcx, p(%rip)
	cmpb	$94, 1(%rax)
	je	.L137
	movq	%rcx, %rax
	movl	$1, %esi
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L135:
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	1(%rax), %ecx
	leal	-48(%rcx), %eax
	cmpb	$9, %al
	movq	%rdx, %rax
	movl	$1, %edx
	ja	.L73
	jmp	.L89
	.p2align 4,,10
	.p2align 3
.L137:
	leaq	3(%rax), %rcx
	movq	%rcx, p(%rip)
	movzbl	2(%rax), %esi
	movq	%rcx, %rax
	andl	$15, %esi
	jmp	.L75
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 100
buf:
	.zero	100
	.globl	ans
	.align 16
	.type	ans, @object
	.size	ans, 24
ans:
	.zero	24
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 16
	.type	a, @object
	.size	a, 24
a:
	.zero	24
	.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:

// AOJ 3002: Factorization
// 2017.11.29 bal4u@uu

#include <stdio.h>

int a[6], n;
int ans[6];

char buf[100], *p;
int getint()
{
	int n = 1;
	int minus = 0;

	if (*p == '-') p++, minus = 1;
	else if (*p == '+') p++;
	if (*p >= '0' && *p <= '9') {
		n = 0;
		while (*p >= '0' && *p <= '9') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	}
	if (minus) n = -n;
	return n;
}

long long pow(int x, int k)
{
	long long t = 1;
	while (k--) t = t * x;
	return t;
}

int check(int v)
{
	int i;
	long long s = 0;
	for (i = 0; i <= n; i++) {
		if (a[i] == 0) continue;
		s += a[i] * pow(v, i);
	}
	return s == 0;
}

int main()
{
	int i, k, c;

    fgets(p=buf, 100, stdin);
	p += 2, n = *p++ & 0xf, a[n] = 1;
	while (*p >= ' ') {
		k = getint(), i = 0;
		if (*p == 'x') {
			i = 1, p++;
			if (*p == '^') p++, i = *p++ & 0xf;
		}
		a[i] = k;
	}

	c = a[0]; if (c < 0) c = -c;
	for (i = 0, k = -c; k <= c; k++) if (k != 0) {
		if (a[0] % k == 0 && check(-k)) {
			ans[i] = k;	if (++i >= n) break;
		}
	}
	for (i = 0; i < n; i++) printf("(x%+d)", ans[i]);
	putchar('\n');
    return 0;
}
x^1-2
 x^1-1
 x^1-3
 x^1-4
 x^2-4
 x^1-5
 x^1-6
 x^1+6
 x^1+5
 x^1+7

(x-2)
 (x-1)
 (x-3)
 (x-4)
 (x-2)(x+2)
 (x-5)
 (x-6)
 (x+6)
 (x+5)
 (x+7)

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

```c
// AOJ 3002: Factorization
// 2017.11.29 bal4u@uu

#include <stdio.h>

int a[6], n;
int ans[6];

char buf[100], *p;
int getint()
{
	int n = 1;
	int minus = 0;

	if (*p == '-') p++, minus = 1;
	else if (*p == '+') p++;
	if (*p >= '0' && *p <= '9') {
		n = 0;
		while (*p >= '0' && *p <= '9') n = (n<<3) + (n<<1) + (*p++ & 0xf);
	}
	if (minus) n = -n;
	return n;
}

long long pow(int x, int k)
{
	long long t = 1;
	while (k--) t = t * x;
	return t;
}

int check(int v)
{
	int i;
	long long s = 0;
	for (i = 0; i <= n; i++) {
		if (a[i] == 0) continue;
		s += a[i] * pow(v, i);
	}
	return s == 0;
}

int main()
{
	int i, k, c;

    fgets(p=buf, 100, stdin);
	p += 2, n = *p++ & 0xf, a[n] = 1;
	while (*p >= ' ') {
		k = getint(), i = 0;
		if (*p == 'x') {
			i = 1, p++;
			if (*p == '^') p++, i = *p++ & 0xf;
		}
		a[i] = k;
	}

	c = a[0]; if (c < 0) c = -c;
	for (i = 0, k = -c; k <= c; k++) if (k != 0) {
		if (a[0] % k == 0 && check(-k)) {
			ans[i] = k;	if (++i >= n) break;
		}
	}
	for (i = 0; i < n; i++) printf("(x%+d)", ans[i]);
	putchar('\n');
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 16
	.type	a, @object
	.size	a, 24
a:
	.zero	24
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ans
	.align 16
	.type	ans, @object
	.size	ans, 24
ans:
	.zero	24
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 100
buf:
	.zero	100
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.text
	.globl	getint
	.type	getint, @function
getint:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$1, -8(%rbp)
	movl	$0, -4(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$45, %al
	jne	.L2
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	$1, -4(%rbp)
	jmp	.L3
.L2:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$43, %al
	jne	.L3
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
.L3:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jle	.L4
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$57, %al
	jg	.L4
	movl	$0, -8(%rbp)
	jmp	.L5
.L6:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -8(%rbp)
.L5:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jle	.L4
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$57, %al
	jle	.L6
.L4:
	cmpl	$0, -4(%rbp)
	je	.L7
	negl	-8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getint, .-getint
	.globl	pow
	.type	pow, @function
pow:
.LFB1:
	.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	$1, -8(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L10:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L11
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	pow, .-pow
	.globl	check
	.type	check, @function
check:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -28(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L14
.L17:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L19
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rbx
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	pow
	imulq	%rbx, %rax
	addq	%rax, -16(%rbp)
	jmp	.L16
.L19:
	nop
.L16:
	addl	$1, -20(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L17
	cmpq	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	check, .-check
	.section	.rodata
.LC0:
	.string	"(x%+d)"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$100, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movq	p(%rip), %rax
	addq	$2, %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	movl	%eax, n(%rip)
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L21
.L23:
	movl	$0, %eax
	call	getint
	movl	%eax, -8(%rbp)
	movl	$0, -12(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	jne	.L22
	movl	$1, -12(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$94, %al
	jne	.L22
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	movl	%eax, -12(%rbp)
.L22:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L21:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$31, %al
	jg	.L23
	movl	a(%rip), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L24
	negl	-4(%rbp)
.L24:
	movl	$0, -12(%rbp)
	movl	-4(%rbp), %eax
	negl	%eax
	movl	%eax, -8(%rbp)
	jmp	.L25
.L28:
	cmpl	$0, -8(%rbp)
	je	.L26
	movl	a(%rip), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L26
	movl	-8(%rbp), %eax
	negl	%eax
	movl	%eax, %edi
	call	check
	testl	%eax, %eax
	je	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ans(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L32
.L26:
	addl	$1, -8(%rbp)
.L25:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L28
	jmp	.L27
.L32:
	nop
.L27:
	movl	$0, -12(%rbp)
	jmp	.L29
.L30:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L29:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L30
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	a
	.bss
	.align 16
	.type	a, @object
	.size	a, 24
a:
	.zero	24
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	ans
	.align 16
	.type	ans, @object
	.size	ans, 24
ans:
	.zero	24
	.globl	buf
	.align 32
	.type	buf, @object
	.size	buf, 100
buf:
	.zero	100
	.globl	p
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.text
	.globl	getint
	.type	getint, @function
getint:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$1, -8(%rbp)
	movl	$0, -4(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$45, %al
	jne	.L2
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movl	$1, -4(%rbp)
	jmp	.L3
.L2:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$43, %al
	jne	.L3
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
.L3:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jle	.L4
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$57, %al
	jg	.L4
	movl	$0, -8(%rbp)
	jmp	.L5
.L6:
	movl	-8(%rbp), %eax
	leal	0(,%rax,8), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %eax
	leal	(%rdx,%rax), %ecx
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	addl	%ecx, %eax
	movl	%eax, -8(%rbp)
.L5:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$47, %al
	jle	.L4
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$57, %al
	jle	.L6
.L4:
	cmpl	$0, -4(%rbp)
	je	.L7
	negl	-8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getint, .-getint
	.globl	pow
	.type	pow, @function
pow:
.LFB1:
	.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	$1, -8(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	movq	-8(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L10:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L11
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	pow, .-pow
	.globl	check
	.type	check, @function
check:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -28(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L14
.L17:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L19
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rbx
	movl	-20(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	pow
	imulq	%rbx, %rax
	addq	%rax, -16(%rbp)
	jmp	.L16
.L19:
	nop
.L16:
	addl	$1, -20(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L17
	cmpq	$0, -16(%rbp)
	sete	%al
	movzbl	%al, %eax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	check, .-check
	.section	.rodata
.LC0:
	.string	"(x%+d)"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	stdin(%rip), %rdx
	leaq	buf(%rip), %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movl	$100, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movq	p(%rip), %rax
	addq	$2, %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	movl	%eax, n(%rip)
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$1, (%rdx,%rax)
	jmp	.L21
.L23:
	movl	$0, %eax
	call	getint
	movl	%eax, -8(%rbp)
	movl	$0, -12(%rbp)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	jne	.L22
	movl	$1, -12(%rbp)
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$94, %al
	jne	.L22
	movq	p(%rip), %rax
	addq	$1, %rax
	movq	%rax, p(%rip)
	movq	p(%rip), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, p(%rip)
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	andl	$15, %eax
	movl	%eax, -12(%rbp)
.L22:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	a(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L21:
	movq	p(%rip), %rax
	movzbl	(%rax), %eax
	cmpb	$31, %al
	jg	.L23
	movl	a(%rip), %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jns	.L24
	negl	-4(%rbp)
.L24:
	movl	$0, -12(%rbp)
	movl	-4(%rbp), %eax
	negl	%eax
	movl	%eax, -8(%rbp)
	jmp	.L25
.L28:
	cmpl	$0, -8(%rbp)
	je	.L26
	movl	a(%rip), %eax
	cltd
	idivl	-8(%rbp)
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L26
	movl	-8(%rbp), %eax
	negl	%eax
	movl	%eax, %edi
	call	check
	testl	%eax, %eax
	je	.L26
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	ans(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L32
.L26:
	addl	$1, -8(%rbp)
.L25:
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jle	.L28
	jmp	.L27
.L32:
	nop
.L27:
	movl	$0, -12(%rbp)
	jmp	.L29
.L30:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L29:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L30
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
