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>

long long int power(long long int a, int n){
	if(n == 0){
		return 1;
	}
	else if(n % 2 == 0){
		return power(a * a, n / 2);
	}
	else{
		return a * power(a, n - 1);
	}
}

int main(){
	int N, A, i, j, xsub, k, l;
	scanf("%d%d", &N, &A);
	int x[2][N], xnum[2] = {0, 0}, xznum = 0;
	for(i = 0; i < N; i++){
		scanf("%d", &xsub);
		if(xsub == A){
			xznum++;
		}
		else if(xsub > A){
			x[0][xnum[0]] = xsub - A;
			xnum[0]++;
		}
		else{
			x[1][xnum[1]] = A - xsub;
			xnum[1]++;
		}
	}
	if(xnum[0] < xnum[1]){
		k = 0;
		l = 1;
	}
	else{
		k = 1;
		l = 0;
	}
	long long int way[N * 25], sum = 0;
	way[0] = power(2, xznum);
	for(i = 1; i < N * 25; i++){
		way[i] = 0;
	}
	for(i = 0; i < xnum[k]; i++){
		sum += x[k][i];
		for(j = sum; j >= x[k][i]; j--){
			way[j] += way[j - x[k][i]];
		}
	}
	for(i = 0; i < xnum[l]; i++){
		for(j = 0; j <= sum - x[l][i]; j++){
			way[j] += way[j + x[l][i]];
		}
	}
	printf("%lld\n", way[0] - 1);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	power
	.type	power, @function
power:
.LFB0:
	.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	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	cmpl	$0, -12(%rbp)
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-12(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L4
	movl	-12(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	imulq	%rax, %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	power
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	power
	imulq	-8(%rbp), %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$160, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rbx
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L6:
	cmpq	%rdx, %rsp
	je	.L7
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L6
.L7:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L8
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L8:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -92(%rbp)
	movl	$0, -108(%rbp)
	jmp	.L9
.L13:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-112(%rbp), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
	addl	$1, -92(%rbp)
	jmp	.L11
.L10:
	movl	-112(%rbp), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L12
	movl	-112(%rbp), %eax
	movl	-116(%rbp), %esi
	movl	-48(%rbp), %edx
	subl	%esi, %eax
	movl	%eax, %ecx
	movq	-72(%rbp), %rax
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movl	-48(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
	jmp	.L11
.L12:
	movl	-116(%rbp), %eax
	movl	-112(%rbp), %esi
	movq	%rbx, %rdi
	shrq	$2, %rdi
	movl	-44(%rbp), %edx
	subl	%esi, %eax
	movl	%eax, %ecx
	movq	-72(%rbp), %rax
	movslq	%edx, %rdx
	addq	%rdi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -44(%rbp)
.L11:
	addl	$1, -108(%rbp)
.L9:
	movl	-120(%rbp), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L13
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	$0, -100(%rbp)
	movl	$1, -96(%rbp)
	jmp	.L15
.L14:
	movl	$1, -100(%rbp)
	movl	$0, -96(%rbp)
.L15:
	movl	-120(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	leal	0(,%rax,4), %edx
	addl	%edx, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -64(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L18
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L18:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -56(%rbp)
	movq	$0, -88(%rbp)
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	movl	$2, %edi
	call	power
	movq	-56(%rbp), %rdx
	movq	%rax, (%rdx)
	movl	$1, -108(%rbp)
	jmp	.L19
.L20:
	movq	-56(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movq	$0, (%rax,%rdx,8)
	addl	$1, -108(%rbp)
.L19:
	movl	-120(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	leal	0(,%rax,4), %edx
	addl	%edx, %eax
	cmpl	%eax, -108(%rbp)
	jl	.L20
	movl	$0, -108(%rbp)
	jmp	.L21
.L24:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rsi
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	addq	%rax, -88(%rbp)
	movq	-88(%rbp), %rax
	movl	%eax, -104(%rbp)
	jmp	.L22
.L23:
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdi
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdi, %rdx
	movl	(%rax,%rdx,4), %ecx
	movl	-104(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movq	-56(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	(%rsi,%rax), %rcx
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	subl	$1, -104(%rbp)
.L22:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rsi
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -104(%rbp)
	jge	.L23
	addl	$1, -108(%rbp)
.L21:
	movl	-100(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L24
	movl	$0, -108(%rbp)
	jmp	.L25
.L28:
	movl	$0, -104(%rbp)
	jmp	.L26
.L27:
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdi
	movl	-96(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdi, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-104(%rbp), %eax
	addl	%eax, %edx
	movq	-56(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	(%rsi,%rax), %rcx
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -104(%rbp)
.L26:
	movl	-104(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	movslq	%eax, %rcx
	movq	-88(%rbp), %rax
	subq	%rcx, %rax
	cmpq	%rax, %rdx
	jle	.L27
	addl	$1, -108(%rbp)
.L25:
	movl	-96(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L28
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	power
	.type	power, @function
power:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %eax
	testl	%esi, %esi
	je	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	testb	$1, %sil
	jne	.L3
	movl	%esi, %edx
	imulq	%rdi, %rdi
	shrl	$31, %edx
	addl	%edx, %esi
	sarl	%esi
	jne	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	imulq	%rdi, %rax
	subl	$1, %esi
	jne	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	ret
	.cfi_endproc
.LFE23:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\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), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-76(%rbp), %rax
	movq	%rsp, %rsi
	leaq	0(,%rax,4), %rdi
	movq	%rax, %rdx
	leaq	15(,%rax,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	movq	%rdi, -104(%rbp)
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L16
.L93:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L93
.L16:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L94
.L17:
	movq	%rsp, -88(%rbp)
	movq	$0, -64(%rbp)
	testl	%edx, %edx
	jle	.L95
	movq	-104(%rbp), %rax
	movl	$0, -92(%rbp)
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	leaq	-68(%rbp), %r15
	leaq	.LC1(%rip), %r14
	shrq	$2, %rax
	movq	%rax, -112(%rbp)
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L23:
	jle	.L25
	movslq	-92(%rbp), %rsi
	subl	%eax, %ecx
	movq	-88(%rbp), %rax
	movq	%rsi, %rdi
	movl	%ecx, (%rax,%rsi,4)
	addl	$1, %edi
	movl	%edi, -92(%rbp)
	movl	%edi, -64(%rbp)
.L24:
	movl	-76(%rbp), %eax
	addl	$1, %ebx
	cmpl	%ebx, %eax
	jle	.L96
.L26:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %ecx
	movl	-72(%rbp), %eax
	cmpl	%eax, %ecx
	jne	.L23
	movl	-76(%rbp), %eax
	addl	$1, %ebx
	addl	$1, %r13d
	cmpl	%ebx, %eax
	jg	.L26
.L96:
	leal	(%rax,%rax,4), %eax
	xorl	%r15d, %r15d
	cmpl	-92(%rbp), %r12d
	movq	%rsp, %rdi
	leal	(%rax,%rax,4), %esi
	setle	%r12b
	setg	%r15b
	movslq	%esi, %rax
	movzbl	%r12b, %r12d
	leaq	15(,%rax,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	andq	$-16, %rcx
	subq	%rax, %rdi
.L28:
	cmpq	%rdi, %rsp
	je	.L29
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L25:
	movq	-88(%rbp), %rdi
	movslq	%r12d, %rsi
	subl	%ecx, %eax
	addq	-112(%rbp), %rsi
	addl	$1, %r12d
	movl	%eax, (%rdi,%rsi,4)
	movl	%r12d, -60(%rbp)
	jmp	.L24
.L29:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L97
.L30:
	leaq	7(%rsp), %rdi
	movq	%rdi, %r8
	andq	$-8, %rdi
	shrq	$3, %r8
	movq	%rdi, %rbx
	testl	%r13d, %r13d
	je	.L58
	movl	$2, %eax
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L34:
	testb	$1, %r13b
	jne	.L32
	imulq	%rax, %rax
	sarl	%r13d
	jne	.L34
.L31:
	movq	%rcx, 0(,%r8,8)
	cmpl	$1, %esi
	jle	.L22
	leal	-1(%rsi), %edx
	addq	$8, %rdi
	xorl	%esi, %esi
	salq	$3, %rdx
	call	memset@PLT
.L22:
	movl	-64(%rbp,%r12,4), %edx
	xorl	%r9d, %r9d
	testl	%edx, %edx
	jle	.L37
	movq	-104(%rbp), %rax
	movq	-88(%rbp), %rdi
	subl	$1, %edx
	xorl	%r9d, %r9d
	leaq	-8(%rbx), %r14
	movq	%rax, %r11
	shrq	$2, %rax
	imulq	%r12, %rax
	imulq	%r12, %r11
	addq	%rdx, %rax
	addq	%rdi, %r11
	leaq	4(%rdi,%rax,4), %r12
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	(%r11), %rdx
	addq	%rdx, %r9
	movq	%rdx, %rdi
	movslq	%r9d, %rax
	cmpl	%r9d, %edx
	jg	.L43
	movl	%r9d, %r8d
	subl	%edx, %r8d
	cmpl	$-1, %edx
	je	.L40
	cmpl	$1, %r8d
	jbe	.L40
	movslq	%eax, %rsi
	addl	$1, %r8d
	leaq	-8(%rbx,%rsi,8), %rcx
	subq	%rdx, %rsi
	xorl	%edx, %edx
	leaq	-8(%rbx,%rsi,8), %r10
	movl	%r8d, %esi
	shrl	%esi
	negq	%rsi
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L41:
	movdqu	(%rcx,%rdx), %xmm0
	movdqu	(%r10,%rdx), %xmm1
	shufpd	$1, %xmm0, %xmm0
	shufpd	$1, %xmm1, %xmm1
	paddq	%xmm1, %xmm0
	shufpd	$1, %xmm0, %xmm0
	movups	%xmm0, (%rcx,%rdx)
	subq	$16, %rdx
	cmpq	%rsi, %rdx
	jne	.L41
	movl	%r8d, %edx
	andl	$-2, %edx
	subl	%edx, %eax
	cmpl	%edx, %r8d
	je	.L43
	movslq	%eax, %rdx
	subl	%edi, %eax
	cltq
	movq	(%rbx,%rax,8), %rax
	addq	%rax, (%rbx,%rdx,8)
.L43:
	addq	$4, %r11
	cmpq	%r12, %r11
	jne	.L39
.L37:
	movl	-64(%rbp,%r15,4), %edx
	testl	%edx, %edx
	jle	.L47
	movq	-104(%rbp), %rax
	movq	-88(%rbp), %rdi
	subl	$1, %edx
	leaq	8(%rbx), %r8
	movq	%rax, %rsi
	shrq	$2, %rax
	imulq	%r15, %rax
	imulq	%r15, %rsi
	addq	%rdx, %rax
	addq	%rdi, %rsi
	leaq	4(%rdi,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L48:
	movslq	(%rsi), %rdx
	movq	%r9, %r10
	movq	%rdx, %rcx
	subq	%rdx, %r10
	js	.L55
	cmpl	$-1, %ecx
	je	.L49
	cmpq	$1, %r10
	jbe	.L49
	addq	$1, %r10
	leaq	(%rbx,%rdx,8), %r11
	xorl	%eax, %eax
	movq	%r10, %rdx
	shrq	%rdx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L50:
	movdqu	(%rbx,%rax), %xmm0
	movdqu	(%r11,%rax), %xmm4
	paddq	%xmm4, %xmm0
	movups	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L50
	movq	%r10, %rax
	andq	$-2, %rax
	andl	$1, %r10d
	je	.L55
	movslq	%eax, %rdx
	addl	%ecx, %eax
	cltq
	movq	(%rbx,%rax,8), %rax
	addq	%rax, (%rbx,%rdx,8)
.L55:
	addq	$4, %rsi
	cmpq	%rdi, %rsi
	jne	.L48
.L47:
	movq	(%rbx), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	subq	$1, %rdx
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L98
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	imulq	%rax, %rcx
	subl	$1, %r13d
	jne	.L34
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L49:
	movq	%rbx, %rax
	leaq	(%r8,%r10,8), %r10
	.p2align 4,,10
	.p2align 3
.L52:
	movq	(%rax,%rdx,8), %rcx
	addq	%rcx, (%rax)
	addq	$8, %rax
	cmpq	%r10, %rax
	jne	.L52
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L40:
	leaq	0(,%rax,8), %rcx
	movl	%r8d, %esi
	movslq	%r8d, %r8
	leaq	(%rbx,%rcx), %rdx
	salq	$3, %rsi
	addq	%r14, %rcx
	subq	%rax, %r8
	subq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L45:
	movq	(%rdx,%r8,8), %rax
	addq	%rax, (%rdx)
	subq	$8, %rdx
	cmpq	%rcx, %rdx
	jne	.L45
	jmp	.L43
.L94:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L17
.L97:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L30
.L95:
	imull	$25, %edx, %eax
	movq	%rsp, %rcx
	cltq
	leaq	15(,%rax,8), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L19:
	cmpq	%rcx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L21
	orq	$0, -8(%rsp,%rax)
.L21:
	leaq	7(%rsp), %rbx
	movl	$1, %r12d
	xorl	%r15d, %r15d
	movq	%rbx, %rax
	andq	$-8, %rbx
	shrq	$3, %rax
	movq	$1, 0(,%rax,8)
	jmp	.L22
.L58:
	movl	$1, %ecx
	jmp	.L31
.L98:
	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
	.file	"temp.c"
	.text
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %eax
	testl	%esi, %esi
	je	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	testb	$1, %sil
	jne	.L3
	movl	%esi, %edx
	imulq	%rdi, %rdi
	shrl	$31, %edx
	addl	%edx, %esi
	sarl	%esi
	jne	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	imulq	%rdi, %rax
	subl	$1, %esi
	jne	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	ret
	.cfi_endproc
.LFE23:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\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), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-72(%rbp), %rdx
	leaq	-76(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-76(%rbp), %rax
	movq	%rsp, %rsi
	leaq	0(,%rax,4), %rdi
	movq	%rax, %rdx
	leaq	15(,%rax,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	movq	%rdi, -104(%rbp)
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L16
.L93:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L93
.L16:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L94
.L17:
	movq	%rsp, -88(%rbp)
	movq	$0, -64(%rbp)
	testl	%edx, %edx
	jle	.L95
	movq	-104(%rbp), %rax
	movl	$0, -92(%rbp)
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	leaq	-68(%rbp), %r15
	leaq	.LC1(%rip), %r14
	shrq	$2, %rax
	movq	%rax, -112(%rbp)
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L23:
	jle	.L25
	movslq	-92(%rbp), %rsi
	subl	%eax, %ecx
	movq	-88(%rbp), %rax
	movq	%rsi, %rdi
	movl	%ecx, (%rax,%rsi,4)
	addl	$1, %edi
	movl	%edi, -92(%rbp)
	movl	%edi, -64(%rbp)
.L24:
	movl	-76(%rbp), %eax
	addl	$1, %ebx
	cmpl	%ebx, %eax
	jle	.L96
.L26:
	movq	%r15, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %ecx
	movl	-72(%rbp), %eax
	cmpl	%eax, %ecx
	jne	.L23
	movl	-76(%rbp), %eax
	addl	$1, %ebx
	addl	$1, %r13d
	cmpl	%ebx, %eax
	jg	.L26
.L96:
	leal	(%rax,%rax,4), %eax
	xorl	%r15d, %r15d
	cmpl	-92(%rbp), %r12d
	movq	%rsp, %rdi
	leal	(%rax,%rax,4), %esi
	setle	%r12b
	setg	%r15b
	movslq	%esi, %rax
	movzbl	%r12b, %r12d
	leaq	15(,%rax,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	andq	$-16, %rcx
	subq	%rax, %rdi
.L28:
	cmpq	%rdi, %rsp
	je	.L29
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L25:
	movq	-88(%rbp), %rdi
	movslq	%r12d, %rsi
	subl	%ecx, %eax
	addq	-112(%rbp), %rsi
	addl	$1, %r12d
	movl	%eax, (%rdi,%rsi,4)
	movl	%r12d, -60(%rbp)
	jmp	.L24
.L29:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L97
.L30:
	leaq	7(%rsp), %rdi
	movq	%rdi, %r8
	andq	$-8, %rdi
	shrq	$3, %r8
	movq	%rdi, %rbx
	testl	%r13d, %r13d
	je	.L58
	movl	$2, %eax
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L34:
	testb	$1, %r13b
	jne	.L32
	imulq	%rax, %rax
	sarl	%r13d
	jne	.L34
.L31:
	movq	%rcx, 0(,%r8,8)
	cmpl	$1, %esi
	jle	.L22
	leal	-1(%rsi), %edx
	addq	$8, %rdi
	xorl	%esi, %esi
	salq	$3, %rdx
	call	memset@PLT
.L22:
	movl	-64(%rbp,%r12,4), %edx
	xorl	%r9d, %r9d
	testl	%edx, %edx
	jle	.L37
	movq	-104(%rbp), %rax
	movq	-88(%rbp), %rdi
	subl	$1, %edx
	xorl	%r9d, %r9d
	leaq	-8(%rbx), %r14
	movq	%rax, %r11
	shrq	$2, %rax
	imulq	%r12, %rax
	imulq	%r12, %r11
	addq	%rdx, %rax
	addq	%rdi, %r11
	leaq	4(%rdi,%rax,4), %r12
	.p2align 4,,10
	.p2align 3
.L39:
	movslq	(%r11), %rdx
	addq	%rdx, %r9
	movq	%rdx, %rdi
	movslq	%r9d, %rax
	cmpl	%r9d, %edx
	jg	.L43
	movl	%r9d, %r8d
	subl	%edx, %r8d
	cmpl	$-1, %edx
	je	.L40
	cmpl	$1, %r8d
	jbe	.L40
	movslq	%eax, %rsi
	addl	$1, %r8d
	leaq	-8(%rbx,%rsi,8), %rcx
	subq	%rdx, %rsi
	xorl	%edx, %edx
	leaq	-8(%rbx,%rsi,8), %r10
	movl	%r8d, %esi
	shrl	%esi
	negq	%rsi
	salq	$4, %rsi
	.p2align 4,,10
	.p2align 3
.L41:
	movdqu	(%rcx,%rdx), %xmm0
	movdqu	(%r10,%rdx), %xmm1
	shufpd	$1, %xmm0, %xmm0
	shufpd	$1, %xmm1, %xmm1
	paddq	%xmm1, %xmm0
	shufpd	$1, %xmm0, %xmm0
	movups	%xmm0, (%rcx,%rdx)
	subq	$16, %rdx
	cmpq	%rsi, %rdx
	jne	.L41
	movl	%r8d, %edx
	andl	$-2, %edx
	subl	%edx, %eax
	cmpl	%edx, %r8d
	je	.L43
	movslq	%eax, %rdx
	subl	%edi, %eax
	cltq
	movq	(%rbx,%rax,8), %rax
	addq	%rax, (%rbx,%rdx,8)
.L43:
	addq	$4, %r11
	cmpq	%r12, %r11
	jne	.L39
.L37:
	movl	-64(%rbp,%r15,4), %edx
	testl	%edx, %edx
	jle	.L47
	movq	-104(%rbp), %rax
	movq	-88(%rbp), %rdi
	subl	$1, %edx
	leaq	8(%rbx), %r8
	movq	%rax, %rsi
	shrq	$2, %rax
	imulq	%r15, %rax
	imulq	%r15, %rsi
	addq	%rdx, %rax
	addq	%rdi, %rsi
	leaq	4(%rdi,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L48:
	movslq	(%rsi), %rdx
	movq	%r9, %r10
	movq	%rdx, %rcx
	subq	%rdx, %r10
	js	.L55
	cmpl	$-1, %ecx
	je	.L49
	cmpq	$1, %r10
	jbe	.L49
	addq	$1, %r10
	leaq	(%rbx,%rdx,8), %r11
	xorl	%eax, %eax
	movq	%r10, %rdx
	shrq	%rdx
	salq	$4, %rdx
	.p2align 4,,10
	.p2align 3
.L50:
	movdqu	(%rbx,%rax), %xmm0
	movdqu	(%r11,%rax), %xmm4
	paddq	%xmm4, %xmm0
	movups	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L50
	movq	%r10, %rax
	andq	$-2, %rax
	andl	$1, %r10d
	je	.L55
	movslq	%eax, %rdx
	addl	%ecx, %eax
	cltq
	movq	(%rbx,%rax,8), %rax
	addq	%rax, (%rbx,%rdx,8)
.L55:
	addq	$4, %rsi
	cmpq	%rdi, %rsi
	jne	.L48
.L47:
	movq	(%rbx), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	subq	$1, %rdx
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L98
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	imulq	%rax, %rcx
	subl	$1, %r13d
	jne	.L34
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L49:
	movq	%rbx, %rax
	leaq	(%r8,%r10,8), %r10
	.p2align 4,,10
	.p2align 3
.L52:
	movq	(%rax,%rdx,8), %rcx
	addq	%rcx, (%rax)
	addq	$8, %rax
	cmpq	%r10, %rax
	jne	.L52
	jmp	.L55
	.p2align 4,,10
	.p2align 3
.L40:
	leaq	0(,%rax,8), %rcx
	movl	%r8d, %esi
	movslq	%r8d, %r8
	leaq	(%rbx,%rcx), %rdx
	salq	$3, %rsi
	addq	%r14, %rcx
	subq	%rax, %r8
	subq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L45:
	movq	(%rdx,%r8,8), %rax
	addq	%rax, (%rdx)
	subq	$8, %rdx
	cmpq	%rcx, %rdx
	jne	.L45
	jmp	.L43
.L94:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L17
.L97:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L30
.L95:
	imull	$25, %edx, %eax
	movq	%rsp, %rcx
	cltq
	leaq	15(,%rax,8), %rdx
	movq	%rdx, %rax
	andq	$-4096, %rdx
	andq	$-16, %rax
	subq	%rdx, %rcx
.L19:
	cmpq	%rcx, %rsp
	je	.L20
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L19
.L20:
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L21
	orq	$0, -8(%rsp,%rax)
.L21:
	leaq	7(%rsp), %rbx
	movl	$1, %r12d
	xorl	%r15d, %r15d
	movq	%rbx, %rax
	andq	$-8, %rbx
	shrq	$3, %rax
	movq	$1, 0(,%rax,8)
	jmp	.L22
.L58:
	movl	$1, %ecx
	jmp	.L31
.L98:
	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:

#include <stdio.h>

long long int power(long long int a, int n){
	if(n == 0){
		return 1;
	}
	else if(n % 2 == 0){
		return power(a * a, n / 2);
	}
	else{
		return a * power(a, n - 1);
	}
}

int main(){
	int N, A, i, j, xsub, k, l;
	scanf("%d%d", &N, &A);
	int x[2][N], xnum[2] = {0, 0}, xznum = 0;
	for(i = 0; i < N; i++){
		scanf("%d", &xsub);
		if(xsub == A){
			xznum++;
		}
		else if(xsub > A){
			x[0][xnum[0]] = xsub - A;
			xnum[0]++;
		}
		else{
			x[1][xnum[1]] = A - xsub;
			xnum[1]++;
		}
	}
	if(xnum[0] < xnum[1]){
		k = 0;
		l = 1;
	}
	else{
		k = 1;
		l = 0;
	}
	long long int way[N * 25], sum = 0;
	way[0] = power(2, xznum);
	for(i = 1; i < N * 25; i++){
		way[i] = 0;
	}
	for(i = 0; i < xnum[k]; i++){
		sum += x[k][i];
		for(j = sum; j >= x[k][i]; j--){
			way[j] += way[j - x[k][i]];
		}
	}
	for(i = 0; i < xnum[l]; i++){
		for(j = 0; j <= sum - x[l][i]; j++){
			way[j] += way[j + x[l][i]];
		}
	}
	printf("%lld\n", way[0] - 1);
	return 0;
}
4 8
7 9 8 9

5

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>

long long int power(long long int a, int n){
	if(n == 0){
		return 1;
	}
	else if(n % 2 == 0){
		return power(a * a, n / 2);
	}
	else{
		return a * power(a, n - 1);
	}
}

int main(){
	int N, A, i, j, xsub, k, l;
	scanf("%d%d", &N, &A);
	int x[2][N], xnum[2] = {0, 0}, xznum = 0;
	for(i = 0; i < N; i++){
		scanf("%d", &xsub);
		if(xsub == A){
			xznum++;
		}
		else if(xsub > A){
			x[0][xnum[0]] = xsub - A;
			xnum[0]++;
		}
		else{
			x[1][xnum[1]] = A - xsub;
			xnum[1]++;
		}
	}
	if(xnum[0] < xnum[1]){
		k = 0;
		l = 1;
	}
	else{
		k = 1;
		l = 0;
	}
	long long int way[N * 25], sum = 0;
	way[0] = power(2, xznum);
	for(i = 1; i < N * 25; i++){
		way[i] = 0;
	}
	for(i = 0; i < xnum[k]; i++){
		sum += x[k][i];
		for(j = sum; j >= x[k][i]; j--){
			way[j] += way[j - x[k][i]];
		}
	}
	for(i = 0; i < xnum[l]; i++){
		for(j = 0; j <= sum - x[l][i]; j++){
			way[j] += way[j + x[l][i]];
		}
	}
	printf("%lld\n", way[0] - 1);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	power
	.type	power, @function
power:
.LFB0:
	.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	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	cmpl	$0, -12(%rbp)
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-12(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L4
	movl	-12(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	imulq	%rax, %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	power
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	power
	imulq	-8(%rbp), %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$160, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rbx
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L6:
	cmpq	%rdx, %rsp
	je	.L7
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L6
.L7:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L8
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L8:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -92(%rbp)
	movl	$0, -108(%rbp)
	jmp	.L9
.L13:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-112(%rbp), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
	addl	$1, -92(%rbp)
	jmp	.L11
.L10:
	movl	-112(%rbp), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L12
	movl	-112(%rbp), %eax
	movl	-116(%rbp), %esi
	movl	-48(%rbp), %edx
	subl	%esi, %eax
	movl	%eax, %ecx
	movq	-72(%rbp), %rax
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movl	-48(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
	jmp	.L11
.L12:
	movl	-116(%rbp), %eax
	movl	-112(%rbp), %esi
	movq	%rbx, %rdi
	shrq	$2, %rdi
	movl	-44(%rbp), %edx
	subl	%esi, %eax
	movl	%eax, %ecx
	movq	-72(%rbp), %rax
	movslq	%edx, %rdx
	addq	%rdi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -44(%rbp)
.L11:
	addl	$1, -108(%rbp)
.L9:
	movl	-120(%rbp), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L13
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	$0, -100(%rbp)
	movl	$1, -96(%rbp)
	jmp	.L15
.L14:
	movl	$1, -100(%rbp)
	movl	$0, -96(%rbp)
.L15:
	movl	-120(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	leal	0(,%rax,4), %edx
	addl	%edx, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -64(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L18
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L18:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -56(%rbp)
	movq	$0, -88(%rbp)
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	movl	$2, %edi
	call	power
	movq	-56(%rbp), %rdx
	movq	%rax, (%rdx)
	movl	$1, -108(%rbp)
	jmp	.L19
.L20:
	movq	-56(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movq	$0, (%rax,%rdx,8)
	addl	$1, -108(%rbp)
.L19:
	movl	-120(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	leal	0(,%rax,4), %edx
	addl	%edx, %eax
	cmpl	%eax, -108(%rbp)
	jl	.L20
	movl	$0, -108(%rbp)
	jmp	.L21
.L24:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rsi
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	addq	%rax, -88(%rbp)
	movq	-88(%rbp), %rax
	movl	%eax, -104(%rbp)
	jmp	.L22
.L23:
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdi
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdi, %rdx
	movl	(%rax,%rdx,4), %ecx
	movl	-104(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movq	-56(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	(%rsi,%rax), %rcx
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	subl	$1, -104(%rbp)
.L22:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rsi
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -104(%rbp)
	jge	.L23
	addl	$1, -108(%rbp)
.L21:
	movl	-100(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L24
	movl	$0, -108(%rbp)
	jmp	.L25
.L28:
	movl	$0, -104(%rbp)
	jmp	.L26
.L27:
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdi
	movl	-96(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdi, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-104(%rbp), %eax
	addl	%eax, %edx
	movq	-56(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	(%rsi,%rax), %rcx
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -104(%rbp)
.L26:
	movl	-104(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	movslq	%eax, %rcx
	movq	-88(%rbp), %rax
	subq	%rcx, %rax
	cmpq	%rax, %rdx
	jle	.L27
	addl	$1, -108(%rbp)
.L25:
	movl	-96(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L28
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	power
	.type	power, @function
power:
.LFB0:
	.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	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	cmpl	$0, -12(%rbp)
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-12(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L4
	movl	-12(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movq	-8(%rbp), %rax
	imulq	%rax, %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	power
	jmp	.L3
.L4:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	power
	imulq	-8(%rbp), %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$160, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-116(%rbp), %rdx
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -80(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rbx
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L6:
	cmpq	%rdx, %rsp
	je	.L7
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L6
.L7:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L8
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L8:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -72(%rbp)
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	$0, -92(%rbp)
	movl	$0, -108(%rbp)
	jmp	.L9
.L13:
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-112(%rbp), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
	addl	$1, -92(%rbp)
	jmp	.L11
.L10:
	movl	-112(%rbp), %edx
	movl	-116(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L12
	movl	-112(%rbp), %eax
	movl	-116(%rbp), %esi
	movl	-48(%rbp), %edx
	subl	%esi, %eax
	movl	%eax, %ecx
	movq	-72(%rbp), %rax
	movslq	%edx, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movl	-48(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
	jmp	.L11
.L12:
	movl	-116(%rbp), %eax
	movl	-112(%rbp), %esi
	movq	%rbx, %rdi
	shrq	$2, %rdi
	movl	-44(%rbp), %edx
	subl	%esi, %eax
	movl	%eax, %ecx
	movq	-72(%rbp), %rax
	movslq	%edx, %rdx
	addq	%rdi, %rdx
	movl	%ecx, (%rax,%rdx,4)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -44(%rbp)
.L11:
	addl	$1, -108(%rbp)
.L9:
	movl	-120(%rbp), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L13
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	$0, -100(%rbp)
	movl	$1, -96(%rbp)
	jmp	.L15
.L14:
	movl	$1, -100(%rbp)
	movl	$0, -96(%rbp)
.L15:
	movl	-120(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	leal	0(,%rax,4), %edx
	addl	%edx, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -64(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L18
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L18:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -56(%rbp)
	movq	$0, -88(%rbp)
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	movl	$2, %edi
	call	power
	movq	-56(%rbp), %rdx
	movq	%rax, (%rdx)
	movl	$1, -108(%rbp)
	jmp	.L19
.L20:
	movq	-56(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movq	$0, (%rax,%rdx,8)
	addl	$1, -108(%rbp)
.L19:
	movl	-120(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	leal	0(,%rax,4), %edx
	addl	%edx, %eax
	cmpl	%eax, -108(%rbp)
	jl	.L20
	movl	$0, -108(%rbp)
	jmp	.L21
.L24:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rsi
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	addq	%rax, -88(%rbp)
	movq	-88(%rbp), %rax
	movl	%eax, -104(%rbp)
	jmp	.L22
.L23:
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdi
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdi, %rdx
	movl	(%rax,%rdx,4), %ecx
	movl	-104(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movq	-56(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	(%rsi,%rax), %rcx
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	subl	$1, -104(%rbp)
.L22:
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rsi
	movl	-100(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rsi, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, -104(%rbp)
	jge	.L23
	addl	$1, -108(%rbp)
.L21:
	movl	-100(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L24
	movl	$0, -108(%rbp)
	jmp	.L25
.L28:
	movl	$0, -104(%rbp)
	jmp	.L26
.L27:
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	%rbx, %rcx
	shrq	$2, %rcx
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdi
	movl	-96(%rbp), %edx
	movslq	%edx, %rdx
	imulq	%rcx, %rdx
	addq	%rdi, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	-104(%rbp), %eax
	addl	%eax, %edx
	movq	-56(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	(%rsi,%rax), %rcx
	movq	-56(%rbp), %rax
	movl	-104(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -104(%rbp)
.L26:
	movl	-104(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rbx, %rsi
	shrq	$2, %rsi
	movq	-72(%rbp), %rax
	movl	-108(%rbp), %ecx
	movslq	%ecx, %rdi
	movl	-96(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	(%rax,%rcx,4), %eax
	movslq	%eax, %rcx
	movq	-88(%rbp), %rax
	subq	%rcx, %rax
	cmpq	%rax, %rdx
	jle	.L27
	addl	$1, -108(%rbp)
.L25:
	movl	-96(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	%eax, -108(%rbp)
	jl	.L28
	movq	-56(%rbp), %rax
	movq	(%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
