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 a,i,n[1000000];
    scanf("%d",&a);
    for(i=0;i<a;i++){
        scanf("%d",&n[i]);
    }
    long max = n[0];
    for(i=0;i<a-1;i++){
        if(max < n[i+1]){
            max = n[i+1];
        }
    }
    long min = n[0];
    for(i=0;i<a-1;i++){
        if(min > n[i+1]){
            min = n[i+1];
        }
    }
    long sum = 0;
    for(i=0;i<a;i++){
        sum += n[i];
    }
    printf("%ld %ld %ld\n",min,max,sum);
    return 0;
}


```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld %ld %ld\n"
	.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	-3997696(%rsp), %r11
	.cfi_def_cfa 11, 3997736
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2344, %rsp
	.cfi_def_cfa_offset 4000080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 4000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	movq	%rbp, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r12
	cmpl	%ebx, %edi
	jg	.L3
	movslq	16(%rsp), %r9
	cmpl	$1, %edi
	jle	.L13
	leal	-2(%rdi), %edx
	leaq	20(%rsp), %rax
	movq	%r9, %rcx
	leaq	24(%rsp,%rdx,4), %r8
	movq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	(%rdx), %rsi
	cmpq	%rsi, %rcx
	cmovl	%rsi, %rcx
	addq	$4, %rdx
	cmpq	%r8, %rdx
	jne	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	(%rax), %rdx
	cmpq	%rdx, %r9
	cmovg	%rdx, %r9
	addq	$4, %rax
	cmpq	%r8, %rax
	jne	.L6
.L4:
	testl	%edi, %edi
	jle	.L14
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqa	0(%rbp), %xmm1
	movdqa	%xmm4, %xmm2
	addq	$16, %rbp
	pcmpgtd	%xmm1, %xmm2
	movdqa	%xmm1, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm1
	paddq	%xmm3, %xmm0
	paddq	%xmm1, %xmm0
	cmpq	%rax, %rbp
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddq	%xmm1, %xmm0
	movq	%xmm0, %r8
	testb	$3, %dil
	je	.L7
.L8:
	movslq	%eax, %rdx
	movslq	16(%rsp,%rdx,4), %rdx
	addq	%rdx, %r8
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L7
	movslq	%edx, %rdx
	addl	$2, %eax
	movslq	16(%rsp,%rdx,4), %rdx
	addq	%rdx, %r8
	cmpl	%eax, %edi
	jle	.L7
	cltq
	movslq	16(%rsp,%rax,4), %rax
	addq	%rax, %r8
.L7:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$4000040, %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
.L2:
	.cfi_restore_state
	movslq	16(%rsp), %rcx
	xorl	%r8d, %r8d
	movq	%rcx, %r9
	jmp	.L7
.L13:
	movq	%r9, %rcx
	jmp	.L4
.L14:
	xorl	%r8d, %r8d
	jmp	.L7
.L15:
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L8
.L23:
	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	"%ld %ld %ld\n"
	.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	-3997696(%rsp), %r11
	.cfi_def_cfa 11, 3997736
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2344, %rsp
	.cfi_def_cfa_offset 4000080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 4000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	movq	%rbp, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r12
	cmpl	%ebx, %edi
	jg	.L3
	movslq	16(%rsp), %r9
	cmpl	$1, %edi
	jle	.L13
	leal	-2(%rdi), %edx
	leaq	20(%rsp), %rax
	movq	%r9, %rcx
	leaq	24(%rsp,%rdx,4), %r8
	movq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	(%rdx), %rsi
	cmpq	%rsi, %rcx
	cmovl	%rsi, %rcx
	addq	$4, %rdx
	cmpq	%r8, %rdx
	jne	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	(%rax), %rdx
	cmpq	%rdx, %r9
	cmovg	%rdx, %r9
	addq	$4, %rax
	cmpq	%r8, %rax
	jne	.L6
.L4:
	testl	%edi, %edi
	jle	.L14
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqa	0(%rbp), %xmm1
	movdqa	%xmm4, %xmm2
	addq	$16, %rbp
	pcmpgtd	%xmm1, %xmm2
	movdqa	%xmm1, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm1
	paddq	%xmm3, %xmm0
	paddq	%xmm1, %xmm0
	cmpq	%rax, %rbp
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddq	%xmm1, %xmm0
	movq	%xmm0, %r8
	testb	$3, %dil
	je	.L7
.L8:
	movslq	%eax, %rdx
	movslq	16(%rsp,%rdx,4), %rdx
	addq	%rdx, %r8
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L7
	movslq	%edx, %rdx
	addl	$2, %eax
	movslq	16(%rsp,%rdx,4), %rdx
	addq	%rdx, %r8
	cmpl	%eax, %edi
	jle	.L7
	cltq
	movslq	16(%rsp,%rax,4), %rax
	addq	%rax, %r8
.L7:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$4000040, %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
.L2:
	.cfi_restore_state
	movslq	16(%rsp), %rcx
	xorl	%r8d, %r8d
	movq	%rcx, %r9
	jmp	.L7
.L13:
	movq	%r9, %rcx
	jmp	.L4
.L14:
	xorl	%r8d, %r8d
	jmp	.L7
.L15:
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L8
.L23:
	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	"%ld %ld %ld\n"
	.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	-3997696(%rsp), %r11
	.cfi_def_cfa 11, 3997736
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2344, %rsp
	.cfi_def_cfa_offset 4000080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 4000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	movq	%rbp, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r12
	cmpl	%ebx, %edi
	jg	.L3
	movslq	16(%rsp), %r9
	cmpl	$1, %edi
	jle	.L13
	leal	-2(%rdi), %edx
	leaq	20(%rsp), %rax
	movq	%r9, %rcx
	leaq	24(%rsp,%rdx,4), %r8
	movq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	(%rdx), %rsi
	cmpq	%rsi, %rcx
	cmovl	%rsi, %rcx
	addq	$4, %rdx
	cmpq	%r8, %rdx
	jne	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	(%rax), %rdx
	cmpq	%rdx, %r9
	cmovg	%rdx, %r9
	addq	$4, %rax
	cmpq	%r8, %rax
	jne	.L6
.L4:
	testl	%edi, %edi
	jle	.L14
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqa	0(%rbp), %xmm1
	movdqa	%xmm4, %xmm2
	addq	$16, %rbp
	pcmpgtd	%xmm1, %xmm2
	movdqa	%xmm1, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm1
	paddq	%xmm3, %xmm0
	paddq	%xmm1, %xmm0
	cmpq	%rax, %rbp
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddq	%xmm1, %xmm0
	movq	%xmm0, %r8
	testb	$3, %dil
	je	.L7
.L8:
	movslq	%eax, %rdx
	movslq	16(%rsp,%rdx,4), %rdx
	addq	%rdx, %r8
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L7
	movslq	%edx, %rdx
	addl	$2, %eax
	movslq	16(%rsp,%rdx,4), %rdx
	addq	%rdx, %r8
	cmpl	%eax, %edi
	jle	.L7
	cltq
	movslq	16(%rsp,%rax,4), %rax
	addq	%rax, %r8
.L7:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$4000040, %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
.L2:
	.cfi_restore_state
	movslq	16(%rsp), %rcx
	xorl	%r8d, %r8d
	movq	%rcx, %r9
	jmp	.L7
.L13:
	movq	%r9, %rcx
	jmp	.L4
.L14:
	xorl	%r8d, %r8d
	jmp	.L7
.L15:
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L8
.L23:
	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 a,i,n[1000000];
    scanf("%d",&a);
    for(i=0;i<a;i++){
        scanf("%d",&n[i]);
    }
    long max = n[0];
    for(i=0;i<a-1;i++){
        if(max < n[i+1]){
            max = n[i+1];
        }
    }
    long min = n[0];
    for(i=0;i<a-1;i++){
        if(min > n[i+1]){
            min = n[i+1];
        }
    }
    long sum = 0;
    for(i=0;i<a;i++){
        sum += n[i];
    }
    printf("%ld %ld %ld\n",min,max,sum);
    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 a,i,n[1000000];
    scanf("%d",&a);
    for(i=0;i<a;i++){
        scanf("%d",&n[i]);
    }
    long max = n[0];
    for(i=0;i<a-1;i++){
        if(max < n[i+1]){
            max = n[i+1];
        }
    }
    long min = n[0];
    for(i=0;i<a-1;i++){
        if(min > n[i+1]){
            min = n[i+1];
        }
    }
    long sum = 0;
    for(i=0;i<a;i++){
        sum += n[i];
    }
    printf("%ld %ld %ld\n",min,max,sum);
    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:

5
13 1 5 4 17
 5
13 1 5 7 17
 5
13 0 5 7 17
 5
13 0 7 7 17
 5
23 0 7 7 17
 5
23 0 0 7 17
 5
23 0 0 4 17
 5
43 0 0 4 17
 5
43 0 0 4 18
 5
43 0 -1 4 18

1 17 40
 1 17 43
 0 17 42
 0 17 44
 0 23 54
 0 23 47
 0 23 44
 0 43 64
 0 43 65
 -1 43 64

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 a,i,n[1000000];
    scanf("%d",&a);
    for(i=0;i<a;i++){
        scanf("%d",&n[i]);
    }
    long max = n[0];
    for(i=0;i<a-1;i++){
        if(max < n[i+1]){
            max = n[i+1];
        }
    }
    long min = n[0];
    for(i=0;i<a-1;i++){
        if(min > n[i+1]){
            min = n[i+1];
        }
    }
    long sum = 0;
    for(i=0;i<a;i++){
        sum += n[i];
    }
    printf("%ld %ld %ld\n",min,max,sum);
    return 0;
}


```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%ld %ld %ld\n"
	.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	-3997696(%rsp), %r11
	.cfi_def_cfa 11, 3997736
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2344, %rsp
	.cfi_def_cfa_offset 4000080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 4000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	movq	%rbp, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r12
	cmpl	%ebx, %edi
	jg	.L3
	movslq	16(%rsp), %r9
	cmpl	$1, %edi
	jle	.L13
	leal	-2(%rdi), %edx
	leaq	20(%rsp), %rax
	movq	%r9, %rcx
	leaq	24(%rsp,%rdx,4), %r8
	movq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	(%rdx), %rsi
	cmpq	%rsi, %rcx
	cmovl	%rsi, %rcx
	addq	$4, %rdx
	cmpq	%r8, %rdx
	jne	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	(%rax), %rdx
	cmpq	%rdx, %r9
	cmovg	%rdx, %r9
	addq	$4, %rax
	cmpq	%r8, %rax
	jne	.L6
