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;
    long long A[110000];
    long long ans=0;

    scanf("%d", &N);
    for(int i=0; i<N; i++){
        scanf("%lld", &A[i]);
    }

    for(int i=0; i<N; i++){
        ans += A[i]/2;
        A[i] = A[i]%2;
        if(i<N-1){
            if(A[i]<A[i+1]){
                ans += A[i];
                A[i+1]= A[i+1]-A[i];
            }else{
                ans += A[i+1];
                A[i+1] = 0;
            }
        }
    }
    printf("%lld", ans);

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-876544(%rsp), %r11
	.cfi_def_cfa 11, 876584
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3496, %rsp
	.cfi_def_cfa_offset 880080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 880024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L22
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$8, %r13
	cmpl	%r12d, %esi
	jg	.L4
	testl	%esi, %esi
	jle	.L5
	movl	%esi, %ecx
	subl	$1, %ecx
	je	.L14
	leaq	24(%rsp), %rdi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L24:
	movq	$0, (%rdi)
	leaq	(%rdx,%r10), %r8
	addq	$8, %rdi
	cmpl	%r9d, %ecx
	jle	.L23
.L9:
	movq	-8(%rdi), %rax
	movq	(%rdi), %r10
	addl	$1, %r9d
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	addq	%r8, %rdx
	movq	%rax, %r8
	shrq	$63, %r8
	addq	%r8, %rax
	andl	$1, %eax
	subq	%r8, %rax
	movq	%rax, -8(%rdi)
	cmpq	%r10, %rax
	jge	.L24
	subq	%rax, %r10
	leaq	(%rdx,%rax), %r8
	addq	$8, %rdi
	movq	%r10, -8(%rdi)
	cmpl	%r9d, %ecx
	jg	.L9
.L23:
	movl	%r9d, %ecx
	cmpl	%r9d, %esi
	jg	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	880024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$880040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	xorl	%r8d, %r8d
.L6:
	movslq	%ecx, %rax
	leaq	(%rbx,%rax,8), %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%rdi), %rax
	addl	$1, %ecx
	addq	$8, %rdi
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	addq	%rdx, %r8
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, -8(%rdi)
	cmpl	%ecx, %esi
	jg	.L11
	jmp	.L3
.L22:
	leaq	.LC1(%rip), %rbp
.L5:
	xorl	%r8d, %r8d
	jmp	.L3
.L25:
	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"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-876544(%rsp), %r11
	.cfi_def_cfa 11, 876584
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3496, %rsp
	.cfi_def_cfa_offset 880080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 880024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L22
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$8, %r13
	cmpl	%r12d, %esi
	jg	.L4
	testl	%esi, %esi
	jle	.L5
	movl	%esi, %ecx
	subl	$1, %ecx
	je	.L14
	leaq	24(%rsp), %rdi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L24:
	movq	$0, (%rdi)
	leaq	(%rdx,%r10), %r8
	addq	$8, %rdi
	cmpl	%r9d, %ecx
	jle	.L23
.L9:
	movq	-8(%rdi), %rax
	movq	(%rdi), %r10
	addl	$1, %r9d
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	addq	%r8, %rdx
	movq	%rax, %r8
	shrq	$63, %r8
	addq	%r8, %rax
	andl	$1, %eax
	subq	%r8, %rax
	movq	%rax, -8(%rdi)
	cmpq	%r10, %rax
	jge	.L24
	subq	%rax, %r10
	leaq	(%rdx,%rax), %r8
	addq	$8, %rdi
	movq	%r10, -8(%rdi)
	cmpl	%r9d, %ecx
	jg	.L9
.L23:
	movl	%r9d, %ecx
	cmpl	%r9d, %esi
	jg	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	880024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$880040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	xorl	%r8d, %r8d
.L6:
	movslq	%ecx, %rax
	leaq	(%rbx,%rax,8), %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%rdi), %rax
	addl	$1, %ecx
	addq	$8, %rdi
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	addq	%rdx, %r8
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, -8(%rdi)
	cmpl	%ecx, %esi
	jg	.L11
	jmp	.L3
