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

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"0"
.LC2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$3976, %rsp
	.cfi_def_cfa_offset 8128
	leaq	.LC0(%rip), %r14
	movq	%r14, %rdi
	movq	%fs:40, %rax
	movq	%rax, 8056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rax
	leaq	4048(%rsp), %r13
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movq	%rax, (%rsp)
	movq	%rax, %rbp
	movq	%r13, %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	cmpl	%eax, 0(%rbp)
	setge	%al
	addl	$1, %r12d
	addq	$4, %rbp
	addq	$4, %rbx
	movzbl	%al, %eax
	addl	%eax, %r15d
	movl	28(%rsp), %eax
	cmpl	%r12d, %eax
	jg	.L4
	leal	-1(%rax), %edx
	cmpl	%r15d, %edx
	jle	.L2
	testl	%eax, %eax
	jle	.L17
	movslq	%eax, %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%rsp), %rdi
	movl	0(%r13,%rax,4), %edx
	subl	(%rdi,%rax,4), %edx
	cmpl	%edx, %r15d
	jge	.L7
	movl	%eax, 12(%rsp)
	movl	%edx, %r15d
.L7:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L8
	movl	24(%rsp), %edi
	xorl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%eax, 12(%rsp)
	je	.L9
	movq	(%rsp), %rbx
	movl	0(%r13,%rax,4), %esi
	cmpl	%esi, (%rbx,%rax,4)
	jge	.L9
	addl	%esi, %edx
	subl	%edi, %edx
.L9:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L10
.L6:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$8072, %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
.L2:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L17:
	xorl	%edx, %edx
	jmp	.L6
.L19:
	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\n"
.LC1:
	.string	"0"
.LC2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$3976, %rsp
	.cfi_def_cfa_offset 8128
	leaq	.LC0(%rip), %r14
	movq	%r14, %rdi
	movq	%fs:40, %rax
	movq	%rax, 8056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rax
	leaq	4048(%rsp), %r13
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movq	%rax, (%rsp)
	movq	%rax, %rbp
	movq	%r13, %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	cmpl	%eax, 0(%rbp)
	setge	%al
	addl	$1, %r12d
	addq	$4, %rbp
	addq	$4, %rbx
	movzbl	%al, %eax
	addl	%eax, %r15d
	movl	28(%rsp), %eax
	cmpl	%r12d, %eax
	jg	.L4
	leal	-1(%rax), %edx
	cmpl	%r15d, %edx
	jle	.L2
	testl	%eax, %eax
	jle	.L17
	movslq	%eax, %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%rsp), %rdi
	movl	0(%r13,%rax,4), %edx
	subl	(%rdi,%rax,4), %edx
	cmpl	%edx, %r15d
	jge	.L7
	movl	%eax, 12(%rsp)
	movl	%edx, %r15d
.L7:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L8
	movl	24(%rsp), %edi
	xorl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%eax, 12(%rsp)
	je	.L9
	movq	(%rsp), %rbx
	movl	0(%r13,%rax,4), %esi
	cmpl	%esi, (%rbx,%rax,4)
	jge	.L9
	addl	%esi, %edx
	subl	%edi, %edx
.L9:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L10
.L6:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$8072, %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
.L2:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L17:
	xorl	%edx, %edx
	jmp	.L6
.L19:
	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\n"
.LC1:
	.string	"0"
.LC2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$3976, %rsp
	.cfi_def_cfa_offset 8128
	leaq	.LC0(%rip), %r14
	movq	%r14, %rdi
	movq	%fs:40, %rax
	movq	%rax, 8056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rax
	leaq	4048(%rsp), %r13
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movq	%rax, (%rsp)
	movq	%rax, %rbp
	movq	%r13, %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	cmpl	%eax, 0(%rbp)
	setge	%al
	addl	$1, %r12d
	addq	$4, %rbp
	addq	$4, %rbx
	movzbl	%al, %eax
	addl	%eax, %r15d
	movl	28(%rsp), %eax
	cmpl	%r12d, %eax
	jg	.L4
	leal	-1(%rax), %edx
	cmpl	%r15d, %edx
	jle	.L2
	testl	%eax, %eax
	jle	.L17
	movslq	%eax, %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%rsp), %rdi
	movl	0(%r13,%rax,4), %edx
	subl	(%rdi,%rax,4), %edx
	cmpl	%edx, %r15d
	jge	.L7
	movl	%eax, 12(%rsp)
	movl	%edx, %r15d
.L7:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L8
	movl	24(%rsp), %edi
	xorl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%eax, 12(%rsp)
	je	.L9
	movq	(%rsp), %rbx
	movl	0(%r13,%rax,4), %esi
	cmpl	%esi, (%rbx,%rax,4)
	jge	.L9
	addl	%esi, %edx
	subl	%edi, %edx
.L9:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L10
.L6:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$8072, %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
.L2:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L17:
	xorl	%edx, %edx
	jmp	.L6
.L19:
	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 e,n,m,a[1001],b[1001],i,c=0,max=0,d;
