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

```c
#include <stdio.h>
int main(){
    int n,m,s[99999],a[100000],ans=0,p=0,i,j;
    scanf("%d%d",&n,&m);
    for (i=0; i<n-1; i++) {
        scanf("%d",&s[i]);
    }
    for (i=0; i<m; i++) {
        scanf("%d",&a[i]);
        if (a[i]>0) {
            for (j=0; j<a[i]; j++) {
                ans+=s[p];
                p++;
                if (ans>100000) {
                    ans%=100000;
                }
            }
        }else{
            for (j=0; j>a[i]; j--) {
                ans+=s[p-1];
                p--;
                if (ans>100000) {
                    ans%=100000;
                }
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	24(%rsp), %rsi
	movq	%rax, 8(%rsp)
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, 24(%rsp)
	jle	.L2
	leaq	32(%rsp), %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	addq	$4, %r12
	subl	$1, %eax
	cmpl	%ebp, %eax
	jg	.L3
.L2:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	leaq	.LC1(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	400032(%rsp), %r13
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%r13), %esi
	testl	%esi, %esi
	jle	.L25
	movslq	%r15d, %rdi
	leal	-1(%rsi), %eax
	addq	%rdi, %rax
	leaq	0(%rbp,%rdi,4), %rdx
	leaq	36(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L9:
	addl	(%rdx), %r12d
	cmpl	$100000, %r12d
	jle	.L8
	movslq	%r12d, %rax
	movl	%r12d, %r8d
	imulq	$351843721, %rax, %rax
	sarl	$31, %r8d
	sarq	$45, %rax
	subl	%r8d, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %r12d
.L8:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L9
	addl	%esi, %r15d
.L7:
	addl	$1, %r14d
	addq	$4, %r13
	cmpl	%r14d, 28(%rsp)
	jg	.L14
.L4:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	800040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	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
.L25:
	.cfi_restore_state
	je	.L7
	movslq	%r15d, %rdi
	movl	%esi, %eax
	salq	$2, %rdi
	notl	%eax
	leaq	0(%rbp,%rdi), %rdx
	salq	$2, %rax
	addq	8(%rsp), %rdi
	subq	%rax, %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	addl	-4(%rdx), %r12d
	cmpl	$100000, %r12d
	jle	.L12
	movslq	%r12d, %rax
	movl	%r12d, %r8d
	imulq	$351843721, %rax, %rax
	sarl	$31, %r8d
	sarq	$45, %rax
	subl	%r8d, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %r12d
.L12:
	subq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L11
	addl	%esi, %r15d
	jmp	.L7
.L16:
	xorl	%r12d, %r12d
	jmp	.L4
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	24(%rsp), %rsi
	movq	%rax, 8(%rsp)
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, 24(%rsp)
	jle	.L2
	leaq	32(%rsp), %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	addq	$4, %r12
	subl	$1, %eax
	cmpl	%ebp, %eax
	jg	.L3
.L2:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	leaq	.LC1(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	400032(%rsp), %r13
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%r13), %esi
	testl	%esi, %esi
	jle	.L25
	movslq	%r15d, %rdi
	leal	-1(%rsi), %eax
	addq	%rdi, %rax
	leaq	0(%rbp,%rdi,4), %rdx
	leaq	36(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L9:
	addl	(%rdx), %r12d
	cmpl	$100000, %r12d
	jle	.L8
	movslq	%r12d, %rax
	movl	%r12d, %r8d
	imulq	$351843721, %rax, %rax
	sarl	$31, %r8d
	sarq	$45, %rax
	subl	%r8d, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %r12d
.L8:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L9
	addl	%esi, %r15d
.L7:
	addl	$1, %r14d
	addq	$4, %r13
	cmpl	%r14d, 28(%rsp)
	jg	.L14
.L4:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	800040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	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
.L25:
	.cfi_restore_state
	je	.L7
	movslq	%r15d, %rdi
	movl	%esi, %eax
	salq	$2, %rdi
	notl	%eax
	leaq	0(%rbp,%rdi), %rdx
	salq	$2, %rax
	addq	8(%rsp), %rdi
	subq	%rax, %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	addl	-4(%rdx), %r12d
	cmpl	$100000, %r12d
	jle	.L12
	movslq	%r12d, %rax
	movl	%r12d, %r8d
	imulq	$351843721, %rax, %rax
	sarl	$31, %r8d
	sarq	$45, %rax
	subl	%r8d, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %r12d
.L12:
	subq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L11
	addl	%esi, %r15d
	jmp	.L7
.L16:
	xorl	%r12d, %r12d
	jmp	.L4
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	24(%rsp), %rsi
	movq	%rax, 8(%rsp)
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, 24(%rsp)
	jle	.L2
	leaq	32(%rsp), %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	addq	$4, %r12
	subl	$1, %eax
	cmpl	%ebp, %eax
	jg	.L3
.L2:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	leaq	.LC1(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	400032(%rsp), %r13
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%r13), %esi
	testl	%esi, %esi
	jle	.L25
	movslq	%r15d, %rdi
	leal	-1(%rsi), %eax
	addq	%rdi, %rax
	leaq	0(%rbp,%rdi,4), %rdx
	leaq	36(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L9:
	addl	(%rdx), %r12d
	cmpl	$100000, %r12d
	jle	.L8
	movslq	%r12d, %rax
	movl	%r12d, %r8d
	imulq	$351843721, %rax, %rax
	sarl	$31, %r8d
	sarq	$45, %rax
	subl	%r8d, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %r12d
.L8:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L9
	addl	%esi, %r15d
.L7:
	addl	$1, %r14d
	addq	$4, %r13
	cmpl	%r14d, 28(%rsp)
	jg	.L14
.L4:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	800040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	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
.L25:
	.cfi_restore_state
	je	.L7
	movslq	%r15d, %rdi
	movl	%esi, %eax
	salq	$2, %rdi
	notl	%eax
	leaq	0(%rbp,%rdi), %rdx
	salq	$2, %rax
	addq	8(%rsp), %rdi
	subq	%rax, %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	addl	-4(%rdx), %r12d
	cmpl	$100000, %r12d
	jle	.L12
	movslq	%r12d, %rax
	movl	%r12d, %r8d
	imulq	$351843721, %rax, %rax
	sarl	$31, %r8d
	sarq	$45, %rax
	subl	%r8d, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %r12d
.L12:
	subq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L11
	addl	%esi, %r15d
	jmp	.L7
.L16:
	xorl	%r12d, %r12d
	jmp	.L4
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#include <stdio.h>
int main(){
    int n,m,s[99999],a[100000],ans=0,p=0,i,j;
    scanf("%d%d",&n,&m);
    for (i=0; i<n-1; i++) {
        scanf("%d",&s[i]);
    }
    for (i=0; i<m; i++) {
        scanf("%d",&a[i]);
        if (a[i]>0) {
            for (j=0; j<a[i]; j++) {
                ans+=s[p];
                p++;
                if (ans>100000) {
                    ans%=100000;
                }
            }
        }else{
            for (j=0; j>a[i]; j--) {
                ans+=s[p-1];
                p--;
                if (ans>100000) {
                    ans%=100000;
                }
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main(){
    int n,m,s[99999],a[100000],ans=0,p=0,i,j;
    scanf("%d%d",&n,&m);
    for (i=0; i<n-1; i++) {
        scanf("%d",&s[i]);
    }
    for (i=0; i<m; i++) {
        scanf("%d",&a[i]);
        if (a[i]>0) {
            for (j=0; j<a[i]; j++) {
                ans+=s[p];
                p++;
                if (ans>100000) {
                    ans%=100000;
                }
            }
        }else{
            for (j=0; j>a[i]; j--) {
                ans+=s[p-1];
                p--;
                if (ans>100000) {
                    ans%=100000;
                }
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main(){
    int n,m,s[99999],a[100000],ans=0,p=0,i,j;
    scanf("%d%d",&n,&m);
    for (i=0; i<n-1; i++) {
        scanf("%d",&s[i]);
    }
    for (i=0; i<m; i++) {
        scanf("%d",&a[i]);
        if (a[i]>0) {
            for (j=0; j<a[i]; j++) {
                ans+=s[p];
                p++;
                if (ans>100000) {
                    ans%=100000;
                }
            }
        }else{
            for (j=0; j>a[i]; j--) {
                ans+=s[p-1];
                p--;
                if (ans>100000) {
                    ans%=100000;
                }
            }
        }
    }
    printf("%d\n",ans);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	24(%rsp), %rsi
	movq	%rax, 8(%rsp)
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, 24(%rsp)
	jle	.L2
	leaq	32(%rsp), %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	addq	$4, %r12
	subl	$1, %eax
	cmpl	%ebp, %eax
	jg	.L3
.L2:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	leaq	.LC1(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	400032(%rsp), %r13
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%r13), %esi
	testl	%esi, %esi
	jle	.L25
	movslq	%r15d, %rdi
	leal	-1(%rsi), %eax
	addq	%rdi, %rax
	leaq	0(%rbp,%rdi,4), %rdx
	leaq	36(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L9:
	addl	(%rdx), %r12d
	cmpl	$100000, %r12d
	jle	.L8
	movslq	%r12d, %rax
	movl	%r12d, %r8d
	imulq	$351843721, %rax, %rax
	sarl	$31, %r8d
	sarq	$45, %rax
	subl	%r8d, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %r12d
.L8:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L9
	addl	%esi, %r15d
.L7:
	addl	$1, %r14d
	addq	$4, %r13
	cmpl	%r14d, 28(%rsp)
	jg	.L14
.L4:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	800040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	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
.L25:
	.cfi_restore_state
	je	.L7
	movslq	%r15d, %rdi
	movl	%esi, %eax
	salq	$2, %rdi
	notl	%eax
	leaq	0(%rbp,%rdi), %rdx
	salq	$2, %rax
	addq	8(%rsp), %rdi
	subq	%rax, %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	addl	-4(%rdx), %r12d
	cmpl	$100000, %r12d
	jle	.L12
	movslq	%r12d, %rax
	movl	%r12d, %r8d
	imulq	$351843721, %rax, %rax
	sarl	$31, %r8d
	sarq	$45, %rax
	subl	%r8d, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %r12d
.L12:
	subq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L11
	addl	%esi, %r15d
	jmp	.L7
.L16:
	xorl	%r12d, %r12d
	jmp	.L4
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800040(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	24(%rsp), %rsi
	movq	%rax, 8(%rsp)
	movq	%rax, %rdx
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, 24(%rsp)
	jle	.L2
	leaq	32(%rsp), %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %eax
	addq	$4, %r12
	subl	$1, %eax
	cmpl	%ebp, %eax
	jg	.L3
.L2:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	leaq	.LC1(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	400032(%rsp), %r13
	leaq	32(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	0(%r13), %esi
	testl	%esi, %esi
	jle	.L25
	movslq	%r15d, %rdi
	leal	-1(%rsi), %eax
	addq	%rdi, %rax
	leaq	0(%rbp,%rdi,4), %rdx
	leaq	36(%rsp,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L9:
	addl	(%rdx), %r12d
	cmpl	$100000, %r12d
	jle	.L8
	movslq	%r12d, %rax
	movl	%r12d, %r8d
	imulq	$351843721, %rax, %rax
	sarl	$31, %r8d
	sarq	$45, %rax
	subl	%r8d, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %r12d
.L8:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L9
	addl	%esi, %r15d
.L7:
	addl	$1, %r14d
	addq	$4, %r13
	cmpl	%r14d, 28(%rsp)
	jg	.L14
.L4:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	800040(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	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
.L25:
	.cfi_restore_state
	je	.L7
	movslq	%r15d, %rdi
	movl	%esi, %eax
	salq	$2, %rdi
	notl	%eax
	leaq	0(%rbp,%rdi), %rdx
	salq	$2, %rax
	addq	8(%rsp), %rdi
	subq	%rax, %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	addl	-4(%rdx), %r12d
	cmpl	$100000, %r12d
	jle	.L12
	movslq	%r12d, %rax
	movl	%r12d, %r8d
	imulq	$351843721, %rax, %rax
	sarl	$31, %r8d
	sarq	$45, %rax
	subl	%r8d, %eax
	imull	$100000, %eax, %eax
	subl	%eax, %r12d
.L12:
	subq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L11
	addl	%esi, %r15d
	jmp	.L7
.L16:
	xorl	%r12d, %r12d
	jmp	.L4
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```