.L22:
	leaq	.LC1(%rip), %rbp
.L5:
	xorl	%r8d, %r8d
	jmp	.L3
.L25:
	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"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-876544(%rsp), %r11
	.cfi_def_cfa 11, 876584
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3496, %rsp
	.cfi_def_cfa_offset 880080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 880024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L22
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$8, %r13
	cmpl	%r12d, %esi
	jg	.L4
	testl	%esi, %esi
	jle	.L5
	movl	%esi, %ecx
	subl	$1, %ecx
	je	.L14
	leaq	24(%rsp), %rdi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L24:
	movq	$0, (%rdi)
	leaq	(%rdx,%r10), %r8
	addq	$8, %rdi
	cmpl	%r9d, %ecx
	jle	.L23
.L9:
	movq	-8(%rdi), %rax
	movq	(%rdi), %r10
	addl	$1, %r9d
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	addq	%r8, %rdx
	movq	%rax, %r8
	shrq	$63, %r8
	addq	%r8, %rax
	andl	$1, %eax
	subq	%r8, %rax
	movq	%rax, -8(%rdi)
	cmpq	%r10, %rax
	jge	.L24
	subq	%rax, %r10
	leaq	(%rdx,%rax), %r8
	addq	$8, %rdi
	movq	%r10, -8(%rdi)
	cmpl	%r9d, %ecx
	jg	.L9
.L23:
	movl	%r9d, %ecx
	cmpl	%r9d, %esi
	jg	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	880024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$880040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	xorl	%r8d, %r8d
.L6:
	movslq	%ecx, %rax
	leaq	(%rbx,%rax,8), %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%rdi), %rax
	addl	$1, %ecx
	addq	$8, %rdi
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	addq	%rdx, %r8
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, -8(%rdi)
	cmpl	%ecx, %esi
	jg	.L11
	jmp	.L3
.L22:
	leaq	.LC1(%rip), %rbp
.L5:
	xorl	%r8d, %r8d
	jmp	.L3
.L25:
	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;
    long long A[110000];
    long long ans=0;

    scanf("%d", &N);
    for(int i=0; i<N; i++){
        scanf("%lld", &A[i]);
    }

    for(int i=0; i<N; i++){
        ans += A[i]/2;
        A[i] = A[i]%2;
        if(i<N-1){
            if(A[i]<A[i+1]){
                ans += A[i];
                A[i+1]= A[i+1]-A[i];
            }else{
                ans += A[i+1];
                A[i+1] = 0;
            }
        }
    }
    printf("%lld", 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;
    long long A[110000];
    long long ans=0;

    scanf("%d", &N);
    for(int i=0; i<N; i++){
        scanf("%lld", &A[i]);
    }

    for(int i=0; i<N; i++){
        ans += A[i]/2;
        A[i] = A[i]%2;
        if(i<N-1){
            if(A[i]<A[i+1]){
                ans += A[i];
                A[i+1]= A[i+1]-A[i];
            }else{
                ans += A[i+1];
                A[i+1] = 0;
            }
        }
    }
    printf("%lld", 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:

8
2
0
1
6
1
8
2
1
 4
4
0
3
1
 8
2
0
1
9
1
8
2
1
 4
3
0
3
1
 4
0
0
3
1
 8
1
0
1
9
1
5
2
1
 8
1
0
1
1
1
5
1
1
 8
0
0
1
4
1
5
1
1
 8
0
0
1
4
1
5
2
1
 8
1
1
2
0
1
5
4
2

10 4 12 3 2 9 5 6 7 8
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;
    long long A[110000];
    long long ans=0;

    scanf("%d", &N);
    for(int i=0; i<N; i++){
        scanf("%lld", &A[i]);
    }

    for(int i=0; i<N; i++){
        ans += A[i]/2;
        A[i] = A[i]%2;
        if(i<N-1){
            if(A[i]<A[i+1]){
                ans += A[i];
                A[i+1]= A[i+1]-A[i];
            }else{
                ans += A[i+1];
                A[i+1] = 0;
            }
        }
    }
    printf("%lld", ans);

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-876544(%rsp), %r11
	.cfi_def_cfa 11, 876584
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3496, %rsp
	.cfi_def_cfa_offset 880080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 880024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L22
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$8, %r13
	cmpl	%r12d, %esi
	jg	.L4
	testl	%esi, %esi
	jle	.L5
	movl	%esi, %ecx
	subl	$1, %ecx
	je	.L14
	leaq	24(%rsp), %rdi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L24:
	movq	$0, (%rdi)
	leaq	(%rdx,%r10), %r8
	addq	$8, %rdi
	cmpl	%r9d, %ecx
	jle	.L23
.L9:
	movq	-8(%rdi), %rax
	movq	(%rdi), %r10
	addl	$1, %r9d
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	addq	%r8, %rdx
	movq	%rax, %r8
	shrq	$63, %r8
	addq	%r8, %rax
	andl	$1, %eax
	subq	%r8, %rax
	movq	%rax, -8(%rdi)
	cmpq	%r10, %rax
	jge	.L24
	subq	%rax, %r10
	leaq	(%rdx,%rax), %r8
	addq	$8, %rdi
	movq	%r10, -8(%rdi)
	cmpl	%r9d, %ecx
	jg	.L9
.L23:
	movl	%r9d, %ecx
	cmpl	%r9d, %esi
	jg	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	880024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$880040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	xorl	%r8d, %r8d
.L6:
	movslq	%ecx, %rax
	leaq	(%rbx,%rax,8), %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%rdi), %rax
	addl	$1, %ecx
	addq	$8, %rdi
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	addq	%rdx, %r8
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, -8(%rdi)
	cmpl	%ecx, %esi
	jg	.L11
	jmp	.L3
.L22:
	leaq	.LC1(%rip), %rbp
.L5:
	xorl	%r8d, %r8d
	jmp	.L3
.L25:
	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"
.LC1:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-876544(%rsp), %r11
	.cfi_def_cfa 11, 876584
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3496, %rsp
	.cfi_def_cfa_offset 880080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 880024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L22
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$8, %r13
	cmpl	%r12d, %esi
	jg	.L4
	testl	%esi, %esi
	jle	.L5
	movl	%esi, %ecx
	subl	$1, %ecx
	je	.L14
	leaq	24(%rsp), %rdi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L24:
	movq	$0, (%rdi)
	leaq	(%rdx,%r10), %r8
	addq	$8, %rdi
	cmpl	%r9d, %ecx
	jle	.L23
.L9:
	movq	-8(%rdi), %rax
	movq	(%rdi), %r10
	addl	$1, %r9d
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	addq	%r8, %rdx
	movq	%rax, %r8
	shrq	$63, %r8
	addq	%r8, %rax
	andl	$1, %eax
	subq	%r8, %rax
	movq	%rax, -8(%rdi)
	cmpq	%r10, %rax
	jge	.L24
	subq	%rax, %r10
	leaq	(%rdx,%rax), %r8
	addq	$8, %rdi
	movq	%r10, -8(%rdi)
	cmpl	%r9d, %ecx
	jg	.L9
.L23:
	movl	%r9d, %ecx
	cmpl	%r9d, %esi
	jg	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	880024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$880040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	xorl	%r8d, %r8d
.L6:
	movslq	%ecx, %rax
	leaq	(%rbx,%rax,8), %rdi
	.p2align 4,,10
	.p2align 3
.L11:
	movq	(%rdi), %rax
	addl	$1, %ecx
	addq	$8, %rdi
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rax, %rdx
	sarq	%rdx
	addq	%rdx, %r8
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	andl	$1, %eax
	subq	%rdx, %rax
	movq	%rax, -8(%rdi)
	cmpl	%ecx, %esi
	jg	.L11
	jmp	.L3
.L22:
	leaq	.LC1(%rip), %rbp
.L5:
	xorl	%r8d, %r8d
	jmp	.L3
.L25:
	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:
```