scanf("%d %d\n",&n,&m);
for(i=0;i<m;i++){
scanf("%d %d\n",&a[i],&b[i]);
if(a[i]>=b[i]){
c++;
}
}
if(c>=m-1){
printf("0\n");
}
else{
for(i=0;i<m;i++){
e=b[i]-a[i];
if(e>c){
c=e;
d=i;
}
}
for(i=0;i<m;i++){
if(i!=d && a[i]<b[i]){
max=max+b[i]-n;
}
}
}
printf("%d\n",max);
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 e,n,m,a[1001],b[1001],i,c=0,max=0,d;
scanf("%d %d\n",&n,&m);
for(i=0;i<m;i++){
scanf("%d %d\n",&a[i],&b[i]);
if(a[i]>=b[i]){
c++;
}
}
if(c>=m-1){
printf("0\n");
}
else{
for(i=0;i<m;i++){
e=b[i]-a[i];
if(e>c){
c=e;
d=i;
}
}
for(i=0;i<m;i++){
if(i!=d && a[i]<b[i]){
max=max+b[i]-n;
}
}
}
printf("%d\n",max);
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 e,n,m,a[1001],b[1001],i,c=0,max=0,d;
scanf("%d %d\n",&n,&m);
for(i=0;i<m;i++){
scanf("%d %d\n",&a[i],&b[i]);
if(a[i]>=b[i]){
c++;
}
}
if(c>=m-1){
printf("0\n");
}
else{
for(i=0;i<m;i++){
e=b[i]-a[i];
if(e>c){
c=e;
d=i;
}
}
for(i=0;i<m;i++){
if(i!=d && a[i]<b[i]){
max=max+b[i]-n;
}
}
}
printf("%d\n",max);
return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"0"
.LC2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$3976, %rsp
	.cfi_def_cfa_offset 8128
	leaq	.LC0(%rip), %r14
	movq	%r14, %rdi
	movq	%fs:40, %rax
	movq	%rax, 8056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rax
	leaq	4048(%rsp), %r13
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movq	%rax, (%rsp)
	movq	%rax, %rbp
	movq	%r13, %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	cmpl	%eax, 0(%rbp)
	setge	%al
	addl	$1, %r12d
	addq	$4, %rbp
	addq	$4, %rbx
	movzbl	%al, %eax
	addl	%eax, %r15d
	movl	28(%rsp), %eax
	cmpl	%r12d, %eax
	jg	.L4
	leal	-1(%rax), %edx
	cmpl	%r15d, %edx
	jle	.L2
	testl	%eax, %eax
	jle	.L17
	movslq	%eax, %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%rsp), %rdi
	movl	0(%r13,%rax,4), %edx
	subl	(%rdi,%rax,4), %edx
	cmpl	%edx, %r15d
	jge	.L7
	movl	%eax, 12(%rsp)
	movl	%edx, %r15d
.L7:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L8
	movl	24(%rsp), %edi
	xorl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%eax, 12(%rsp)
	je	.L9
	movq	(%rsp), %rbx
	movl	0(%r13,%rax,4), %esi
	cmpl	%esi, (%rbx,%rax,4)
	jge	.L9
	addl	%esi, %edx
	subl	%edi, %edx
.L9:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L10
.L6:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$8072, %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
.L2:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L17:
	xorl	%edx, %edx
	jmp	.L6
.L19:
	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\n"
.LC1:
	.string	"0"
.LC2:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$3976, %rsp
	.cfi_def_cfa_offset 8128
	leaq	.LC0(%rip), %r14
	movq	%r14, %rdi
	movq	%fs:40, %rax
	movq	%rax, 8056(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rax
	leaq	4048(%rsp), %r13
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movq	%rax, (%rsp)
	movq	%rax, %rbp
	movq	%r13, %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbx, %rdx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	cmpl	%eax, 0(%rbp)
	setge	%al
	addl	$1, %r12d
	addq	$4, %rbp
	addq	$4, %rbx
	movzbl	%al, %eax
	addl	%eax, %r15d
	movl	28(%rsp), %eax
	cmpl	%r12d, %eax
	jg	.L4
	leal	-1(%rax), %edx
	cmpl	%r15d, %edx
	jle	.L2
	testl	%eax, %eax
	jle	.L17
	movslq	%eax, %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%rsp), %rdi
	movl	0(%r13,%rax,4), %edx
	subl	(%rdi,%rax,4), %edx
	cmpl	%edx, %r15d
	jge	.L7
	movl	%eax, 12(%rsp)
	movl	%edx, %r15d
.L7:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L8
	movl	24(%rsp), %edi
	xorl	%eax, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%eax, 12(%rsp)
	je	.L9
	movq	(%rsp), %rbx
	movl	0(%r13,%rax,4), %esi
	cmpl	%esi, (%rbx,%rax,4)
	jge	.L9
	addl	%esi, %edx
	subl	%edi, %edx
.L9:
	addq	$1, %rax
	cmpq	%rcx, %rax
	jne	.L10
.L6:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$8072, %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
.L2:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L17:
	xorl	%edx, %edx
	jmp	.L6
.L19:
	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:
```