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 <stdlib.h>
int main(void) {
    long long num,day,move,town=1,temp,road[100000]={0},sum=0,i,j;
    scanf("%lld %lld",&num,&day);
    sum=0;
    for (i=0; i<num-1; i++) {
        scanf("%lld",&temp);
        road[i+1]=road[i]+temp;
    }
    for (i=0; i<day; i++) {
        scanf("%lld",&move);
        if (move>0) {
            sum+=road[town+move-1]-road[town-1];
        } else {
            sum+=road[town-1]-road[town+move-1];
        }
        sum%=100000;
        town+=move;
    }
    printf("%lld\n",sum);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	$1360, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$1, -800040(%rbp)
	leaq	-800016(%rbp), %rax
	movl	$800000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$0, -800032(%rbp)
	leaq	-800064(%rbp), %rdx
	leaq	-800072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -800032(%rbp)
	movq	$0, -800024(%rbp)
	jmp	.L2
.L3:
	leaq	-800048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800024(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rcx
	movq	-800048(%rbp), %rdx
	movq	-800024(%rbp), %rax
	addq	$1, %rax
	addq	%rcx, %rdx
	movq	%rdx, -800016(%rbp,%rax,8)
	addq	$1, -800024(%rbp)
.L2:
	movq	-800072(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -800024(%rbp)
	jl	.L3
	movq	$0, -800024(%rbp)
	jmp	.L4
.L7:
	leaq	-800056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800056(%rbp), %rax
	testq	%rax, %rax
	jle	.L5
	movq	-800056(%rbp), %rdx
	movq	-800040(%rbp), %rax
	addq	%rdx, %rax
	subq	$1, %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	-800040(%rbp), %rdx
	subq	$1, %rdx
	movq	-800016(%rbp,%rdx,8), %rdx
	subq	%rdx, %rax
	addq	%rax, -800032(%rbp)
	jmp	.L6
.L5:
	movq	-800040(%rbp), %rax
	subq	$1, %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	-800056(%rbp), %rcx
	movq	-800040(%rbp), %rdx
	addq	%rcx, %rdx
	subq	$1, %rdx
	movq	-800016(%rbp,%rdx,8), %rdx
	subq	%rdx, %rax
	addq	%rax, -800032(%rbp)
.L6:
	movq	-800032(%rbp), %rcx
	movabsq	$3022314549036572937, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$14, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$100000, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -800032(%rbp)
	movq	-800056(%rbp), %rax
	addq	%rax, -800040(%rbp)
	addq	$1, -800024(%rbp)
.L4:
	movq	-800064(%rbp), %rax
	cmpq	%rax, -800024(%rbp)
	jl	.L7
	movq	-800032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1336, %rsp
	.cfi_def_cfa_offset 800112
	xorl	%esi, %esi
	movl	$800000, %edx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 800040(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %r13
	leaq	24(%rsp), %rbx
	movq	%r13, %rdi
	call	memset@PLT
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpq	$1, (%rsp)
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	0(%r13,%r12,8), %rax
	addq	$1, %r12
	addq	24(%rsp), %rax
	movq	%rax, 0(%r13,%r12,8)
	movq	(%rsp), %rax
	subq	$1, %rax
	cmpq	%rax, %r12
	jl	.L2
.L5:
	xorl	%r12d, %r12d
	cmpq	$0, 8(%rsp)
	jle	.L4
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movl	$1, %ebx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %rbp
	leaq	16(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movq	%r13, %rdx
	movq	%r12, %rcx
	addq	%rax, %rbx
	leaq	-1(%rbx), %r13
	testq	%rax, %rax
	jle	.L6
	movabsq	$3022314549036572937, %rax
	addq	24(%rsp,%rbx,8), %rcx
	subq	32(%rsp,%rdx,8), %rcx
	addq	$1, %r15
	imulq	%rcx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$14, %rdx
	subq	%rax, %rdx
	imulq	$100000, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r12
	cmpq	8(%rsp), %r15
	jl	.L3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	800040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$800056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	addq	32(%rsp,%rdx,8), %rcx
	subq	24(%rsp,%rbx,8), %rcx
	addq	$1, %r15
	movabsq	$3022314549036572937, %rax
	imulq	%rcx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$14, %rdx
	subq	%rax, %rdx
	imulq	$100000, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r12
	cmpq	%r15, 8(%rsp)
	jg	.L3
	jmp	.L4
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1336, %rsp
	.cfi_def_cfa_offset 800112
	xorl	%esi, %esi
	movl	$800000, %edx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 800040(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %r13
	leaq	24(%rsp), %rbx
	movq	%r13, %rdi
	call	memset@PLT
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	movq	%rsp, %rsi
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	cmpq	$1, (%rsp)
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	0(%r13,%r12,8), %rax
	addq	$1, %r12
	addq	24(%rsp), %rax
	movq	%rax, 0(%r13,%r12,8)
	movq	(%rsp), %rax
	subq	$1, %rax
	cmpq	%rax, %r12
	jl	.L2
.L5:
	xorl	%r12d, %r12d
	cmpq	$0, 8(%rsp)
	jle	.L4
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movl	$1, %ebx
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %rbp
	leaq	16(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	16(%rsp), %rax
	movq	%r13, %rdx
	movq	%r12, %rcx
	addq	%rax, %rbx
	leaq	-1(%rbx), %r13
	testq	%rax, %rax
	jle	.L6
	movabsq	$3022314549036572937, %rax
	addq	24(%rsp,%rbx,8), %rcx
	subq	32(%rsp,%rdx,8), %rcx
	addq	$1, %r15
	imulq	%rcx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$14, %rdx
	subq	%rax, %rdx
	imulq	$100000, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r12
	cmpq	8(%rsp), %r15
	jl	.L3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	800040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$800056, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	addq	32(%rsp,%rdx,8), %rcx
	subq	24(%rsp,%rbx,8), %rcx
	addq	$1, %r15
	movabsq	$3022314549036572937, %rax
	imulq	%rcx
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$14, %rdx
	subq	%rax, %rdx
	imulq	$100000, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r12
	cmpq	%r15, 8(%rsp)
	jg	.L3
	jmp	.L4
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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>
#include <stdlib.h>
int main(void) {
    long long num,day,move,town=1,temp,road[100000]={0},sum=0,i,j;
    scanf("%lld %lld",&num,&day);
    sum=0;
    for (i=0; i<num-1; i++) {
        scanf("%lld",&temp);
        road[i+1]=road[i]+temp;
    }
    for (i=0; i<day; i++) {
        scanf("%lld",&move);
        if (move>0) {
            sum+=road[town+move-1]-road[town-1];
        } else {
            sum+=road[town-1]-road[town+move-1];
        }
        sum%=100000;
        town+=move;
    }
    printf("%lld\n",sum);
    return 0;
}
7 5
2
1
2
3
2
1
2
-1
3
2
-3
 7 5
2
0
2
3
2
1
2
-1
3
2
-3
 7 5
2
1
1
3
2
1
2
-1
1
2
-3
 7 5
2
1
1
0
2
1
2
-1
1
2
-3
 7 5
2
1
2
3
0
1
2
-1
3
2
-1
 7 5
1
0
2
3
2
1
2
-1
3
1
-3
 7 5
2
0
1
0
2
1
2
-1
1
2
-3
 7 5
4
1
2
3
0
1
2
-1
3
2
0
 7 5
4
1
2
3
0
1
2
-1
0
2
0
 7 5
2
1
1
3
2
1
2
-1
0
2
-3

19
 16
 14
 8
 12
 15
 4
 13
 9
 10

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 <stdlib.h>
int main(void) {
    long long num,day,move,town=1,temp,road[100000]={0},sum=0,i,j;
    scanf("%lld %lld",&num,&day);
    sum=0;
    for (i=0; i<num-1; i++) {
        scanf("%lld",&temp);
        road[i+1]=road[i]+temp;
    }
    for (i=0; i<day; i++) {
        scanf("%lld",&move);
        if (move>0) {
            sum+=road[town+move-1]-road[town-1];
        } else {
            sum+=road[town-1]-road[town+move-1];
        }
        sum%=100000;
        town+=move;
    }
    printf("%lld\n",sum);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	$1360, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$1, -800040(%rbp)
	leaq	-800016(%rbp), %rax
	movl	$800000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$0, -800032(%rbp)
	leaq	-800064(%rbp), %rdx
	leaq	-800072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -800032(%rbp)
	movq	$0, -800024(%rbp)
	jmp	.L2
.L3:
	leaq	-800048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800024(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rcx
	movq	-800048(%rbp), %rdx
	movq	-800024(%rbp), %rax
	addq	$1, %rax
	addq	%rcx, %rdx
	movq	%rdx, -800016(%rbp,%rax,8)
	addq	$1, -800024(%rbp)
.L2:
	movq	-800072(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -800024(%rbp)
	jl	.L3
	movq	$0, -800024(%rbp)
	jmp	.L4
.L7:
	leaq	-800056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800056(%rbp), %rax
	testq	%rax, %rax
	jle	.L5
	movq	-800056(%rbp), %rdx
	movq	-800040(%rbp), %rax
	addq	%rdx, %rax
	subq	$1, %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	-800040(%rbp), %rdx
	subq	$1, %rdx
	movq	-800016(%rbp,%rdx,8), %rdx
	subq	%rdx, %rax
	addq	%rax, -800032(%rbp)
	jmp	.L6
.L5:
	movq	-800040(%rbp), %rax
	subq	$1, %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	-800056(%rbp), %rcx
	movq	-800040(%rbp), %rdx
	addq	%rcx, %rdx
	subq	$1, %rdx
	movq	-800016(%rbp,%rdx,8), %rdx
	subq	%rdx, %rax
	addq	%rax, -800032(%rbp)
.L6:
	movq	-800032(%rbp), %rcx
	movabsq	$3022314549036572937, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$14, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$100000, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -800032(%rbp)
	movq	-800056(%rbp), %rax
	addq	%rax, -800040(%rbp)
	addq	$1, -800024(%rbp)
.L4:
	movq	-800064(%rbp), %rax
	cmpq	%rax, -800024(%rbp)
	jl	.L7
	movq	-800032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.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	$1360, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$1, -800040(%rbp)
	leaq	-800016(%rbp), %rax
	movl	$800000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movq	$0, -800032(%rbp)
	leaq	-800064(%rbp), %rdx
	leaq	-800072(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -800032(%rbp)
	movq	$0, -800024(%rbp)
	jmp	.L2
.L3:
	leaq	-800048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800024(%rbp), %rax
	movq	-800016(%rbp,%rax,8), %rcx
	movq	-800048(%rbp), %rdx
	movq	-800024(%rbp), %rax
	addq	$1, %rax
	addq	%rcx, %rdx
	movq	%rdx, -800016(%rbp,%rax,8)
	addq	$1, -800024(%rbp)
.L2:
	movq	-800072(%rbp), %rax
	subq	$1, %rax
	cmpq	%rax, -800024(%rbp)
	jl	.L3
	movq	$0, -800024(%rbp)
	jmp	.L4
.L7:
	leaq	-800056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-800056(%rbp), %rax
	testq	%rax, %rax
	jle	.L5
	movq	-800056(%rbp), %rdx
	movq	-800040(%rbp), %rax
	addq	%rdx, %rax
	subq	$1, %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	-800040(%rbp), %rdx
	subq	$1, %rdx
	movq	-800016(%rbp,%rdx,8), %rdx
	subq	%rdx, %rax
	addq	%rax, -800032(%rbp)
	jmp	.L6
.L5:
	movq	-800040(%rbp), %rax
	subq	$1, %rax
	movq	-800016(%rbp,%rax,8), %rax
	movq	-800056(%rbp), %rcx
	movq	-800040(%rbp), %rdx
	addq	%rcx, %rdx
	subq	$1, %rdx
	movq	-800016(%rbp,%rdx,8), %rdx
	subq	%rdx, %rax
	addq	%rax, -800032(%rbp)
.L6:
	movq	-800032(%rbp), %rcx
	movabsq	$3022314549036572937, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$14, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	imulq	$100000, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -800032(%rbp)
	movq	-800056(%rbp), %rax
	addq	%rax, -800040(%rbp)
	addq	$1, -800024(%rbp)
.L4:
	movq	-800064(%rbp), %rax
	cmpq	%rax, -800024(%rbp)
	jl	.L7
	movq	-800032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
