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(void)
{
    int n,a[100],i,j,g=0,b=0,s,tmp;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n-1;i++){
        for(j=i;j<n;j++){
            if(a[i]<a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    }
    for(i=0;i<n;i++){
        if(i%2==0)
            g+=a[i];
        else 
            b+=a[i];
    }
    s=g-b;
    printf("%d\n",s);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC4:
	.string	"%d\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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%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	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L3
	leal	-1(%r8), %r10d
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	testl	%r10d, %r10d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rdi, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jge	.L6
	movl	%esi, (%rdi)
	movl	%ecx, (%rax)
.L6:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L7
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r10d
	jne	.L8
.L9:
	testl	%r8d, %r8d
	jle	.L22
	cmpl	$3, %r10d
	jbe	.L23
	movl	%r8d, %eax
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC2(%rip), %xmm7
	shrl	$2, %eax
	movdqa	.LC3(%rip), %xmm6
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm5
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm3, %xmm0
	movdqa	(%rbx), %xmm4
	addq	$16, %rbx
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm4
	pandn	-16(%rbx), %xmm0
	paddd	%xmm4, %xmm1
	paddd	%xmm0, %xmm2
	cmpq	%rbx, %rax
	jne	.L11
	movdqa	%xmm2, %xmm0
	movl	%r8d, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %eax
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %r8b
	je	.L2
.L10:
	movslq	%ecx, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %r8d
	jle	.L2
	testb	$1, %sil
	movslq	%esi, %rsi
	je	.L31
	addl	16(%rsp,%rsi,4), %eax
.L15:
	leal	2(%rcx), %esi
	cmpl	%esi, %r8d
	jle	.L2
	movslq	%esi, %rsi
	addl	$3, %ecx
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %r8d
	jle	.L2
	testb	$1, %cl
	movslq	%ecx, %rcx
	je	.L18
	addl	16(%rsp,%rcx,4), %eax
.L2:
	subl	%eax, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$440, %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
.L31:
	.cfi_restore_state
	addl	16(%rsp,%rsi,4), %edx
	jmp	.L15
.L18:
	addl	16(%rsp,%rcx,4), %edx
	jmp	.L2
.L22:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L2
.L23:
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L10
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	1
	.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
.LC1:
	.string	"%d"
.LC4:
	.string	"%d\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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%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	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L3
	leal	-1(%r8), %r10d
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	testl	%r10d, %r10d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rdi, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jge	.L6
	movl	%esi, (%rdi)
	movl	%ecx, (%rax)
.L6:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L7
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r10d
	jne	.L8
.L9:
	testl	%r8d, %r8d
	jle	.L22
	cmpl	$3, %r10d
	jbe	.L23
	movl	%r8d, %eax
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC2(%rip), %xmm7
	shrl	$2, %eax
	movdqa	.LC3(%rip), %xmm6
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm5
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm3, %xmm0
	movdqa	(%rbx), %xmm4
	addq	$16, %rbx
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm4
	pandn	-16(%rbx), %xmm0
	paddd	%xmm4, %xmm1
	paddd	%xmm0, %xmm2
	cmpq	%rbx, %rax
	jne	.L11
	movdqa	%xmm2, %xmm0
	movl	%r8d, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %eax
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %r8b
	je	.L2
.L10:
	movslq	%ecx, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %r8d
	jle	.L2
	testb	$1, %sil
	movslq	%esi, %rsi
	je	.L31
	addl	16(%rsp,%rsi,4), %eax
.L15:
	leal	2(%rcx), %esi
	cmpl	%esi, %r8d
	jle	.L2
	movslq	%esi, %rsi
	addl	$3, %ecx
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %r8d
	jle	.L2
	testb	$1, %cl
	movslq	%ecx, %rcx
	je	.L18
	addl	16(%rsp,%rcx,4), %eax
.L2:
	subl	%eax, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$440, %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
.L31:
	.cfi_restore_state
	addl	16(%rsp,%rsi,4), %edx
	jmp	.L15
.L18:
	addl	16(%rsp,%rcx,4), %edx
	jmp	.L2
.L22:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L2
.L23:
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L10
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	1
	.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
.LC1:
	.string	"%d"
.LC4:
	.string	"%d\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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%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	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L3
	leal	-1(%r8), %r10d
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	testl	%r10d, %r10d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rdi, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jge	.L6
	movl	%esi, (%rdi)
	movl	%ecx, (%rax)
.L6:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L7
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r10d
	jne	.L8
.L9:
	testl	%r8d, %r8d
	jle	.L22
	cmpl	$3, %r10d
	jbe	.L23
	movl	%r8d, %eax
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC2(%rip), %xmm7
	shrl	$2, %eax
	movdqa	.LC3(%rip), %xmm6
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm5
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm3, %xmm0
	movdqa	(%rbx), %xmm4
	addq	$16, %rbx
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm4
	pandn	-16(%rbx), %xmm0
	paddd	%xmm4, %xmm1
	paddd	%xmm0, %xmm2
	cmpq	%rbx, %rax
	jne	.L11
	movdqa	%xmm2, %xmm0
	movl	%r8d, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %eax
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %r8b
	je	.L2
.L10:
	movslq	%ecx, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %r8d
	jle	.L2
	testb	$1, %sil
	movslq	%esi, %rsi
	je	.L31
	addl	16(%rsp,%rsi,4), %eax
.L15:
	leal	2(%rcx), %esi
	cmpl	%esi, %r8d
	jle	.L2
	movslq	%esi, %rsi
	addl	$3, %ecx
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %r8d
	jle	.L2
	testb	$1, %cl
	movslq	%ecx, %rcx
	je	.L18
	addl	16(%rsp,%rcx,4), %eax
.L2:
	subl	%eax, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$440, %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
.L31:
	.cfi_restore_state
	addl	16(%rsp,%rsi,4), %edx
	jmp	.L15
.L18:
	addl	16(%rsp,%rcx,4), %edx
	jmp	.L2
.L22:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L2
.L23:
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L10
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	1
	.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(void)
{
    int n,a[100],i,j,g=0,b=0,s,tmp;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n-1;i++){
        for(j=i;j<n;j++){
            if(a[i]<a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    }
    for(i=0;i<n;i++){
        if(i%2==0)
            g+=a[i];
        else 
            b+=a[i];
    }
    s=g-b;
    printf("%d\n",s);
    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(void)
{
    int n,a[100],i,j,g=0,b=0,s,tmp;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n-1;i++){
        for(j=i;j<n;j++){
            if(a[i]<a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    }
    for(i=0;i<n;i++){
        if(i%2==0)
            g+=a[i];
        else 
            b+=a[i];
    }
    s=g-b;
    printf("%d\n",s);
    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
20 18 2 12
 2
2 1
 3
3 7 4
 4
20 1 2 12
 2
2 0
 3
3 9 4
 4
20 1 4 12
 2
2 -1
 2
4 -1
 4
20 2 0 12

12
 1
 6
 9
 2
 8
 11
 3
 5
 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(void)
{
    int n,a[100],i,j,g=0,b=0,s,tmp;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n-1;i++){
        for(j=i;j<n;j++){
            if(a[i]<a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    }
    for(i=0;i<n;i++){
        if(i%2==0)
            g+=a[i];
        else 
            b+=a[i];
    }
    s=g-b;
    printf("%d\n",s);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC4:
	.string	"%d\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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%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	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L3
	leal	-1(%r8), %r10d
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	testl	%r10d, %r10d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rdi, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jge	.L6
	movl	%esi, (%rdi)
	movl	%ecx, (%rax)
.L6:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L7
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r10d
	jne	.L8
.L9:
	testl	%r8d, %r8d
	jle	.L22
	cmpl	$3, %r10d
	jbe	.L23
	movl	%r8d, %eax
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC2(%rip), %xmm7
	shrl	$2, %eax
	movdqa	.LC3(%rip), %xmm6
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm5
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm3, %xmm0
	movdqa	(%rbx), %xmm4
	addq	$16, %rbx
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm4
	pandn	-16(%rbx), %xmm0
	paddd	%xmm4, %xmm1
	paddd	%xmm0, %xmm2
	cmpq	%rbx, %rax
	jne	.L11
	movdqa	%xmm2, %xmm0
	movl	%r8d, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %eax
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %r8b
	je	.L2
.L10:
	movslq	%ecx, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %r8d
	jle	.L2
	testb	$1, %sil
	movslq	%esi, %rsi
	je	.L31
	addl	16(%rsp,%rsi,4), %eax
.L15:
	leal	2(%rcx), %esi
	cmpl	%esi, %r8d
	jle	.L2
	movslq	%esi, %rsi
	addl	$3, %ecx
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %r8d
	jle	.L2
	testb	$1, %cl
	movslq	%ecx, %rcx
	je	.L18
	addl	16(%rsp,%rcx,4), %eax
.L2:
	subl	%eax, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$440, %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
.L31:
	.cfi_restore_state
	addl	16(%rsp,%rsi,4), %edx
	jmp	.L15
.L18:
	addl	16(%rsp,%rcx,4), %edx
	jmp	.L2
.L22:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L2
.L23:
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L10
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	1
	.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
.LC1:
	.string	"%d"
.LC4:
	.string	"%d\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
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%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	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	addq	$4, %r12
	cmpl	%ebp, %r8d
	jg	.L3
	leal	-1(%r8), %r10d
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	testl	%r10d, %r10d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%rdi, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jge	.L6
	movl	%esi, (%rdi)
	movl	%ecx, (%rax)
.L6:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L7
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r10d
	jne	.L8
.L9:
	testl	%r8d, %r8d
	jle	.L22
	cmpl	$3, %r10d
	jbe	.L23
	movl	%r8d, %eax
	pxor	%xmm2, %xmm2
	movdqa	.LC0(%rip), %xmm3
	movdqa	.LC2(%rip), %xmm7
	shrl	$2, %eax
	movdqa	.LC3(%rip), %xmm6
	movdqa	%xmm2, %xmm1
	movdqa	%xmm2, %xmm5
	subl	$1, %eax
	salq	$4, %rax
	leaq	32(%rsp,%rax), %rax
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm3, %xmm0
	movdqa	(%rbx), %xmm4
	addq	$16, %rbx
	paddd	%xmm7, %xmm3
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm5, %xmm0
	pand	%xmm0, %xmm4
	pandn	-16(%rbx), %xmm0
	paddd	%xmm4, %xmm1
	paddd	%xmm0, %xmm2
	cmpq	%rbx, %rax
	jne	.L11
	movdqa	%xmm2, %xmm0
	movl	%r8d, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %eax
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %r8b
	je	.L2
.L10:
	movslq	%ecx, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rcx), %esi
	cmpl	%esi, %r8d
	jle	.L2
	testb	$1, %sil
	movslq	%esi, %rsi
	je	.L31
	addl	16(%rsp,%rsi,4), %eax
.L15:
	leal	2(%rcx), %esi
	cmpl	%esi, %r8d
	jle	.L2
	movslq	%esi, %rsi
	addl	$3, %ecx
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%ecx, %r8d
	jle	.L2
	testb	$1, %cl
	movslq	%ecx, %rcx
	je	.L18
	addl	16(%rsp,%rcx,4), %eax
.L2:
	subl	%eax, %edx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$440, %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
.L31:
	.cfi_restore_state
	addl	16(%rsp,%rsi,4), %edx
	jmp	.L15
.L18:
	addl	16(%rsp,%rcx,4), %edx
	jmp	.L2
.L22:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L2
.L23:
	xorl	%eax, %eax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L10
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC3:
	.long	1
	.long	1
	.long	1
	.long	1
	.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:
```