Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
  
#define MAX_DATASET 3000
#define MIN         0
#define MAX         10000
#define X 0
#define Y 1
#define IS_ERR(n) (n < MIN || n > MAX)
  
void swap(int *a, int *b)
{
    int c;
     c = *a;
    *a = *b;
    *b = c;
}
   
   
int main(void)
{
    int i, j, array[MAX_DATASET][2];
   
    for(i=0;i<MAX_DATASET;i++)
    {
        scanf("%d %d", &array[i][X], &array[i][Y]);
   
        if(IS_ERR(array[i][X]) || IS_ERR(array[i][Y]) )
        {
            return -1;
        }
   
        if(array[i][X] == 0 && array[i][Y] == 0)
        { 
            break;
        }
   
        if(array[i][X] > array[i][Y])
        {
           swap(&array[i][X], &array[i][Y]);
        }
    }
   
    for(j=0;j<i;j++)
    {
        printf("%d %d\n", array[j][X], array[j][Y]);
    }
   
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-20480(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3552, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24024(%rbp)
	jmp	.L3
.L10:
	leaq	-24016(%rbp), %rdx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	$4, %rax
	addq	%rax, %rdx
	leaq	-24016(%rbp), %rcx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	testl	%eax, %eax
	js	.L4
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	cmpl	$10000, %eax
	jg	.L4
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	testl	%eax, %eax
	js	.L4
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	cmpl	$10000, %eax
	jle	.L5
.L4:
	movl	$-1, %eax
	jmp	.L13
.L5:
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L7
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L15
.L7:
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %edx
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	cmpl	%eax, %edx
	jle	.L9
	leaq	-24016(%rbp), %rdx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	$4, %rax
	addq	%rax, %rdx
	leaq	-24016(%rbp), %rcx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L9:
	addl	$1, -24024(%rbp)
.L3:
	cmpl	$2999, -24024(%rbp)
	jle	.L10
	jmp	.L8
.L15:
	nop
.L8:
	movl	$0, -24020(%rbp)
	jmp	.L11
.L12:
	movl	-24020(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %edx
	movl	-24020(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -24020(%rbp)
.L11:
	movl	-24020(%rbp), %eax
	cmpl	-24024(%rbp), %eax
	jl	.L12
	movl	$0, %eax
.L13:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB23:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE23:
	.size	swap, .-swap
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	-20480(%rsp), %r11
	.cfi_def_cfa 11, 20520
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3544, %rsp
	.cfi_def_cfa_offset 24064
	xorl	%ebp, %ebp
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 24008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r13
	movq	%r13, %rbx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	movl	4(%rbx), %edx
	movd	%eax, %xmm1
	movd	%edx, %xmm0
	punpckldq	%xmm1, %xmm0
	cmpl	$10000, %edx
	ja	.L13
	movl	%eax, %ecx
	orl	%edx, %ecx
	je	.L5
	cmpl	%edx, %eax
	jle	.L6
	movq	%xmm0, (%rbx)
.L6:
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	$3000, %ebp
	je	.L8
.L7:
	leaq	4(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	cmpl	$10000, %eax
	jbe	.L17
.L13:
	movl	$-1, %eax
.L3:
	movq	24008(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L18
	addq	$24024, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L5:
	.cfi_restore_state
	testl	%ebp, %ebp
	je	.L10
.L8:
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	4(%r13,%rbx,8), %ecx
	movl	0(%r13,%rbx,8), %edx
	movq	%r12, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, %ebp
	jg	.L9
.L10:
	xorl	%eax, %eax
	jmp	.L3
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.file	"temp.c"
	.text
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB23:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	%eax, (%rsi)
	ret
	.cfi_endproc
.LFE23:
	.size	swap, .-swap
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	-20480(%rsp), %r11
	.cfi_def_cfa 11, 20520
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3544, %rsp
	.cfi_def_cfa_offset 24064
	xorl	%ebp, %ebp
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 24008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %r13
	movq	%r13, %rbx
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L17:
	movl	4(%rbx), %edx
	movd	%eax, %xmm1
	movd	%edx, %xmm0
	punpckldq	%xmm1, %xmm0
	cmpl	$10000, %edx
	ja	.L13
	movl	%eax, %ecx
	orl	%edx, %ecx
	je	.L5
	cmpl	%edx, %eax
	jle	.L6
	movq	%xmm0, (%rbx)
.L6:
	addl	$1, %ebp
	addq	$8, %rbx
	cmpl	$3000, %ebp
	je	.L8
.L7:
	leaq	4(%rbx), %rdx
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	cmpl	$10000, %eax
	jbe	.L17
.L13:
	movl	$-1, %eax
.L3:
	movq	24008(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L18
	addq	$24024, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L5:
	.cfi_restore_state
	testl	%ebp, %ebp
	je	.L10
.L8:
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	4(%r13,%rbx,8), %ecx
	movl	0(%r13,%rbx,8), %edx
	movq	%r12, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, %ebp
	jg	.L9
.L10:
	xorl	%eax, %eax
	jmp	.L3
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

#include<stdio.h>
  
#define MAX_DATASET 3000
#define MIN         0
#define MAX         10000
#define X 0
#define Y 1
#define IS_ERR(n) (n < MIN || n > MAX)
  
void swap(int *a, int *b)
{
    int c;
     c = *a;
    *a = *b;
    *b = c;
}
   
   
int main(void)
{
    int i, j, array[MAX_DATASET][2];
   
    for(i=0;i<MAX_DATASET;i++)
    {
        scanf("%d %d", &array[i][X], &array[i][Y]);
   
        if(IS_ERR(array[i][X]) || IS_ERR(array[i][Y]) )
        {
            return -1;
        }
   
        if(array[i][X] == 0 && array[i][Y] == 0)
        { 
            break;
        }
   
        if(array[i][X] > array[i][Y])
        {
           swap(&array[i][X], &array[i][Y]);
        }
    }
   
    for(j=0;j<i;j++)
    {
        printf("%d %d\n", array[j][X], array[j][Y]);
    }
   
    return 0;
}

3 1
2 2
5 3
0 0
 3 1
2 2
9 3
0 0
 3 1
0 2
9 3
0 0
 3 0
0 2
9 3
0 0
 3 0
0 2
15 3
0 0

1 3
2 2
3 5
 1 3
2 2
3 9
 1 3
0 2
3 9
 0 3
0 2
3 9
 0 3
0 2
3 15

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
  
#define MAX_DATASET 3000
#define MIN         0
#define MAX         10000
#define X 0
#define Y 1
#define IS_ERR(n) (n < MIN || n > MAX)
  
void swap(int *a, int *b)
{
    int c;
     c = *a;
    *a = *b;
    *b = c;
}
   
   
int main(void)
{
    int i, j, array[MAX_DATASET][2];
   
    for(i=0;i<MAX_DATASET;i++)
    {
        scanf("%d %d", &array[i][X], &array[i][Y]);
   
        if(IS_ERR(array[i][X]) || IS_ERR(array[i][Y]) )
        {
            return -1;
        }
   
        if(array[i][X] == 0 && array[i][Y] == 0)
        { 
            break;
        }
   
        if(array[i][X] > array[i][Y])
        {
           swap(&array[i][X], &array[i][Y]);
        }
    }
   
    for(j=0;j<i;j++)
    {
        printf("%d %d\n", array[j][X], array[j][Y]);
    }
   
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-20480(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3552, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24024(%rbp)
	jmp	.L3
.L10:
	leaq	-24016(%rbp), %rdx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	$4, %rax
	addq	%rax, %rdx
	leaq	-24016(%rbp), %rcx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	testl	%eax, %eax
	js	.L4
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	cmpl	$10000, %eax
	jg	.L4
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	testl	%eax, %eax
	js	.L4
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	cmpl	$10000, %eax
	jle	.L5
.L4:
	movl	$-1, %eax
	jmp	.L13
.L5:
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L7
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L15
.L7:
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %edx
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	cmpl	%eax, %edx
	jle	.L9
	leaq	-24016(%rbp), %rdx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	$4, %rax
	addq	%rax, %rdx
	leaq	-24016(%rbp), %rcx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L9:
	addl	$1, -24024(%rbp)
.L3:
	cmpl	$2999, -24024(%rbp)
	jle	.L10
	jmp	.L8
.L15:
	nop
.L8:
	movl	$0, -24020(%rbp)
	jmp	.L11
.L12:
	movl	-24020(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %edx
	movl	-24020(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -24020(%rbp)
.L11:
	movl	-24020(%rbp), %eax
	cmpl	-24024(%rbp), %eax
	jl	.L12
	movl	$0, %eax
.L13:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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.
train
	.file	"temp.c"
	.text
	.globl	swap
	.type	swap, @function
swap:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
	movq	-32(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	swap, .-swap
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-20480(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3552, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24024(%rbp)
	jmp	.L3
.L10:
	leaq	-24016(%rbp), %rdx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	$4, %rax
	addq	%rax, %rdx
	leaq	-24016(%rbp), %rcx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	testl	%eax, %eax
	js	.L4
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	cmpl	$10000, %eax
	jg	.L4
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	testl	%eax, %eax
	js	.L4
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	cmpl	$10000, %eax
	jle	.L5
.L4:
	movl	$-1, %eax
	jmp	.L13
.L5:
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	testl	%eax, %eax
	jne	.L7
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	testl	%eax, %eax
	je	.L15
.L7:
	movl	-24024(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %edx
	movl	-24024(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %eax
	cmpl	%eax, %edx
	jle	.L9
	leaq	-24016(%rbp), %rdx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	$4, %rax
	addq	%rax, %rdx
	leaq	-24016(%rbp), %rcx
	movl	-24024(%rbp), %eax
	cltq
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L9:
	addl	$1, -24024(%rbp)
.L3:
	cmpl	$2999, -24024(%rbp)
	jle	.L10
	jmp	.L8
.L15:
	nop
.L8:
	movl	$0, -24020(%rbp)
	jmp	.L11
.L12:
	movl	-24020(%rbp), %eax
	cltq
	movl	-24012(%rbp,%rax,8), %edx
	movl	-24020(%rbp), %eax
	cltq
	movl	-24016(%rbp,%rax,8), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -24020(%rbp)
.L11:
	movl	-24020(%rbp), %eax
	cmpl	-24024(%rbp), %eax
	jl	.L12
	movl	$0, %eax
.L13:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
