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>
#define MODN 1000000007

static inline long modadd(long a,long b){
    return (a+b) % MODN;
}

int main(void){
    register int i;
    int n;
    scanf("%d",&n);
    int c[n];
    for(i = 0;i < n;i++)scanf("%d",&c[i]);
    long dp[n];
    dp[0] = 1;
    static long hst[200200];
    hst[c[0]] = 1;
    for(i = 0;i< n-1;i++){
        if(c[i] == c[i+1]){
            dp[i+1] = dp[i];
            continue;
        }
        dp[i+1] = modadd(dp[i],hst[c[i+1]]);
        hst[c[i+1]] = dp[i+1];
    }
    printf("%ld",dp[n-1]);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.type	modadd, @function
modadd:
.LFB0:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	leaq	(%rdx,%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
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	modadd, .-modadd
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %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, %r13
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -112(%rbp)
	movq	$0, -104(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	cltq
	leaq	0(,%rax,4), %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
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$0, %ebx
	jmp	.L7
.L8:
	movslq	%ebx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %ebx
.L7:
	movl	-92(%rbp), %eax
	cmpl	%eax, %ebx
	jl	.L8
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%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
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	movq	$1, (%rax)
	movq	-80(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	hst.0(%rip), %rax
	movq	$1, (%rdx,%rax)
	movl	$0, %ebx
	jmp	.L12
.L15:
	movq	-80(%rbp), %rax
	movslq	%ebx, %rdx
	movl	(%rax,%rdx,4), %ecx
	leal	1(%rbx), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jne	.L13
	leal	1(%rbx), %esi
	movq	-64(%rbp), %rax
	movslq	%ebx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L14
.L13:
	leal	1(%rbx), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	hst.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-64(%rbp), %rax
	movslq	%ebx, %rcx
	movq	(%rax,%rcx,8), %rax
	leal	1(%rbx), %r12d
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	modadd
	movq	-64(%rbp), %rdx
	movslq	%r12d, %rcx
	movq	%rax, (%rdx,%rcx,8)
	leal	1(%rbx), %esi
	leal	1(%rbx), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	(%rax,%rdx,8), %rax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	hst.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L14:
	addl	$1, %ebx
.L12:
	movl	-92(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, %ebx
	jl	.L15
	movl	-92(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%r13, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.local	hst.0
	.comm	hst.0,1601600,32
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	leaq	.LC0(%rip), %r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	movq	%r15, %rdi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.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	-60(%rbp), %rcx
	movq	%rsp, %rdi
	leaq	15(,%rcx,4), %rdx
	movq	%rcx, %rax
	movq	%rdx, %rsi
	andq	$-4096, %rdx
	subq	%rdx, %rdi
	andq	$-16, %rsi
	cmpq	%rdi, %rsp
	je	.L3
.L24:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L24
.L3:
	andl	$4095, %esi
	subq	%rsi, %rsp
	testq	%rsi, %rsi
	jne	.L25
.L4:
	leaq	3(%rsp), %rbx
	movq	%rbx, %r14
	andq	$-4, %rbx
	shrq	$2, %r14
	testl	%eax, %eax
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jg	.L6
	movslq	%eax, %rcx
.L5:
	leaq	15(,%rcx,8), %rdx
	movq	%rsp, %rsi
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L8
.L26:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L26
.L8:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L27
.L9:
	leaq	7(%rsp), %r9
	movslq	0(,%r14,4), %rcx
	leaq	hst.0(%rip), %r10
	movq	%r9, %rdx
	leal	-1(%rax), %r13d
	andq	$-8, %r9
	shrq	$3, %rdx
	movq	$1, (%r10,%rcx,8)
	movq	$1, 0(,%rdx,8)
	movq	%rcx, %rdx
	testl	%r13d, %r13d
	jle	.L10
	leal	-2(%rax), %r11d
	movl	$1, %ecx
	movabsq	$-8543223828751151131, %r12
	addq	$2, %r11
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%r8d, %rdi
	movq	-8(%r9,%rcx,8), %rsi
	addq	(%r10,%rdi,8), %rsi
	movq	%rsi, %rax
	imulq	%r12
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	movq	%rsi, (%r9,%rcx,8)
	addq	$1, %rcx
	movq	%rsi, (%r10,%rdi,8)
	cmpq	%r11, %rcx
	je	.L10
.L12:
	movl	%r8d, %edx
.L13:
	movl	(%rbx,%rcx,4), %r8d
	cmpl	%edx, %r8d
	jne	.L11
	movq	-8(%r9,%rcx,8), %rax
	movq	%rax, (%r9,%rcx,8)
	addq	$1, %rcx
	cmpq	%rcx, %r11
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%r13d, %r13
	xorl	%eax, %eax
	movl	$1, %edi
	movq	(%r9,%r13,8), %rdx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L28
	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
.L27:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L9
.L25:
	orq	$0, -8(%rsp,%rsi)
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.local	hst.0
	.comm	hst.0,1601600,32
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	leaq	.LC0(%rip), %r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	movq	%r15, %rdi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.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	-60(%rbp), %rcx
	movq	%rsp, %rdi
	leaq	15(,%rcx,4), %rdx
	movq	%rcx, %rax
	movq	%rdx, %rsi
	andq	$-4096, %rdx
	subq	%rdx, %rdi
	andq	$-16, %rsi
	cmpq	%rdi, %rsp
	je	.L3
.L24:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L24
.L3:
	andl	$4095, %esi
	subq	%rsi, %rsp
	testq	%rsi, %rsi
	jne	.L25
.L4:
	leaq	3(%rsp), %rbx
	movq	%rbx, %r14
	andq	$-4, %rbx
	shrq	$2, %r14
	testl	%eax, %eax
	jle	.L5
	movq	%rbx, %r13
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addq	$4, %r13
	cmpl	%r12d, %eax
	jg	.L6
	movslq	%eax, %rcx
.L5:
	leaq	15(,%rcx,8), %rdx
	movq	%rsp, %rsi
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L8
.L26:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L26
.L8:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L27
.L9:
	leaq	7(%rsp), %r9
	movslq	0(,%r14,4), %rcx
	leaq	hst.0(%rip), %r10
	movq	%r9, %rdx
	leal	-1(%rax), %r13d
	andq	$-8, %r9
	shrq	$3, %rdx
	movq	$1, (%r10,%rcx,8)
	movq	$1, 0(,%rdx,8)
	movq	%rcx, %rdx
	testl	%r13d, %r13d
	jle	.L10
	leal	-2(%rax), %r11d
	movl	$1, %ecx
	movabsq	$-8543223828751151131, %r12
	addq	$2, %r11
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%r8d, %rdi
	movq	-8(%r9,%rcx,8), %rsi
	addq	(%r10,%rdi,8), %rsi
	movq	%rsi, %rax
	imulq	%r12
	movq	%rsi, %rax
	sarq	$63, %rax
	addq	%rsi, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rax
	subq	%rax, %rsi
	movq	%rsi, (%r9,%rcx,8)
	addq	$1, %rcx
	movq	%rsi, (%r10,%rdi,8)
	cmpq	%r11, %rcx
	je	.L10
.L12:
	movl	%r8d, %edx
.L13:
	movl	(%rbx,%rcx,4), %r8d
	cmpl	%edx, %r8d
	jne	.L11
	movq	-8(%r9,%rcx,8), %rax
	movq	%rax, (%r9,%rcx,8)
	addq	$1, %rcx
	cmpq	%rcx, %r11
	jne	.L12
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%r13d, %r13
	xorl	%eax, %eax
	movl	$1, %edi
	movq	(%r9,%r13,8), %rdx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L28
	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
.L27:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L9
.L25:
	orq	$0, -8(%rsp,%rsi)
	jmp	.L4
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.local	hst.0
	.comm	hst.0,1601600,32
	.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>
#define MODN 1000000007

static inline long modadd(long a,long b){
    return (a+b) % MODN;
}

int main(void){
    register int i;
    int n;
    scanf("%d",&n);
    int c[n];
    for(i = 0;i < n;i++)scanf("%d",&c[i]);
    long dp[n];
    dp[0] = 1;
    static long hst[200200];
    hst[c[0]] = 1;
    for(i = 0;i< n-1;i++){
        if(c[i] == c[i+1]){
            dp[i+1] = dp[i];
            continue;
        }
        dp[i+1] = modadd(dp[i],hst[c[i+1]]);
        hst[c[i+1]] = dp[i+1];
    }
    printf("%ld",dp[n-1]);
}
6
4
2
2
4
2
4
 5
1
4
1
2
2
 6
4
2
2
1
2
4
 6
4
1
2
1
2
4
 7
1
2
1
2
3
3
2
 6
3
2
2
2
2
4
 7
1
3
1
2
1
3
2
 7
1
3
1
2
4
3
2
 7
1
3
1
2
2
3
2
 6
4
2
5
4
2
1

5 2 3 4 6 1 7 5 5 3
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>
#define MODN 1000000007

static inline long modadd(long a,long b){
    return (a+b) % MODN;
}

int main(void){
    register int i;
    int n;
    scanf("%d",&n);
    int c[n];
    for(i = 0;i < n;i++)scanf("%d",&c[i]);
    long dp[n];
    dp[0] = 1;
    static long hst[200200];
    hst[c[0]] = 1;
    for(i = 0;i< n-1;i++){
        if(c[i] == c[i+1]){
            dp[i+1] = dp[i];
            continue;
        }
        dp[i+1] = modadd(dp[i],hst[c[i+1]]);
        hst[c[i+1]] = dp[i+1];
    }
    printf("%ld",dp[n-1]);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.type	modadd, @function
modadd:
.LFB0:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	leaq	(%rdx,%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
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	modadd, .-modadd
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %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, %r13
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -112(%rbp)
	movq	$0, -104(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	cltq
	leaq	0(,%rax,4), %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
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$0, %ebx
	jmp	.L7
.L8:
	movslq	%ebx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %ebx
.L7:
	movl	-92(%rbp), %eax
	cmpl	%eax, %ebx
	jl	.L8
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%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
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	movq	$1, (%rax)
	movq	-80(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	hst.0(%rip), %rax
	movq	$1, (%rdx,%rax)
	movl	$0, %ebx
	jmp	.L12
.L15:
	movq	-80(%rbp), %rax
	movslq	%ebx, %rdx
	movl	(%rax,%rdx,4), %ecx
	leal	1(%rbx), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jne	.L13
	leal	1(%rbx), %esi
	movq	-64(%rbp), %rax
	movslq	%ebx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L14
.L13:
	leal	1(%rbx), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	hst.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-64(%rbp), %rax
	movslq	%ebx, %rcx
	movq	(%rax,%rcx,8), %rax
	leal	1(%rbx), %r12d
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	modadd
	movq	-64(%rbp), %rdx
	movslq	%r12d, %rcx
	movq	%rax, (%rdx,%rcx,8)
	leal	1(%rbx), %esi
	leal	1(%rbx), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	(%rax,%rdx,8), %rax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	hst.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L14:
	addl	$1, %ebx
.L12:
	movl	-92(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, %ebx
	jl	.L15
	movl	-92(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%r13, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.local	hst.0
	.comm	hst.0,1601600,32
	.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
	.type	modadd, @function
modadd:
.LFB0:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rdx
	movq	-16(%rbp), %rax
	leaq	(%rdx,%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
	imulq	$1000000007, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	modadd, .-modadd
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld"
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %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, %r13
	leaq	-92(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -112(%rbp)
	movq	$0, -104(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	cltq
	leaq	0(,%rax,4), %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
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	$0, %ebx
	jmp	.L7
.L8:
	movslq	%ebx, %rax
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, %ebx
.L7:
	movl	-92(%rbp), %eax
	cmpl	%eax, %ebx
	jl	.L8
	movl	-92(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%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
.L9:
	cmpq	%rdx, %rsp
	je	.L10
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L9
.L10:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L11
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L11:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	movq	$1, (%rax)
	movq	-80(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	hst.0(%rip), %rax
	movq	$1, (%rdx,%rax)
	movl	$0, %ebx
	jmp	.L12
.L15:
	movq	-80(%rbp), %rax
	movslq	%ebx, %rdx
	movl	(%rax,%rdx,4), %ecx
	leal	1(%rbx), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	%eax, %ecx
	jne	.L13
	leal	1(%rbx), %esi
	movq	-64(%rbp), %rax
	movslq	%ebx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	%rcx, (%rax,%rdx,8)
	jmp	.L14
.L13:
	leal	1(%rbx), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	hst.0(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-64(%rbp), %rax
	movslq	%ebx, %rcx
	movq	(%rax,%rcx,8), %rax
	leal	1(%rbx), %r12d
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	modadd
	movq	-64(%rbp), %rdx
	movslq	%r12d, %rcx
	movq	%rax, (%rdx,%rcx,8)
	leal	1(%rbx), %esi
	leal	1(%rbx), %edx
	movq	-80(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-64(%rbp), %rax
	movslq	%esi, %rdx
	movq	(%rax,%rdx,8), %rax
	movslq	%ecx, %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	hst.0(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L14:
	addl	$1, %ebx
.L12:
	movl	-92(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, %ebx
	jl	.L15
	movl	-92(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%r13, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.local	hst.0
	.comm	hst.0,1601600,32
	.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:
