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,K,t;
    scanf("%d %d ",&N,&K);
    int p[1000];
    int i,j,sum=0;
    for(i=0;i<N;i++){
        scanf("%d",&p[i]);
    }


    for(i=0;i<N;i++){

            for(j=i+1;j<N;j++){
                    if(p[i]>p[j]){
                        t=p[i];
                        p[i]=p[j];
                        p[j]=t;

                    }

            }

    }
          for(i=0;i<K;i++){
                    sum=sum+p[i];
    }


           printf("%d\n",sum);



    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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r8d
	addq	$4, %rbp
	cmpl	%ebx, %r8d
	jg	.L3
	cmpl	$1, %r8d
	jle	.L2
	leaq	20(%rsp), %rdi
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rdi, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	-4(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L5
	movl	%esi, -4(%rdi)
	movl	%ecx, (%rax)
.L5:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L6
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r8d
	jne	.L4
.L2:
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L13
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L14
	movl	%ecx, %edx
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%ecx, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %cl
	je	.L8
.L9:
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rax), %esi
	cmpl	%ecx, %esi
	jge	.L8
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%eax, %ecx
	jle	.L8
	cltq
	addl	16(%rsp,%rax,4), %edx
.L8:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L8
.L14:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L21:
	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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r8d
	addq	$4, %rbp
	cmpl	%ebx, %r8d
	jg	.L3
	cmpl	$1, %r8d
	jle	.L2
	leaq	20(%rsp), %rdi
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rdi, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	-4(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L5
	movl	%esi, -4(%rdi)
	movl	%ecx, (%rax)
.L5:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L6
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r8d
	jne	.L4
.L2:
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L13
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L14
	movl	%ecx, %edx
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%ecx, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %cl
	je	.L8
.L9:
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rax), %esi
	cmpl	%ecx, %esi
	jge	.L8
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%eax, %ecx
	jle	.L8
	cltq
	addl	16(%rsp,%rax,4), %edx
.L8:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L8
.L14:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L21:
	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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r8d
	addq	$4, %rbp
	cmpl	%ebx, %r8d
	jg	.L3
	cmpl	$1, %r8d
	jle	.L2
	leaq	20(%rsp), %rdi
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rdi, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	-4(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L5
	movl	%esi, -4(%rdi)
	movl	%ecx, (%rax)
.L5:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L6
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r8d
	jne	.L4
.L2:
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L13
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L14
	movl	%ecx, %edx
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%ecx, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %cl
	je	.L8
.L9:
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rax), %esi
	cmpl	%ecx, %esi
	jge	.L8
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%eax, %ecx
	jle	.L8
	cltq
	addl	16(%rsp,%rax,4), %edx
.L8:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L8
.L14:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L21:
	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,K,t;
    scanf("%d %d ",&N,&K);
    int p[1000];
    int i,j,sum=0;
    for(i=0;i<N;i++){
        scanf("%d",&p[i]);
    }


    for(i=0;i<N;i++){

            for(j=i+1;j<N;j++){
                    if(p[i]>p[j]){
                        t=p[i];
                        p[i]=p[j];
                        p[j]=t;

                    }

            }

    }
          for(i=0;i<K;i++){
                    sum=sum+p[i];
    }


           printf("%d\n",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 N,K,t;
    scanf("%d %d ",&N,&K);
    int p[1000];
    int i,j,sum=0;
    for(i=0;i<N;i++){
        scanf("%d",&p[i]);
    }


    for(i=0;i<N;i++){

            for(j=i+1;j<N;j++){
                    if(p[i]>p[j]){
                        t=p[i];
                        p[i]=p[j];
                        p[j]=t;

                    }

            }

    }
          for(i=0;i<K;i++){
                    sum=sum+p[i];
    }


           printf("%d\n",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 3
50 000 80 120 80
 5 3
83 000 80 120 80
 5 3
83 010 80 120 80
 5 3
83 000 80 120 99
 5 3
83 000 16 120 99
 2 3
83 001 16 120 99
 1 0
1000
 5 3
50 100 80 120 150
 5 3
28 000 80 120 80
 5 3
68 000 80 120 80

130
 160
 170
 163
 99
 84
 0
 230
 108
 148

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,K,t;
    scanf("%d %d ",&N,&K);
    int p[1000];
    int i,j,sum=0;
    for(i=0;i<N;i++){
        scanf("%d",&p[i]);
    }


    for(i=0;i<N;i++){

            for(j=i+1;j<N;j++){
                    if(p[i]>p[j]){
                        t=p[i];
                        p[i]=p[j];
                        p[j]=t;

                    }

            }

    }
          for(i=0;i<K;i++){
                    sum=sum+p[i];
    }


           printf("%d\n",sum);



    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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r8d
	addq	$4, %rbp
	cmpl	%ebx, %r8d
	jg	.L3
	cmpl	$1, %r8d
	jle	.L2
	leaq	20(%rsp), %rdi
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rdi, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	-4(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L5
	movl	%esi, -4(%rdi)
	movl	%ecx, (%rax)
.L5:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L6
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r8d
	jne	.L4
.L2:
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L13
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L14
	movl	%ecx, %edx
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%ecx, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %cl
	je	.L8
.L9:
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rax), %esi
	cmpl	%ecx, %esi
	jge	.L8
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%eax, %ecx
	jle	.L8
	cltq
	addl	16(%rsp,%rax,4), %edx
.L8:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L8
.L14:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L21:
	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	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r8d
	addq	$4, %rbp
	cmpl	%ebx, %r8d
	jg	.L3
	cmpl	$1, %r8d
	jle	.L2
	leaq	20(%rsp), %rdi
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rdi, %rax
	movl	%r9d, %edx
	.p2align 4,,10
	.p2align 3
.L6:
	movl	-4(%rdi), %ecx
	movl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	.L5
	movl	%esi, -4(%rdi)
	movl	%ecx, (%rax)
.L5:
	addl	$1, %edx
	addq	$4, %rax
	cmpl	%edx, %r8d
	jg	.L6
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r9d, %r8d
	jne	.L4
.L2:
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L13
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L14
	movl	%ecx, %edx
	leaq	16(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L10:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L10
	movdqa	%xmm0, %xmm1
	movl	%ecx, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %cl
	je	.L8
.L9:
	movslq	%eax, %rsi
	addl	16(%rsp,%rsi,4), %edx
	leal	1(%rax), %esi
	cmpl	%ecx, %esi
	jge	.L8
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	16(%rsp,%rsi,4), %edx
	cmpl	%eax, %ecx
	jle	.L8
	cltq
	addl	16(%rsp,%rax,4), %edx
.L8:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L8
.L14:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L21:
	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:
```