.L4:
	testl	%edi, %edi
	jle	.L14
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqa	0(%rbp), %xmm1
	movdqa	%xmm4, %xmm2
	addq	$16, %rbp
	pcmpgtd	%xmm1, %xmm2
	movdqa	%xmm1, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm1
	paddq	%xmm3, %xmm0
	paddq	%xmm1, %xmm0
	cmpq	%rax, %rbp
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddq	%xmm1, %xmm0
	movq	%xmm0, %r8
	testb	$3, %dil
	je	.L7
.L8:
	movslq	%eax, %rdx
	movslq	16(%rsp,%rdx,4), %rdx
	addq	%rdx, %r8
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L7
	movslq	%edx, %rdx
	addl	$2, %eax
	movslq	16(%rsp,%rdx,4), %rdx
	addq	%rdx, %r8
	cmpl	%eax, %edi
	jle	.L7
	cltq
	movslq	16(%rsp,%rax,4), %rax
	addq	%rax, %r8
.L7:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$4000040, %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
.L2:
	.cfi_restore_state
	movslq	16(%rsp), %rcx
	xorl	%r8d, %r8d
	movq	%rcx, %r9
	jmp	.L7
.L13:
	movq	%r9, %rcx
	jmp	.L4
.L14:
	xorl	%r8d, %r8d
	jmp	.L7
.L15:
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L8
.L23:
	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	"%ld %ld %ld\n"
	.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	-3997696(%rsp), %r11
	.cfi_def_cfa 11, 3997736
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2344, %rsp
	.cfi_def_cfa_offset 4000080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 4000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	movq	%rbp, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	addq	$4, %r12
	cmpl	%ebx, %edi
	jg	.L3
	movslq	16(%rsp), %r9
	cmpl	$1, %edi
	jle	.L13
	leal	-2(%rdi), %edx
	leaq	20(%rsp), %rax
	movq	%r9, %rcx
	leaq	24(%rsp,%rdx,4), %r8
	movq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	(%rdx), %rsi
	cmpq	%rsi, %rcx
	cmovl	%rsi, %rcx
	addq	$4, %rdx
	cmpq	%r8, %rdx
	jne	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	(%rax), %rdx
	cmpq	%rdx, %r9
	cmovg	%rdx, %r9
	addq	$4, %rax
	cmpq	%r8, %rax
	jne	.L6
.L4:
	testl	%edi, %edi
	jle	.L14
	leal	-1(%rdi), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%edi, %eax
	pxor	%xmm0, %xmm0
	pxor	%xmm4, %xmm4
	shrl	$2, %eax
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L9:
	movdqa	0(%rbp), %xmm1
	movdqa	%xmm4, %xmm2
	addq	$16, %rbp
	pcmpgtd	%xmm1, %xmm2
	movdqa	%xmm1, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm1
	paddq	%xmm3, %xmm0
	paddq	%xmm1, %xmm0
	cmpq	%rax, %rbp
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%edi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddq	%xmm1, %xmm0
	movq	%xmm0, %r8
	testb	$3, %dil
	je	.L7
.L8:
	movslq	%eax, %rdx
	movslq	16(%rsp,%rdx,4), %rdx
	addq	%rdx, %r8
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jle	.L7
	movslq	%edx, %rdx
	addl	$2, %eax
	movslq	16(%rsp,%rdx,4), %rdx
	addq	%rdx, %r8
	cmpl	%eax, %edi
	jle	.L7
	cltq
	movslq	16(%rsp,%rax,4), %rax
	addq	%rax, %r8
.L7:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$4000040, %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
.L2:
	.cfi_restore_state
	movslq	16(%rsp), %rcx
	xorl	%r8d, %r8d
	movq	%rcx, %r9
	jmp	.L7
.L13:
	movq	%r9, %rcx
	jmp	.L4
.L14:
	xorl	%r8d, %r8d
	jmp	.L7
.L15:
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	jmp	.L8
.L23:
	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:
```