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

```c
#include<stdio.h>

int mod=1000000007;
long long fun(int a,int b,int mod)
{
	long long d=1,t=a;
	while(b)
	{
		if(b&1)
			d=(d*t)%mod;
		b/=2;
		t=(t*t)%mod;
	}
	return d;
}


int main()
{
	int n,i,f;
	long long sum;
	int a[100005],m[100000];
	scanf("%d",&n);
	f=0;
	for(i=0;i<n;i++)
	{
		m[i]=0;
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
		m[a[i]]++;
	if(n%2==1)
	{
		if(m[0]!=1)
			f=1;
		for(i=2;i<n;i+=2)
			if(m[i]!=2)
				f=1;
	}
	else
	{
		for(i=1;i<n;i+=2)
			if(m[i]!=2)
				f=1;
	}
	sum=fun(2,n/2,mod);
	if(n%2)
	{
		if(f)
			printf("0\n");
		else
			printf("%lld\n",sum);
	}
	else
	{
		if(f)
			printf("0\n");
		else
			printf("%lld\n",sum);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mod
	.data
	.align 4
	.type	mod, @object
	.size	mod, 4
mod:
	.long	1000000007
	.text
	.globl	fun
	.type	fun, @function
fun:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movq	$1, -16(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movq	%rax, -8(%rbp)
	jmp	.L2
.L4:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movq	-16(%rbp), %rax
	imulq	-8(%rbp), %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -16(%rbp)
.L3:
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	movq	-8(%rbp), %rax
	imulq	%rax, %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L2:
	cmpl	$0, -24(%rbp)
	jne	.L4
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	fun, .-fun
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1344, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800052(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800044(%rbp)
	movl	$0, -800048(%rbp)
	jmp	.L7
.L8:
	movl	-800048(%rbp), %eax
	cltq
	movl	$0, -800032(%rbp,%rax,4)
	leaq	-400032(%rbp), %rdx
	movl	-800048(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800048(%rbp)
.L7:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L8
	movl	$0, -800048(%rbp)
	jmp	.L9
.L10:
	movl	-800048(%rbp), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-800032(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -800032(%rbp,%rax,4)
	addl	$1, -800048(%rbp)
.L9:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L10
	movl	-800052(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L11
	movl	-800032(%rbp), %eax
	cmpl	$1, %eax
	je	.L12
	movl	$1, -800044(%rbp)
.L12:
	movl	$2, -800048(%rbp)
	jmp	.L13
.L15:
	movl	-800048(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L14
	movl	$1, -800044(%rbp)
.L14:
	addl	$2, -800048(%rbp)
.L13:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L15
	jmp	.L16
.L11:
	movl	$1, -800048(%rbp)
	jmp	.L17
.L19:
	movl	-800048(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L18
	movl	$1, -800044(%rbp)
.L18:
	addl	$2, -800048(%rbp)
.L17:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L19
.L16:
	movl	mod(%rip), %eax
	movl	-800052(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	%eax, %edx
	movl	%ecx, %esi
	movl	$2, %edi
	call	fun
	movq	%rax, -800040(%rbp)
	movl	-800052(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L20
	cmpl	$0, -800044(%rbp)
	je	.L21
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L22
.L21:
	movq	-800040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L22
.L20:
	cmpl	$0, -800044(%rbp)
	je	.L23
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L22
.L23:
	movq	-800040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L22:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.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	fun
	.type	fun, @function
fun:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	testl	%esi, %esi
	je	.L5
	movslq	%edx, %rcx
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L4:
	testb	$1, %sil
	je	.L3
	movq	%r8, %rax
	imulq	%rdi, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %r8
.L3:
	imulq	%rdi, %rdi
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%eax, %esi
	movq	%rdi, %rax
	cqto
	idivq	%rcx
	sarl	%esi
	movq	%rdx, %rdi
	jne	.L4
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	fun, .-fun
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC5:
	.string	"0"
.LC6:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1328, %rsp
	.cfi_def_cfa_offset 800096
	leaq	.LC1(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	jle	.L12
	leaq	400016(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r14
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	movl	$0, (%r14,%rbx,4)
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %edi
	jg	.L13
	testl	%edi, %edi
	jle	.L12
	leal	-1(%rdi), %edx
	leaq	4(%r12), %rax
	leaq	(%rax,%rdx,4), %rcx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L86:
	addq	$4, %rax
.L14:
	movslq	(%r12), %rdx
	movq	%rax, %r12
	addl	$1, 16(%rsp,%rdx,4)
	cmpq	%rcx, %rax
	jne	.L86
.L12:
	movl	%edi, %eax
	shrl	$31, %eax
	leal	(%rdi,%rax), %ecx
	andl	$1, %ecx
	subl	%eax, %ecx
	cmpl	$1, %ecx
	je	.L15
	cmpl	$1, %edi
	jle	.L87
	leal	-2(%rdi), %eax
	cmpl	$7, %eax
	jbe	.L62
	shrl	$3, %eax
	movdqa	.LC2(%rip), %xmm5
	movdqa	.LC3(%rip), %xmm4
	pxor	%xmm1, %xmm1
	movl	%eax, %ecx
	leaq	20(%rsp), %rax
	leal	-1(%rcx), %edx
	salq	$5, %rdx
	leaq	52(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L35:
	movdqu	(%rax), %xmm0
	movdqu	16(%rax), %xmm7
	addq	$32, %rax
	shufps	$136, %xmm7, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	por	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L35
	movdqa	%xmm1, %xmm2
	leal	1(,%rcx,8), %eax
	psrldq	$8, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %r10d
.L34:
	movslq	%eax, %rdx
	movl	$1, %ecx
	cmpl	$2, 16(%rsp,%rdx,4)
	leal	2(%rax), %edx
	cmovne	%ecx, %r10d
	cmpl	%edx, %edi
	jle	.L37
	movslq	%edx, %rdx
	cmpl	$2, 16(%rsp,%rdx,4)
	leal	4(%rax), %edx
	cmovne	%ecx, %r10d
	cmpl	%edx, %edi
	jle	.L37
	movslq	%edx, %rdx
	cmpl	$2, 16(%rsp,%rdx,4)
	cmovne	%ecx, %r10d
	addl	$6, %eax
	cmpl	%eax, %edi
	jle	.L37
	cltq
	cmpl	$2, 16(%rsp,%rax,4)
	cmovne	%ecx, %r10d
.L37:
	movl	%edi, %ecx
	movslq	mod(%rip), %r8
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
.L52:
	movl	$2, %esi
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L48:
	testb	$1, %cl
	je	.L47
	movq	%r9, %rax
	imulq	%rsi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L47:
	imulq	%rsi, %rsi
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%eax, %ecx
	movq	%rsi, %rax
	cqto
	idivq	%r8
	sarl	%ecx
	movq	%rdx, %rsi
	jne	.L48
.L46:
	testl	%r10d, %r10d
	je	.L45
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
.L50:
	movq	800040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L88
	addq	$800048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L87:
	.cfi_restore_state
	movl	%edi, %eax
	movl	$2, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	.L67
	movl	$1, %r9d
.L45:
	movq	%r9, %rdx
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L50
.L15:
	xorl	%r10d, %r10d
	cmpl	$1, 16(%rsp)
	setne	%r10b
	cmpl	$2, %edi
	jle	.L18
	leal	-3(%rdi), %eax
	movl	%eax, %r8d
	shrl	%r8d
	addl	$1, %r8d
	cmpl	$15, %eax
	jbe	.L54
	movl	%r8d, %edx
	movd	%r10d, %xmm3
	movdqa	.LC2(%rip), %xmm5
	movdqa	.LC3(%rip), %xmm4
	shrl	$2, %edx
	pshufd	$0, %xmm3, %xmm2
	leaq	24(%rsp), %rax
	movdqa	.LC0(%rip), %xmm3
	subl	$1, %edx
	movdqa	.LC4(%rip), %xmm7
	pxor	%xmm1, %xmm1
	salq	$5, %rdx
	leaq	56(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L20:
	movdqu	16(%rax), %xmm6
	movdqu	(%rax), %xmm0
	addq	$32, %rax
	shufps	$136, %xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	movdqa	%xmm0, %xmm6
	pand	%xmm0, %xmm2
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm6
	pandn	%xmm3, %xmm0
	paddd	%xmm7, %xmm3
	por	%xmm6, %xmm2
	por	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L20
	pshufd	$85, %xmm1, %xmm0
	movd	%xmm1, %r9d
	movd	%xmm0, %edx
	movd	%xmm0, %eax
	movdqa	%xmm1, %xmm0
	cmpl	%edx, %r9d
	punpckhdq	%xmm1, %xmm0
	cmovnb	%r9d, %eax
	movd	%xmm0, %esi
	cmpl	%esi, %eax
	jb	.L21
	movd	%xmm2, %r10d
	cmpl	%edx, %r9d
	jnb	.L22
	pshufd	$85, %xmm2, %xmm0
	movd	%xmm0, %r10d
.L22:
	cmpl	%esi, %eax
	pshufd	$255, %xmm1, %xmm1
	pshufd	$255, %xmm2, %xmm2
	cmovnb	%eax, %esi
	movd	%xmm1, %eax
	movd	%xmm2, %edx
	cmpl	%eax, %esi
	cmovb	%edx, %r10d
	movl	%r8d, %edx
	andl	$-4, %edx
	leal	2(%rdx,%rdx), %eax
	cmpl	%edx, %r8d
	je	.L37
.L19:
	movslq	%eax, %rsi
	movl	$1, %edx
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	2(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	4(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	6(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	8(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	10(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	12(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	cmovne	%edx, %r10d
	addl	$14, %eax
	cmpl	%eax, %edi
	jle	.L37
	cltq
	cmpl	$2, 16(%rsp,%rax,4)
	cmovne	%ecx, %r10d
	jmp	.L37
.L21:
	movdqa	%xmm2, %xmm0
	punpckhdq	%xmm2, %xmm0
	movd	%xmm0, %r10d
	jmp	.L22
.L62:
	xorl	%r10d, %r10d
	movl	$1, %eax
	jmp	.L34
.L18:
	movl	%edi, %eax
	movl	$2, %ecx
	movl	$1, %r9d
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	testl	%eax, %eax
	je	.L46
	jmp	.L43
.L54:
	movl	$2, %eax
	jmp	.L19
.L67:
	xorl	%r10d, %r10d
.L43:
	movslq	mod(%rip), %r8
	jmp	.L52
.L88:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	mod
	.data
	.align 4
	.type	mod, @object
	.size	mod, 4
mod:
	.long	1000000007
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC2:
	.long	2
	.long	2
	.long	2
	.long	2
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC4:
	.long	4
	.long	4
	.long	4
	.long	4
	.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	fun
	.type	fun, @function
fun:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdi
	testl	%esi, %esi
	je	.L5
	movslq	%edx, %rcx
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L4:
	testb	$1, %sil
	je	.L3
	movq	%r8, %rax
	imulq	%rdi, %rax
	cqto
	idivq	%rcx
	movq	%rdx, %r8
.L3:
	imulq	%rdi, %rdi
	movl	%esi, %eax
	shrl	$31, %eax
	addl	%eax, %esi
	movq	%rdi, %rax
	cqto
	idivq	%rcx
	sarl	%esi
	movq	%rdx, %rdi
	jne	.L4
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	fun, .-fun
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC5:
	.string	"0"
.LC6:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1328, %rsp
	.cfi_def_cfa_offset 800096
	leaq	.LC1(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800040(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	testl	%edi, %edi
	jle	.L12
	leaq	400016(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	16(%rsp), %r14
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	movl	$0, (%r14,%rbx,4)
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %edi
	jg	.L13
	testl	%edi, %edi
	jle	.L12
	leal	-1(%rdi), %edx
	leaq	4(%r12), %rax
	leaq	(%rax,%rdx,4), %rcx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L86:
	addq	$4, %rax
.L14:
	movslq	(%r12), %rdx
	movq	%rax, %r12
	addl	$1, 16(%rsp,%rdx,4)
	cmpq	%rcx, %rax
	jne	.L86
.L12:
	movl	%edi, %eax
	shrl	$31, %eax
	leal	(%rdi,%rax), %ecx
	andl	$1, %ecx
	subl	%eax, %ecx
	cmpl	$1, %ecx
	je	.L15
	cmpl	$1, %edi
	jle	.L87
	leal	-2(%rdi), %eax
	cmpl	$7, %eax
	jbe	.L62
	shrl	$3, %eax
	movdqa	.LC2(%rip), %xmm5
	movdqa	.LC3(%rip), %xmm4
	pxor	%xmm1, %xmm1
	movl	%eax, %ecx
	leaq	20(%rsp), %rax
	leal	-1(%rcx), %edx
	salq	$5, %rdx
	leaq	52(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L35:
	movdqu	(%rax), %xmm0
	movdqu	16(%rax), %xmm7
	addq	$32, %rax
	shufps	$136, %xmm7, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm0
	por	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L35
	movdqa	%xmm1, %xmm2
	leal	1(,%rcx,8), %eax
	psrldq	$8, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %r10d
.L34:
	movslq	%eax, %rdx
	movl	$1, %ecx
	cmpl	$2, 16(%rsp,%rdx,4)
	leal	2(%rax), %edx
	cmovne	%ecx, %r10d
	cmpl	%edx, %edi
	jle	.L37
	movslq	%edx, %rdx
	cmpl	$2, 16(%rsp,%rdx,4)
	leal	4(%rax), %edx
	cmovne	%ecx, %r10d
	cmpl	%edx, %edi
	jle	.L37
	movslq	%edx, %rdx
	cmpl	$2, 16(%rsp,%rdx,4)
	cmovne	%ecx, %r10d
	addl	$6, %eax
	cmpl	%eax, %edi
	jle	.L37
	cltq
	cmpl	$2, 16(%rsp,%rax,4)
	cmovne	%ecx, %r10d
.L37:
	movl	%edi, %ecx
	movslq	mod(%rip), %r8
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
.L52:
	movl	$2, %esi
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L48:
	testb	$1, %cl
	je	.L47
	movq	%r9, %rax
	imulq	%rsi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L47:
	imulq	%rsi, %rsi
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%eax, %ecx
	movq	%rsi, %rax
	cqto
	idivq	%r8
	sarl	%ecx
	movq	%rdx, %rsi
	jne	.L48
.L46:
	testl	%r10d, %r10d
	je	.L45
	leaq	.LC5(%rip), %rdi
	call	puts@PLT
.L50:
	movq	800040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L88
	addq	$800048, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L87:
	.cfi_restore_state
	movl	%edi, %eax
	movl	$2, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	testl	%eax, %eax
	jne	.L67
	movl	$1, %r9d
.L45:
	movq	%r9, %rdx
	leaq	.LC6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L50
.L15:
	xorl	%r10d, %r10d
	cmpl	$1, 16(%rsp)
	setne	%r10b
	cmpl	$2, %edi
	jle	.L18
	leal	-3(%rdi), %eax
	movl	%eax, %r8d
	shrl	%r8d
	addl	$1, %r8d
	cmpl	$15, %eax
	jbe	.L54
	movl	%r8d, %edx
	movd	%r10d, %xmm3
	movdqa	.LC2(%rip), %xmm5
	movdqa	.LC3(%rip), %xmm4
	shrl	$2, %edx
	pshufd	$0, %xmm3, %xmm2
	leaq	24(%rsp), %rax
	movdqa	.LC0(%rip), %xmm3
	subl	$1, %edx
	movdqa	.LC4(%rip), %xmm7
	pxor	%xmm1, %xmm1
	salq	$5, %rdx
	leaq	56(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L20:
	movdqu	16(%rax), %xmm6
	movdqu	(%rax), %xmm0
	addq	$32, %rax
	shufps	$136, %xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	movdqa	%xmm0, %xmm6
	pand	%xmm0, %xmm2
	pand	%xmm0, %xmm1
	pandn	%xmm4, %xmm6
	pandn	%xmm3, %xmm0
	paddd	%xmm7, %xmm3
	por	%xmm6, %xmm2
	por	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L20
	pshufd	$85, %xmm1, %xmm0
	movd	%xmm1, %r9d
	movd	%xmm0, %edx
	movd	%xmm0, %eax
	movdqa	%xmm1, %xmm0
	cmpl	%edx, %r9d
	punpckhdq	%xmm1, %xmm0
	cmovnb	%r9d, %eax
	movd	%xmm0, %esi
	cmpl	%esi, %eax
	jb	.L21
	movd	%xmm2, %r10d
	cmpl	%edx, %r9d
	jnb	.L22
	pshufd	$85, %xmm2, %xmm0
	movd	%xmm0, %r10d
.L22:
	cmpl	%esi, %eax
	pshufd	$255, %xmm1, %xmm1
	pshufd	$255, %xmm2, %xmm2
	cmovnb	%eax, %esi
	movd	%xmm1, %eax
	movd	%xmm2, %edx
	cmpl	%eax, %esi
	cmovb	%edx, %r10d
	movl	%r8d, %edx
	andl	$-4, %edx
	leal	2(%rdx,%rdx), %eax
	cmpl	%edx, %r8d
	je	.L37
.L19:
	movslq	%eax, %rsi
	movl	$1, %edx
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	2(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	4(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	6(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	8(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	10(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	leal	12(%rax), %esi
	cmovne	%edx, %r10d
	cmpl	%esi, %edi
	jle	.L37
	movslq	%esi, %rsi
	cmpl	$2, 16(%rsp,%rsi,4)
	cmovne	%edx, %r10d
	addl	$14, %eax
	cmpl	%eax, %edi
	jle	.L37
	cltq
	cmpl	$2, 16(%rsp,%rax,4)
	cmovne	%ecx, %r10d
	jmp	.L37
.L21:
	movdqa	%xmm2, %xmm0
	punpckhdq	%xmm2, %xmm0
	movd	%xmm0, %r10d
	jmp	.L22
.L62:
	xorl	%r10d, %r10d
	movl	$1, %eax
	jmp	.L34
.L18:
	movl	%edi, %eax
	movl	$2, %ecx
	movl	$1, %r9d
	cltd
	idivl	%ecx
	movl	%eax, %ecx
	testl	%eax, %eax
	je	.L46
	jmp	.L43
.L54:
	movl	$2, %eax
	jmp	.L19
.L67:
	xorl	%r10d, %r10d
.L43:
	movslq	mod(%rip), %r8
	jmp	.L52
.L88:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	mod
	.data
	.align 4
	.type	mod, @object
	.size	mod, 4
mod:
	.long	1000000007
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	2
	.long	3
	.long	4
	.align 16
.LC2:
	.long	2
	.long	2
	.long	2
	.long	2
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC4:
	.long	4
	.long	4
	.long	4
	.long	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>

int mod=1000000007;
long long fun(int a,int b,int mod)
{
	long long d=1,t=a;
	while(b)
	{
		if(b&1)
			d=(d*t)%mod;
		b/=2;
		t=(t*t)%mod;
	}
	return d;
}


int main()
{
	int n,i,f;
	long long sum;
	int a[100005],m[100000];
	scanf("%d",&n);
	f=0;
	for(i=0;i<n;i++)
	{
		m[i]=0;
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
		m[a[i]]++;
	if(n%2==1)
	{
		if(m[0]!=1)
			f=1;
		for(i=2;i<n;i+=2)
			if(m[i]!=2)
				f=1;
	}
	else
	{
		for(i=1;i<n;i+=2)
			if(m[i]!=2)
				f=1;
	}
	sum=fun(2,n/2,mod);
	if(n%2)
	{
		if(f)
			printf("0\n");
		else
			printf("%lld\n",sum);
	}
	else
	{
		if(f)
			printf("0\n");
		else
			printf("%lld\n",sum);
	}
	return 0;
}
5
2 4 4 0 2

4

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

```c
#include<stdio.h>

int mod=1000000007;
long long fun(int a,int b,int mod)
{
	long long d=1,t=a;
	while(b)
	{
		if(b&1)
			d=(d*t)%mod;
		b/=2;
		t=(t*t)%mod;
	}
	return d;
}


int main()
{
	int n,i,f;
	long long sum;
	int a[100005],m[100000];
	scanf("%d",&n);
	f=0;
	for(i=0;i<n;i++)
	{
		m[i]=0;
		scanf("%d",&a[i]);
	}
	for(i=0;i<n;i++)
		m[a[i]]++;
	if(n%2==1)
	{
		if(m[0]!=1)
			f=1;
		for(i=2;i<n;i+=2)
			if(m[i]!=2)
				f=1;
	}
	else
	{
		for(i=1;i<n;i+=2)
			if(m[i]!=2)
				f=1;
	}
	sum=fun(2,n/2,mod);
	if(n%2)
	{
		if(f)
			printf("0\n");
		else
			printf("%lld\n",sum);
	}
	else
	{
		if(f)
			printf("0\n");
		else
			printf("%lld\n",sum);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	mod
	.data
	.align 4
	.type	mod, @object
	.size	mod, 4
mod:
	.long	1000000007
	.text
	.globl	fun
	.type	fun, @function
fun:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movq	$1, -16(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movq	%rax, -8(%rbp)
	jmp	.L2
.L4:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movq	-16(%rbp), %rax
	imulq	-8(%rbp), %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -16(%rbp)
.L3:
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	movq	-8(%rbp), %rax
	imulq	%rax, %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L2:
	cmpl	$0, -24(%rbp)
	jne	.L4
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	fun, .-fun
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1344, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800052(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800044(%rbp)
	movl	$0, -800048(%rbp)
	jmp	.L7
.L8:
	movl	-800048(%rbp), %eax
	cltq
	movl	$0, -800032(%rbp,%rax,4)
	leaq	-400032(%rbp), %rdx
	movl	-800048(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800048(%rbp)
.L7:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L8
	movl	$0, -800048(%rbp)
	jmp	.L9
.L10:
	movl	-800048(%rbp), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-800032(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -800032(%rbp,%rax,4)
	addl	$1, -800048(%rbp)
.L9:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L10
	movl	-800052(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L11
	movl	-800032(%rbp), %eax
	cmpl	$1, %eax
	je	.L12
	movl	$1, -800044(%rbp)
.L12:
	movl	$2, -800048(%rbp)
	jmp	.L13
.L15:
	movl	-800048(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L14
	movl	$1, -800044(%rbp)
.L14:
	addl	$2, -800048(%rbp)
.L13:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L15
	jmp	.L16
.L11:
	movl	$1, -800048(%rbp)
	jmp	.L17
.L19:
	movl	-800048(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L18
	movl	$1, -800044(%rbp)
.L18:
	addl	$2, -800048(%rbp)
.L17:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L19
.L16:
	movl	mod(%rip), %eax
	movl	-800052(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	%eax, %edx
	movl	%ecx, %esi
	movl	$2, %edi
	call	fun
	movq	%rax, -800040(%rbp)
	movl	-800052(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L20
	cmpl	$0, -800044(%rbp)
	je	.L21
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L22
.L21:
	movq	-800040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L22
.L20:
	cmpl	$0, -800044(%rbp)
	je	.L23
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L22
.L23:
	movq	-800040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L22:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.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	mod
	.data
	.align 4
	.type	mod, @object
	.size	mod, 4
mod:
	.long	1000000007
	.text
	.globl	fun
	.type	fun, @function
fun:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movq	$1, -16(%rbp)
	movl	-20(%rbp), %eax
	cltq
	movq	%rax, -8(%rbp)
	jmp	.L2
.L4:
	movl	-24(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L3
	movq	-16(%rbp), %rax
	imulq	-8(%rbp), %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -16(%rbp)
.L3:
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	movq	-8(%rbp), %rax
	imulq	%rax, %rax
	movl	-28(%rbp), %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, -8(%rbp)
.L2:
	cmpl	$0, -24(%rbp)
	jne	.L4
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	fun, .-fun
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.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
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1344, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800052(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800044(%rbp)
	movl	$0, -800048(%rbp)
	jmp	.L7
.L8:
	movl	-800048(%rbp), %eax
	cltq
	movl	$0, -800032(%rbp,%rax,4)
	leaq	-400032(%rbp), %rdx
	movl	-800048(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800048(%rbp)
.L7:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L8
	movl	$0, -800048(%rbp)
	jmp	.L9
.L10:
	movl	-800048(%rbp), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	movl	-800032(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -800032(%rbp,%rax,4)
	addl	$1, -800048(%rbp)
.L9:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L10
	movl	-800052(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L11
	movl	-800032(%rbp), %eax
	cmpl	$1, %eax
	je	.L12
	movl	$1, -800044(%rbp)
.L12:
	movl	$2, -800048(%rbp)
	jmp	.L13
.L15:
	movl	-800048(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L14
	movl	$1, -800044(%rbp)
.L14:
	addl	$2, -800048(%rbp)
.L13:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L15
	jmp	.L16
.L11:
	movl	$1, -800048(%rbp)
	jmp	.L17
.L19:
	movl	-800048(%rbp), %eax
	cltq
	movl	-800032(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	je	.L18
	movl	$1, -800044(%rbp)
.L18:
	addl	$2, -800048(%rbp)
.L17:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800048(%rbp)
	jl	.L19
.L16:
	movl	mod(%rip), %eax
	movl	-800052(%rbp), %edx
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%ecx, %edx
	sarl	%edx
	movl	%edx, %ecx
	movl	%eax, %edx
	movl	%ecx, %esi
	movl	$2, %edi
	call	fun
	movq	%rax, -800040(%rbp)
	movl	-800052(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L20
	cmpl	$0, -800044(%rbp)
	je	.L21
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L22
.L21:
	movq	-800040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L22
.L20:
	cmpl	$0, -800044(%rbp)
	je	.L23
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L22
.L23:
	movq	-800040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L22:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.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:
