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>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define lld long long int

#define MOD 1000000007

long long int MOD_pow(long long int a, long long int n){
    long long int res = 1;
    while(n>0){
        if(n&1){
            res = res*a % MOD;
        }
        a = a*a % MOD;
        n >>= 1;
    }
    return res;
}

int main(){
    lld n;
    scanf("%lld", &n);
    int a[(int)n];
    int b[100000] = {0};
    rep(i, 0, (int)n){
        scanf("%d", &a[i]);
        b[a[i]]++;
    }
    int flag = 1;
    if(n%2){
        if(b[0] != 1){
            flag = 0;
        }
        rep(i, 1, (int)n){
            if(i%2){
                if(b[i] != 0){
                    flag = 0;
                }
            }else{
                if(b[i] != 2){
                    flag = 0;
                }
            }
        }
    }else{
        rep(i, 0, n){
            if(i%2){
                if(b[i] != 2){
                    flag = 0;
                }
            }else{
                if(b[i] != 0){
                    flag = 0;
                }
            }
        }
    }
    if(flag){
        printf("%lld", MOD_pow(2, n/2));
    }else{
        printf("0");
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	MOD_pow
	.type	MOD_pow, @function
MOD_pow:
.LFB6:
	.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	$1, -8(%rbp)
	jmp	.L2
.L4:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L3
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L3:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	sarq	-32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jg	.L4
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	MOD_pow, .-MOD_pow
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2760, %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
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-400088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-400088(%rbp), %rax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -400080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ecx
	movl	$0, %edx
	divq	%rcx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -400072(%rbp)
	leaq	-400064(%rbp), %rax
	movl	$400000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -400104(%rbp)
	jmp	.L10
.L11:
	movl	-400104(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-400072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-400072(%rbp), %rax
	movl	-400104(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$1, -400104(%rbp)
.L10:
	movq	-400088(%rbp), %rax
	cmpl	%eax, -400104(%rbp)
	jl	.L11
	movl	$1, -400100(%rbp)
	movq	-400088(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L12
	movl	-400064(%rbp), %eax
	cmpl	$1, %eax
	je	.L13
	movl	$0, -400100(%rbp)
.L13:
	movl	$1, -400096(%rbp)
	jmp	.L14
.L17:
	movl	-400096(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L15
	movl	-400096(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L16
	movl	$0, -400100(%rbp)
	jmp	.L16
.L15:
	movl	-400096(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L16
	movl	$0, -400100(%rbp)
.L16:
	addl	$1, -400096(%rbp)
.L14:
	movq	-400088(%rbp), %rax
	cmpl	%eax, -400096(%rbp)
	jl	.L17
	jmp	.L18
.L12:
	movl	$0, -400092(%rbp)
	jmp	.L19
.L22:
	movl	-400092(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L20
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L21
	movl	$0, -400100(%rbp)
	jmp	.L21
.L20:
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L21
	movl	$0, -400100(%rbp)
.L21:
	addl	$1, -400092(%rbp)
.L19:
	movl	-400092(%rbp), %eax
	movslq	%eax, %rdx
	movq	-400088(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L22
.L18:
	cmpl	$0, -400100(%rbp)
	je	.L23
	movq	-400088(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movl	$2, %edi
	call	MOD_pow
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L24
.L23:
	movl	$48, %edi
	call	putchar@PLT
.L24:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	MOD_pow
	.type	MOD_pow, @function
MOD_pow:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %rcx
	movl	$1, %r8d
	movq	%rsi, %rdi
	testq	%rsi, %rsi
	jle	.L1
	movabsq	$-8543223828751151131, %r9
	.p2align 4,,10
	.p2align 3
.L4:
	testb	$1, %dil
	je	.L3
	movq	%r8, %rsi
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	imulq	%r9
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
.L3:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	movq	%rcx, %rsi
	mulq	%r9
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	sarq	%rdi
	movq	%rsi, %rcx
	jne	.L4
.L1:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	MOD_pow, .-MOD_pow
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%lld"
.LC4:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC3(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-400072(%rbp), %rsi
	call	__isoc99_scanf@PLT
	movq	-400072(%rbp), %rcx
	movq	%rsp, %rsi
	movslq	%ecx, %rax
	movl	%ecx, %r8d
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L13
.L75:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L75
.L13:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L76
.L14:
	leaq	-400064(%rbp), %r14
	xorl	%esi, %esi
	movl	$400000, %edx
	movl	%r8d, -400092(%rbp)
	movq	%r14, %rdi
	movq	%rcx, -400088(%rbp)
	movq	%rsp, %rbx
	call	memset@PLT
	movl	-400092(%rbp), %r8d
	movq	-400088(%rbp), %rcx
	testl	%r8d, %r8d
	jle	.L15
	xorl	%r13d, %r13d
	leaq	.LC4(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbx, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	(%rbx), %rax
	movq	-400072(%rbp), %rcx
	addq	$4, %rbx
	addl	$1, -400064(%rbp,%rax,4)
	movl	%ecx, %r8d
	cmpl	%r13d, %ecx
	jg	.L16
.L15:
	testb	$1, %cl
	jne	.L17
	movl	$1, %r8d
	testq	%rcx, %rcx
	jle	.L19
	leaq	-1(%rcx), %rax
	cmpq	$2, %rax
	jbe	.L38
	movq	%rcx, %rax
	movdqa	.LC2(%rip), %xmm2
	movdqa	.LC1(%rip), %xmm7
	pxor	%xmm5, %xmm5
	shrq	$2, %rax
	movdqa	.LC5(%rip), %xmm1
	movdqa	.LC6(%rip), %xmm3
	salq	$4, %rax
	movdqa	%xmm2, %xmm8
	addq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L39:
	movdqa	%xmm7, %xmm0
	movdqa	%xmm5, %xmm6
	movdqa	%xmm3, %xmm4
	addq	$16, %r14
	pcmpeqd	-16(%r14), %xmm6
	pcmpeqd	-16(%r14), %xmm4
	pand	%xmm2, %xmm0
	pcmpeqd	%xmm5, %xmm0
	paddd	%xmm1, %xmm7
	pcmpeqd	%xmm5, %xmm6
	pcmpeqd	%xmm5, %xmm4
	pcmpeqd	%xmm5, %xmm0
	pxor	%xmm6, %xmm4
	pand	%xmm4, %xmm0
	pxor	%xmm6, %xmm0
	pandn	%xmm8, %xmm0
	movdqa	%xmm0, %xmm8
	cmpq	%rax, %r14
	jne	.L39
	movdqa	%xmm0, %xmm1
	movq	%rcx, %rsi
	psrldq	$8, %xmm1
	andq	$-4, %rsi
	movdqa	%xmm1, %xmm0
	movl	%esi, %edx
	pcmpgtd	%xmm8, %xmm0
	pand	%xmm0, %xmm8
	pandn	%xmm1, %xmm0
	por	%xmm8, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpq	%rsi, %rcx
	je	.L20
	movslq	%esi, %rsi
	movl	-400064(%rbp,%rsi,4), %esi
.L42:
	xorl	%r8d, %r8d
	testl	%esi, %esi
	leal	1(%rdx), %esi
	movslq	%esi, %rdi
	cmovne	%r8d, %eax
	cmpq	%rcx, %rdi
	jge	.L20
	movl	-400064(%rbp,%rdi,4), %edi
	andl	$1, %esi
	jne	.L77
	testl	%edi, %edi
	cmovne	%esi, %eax
.L46:
	addl	$2, %edx
	movslq	%edx, %rdx
	cmpq	%rdx, %rcx
	jle	.L20
	movl	-400064(%rbp,%rdx,4), %edx
	testl	%edx, %edx
	jne	.L37
.L20:
	testl	%eax, %eax
	je	.L37
	movq	%rcx, %rax
	movl	$2, %esi
	movl	$1, %r8d
	cqto
	idivq	%rsi
	subq	$1, %rcx
	movq	%rax, %rdi
	jle	.L19
	movabsq	$-8543223828751151131, %r9
	movl	$2, %ecx
	.p2align 4,,10
	.p2align 3
.L49:
	testb	$1, %dil
	je	.L48
	movq	%r8, %rsi
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	imulq	%r9
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
.L48:
	movq	%rcx, %rsi
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	movq	%rsi, %rcx
	mulq	%r9
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	sarq	%rdi
	jne	.L49
.L19:
	movq	%r8, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L50:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L78
	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
.L17:
	.cfi_restore_state
	xorl	%eax, %eax
	cmpl	$1, -400064(%rbp)
	sete	%al
	cmpl	$1, %r8d
	jle	.L20
	leal	-2(%r8), %edx
	leal	-1(%r8), %r9d
	cmpl	$3, %edx
	jbe	.L52
	movl	%r9d, %edx
	movd	%eax, %xmm3
	pxor	%xmm6, %xmm6
	movdqa	.LC0(%rip), %xmm8
	shrl	$2, %edx
	pshufd	$0, %xmm3, %xmm7
	movdqa	.LC5(%rip), %xmm1
	movdqa	.LC6(%rip), %xmm3
	subl	$1, %edx
	leaq	-400060(%rbp), %rax
	movdqa	%xmm8, %xmm9
	movdqa	.LC2(%rip), %xmm2
	salq	$4, %rdx
	movdqa	%xmm6, %xmm5
	leaq	-400044(%rbp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L22:
	movdqu	(%rax), %xmm10
	movdqu	(%rax), %xmm4
	movdqa	%xmm9, %xmm0
	addq	$16, %rax
	pand	%xmm2, %xmm0
	paddd	%xmm1, %xmm9
	pcmpeqd	%xmm3, %xmm10
	pcmpeqd	%xmm5, %xmm4
	pcmpeqd	%xmm5, %xmm0
	pcmpeqd	%xmm5, %xmm10
	pcmpeqd	%xmm5, %xmm4
	pcmpeqd	%xmm5, %xmm0
	pxor	%xmm10, %xmm4
	pand	%xmm4, %xmm0
	pxor	%xmm10, %xmm0
	movdqa	%xmm0, %xmm4
	pandn	%xmm7, %xmm4
	movdqa	%xmm4, %xmm7
	movdqa	%xmm8, %xmm4
	paddd	%xmm1, %xmm8
	pand	%xmm0, %xmm4
	pandn	%xmm6, %xmm0
	movdqa	%xmm0, %xmm6
	por	%xmm4, %xmm6
	cmpq	%rax, %rdx
	jne	.L22
	pshufd	$85, %xmm6, %xmm0
	movd	%xmm6, %esi
	movd	%xmm0, %eax
	movd	%xmm0, %edx
	movdqa	%xmm6, %xmm0
	cmpl	%eax, %esi
	punpckhdq	%xmm6, %xmm0
	cmovnb	%esi, %edx
	movd	%xmm0, %edi
	cmpl	%edi, %edx
	jb	.L24
	cmpl	%eax, %esi
	jnb	.L79
	pshufd	$85, %xmm7, %xmm0
	movd	%xmm0, %eax
	jmp	.L25
.L24:
	movdqa	%xmm7, %xmm0
	punpckhdq	%xmm7, %xmm0
	movd	%xmm0, %eax
.L25:
	cmpl	%edi, %edx
	pshufd	$255, %xmm6, %xmm6
	pshufd	$255, %xmm7, %xmm7
	cmovnb	%edx, %edi
	movd	%xmm6, %edx
	movd	%xmm7, %esi
	cmpl	%edx, %edi
	cmovb	%esi, %eax
	movl	%r9d, %esi
	andl	$-4, %esi
	leal	1(%rsi), %edx
	cmpl	%r9d, %esi
	je	.L20
	testb	$1, %dl
	jne	.L21
	movslq	%edx, %rsi
	cmpl	$2, -400064(%rbp,%rsi,4)
	je	.L30
.L31:
	xorl	%eax, %eax
.L30:
	leal	1(%rdx), %esi
	cmpl	%r8d, %esi
	jge	.L20
	movl	%esi, %edi
	movslq	%esi, %rsi
	andl	$1, %edi
	je	.L32
	cmpl	$0, -400064(%rbp,%rsi,4)
	movl	$0, %esi
	cmovne	%esi, %eax
.L33:
	leal	2(%rdx), %esi
	cmpl	%r8d, %esi
	jge	.L20
	movl	%esi, %edi
	movslq	%esi, %rsi
	andl	$1, %edi
	je	.L34
	cmpl	$0, -400064(%rbp,%rsi,4)
	movl	$0, %esi
	cmovne	%esi, %eax
.L35:
	addl	$3, %edx
	cmpl	%edx, %r8d
	jle	.L20
	testb	$1, %dl
	movslq	%edx, %rdx
	jne	.L36
	cmpl	$2, -400064(%rbp,%rdx,4)
	je	.L20
.L37:
	movl	$48, %edi
	call	putchar@PLT
	jmp	.L50
.L77:
	cmpl	$2, %edi
	cmovne	%r8d, %eax
	jmp	.L46
.L76:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L14
.L52:
	movl	$1, %edx
.L21:
	movslq	%edx, %rsi
	cmpl	$0, -400064(%rbp,%rsi,4)
	je	.L30
	jmp	.L31
.L79:
	movd	%xmm7, %eax
	jmp	.L25
.L32:
	cmpl	$2, -400064(%rbp,%rsi,4)
	cmovne	%edi, %eax
	jmp	.L33
.L34:
	cmpl	$2, -400064(%rbp,%rsi,4)
	cmovne	%edi, %eax
	jmp	.L35
.L36:
	cmpl	$0, -400064(%rbp,%rdx,4)
	jne	.L37
	jmp	.L20
.L38:
	movl	-400064(%rbp), %esi
	xorl	%edx, %edx
	movl	$1, %eax
	jmp	.L42
.L78:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC1:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC5:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC6:
	.long	2
	.long	2
	.long	2
	.long	2
	.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	MOD_pow
	.type	MOD_pow, @function
MOD_pow:
.LFB51:
	.cfi_startproc
	endbr64
	movq	%rdi, %rcx
	movl	$1, %r8d
	movq	%rsi, %rdi
	testq	%rsi, %rsi
	jle	.L1
	movabsq	$-8543223828751151131, %r9
	.p2align 4,,10
	.p2align 3
.L4:
	testb	$1, %dil
	je	.L3
	movq	%r8, %rsi
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	imulq	%r9
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
.L3:
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	movq	%rcx, %rsi
	mulq	%r9
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	sarq	%rdi
	movq	%rsi, %rcx
	jne	.L4
.L1:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	MOD_pow, .-MOD_pow
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%lld"
.LC4:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC3(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-400072(%rbp), %rsi
	call	__isoc99_scanf@PLT
	movq	-400072(%rbp), %rcx
	movq	%rsp, %rsi
	movslq	%ecx, %rax
	movl	%ecx, %r8d
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L13
.L75:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L75
.L13:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L76
.L14:
	leaq	-400064(%rbp), %r14
	xorl	%esi, %esi
	movl	$400000, %edx
	movl	%r8d, -400092(%rbp)
	movq	%r14, %rdi
	movq	%rcx, -400088(%rbp)
	movq	%rsp, %rbx
	call	memset@PLT
	movl	-400092(%rbp), %r8d
	movq	-400088(%rbp), %rcx
	testl	%r8d, %r8d
	jle	.L15
	xorl	%r13d, %r13d
	leaq	.LC4(%rip), %r15
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbx, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	(%rbx), %rax
	movq	-400072(%rbp), %rcx
	addq	$4, %rbx
	addl	$1, -400064(%rbp,%rax,4)
	movl	%ecx, %r8d
	cmpl	%r13d, %ecx
	jg	.L16
.L15:
	testb	$1, %cl
	jne	.L17
	movl	$1, %r8d
	testq	%rcx, %rcx
	jle	.L19
	leaq	-1(%rcx), %rax
	cmpq	$2, %rax
	jbe	.L38
	movq	%rcx, %rax
	movdqa	.LC2(%rip), %xmm2
	movdqa	.LC1(%rip), %xmm7
	pxor	%xmm5, %xmm5
	shrq	$2, %rax
	movdqa	.LC5(%rip), %xmm1
	movdqa	.LC6(%rip), %xmm3
	salq	$4, %rax
	movdqa	%xmm2, %xmm8
	addq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L39:
	movdqa	%xmm7, %xmm0
	movdqa	%xmm5, %xmm6
	movdqa	%xmm3, %xmm4
	addq	$16, %r14
	pcmpeqd	-16(%r14), %xmm6
	pcmpeqd	-16(%r14), %xmm4
	pand	%xmm2, %xmm0
	pcmpeqd	%xmm5, %xmm0
	paddd	%xmm1, %xmm7
	pcmpeqd	%xmm5, %xmm6
	pcmpeqd	%xmm5, %xmm4
	pcmpeqd	%xmm5, %xmm0
	pxor	%xmm6, %xmm4
	pand	%xmm4, %xmm0
	pxor	%xmm6, %xmm0
	pandn	%xmm8, %xmm0
	movdqa	%xmm0, %xmm8
	cmpq	%rax, %r14
	jne	.L39
	movdqa	%xmm0, %xmm1
	movq	%rcx, %rsi
	psrldq	$8, %xmm1
	andq	$-4, %rsi
	movdqa	%xmm1, %xmm0
	movl	%esi, %edx
	pcmpgtd	%xmm8, %xmm0
	pand	%xmm0, %xmm8
	pandn	%xmm1, %xmm0
	por	%xmm8, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpq	%rsi, %rcx
	je	.L20
	movslq	%esi, %rsi
	movl	-400064(%rbp,%rsi,4), %esi
.L42:
	xorl	%r8d, %r8d
	testl	%esi, %esi
	leal	1(%rdx), %esi
	movslq	%esi, %rdi
	cmovne	%r8d, %eax
	cmpq	%rcx, %rdi
	jge	.L20
	movl	-400064(%rbp,%rdi,4), %edi
	andl	$1, %esi
	jne	.L77
	testl	%edi, %edi
	cmovne	%esi, %eax
.L46:
	addl	$2, %edx
	movslq	%edx, %rdx
	cmpq	%rdx, %rcx
	jle	.L20
	movl	-400064(%rbp,%rdx,4), %edx
	testl	%edx, %edx
	jne	.L37
.L20:
	testl	%eax, %eax
	je	.L37
	movq	%rcx, %rax
	movl	$2, %esi
	movl	$1, %r8d
	cqto
	idivq	%rsi
	subq	$1, %rcx
	movq	%rax, %rdi
	jle	.L19
	movabsq	$-8543223828751151131, %r9
	movl	$2, %ecx
	.p2align 4,,10
	.p2align 3
.L49:
	testb	$1, %dil
	je	.L48
	movq	%r8, %rsi
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	imulq	%r9
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
.L48:
	movq	%rcx, %rsi
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	movq	%rsi, %rcx
	mulq	%r9
	shrq	$29, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rcx
	sarq	%rdi
	jne	.L49
.L19:
	movq	%r8, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L50:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L78
	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
.L17:
	.cfi_restore_state
	xorl	%eax, %eax
	cmpl	$1, -400064(%rbp)
	sete	%al
	cmpl	$1, %r8d
	jle	.L20
	leal	-2(%r8), %edx
	leal	-1(%r8), %r9d
	cmpl	$3, %edx
	jbe	.L52
	movl	%r9d, %edx
	movd	%eax, %xmm3
	pxor	%xmm6, %xmm6
	movdqa	.LC0(%rip), %xmm8
	shrl	$2, %edx
	pshufd	$0, %xmm3, %xmm7
	movdqa	.LC5(%rip), %xmm1
	movdqa	.LC6(%rip), %xmm3
	subl	$1, %edx
	leaq	-400060(%rbp), %rax
	movdqa	%xmm8, %xmm9
	movdqa	.LC2(%rip), %xmm2
	salq	$4, %rdx
	movdqa	%xmm6, %xmm5
	leaq	-400044(%rbp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L22:
	movdqu	(%rax), %xmm10
	movdqu	(%rax), %xmm4
	movdqa	%xmm9, %xmm0
	addq	$16, %rax
	pand	%xmm2, %xmm0
	paddd	%xmm1, %xmm9
	pcmpeqd	%xmm3, %xmm10
	pcmpeqd	%xmm5, %xmm4
	pcmpeqd	%xmm5, %xmm0
	pcmpeqd	%xmm5, %xmm10
	pcmpeqd	%xmm5, %xmm4
	pcmpeqd	%xmm5, %xmm0
	pxor	%xmm10, %xmm4
	pand	%xmm4, %xmm0
	pxor	%xmm10, %xmm0
	movdqa	%xmm0, %xmm4
	pandn	%xmm7, %xmm4
	movdqa	%xmm4, %xmm7
	movdqa	%xmm8, %xmm4
	paddd	%xmm1, %xmm8
	pand	%xmm0, %xmm4
	pandn	%xmm6, %xmm0
	movdqa	%xmm0, %xmm6
	por	%xmm4, %xmm6
	cmpq	%rax, %rdx
	jne	.L22
	pshufd	$85, %xmm6, %xmm0
	movd	%xmm6, %esi
	movd	%xmm0, %eax
	movd	%xmm0, %edx
	movdqa	%xmm6, %xmm0
	cmpl	%eax, %esi
	punpckhdq	%xmm6, %xmm0
	cmovnb	%esi, %edx
	movd	%xmm0, %edi
	cmpl	%edi, %edx
	jb	.L24
	cmpl	%eax, %esi
	jnb	.L79
	pshufd	$85, %xmm7, %xmm0
	movd	%xmm0, %eax
	jmp	.L25
.L24:
	movdqa	%xmm7, %xmm0
	punpckhdq	%xmm7, %xmm0
	movd	%xmm0, %eax
.L25:
	cmpl	%edi, %edx
	pshufd	$255, %xmm6, %xmm6
	pshufd	$255, %xmm7, %xmm7
	cmovnb	%edx, %edi
	movd	%xmm6, %edx
	movd	%xmm7, %esi
	cmpl	%edx, %edi
	cmovb	%esi, %eax
	movl	%r9d, %esi
	andl	$-4, %esi
	leal	1(%rsi), %edx
	cmpl	%r9d, %esi
	je	.L20
	testb	$1, %dl
	jne	.L21
	movslq	%edx, %rsi
	cmpl	$2, -400064(%rbp,%rsi,4)
	je	.L30
.L31:
	xorl	%eax, %eax
.L30:
	leal	1(%rdx), %esi
	cmpl	%r8d, %esi
	jge	.L20
	movl	%esi, %edi
	movslq	%esi, %rsi
	andl	$1, %edi
	je	.L32
	cmpl	$0, -400064(%rbp,%rsi,4)
	movl	$0, %esi
	cmovne	%esi, %eax
.L33:
	leal	2(%rdx), %esi
	cmpl	%r8d, %esi
	jge	.L20
	movl	%esi, %edi
	movslq	%esi, %rsi
	andl	$1, %edi
	je	.L34
	cmpl	$0, -400064(%rbp,%rsi,4)
	movl	$0, %esi
	cmovne	%esi, %eax
.L35:
	addl	$3, %edx
	cmpl	%edx, %r8d
	jle	.L20
	testb	$1, %dl
	movslq	%edx, %rdx
	jne	.L36
	cmpl	$2, -400064(%rbp,%rdx,4)
	je	.L20
.L37:
	movl	$48, %edi
	call	putchar@PLT
	jmp	.L50
.L77:
	cmpl	$2, %edi
	cmovne	%r8d, %eax
	jmp	.L46
.L76:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L14
.L52:
	movl	$1, %edx
.L21:
	movslq	%edx, %rsi
	cmpl	$0, -400064(%rbp,%rsi,4)
	je	.L30
	jmp	.L31
.L79:
	movd	%xmm7, %eax
	jmp	.L25
.L32:
	cmpl	$2, -400064(%rbp,%rsi,4)
	cmovne	%edi, %eax
	jmp	.L33
.L34:
	cmpl	$2, -400064(%rbp,%rsi,4)
	cmovne	%edi, %eax
	jmp	.L35
.L36:
	cmpl	$0, -400064(%rbp,%rdx,4)
	jne	.L37
	jmp	.L20
.L38:
	movl	-400064(%rbp), %esi
	xorl	%edx, %edx
	movl	$1, %eax
	jmp	.L42
.L78:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC1:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC5:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC6:
	.long	2
	.long	2
	.long	2
	.long	2
	.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>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define lld long long int

#define MOD 1000000007

long long int MOD_pow(long long int a, long long int n){
    long long int res = 1;
    while(n>0){
        if(n&1){
            res = res*a % MOD;
        }
        a = a*a % MOD;
        n >>= 1;
    }
    return res;
}

int main(){
    lld n;
    scanf("%lld", &n);
    int a[(int)n];
    int b[100000] = {0};
    rep(i, 0, (int)n){
        scanf("%d", &a[i]);
        b[a[i]]++;
    }
    int flag = 1;
    if(n%2){
        if(b[0] != 1){
            flag = 0;
        }
        rep(i, 1, (int)n){
            if(i%2){
                if(b[i] != 0){
                    flag = 0;
                }
            }else{
                if(b[i] != 2){
                    flag = 0;
                }
            }
        }
    }else{
        rep(i, 0, n){
            if(i%2){
                if(b[i] != 2){
                    flag = 0;
                }
            }else{
                if(b[i] != 0){
                    flag = 0;
                }
            }
        }
    }
    if(flag){
        printf("%lld", MOD_pow(2, n/2));
    }else{
        printf("0");
    }

    return 0;
}
8
7 5 1 2 7 3 5 3
 7
6 4 0 2 4 0 4
 5
0 4 4 0 2

0 0 0
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>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<limits.h>

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define lld long long int

#define MOD 1000000007

long long int MOD_pow(long long int a, long long int n){
    long long int res = 1;
    while(n>0){
        if(n&1){
            res = res*a % MOD;
        }
        a = a*a % MOD;
        n >>= 1;
    }
    return res;
}

int main(){
    lld n;
    scanf("%lld", &n);
    int a[(int)n];
    int b[100000] = {0};
    rep(i, 0, (int)n){
        scanf("%d", &a[i]);
        b[a[i]]++;
    }
    int flag = 1;
    if(n%2){
        if(b[0] != 1){
            flag = 0;
        }
        rep(i, 1, (int)n){
            if(i%2){
                if(b[i] != 0){
                    flag = 0;
                }
            }else{
                if(b[i] != 2){
                    flag = 0;
                }
            }
        }
    }else{
        rep(i, 0, n){
            if(i%2){
                if(b[i] != 2){
                    flag = 0;
                }
            }else{
                if(b[i] != 0){
                    flag = 0;
                }
            }
        }
    }
    if(flag){
        printf("%lld", MOD_pow(2, n/2));
    }else{
        printf("0");
    }

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	MOD_pow
	.type	MOD_pow, @function
MOD_pow:
.LFB6:
	.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	$1, -8(%rbp)
	jmp	.L2
.L4:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L3
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L3:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	sarq	-32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jg	.L4
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	MOD_pow, .-MOD_pow
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2760, %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
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-400088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-400088(%rbp), %rax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -400080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ecx
	movl	$0, %edx
	divq	%rcx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -400072(%rbp)
	leaq	-400064(%rbp), %rax
	movl	$400000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -400104(%rbp)
	jmp	.L10
.L11:
	movl	-400104(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-400072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-400072(%rbp), %rax
	movl	-400104(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$1, -400104(%rbp)
.L10:
	movq	-400088(%rbp), %rax
	cmpl	%eax, -400104(%rbp)
	jl	.L11
	movl	$1, -400100(%rbp)
	movq	-400088(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L12
	movl	-400064(%rbp), %eax
	cmpl	$1, %eax
	je	.L13
	movl	$0, -400100(%rbp)
.L13:
	movl	$1, -400096(%rbp)
	jmp	.L14
.L17:
	movl	-400096(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L15
	movl	-400096(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L16
	movl	$0, -400100(%rbp)
	jmp	.L16
.L15:
	movl	-400096(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L16
	movl	$0, -400100(%rbp)
.L16:
	addl	$1, -400096(%rbp)
.L14:
	movq	-400088(%rbp), %rax
	cmpl	%eax, -400096(%rbp)
	jl	.L17
	jmp	.L18
.L12:
	movl	$0, -400092(%rbp)
	jmp	.L19
.L22:
	movl	-400092(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L20
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L21
	movl	$0, -400100(%rbp)
	jmp	.L21
.L20:
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L21
	movl	$0, -400100(%rbp)
.L21:
	addl	$1, -400092(%rbp)
.L19:
	movl	-400092(%rbp), %eax
	movslq	%eax, %rdx
	movq	-400088(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L22
.L18:
	cmpl	$0, -400100(%rbp)
	je	.L23
	movq	-400088(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movl	$2, %edi
	call	MOD_pow
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L24
.L23:
	movl	$48, %edi
	call	putchar@PLT
.L24:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	MOD_pow
	.type	MOD_pow, @function
MOD_pow:
.LFB6:
	.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	$1, -8(%rbp)
	jmp	.L2
.L4:
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L3
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
.L3:
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	movq	%rax, %rcx
	movabsq	$-8543223828751151131, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	leaq	(%rdx,%rcx), %rax
	sarq	$29, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	sarq	-32(%rbp)
.L2:
	cmpq	$0, -32(%rbp)
	jg	.L4
	movq	-8(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	MOD_pow, .-MOD_pow
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.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	%r13
	pushq	%r12
	pushq	%rbx
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2760, %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
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-400088(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-400088(%rbp), %rax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -400080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ecx
	movl	$0, %edx
	divq	%rcx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -400072(%rbp)
	leaq	-400064(%rbp), %rax
	movl	$400000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -400104(%rbp)
	jmp	.L10
.L11:
	movl	-400104(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-400072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-400072(%rbp), %rax
	movl	-400104(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	addl	$1, -400104(%rbp)
.L10:
	movq	-400088(%rbp), %rax
	cmpl	%eax, -400104(%rbp)
	jl	.L11
	movl	$1, -400100(%rbp)
	movq	-400088(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L12
	movl	-400064(%rbp), %eax
	cmpl	$1, %eax
	je	.L13
	movl	$0, -400100(%rbp)
.L13:
	movl	$1, -400096(%rbp)
	jmp	.L14
.L17:
	movl	-400096(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L15
	movl	-400096(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L16
	movl	$0, -400100(%rbp)
	jmp	.L16
.L15:
	movl	-400096(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L16
	movl	$0, -400100(%rbp)
.L16:
	addl	$1, -400096(%rbp)
.L14:
	movq	-400088(%rbp), %rax
	cmpl	%eax, -400096(%rbp)
	jl	.L17
	jmp	.L18
.L12:
	movl	$0, -400092(%rbp)
	jmp	.L19
.L22:
	movl	-400092(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L20
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L21
	movl	$0, -400100(%rbp)
	jmp	.L21
.L20:
	movl	-400092(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L21
	movl	$0, -400100(%rbp)
.L21:
	addl	$1, -400092(%rbp)
.L19:
	movl	-400092(%rbp), %eax
	movslq	%eax, %rdx
	movq	-400088(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L22
.L18:
	cmpl	$0, -400100(%rbp)
	je	.L23
	movq	-400088(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movl	$2, %edi
	call	MOD_pow
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L24
.L23:
	movl	$48, %edi
	call	putchar@PLT
.L24:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
