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,i,j,a[1001],b,c=0;
	scanf("%d%d",&n,&k);
	for(i=0;i<k;i++)scanf("%d%d",&a[i],&b);
	for(i=0;i<k-1;i++){
		for(j=i+1;j<k;j++){
			if(a[i]>a[j]){
				b=a[i];
				a[i]=a[j];
				a[j]=b;
			}
		}
	}
	for(i=1;i<k;i++){
		if(a[i]<n)c+=n-a[i];
		else break;
	}
	printf("%d\n",c);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4096
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	testl	%r10d, %r10d
	jle	.L5
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	12(%rsp), %r14
	movq	%rbx, %r15
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	addl	$1, %r12d
	addq	$4, %r15
	cmpl	%r12d, %r10d
	jg	.L3
	cmpl	$1, %r10d
	jle	.L13
	leal	-2(%r10), %r11d
	movq	%rbx, %rsi
	movl	$1, %r8d
	xorl	%r9d, %r9d
	addq	$2, %r11
	leal	-1(%r10), %r12d
	leaq	20(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%r8d, %r10d
	jle	.L6
	movl	%r12d, %eax
	subl	%r8d, %eax
	leaq	-1(%r8,%rax), %rax
	leaq	(%rbx,%rax,4), %rdi
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rsi), %edx
	movl	4(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L7
	movl	%ecx, (%rsi)
	movl	%edx, %ebp
	movl	$1, %r9d
	movl	%edx, 4(%rax)
.L7:
	addq	$4, %rax
	cmpq	%rdi, %rax
	jne	.L8
.L6:
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r11, %r8
	jne	.L9
	testb	%r9b, %r9b
	je	.L5
	movl	%ebp, 12(%rsp)
.L5:
	cmpl	$1, %r10d
	jle	.L13
	leal	-2(%r10), %edx
	movl	4(%rsp), %ecx
	leaq	20(%rsp), %rax
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,4), %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%ecx, %esi
	addq	$4, %rax
	subl	%edx, %esi
	addl	%esi, %r8d
	cmpq	%rdi, %rax
	je	.L10
.L11:
	movl	(%rax), %edx
	cmpl	%ecx, %edx
	jl	.L23
.L10:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$4040, %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
.L13:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L10
.L24:
	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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4096
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	testl	%r10d, %r10d
	jle	.L5
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	12(%rsp), %r14
	movq	%rbx, %r15
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	addl	$1, %r12d
	addq	$4, %r15
	cmpl	%r12d, %r10d
	jg	.L3
	cmpl	$1, %r10d
	jle	.L13
	leal	-2(%r10), %r11d
	movq	%rbx, %rsi
	movl	$1, %r8d
	xorl	%r9d, %r9d
	addq	$2, %r11
	leal	-1(%r10), %r12d
	leaq	20(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%r8d, %r10d
	jle	.L6
	movl	%r12d, %eax
	subl	%r8d, %eax
	leaq	-1(%r8,%rax), %rax
	leaq	(%rbx,%rax,4), %rdi
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rsi), %edx
	movl	4(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L7
	movl	%ecx, (%rsi)
	movl	%edx, %ebp
	movl	$1, %r9d
	movl	%edx, 4(%rax)
.L7:
	addq	$4, %rax
	cmpq	%rdi, %rax
	jne	.L8
.L6:
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r11, %r8
	jne	.L9
	testb	%r9b, %r9b
	je	.L5
	movl	%ebp, 12(%rsp)
.L5:
	cmpl	$1, %r10d
	jle	.L13
	leal	-2(%r10), %edx
	movl	4(%rsp), %ecx
	leaq	20(%rsp), %rax
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,4), %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%ecx, %esi
	addq	$4, %rax
	subl	%edx, %esi
	addl	%esi, %r8d
	cmpq	%rdi, %rax
	je	.L10
.L11:
	movl	(%rax), %edx
	cmpl	%ecx, %edx
	jl	.L23
.L10:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$4040, %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
.L13:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L10
.L24:
	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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4096
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	testl	%r10d, %r10d
	jle	.L5
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	12(%rsp), %r14
	movq	%rbx, %r15
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	addl	$1, %r12d
	addq	$4, %r15
	cmpl	%r12d, %r10d
	jg	.L3
	cmpl	$1, %r10d
	jle	.L13
	leal	-2(%r10), %r11d
	movq	%rbx, %rsi
	movl	$1, %r8d
	xorl	%r9d, %r9d
	addq	$2, %r11
	leal	-1(%r10), %r12d
	leaq	20(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%r8d, %r10d
	jle	.L6
	movl	%r12d, %eax
	subl	%r8d, %eax
	leaq	-1(%r8,%rax), %rax
	leaq	(%rbx,%rax,4), %rdi
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rsi), %edx
	movl	4(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L7
	movl	%ecx, (%rsi)
	movl	%edx, %ebp
	movl	$1, %r9d
	movl	%edx, 4(%rax)
.L7:
	addq	$4, %rax
	cmpq	%rdi, %rax
	jne	.L8
.L6:
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r11, %r8
	jne	.L9
	testb	%r9b, %r9b
	je	.L5
	movl	%ebp, 12(%rsp)
.L5:
	cmpl	$1, %r10d
	jle	.L13
	leal	-2(%r10), %edx
	movl	4(%rsp), %ecx
	leaq	20(%rsp), %rax
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,4), %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%ecx, %esi
	addq	$4, %rax
	subl	%edx, %esi
	addl	%esi, %r8d
	cmpq	%rdi, %rax
	je	.L10
.L11:
	movl	(%rax), %edx
	cmpl	%ecx, %edx
	jl	.L23
.L10:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$4040, %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
.L13:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L10
.L24:
	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,i,j,a[1001],b,c=0;
	scanf("%d%d",&n,&k);
	for(i=0;i<k;i++)scanf("%d%d",&a[i],&b);
	for(i=0;i<k-1;i++){
		for(j=i+1;j<k;j++){
			if(a[i]>a[j]){
				b=a[i];
				a[i]=a[j];
				a[j]=b;
			}
		}
	}
	for(i=1;i<k;i++){
		if(a[i]<n)c+=n-a[i];
		else break;
	}
	printf("%d\n",c);
	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,i,j,a[1001],b,c=0;
	scanf("%d%d",&n,&k);
	for(i=0;i<k;i++)scanf("%d%d",&a[i],&b);
	for(i=0;i<k-1;i++){
		for(j=i+1;j<k;j++){
			if(a[i]>a[j]){
				b=a[i];
				a[i]=a[j];
				a[j]=b;
			}
		}
	}
	for(i=1;i<k;i++){
		if(a[i]<n)c+=n-a[i];
		else break;
	}
	printf("%d\n",c);
	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 5
1 7
6 2
3 5
4 4
0 8

4

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,i,j,a[1001],b,c=0;
	scanf("%d%d",&n,&k);
	for(i=0;i<k;i++)scanf("%d%d",&a[i],&b);
	for(i=0;i<k-1;i++){
		for(j=i+1;j<k;j++){
			if(a[i]>a[j]){
				b=a[i];
				a[i]=a[j];
				a[j]=b;
			}
		}
	}
	for(i=1;i<k;i++){
		if(a[i]<n)c+=n-a[i];
		else break;
	}
	printf("%d\n",c);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4096
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	testl	%r10d, %r10d
	jle	.L5
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	12(%rsp), %r14
	movq	%rbx, %r15
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	addl	$1, %r12d
	addq	$4, %r15
	cmpl	%r12d, %r10d
	jg	.L3
	cmpl	$1, %r10d
	jle	.L13
	leal	-2(%r10), %r11d
	movq	%rbx, %rsi
	movl	$1, %r8d
	xorl	%r9d, %r9d
	addq	$2, %r11
	leal	-1(%r10), %r12d
	leaq	20(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%r8d, %r10d
	jle	.L6
	movl	%r12d, %eax
	subl	%r8d, %eax
	leaq	-1(%r8,%rax), %rax
	leaq	(%rbx,%rax,4), %rdi
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rsi), %edx
	movl	4(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L7
	movl	%ecx, (%rsi)
	movl	%edx, %ebp
	movl	$1, %r9d
	movl	%edx, 4(%rax)
.L7:
	addq	$4, %rax
	cmpq	%rdi, %rax
	jne	.L8
.L6:
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r11, %r8
	jne	.L9
	testb	%r9b, %r9b
	je	.L5
	movl	%ebp, 12(%rsp)
.L5:
	cmpl	$1, %r10d
	jle	.L13
	leal	-2(%r10), %edx
	movl	4(%rsp), %ecx
	leaq	20(%rsp), %rax
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,4), %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%ecx, %esi
	addq	$4, %rax
	subl	%edx, %esi
	addl	%esi, %r8d
	cmpq	%rdi, %rax
	je	.L10
.L11:
	movl	(%rax), %edx
	cmpl	%ecx, %edx
	jl	.L23
.L10:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$4040, %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
.L13:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L10
.L24:
	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\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4040, %rsp
	.cfi_def_cfa_offset 4096
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	testl	%r10d, %r10d
	jle	.L5
	leaq	16(%rsp), %rbx
	xorl	%r12d, %r12d
	leaq	12(%rsp), %r14
	movq	%rbx, %r15
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	movq	%r14, %rdx
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %r10d
	addl	$1, %r12d
	addq	$4, %r15
	cmpl	%r12d, %r10d
	jg	.L3
	cmpl	$1, %r10d
	jle	.L13
	leal	-2(%r10), %r11d
	movq	%rbx, %rsi
	movl	$1, %r8d
	xorl	%r9d, %r9d
	addq	$2, %r11
	leal	-1(%r10), %r12d
	leaq	20(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	%r8d, %r10d
	jle	.L6
	movl	%r12d, %eax
	subl	%r8d, %eax
	leaq	-1(%r8,%rax), %rax
	leaq	(%rbx,%rax,4), %rdi
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rsi), %edx
	movl	4(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L7
	movl	%ecx, (%rsi)
	movl	%edx, %ebp
	movl	$1, %r9d
	movl	%edx, 4(%rax)
.L7:
	addq	$4, %rax
	cmpq	%rdi, %rax
	jne	.L8
.L6:
	addq	$1, %r8
	addq	$4, %rsi
	cmpq	%r11, %r8
	jne	.L9
	testb	%r9b, %r9b
	je	.L5
	movl	%ebp, 12(%rsp)
.L5:
	cmpl	$1, %r10d
	jle	.L13
	leal	-2(%r10), %edx
	movl	4(%rsp), %ecx
	leaq	20(%rsp), %rax
	xorl	%r8d, %r8d
	leaq	24(%rsp,%rdx,4), %rdi
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%ecx, %esi
	addq	$4, %rax
	subl	%edx, %esi
	addl	%esi, %r8d
	cmpq	%rdi, %rax
	je	.L10
.L11:
	movl	(%rax), %edx
	cmpl	%ecx, %edx
	jl	.L23
.L10:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$4040, %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
.L13:
	.cfi_restore_state
	xorl	%r8d, %r8d
	jmp	.L10
.L24:
	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:
```