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

int main () {
    int N;
    int X;
    scanf("%d", &N);
    scanf("%d", &X);

    int *L = malloc((N + 1) * sizeof(int));
    int ans = 0;
    int *D = malloc((N + 1) * sizeof(int));
    D[1] = 0;
    for (int i = 1; i <= N; i++) {
        scanf("%d", &L[i]);
        if (i >= 2) {
            D[i] += D[i-1] + L[i-1];
            if (D[i] > X){
                ans = i - 1;
                printf("%d\n", ans);
                return 0;
            }
        }
    }
    if ((D[N] + L[N]) > X)
        ans = N;
    else
        ans = N + 1;
    printf("%d\n", ans);

    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r8d
	leal	1(%r8), %ebp
	movl	%r8d, 12(%rsp)
	movslq	%ebp, %rbp
	salq	$2, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, (%rsp)
	call	malloc@PLT
	movl	12(%rsp), %r8d
	movl	$0, 4(%rax)
	movq	%rax, %rbp
	testl	%r8d, %r8d
	jle	.L3
	movq	(%rsp), %r15
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	8(%rbp), %r14
	leaq	4(%r15), %rsi
	leaq	8(%r15), %r13
	movl	$1, %r15d
	call	__isoc99_scanf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	movl	-8(%r13), %eax
	addl	-4(%r14), %eax
	addq	$4, %r14
	addl	-4(%r14), %eax
	movl	%eax, -4(%r14)
	cmpl	20(%rsp), %eax
	jg	.L13
.L4:
	movl	16(%rsp), %r8d
	movl	%r15d, %r12d
	addl	$1, %r15d
	cmpl	%r15d, %r8d
	jge	.L6
.L3:
	movq	(%rsp), %rax
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	0(%rbp,%rdx,4), %eax
	cmpl	20(%rsp), %eax
	jle	.L14
.L7:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$40, %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
.L14:
	.cfi_restore_state
	addl	$1, %r8d
	jmp	.L7
.L13:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
.L15:
	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:
```

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"
.LC1:
	.string	"%d\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	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r8d
	leal	1(%r8), %ebp
	movl	%r8d, 12(%rsp)
	movslq	%ebp, %rbp
	salq	$2, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, (%rsp)
	call	malloc@PLT
	movl	12(%rsp), %r8d
	movl	$0, 4(%rax)
	movq	%rax, %rbp
	testl	%r8d, %r8d
	jle	.L3
	movq	(%rsp), %r15
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	8(%rbp), %r14
	leaq	4(%r15), %rsi
	leaq	8(%r15), %r13
	movl	$1, %r15d
	call	__isoc99_scanf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	movl	-8(%r13), %eax
	addl	-4(%r14), %eax
	addq	$4, %r14
	addl	-4(%r14), %eax
	movl	%eax, -4(%r14)
	cmpl	20(%rsp), %eax
	jg	.L13
.L4:
	movl	16(%rsp), %r8d
	movl	%r15d, %r12d
	addl	$1, %r15d
	cmpl	%r15d, %r8d
	jge	.L6
.L3:
	movq	(%rsp), %rax
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	0(%rbp,%rdx,4), %eax
	cmpl	20(%rsp), %eax
	jle	.L14
.L7:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$40, %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
.L14:
	.cfi_restore_state
	addl	$1, %r8d
	jmp	.L7
.L13:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
.L15:
	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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r8d
	leal	1(%r8), %ebp
	movl	%r8d, 12(%rsp)
	movslq	%ebp, %rbp
	salq	$2, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, (%rsp)
	call	malloc@PLT
	movl	12(%rsp), %r8d
	movl	$0, 4(%rax)
	movq	%rax, %rbp
	testl	%r8d, %r8d
	jle	.L3
	movq	(%rsp), %r15
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	8(%rbp), %r14
	leaq	4(%r15), %rsi
	leaq	8(%r15), %r13
	movl	$1, %r15d
	call	__isoc99_scanf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	movl	-8(%r13), %eax
	addl	-4(%r14), %eax
	addq	$4, %r14
	addl	-4(%r14), %eax
	movl	%eax, -4(%r14)
	cmpl	20(%rsp), %eax
	jg	.L13
.L4:
	movl	16(%rsp), %r8d
	movl	%r15d, %r12d
	addl	$1, %r15d
	cmpl	%r15d, %r8d
	jge	.L6
.L3:
	movq	(%rsp), %rax
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	0(%rbp,%rdx,4), %eax
	cmpl	20(%rsp), %eax
	jle	.L14
.L7:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$40, %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
.L14:
	.cfi_restore_state
	addl	$1, %r8d
	jmp	.L7
.L13:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
.L15:
	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:
```
```c
#include <stdio.h>
#include <stdlib.h>

int main () {
    int N;
    int X;
    scanf("%d", &N);
    scanf("%d", &X);

    int *L = malloc((N + 1) * sizeof(int));
    int ans = 0;
    int *D = malloc((N + 1) * sizeof(int));
    D[1] = 0;
    for (int i = 1; i <= N; i++) {
        scanf("%d", &L[i]);
        if (i >= 2) {
            D[i] += D[i-1] + L[i-1];
            if (D[i] > X){
                ans = i - 1;
                printf("%d\n", ans);
                return 0;
            }
        }
    }
    if ((D[N] + L[N]) > X)
        ans = N;
    else
        ans = N + 1;
    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>
#include <stdlib.h>

int main () {
    int N;
    int X;
    scanf("%d", &N);
    scanf("%d", &X);

    int *L = malloc((N + 1) * sizeof(int));
    int ans = 0;
    int *D = malloc((N + 1) * sizeof(int));
    D[1] = 0;
    for (int i = 1; i <= N; i++) {
        scanf("%d", &L[i]);
        if (i >= 2) {
            D[i] += D[i-1] + L[i-1];
            if (D[i] > X){
                ans = i - 1;
                printf("%d\n", ans);
                return 0;
            }
        }
    }
    if ((D[N] + L[N]) > X)
        ans = N;
    else
        ans = N + 1;
    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:

4 9
3 6 3 3
 4 9
5 6 2 6
 4 9
3 2 3 3
 4 9
3 2 0 3
 3 9
16 5 1 12
 4 9
3 6 2 3
 4 9
3 6 2 6
 1 9
5 6 2 6
 1 9
4 6 2 6
 4 6
3 3 3 3

3
 2
 4
 5
 1
 3
 3
 2
 2
 3

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

int main () {
    int N;
    int X;
    scanf("%d", &N);
    scanf("%d", &X);

    int *L = malloc((N + 1) * sizeof(int));
    int ans = 0;
    int *D = malloc((N + 1) * sizeof(int));
    D[1] = 0;
    for (int i = 1; i <= N; i++) {
        scanf("%d", &L[i]);
        if (i >= 2) {
            D[i] += D[i-1] + L[i-1];
            if (D[i] > X){
                ans = i - 1;
                printf("%d\n", ans);
                return 0;
            }
        }
    }
    if ((D[N] + L[N]) > X)
        ans = N;
    else
        ans = N + 1;
    printf("%d\n", ans);

    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\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	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r8d
	leal	1(%r8), %ebp
	movl	%r8d, 12(%rsp)
	movslq	%ebp, %rbp
	salq	$2, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, (%rsp)
	call	malloc@PLT
	movl	12(%rsp), %r8d
	movl	$0, 4(%rax)
	movq	%rax, %rbp
	testl	%r8d, %r8d
	jle	.L3
	movq	(%rsp), %r15
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	8(%rbp), %r14
	leaq	4(%r15), %rsi
	leaq	8(%r15), %r13
	movl	$1, %r15d
	call	__isoc99_scanf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	movl	-8(%r13), %eax
	addl	-4(%r14), %eax
	addq	$4, %r14
	addl	-4(%r14), %eax
	movl	%eax, -4(%r14)
	cmpl	20(%rsp), %eax
	jg	.L13
.L4:
	movl	16(%rsp), %r8d
	movl	%r15d, %r12d
	addl	$1, %r15d
	cmpl	%r15d, %r8d
	jge	.L6
.L3:
	movq	(%rsp), %rax
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	0(%rbp,%rdx,4), %eax
	cmpl	20(%rsp), %eax
	jle	.L14
.L7:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$40, %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
.L14:
	.cfi_restore_state
	addl	$1, %r8d
	jmp	.L7
.L13:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
.L15:
	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:
```

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"
.LC1:
	.string	"%d\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	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	leaq	20(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %r8d
	leal	1(%r8), %ebp
	movl	%r8d, 12(%rsp)
	movslq	%ebp, %rbp
	salq	$2, %rbp
	movq	%rbp, %rdi
	call	malloc@PLT
	movq	%rbp, %rdi
	movq	%rax, (%rsp)
	call	malloc@PLT
	movl	12(%rsp), %r8d
	movl	$0, 4(%rax)
	movq	%rax, %rbp
	testl	%r8d, %r8d
	jle	.L3
	movq	(%rsp), %r15
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	8(%rbp), %r14
	leaq	4(%r15), %rsi
	leaq	8(%r15), %r13
	movl	$1, %r15d
	call	__isoc99_scanf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	movl	-8(%r13), %eax
	addl	-4(%r14), %eax
	addq	$4, %r14
	addl	-4(%r14), %eax
	movl	%eax, -4(%r14)
	cmpl	20(%rsp), %eax
	jg	.L13
.L4:
	movl	16(%rsp), %r8d
	movl	%r15d, %r12d
	addl	$1, %r15d
	cmpl	%r15d, %r8d
	jge	.L6
.L3:
	movq	(%rsp), %rax
	movslq	%r8d, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	0(%rbp,%rdx,4), %eax
	cmpl	20(%rsp), %eax
	jle	.L14
.L7:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$40, %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
.L14:
	.cfi_restore_state
	addl	$1, %r8d
	jmp	.L7
.L13:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L5
.L15:
	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:
```