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>
#include <string.h>

void sort(int a[]);
void swap(int *a, int *b);

int n;

int main(void)
{
	int taro[200];
	int hanako[200];
	int t_count, h_count;
	int flag;
	int bord;
	int i, j;
	int list[200];

	while (1){
		scanf("%d", &n);

		if (n == 0){
			break;
		}

		memset(taro, 0, sizeof(taro));
		memset(hanako, 0, sizeof(hanako));
		memset(list, 0, sizeof(list));

		for (i = 0; i < n; i++){
			scanf("%d", &taro[i]);
		}

		sort(taro);

		for (i = 0; i < n; i++){
			list[taro[i]] = 1;
		}

		j = 0;

		for (i = 1; i <= 2 * n; i++){
			if (list[i] == 0){
				hanako[j] = i;
				j++;
			}
		}

		bord = 0;
		t_count = h_count = n;

		for (i = 0; i < 2 * n; i++){
			flag = 0;
			for (j = 0; j < n; j++){
				if (bord < taro[j]){
					bord = taro[j];
					taro[j] = 0;
					t_count--;
					break;
				}
				flag++;
			}
			if (t_count == 0){
				break;
			}
			if (flag == n){
				bord = 0;
			}
			flag = 0;
			for (j = 0; j < n; j++){
				if (bord < hanako[j]){
					bord = hanako[j];
					hanako[j] = 0;
					h_count--;
					break;
				}
				flag++;
			}
			if (flag == n){
				bord = 0;
			}
			if (h_count == 0){
				break;
			}
		}

		printf("%d\n", h_count);
		printf("%d\n", t_count);
	}

	return (0);
}

void sort(int a[])
{
	int i, j;

	for (i = 0; i < n - 1; i++){
		for (j = i; j < n; j++){
			if (a[i] > a[j]){
				swap(&a[i], &a[j]);
			}
		}
	}
}

void swap(int *a, int *b)
{
	*a += *b;
	*b = *a - *b;
	*a -= *b;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L26:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L30
	leaq	-2416(%rbp), %rax
	movl	$800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-1616(%rbp), %rax
	movl	$800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-816(%rbp), %rax
	movl	$800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -2424(%rbp)
	jmp	.L4
.L5:
	leaq	-2416(%rbp), %rdx
	movl	-2424(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -2424(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -2424(%rbp)
	jl	.L5
	leaq	-2416(%rbp), %rax
	movq	%rax, %rdi
	call	sort
	movl	$0, -2424(%rbp)
	jmp	.L6
.L7:
	movl	-2424(%rbp), %eax
	cltq
	movl	-2416(%rbp,%rax,4), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
	addl	$1, -2424(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -2424(%rbp)
	jl	.L7
	movl	$0, -2420(%rbp)
	movl	$1, -2424(%rbp)
	jmp	.L8
.L10:
	movl	-2424(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-2420(%rbp), %eax
	cltq
	movl	-2424(%rbp), %edx
	movl	%edx, -1616(%rbp,%rax,4)
	addl	$1, -2420(%rbp)
.L9:
	addl	$1, -2424(%rbp)
.L8:
	movl	n(%rip), %eax
	addl	%eax, %eax
	cmpl	%eax, -2424(%rbp)
	jle	.L10
	movl	$0, -2428(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -2436(%rbp)
	movl	-2436(%rbp), %eax
	movl	%eax, -2440(%rbp)
	movl	$0, -2424(%rbp)
	jmp	.L11
.L25:
	movl	$0, -2432(%rbp)
	movl	$0, -2420(%rbp)
	jmp	.L12
.L15:
	movl	-2420(%rbp), %eax
	cltq
	movl	-2416(%rbp,%rax,4), %eax
	cmpl	%eax, -2428(%rbp)
	jge	.L13
	movl	-2420(%rbp), %eax
	cltq
	movl	-2416(%rbp,%rax,4), %eax
	movl	%eax, -2428(%rbp)
	movl	-2420(%rbp), %eax
	cltq
	movl	$0, -2416(%rbp,%rax,4)
	subl	$1, -2440(%rbp)
	jmp	.L14
.L13:
	addl	$1, -2432(%rbp)
	addl	$1, -2420(%rbp)
.L12:
	movl	n(%rip), %eax
	cmpl	%eax, -2420(%rbp)
	jl	.L15
.L14:
	cmpl	$0, -2440(%rbp)
	je	.L31
	movl	n(%rip), %eax
	cmpl	%eax, -2432(%rbp)
	jne	.L18
	movl	$0, -2428(%rbp)
.L18:
	movl	$0, -2432(%rbp)
	movl	$0, -2420(%rbp)
	jmp	.L19
.L22:
	movl	-2420(%rbp), %eax
	cltq
	movl	-1616(%rbp,%rax,4), %eax
	cmpl	%eax, -2428(%rbp)
	jge	.L20
	movl	-2420(%rbp), %eax
	cltq
	movl	-1616(%rbp,%rax,4), %eax
	movl	%eax, -2428(%rbp)
	movl	-2420(%rbp), %eax
	cltq
	movl	$0, -1616(%rbp,%rax,4)
	subl	$1, -2436(%rbp)
	jmp	.L21
.L20:
	addl	$1, -2432(%rbp)
	addl	$1, -2420(%rbp)
.L19:
	movl	n(%rip), %eax
	cmpl	%eax, -2420(%rbp)
	jl	.L22
.L21:
	movl	n(%rip), %eax
	cmpl	%eax, -2432(%rbp)
	jne	.L23
	movl	$0, -2428(%rbp)
.L23:
	cmpl	$0, -2436(%rbp)
	je	.L32
	addl	$1, -2424(%rbp)
.L11:
	movl	n(%rip), %eax
	addl	%eax, %eax
	cmpl	%eax, -2424(%rbp)
	jl	.L25
	jmp	.L17
.L31:
	nop
	jmp	.L17
.L32:
	nop
.L17:
	movl	-2436(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-2440(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L30:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	sort
	.type	sort, @function
sort:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L34
.L38:
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L35
.L37:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L36
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L36:
	addl	$1, -4(%rbp)
.L35:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L37
	addl	$1, -8(%rbp)
.L34:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jl	.L38
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	sort, .-sort
	.globl	swap
	.type	swap, @function
swap:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	subl	%eax, %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	subl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	swap, .-swap
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	leaq	.LC0(%rip), %r14
	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
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$2440, %rsp
	.cfi_def_cfa_offset 2496
	movq	%fs:40, %rax
	movq	%rax, 2424(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L27:
	leaq	n(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r8d
	testl	%r8d, %r8d
	je	.L2
	movl	$0, %eax
	movl	$100, %ecx
	movq	%rbx, %rdi
	rep stosq
	leaq	1616(%rsp), %r13
	leaq	816(%rsp), %rdi
	movl	$100, %ecx
	movq	%rdi, 8(%rsp)
	rep stosq
	movl	$100, %ecx
	movq	%r13, %rdi
	rep stosq
	jle	.L30
	movq	%rbx, %r12
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	n(%rip), %ecx
	addq	$4, %r12
	cmpl	%r15d, %ecx
	jg	.L4
	leal	-1(%rcx), %r8d
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	testl	%r8d, %r8d
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rdi), %r10d
	movq	%rdi, %rdx
	movl	%r9d, %esi
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rdx), %eax
	cmpl	%eax, %r10d
	jle	.L8
	addl	%r10d, %eax
	movl	%eax, (%rdi)
	subl	(%rdx), %eax
	movl	%eax, (%rdx)
	movl	(%rdi), %r10d
	subl	%eax, %r10d
	movl	%r10d, (%rdi)
.L8:
	addl	$1, %esi
	addq	$4, %rdx
	cmpl	%esi, %ecx
	jg	.L9
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r8d, %r9d
	jne	.L10
.L11:
	leal	(%rcx,%rcx), %r11d
	testl	%ecx, %ecx
	jle	.L55
	movq	%rbx, %rax
	leaq	20(%rsp,%r8,4), %rsi
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	(%rax), %rdx
	addq	$4, %rax
	movl	$1, 1616(%rsp,%rdx,4)
	cmpq	%rsi, %rax
	jne	.L12
.L14:
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	0(%r13,%rax,4), %esi
	testl	%esi, %esi
	jne	.L15
	movslq	%edx, %rsi
	addl	$1, %edx
	movl	%eax, 816(%rsp,%rsi,4)
.L15:
	addq	$1, %rax
	cmpl	%eax, %r11d
	jge	.L13
	movl	%ecx, %r10d
	movl	%ecx, %r8d
	xorl	%r9d, %r9d
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%edx, %eax
	testl	%ecx, %ecx
	jg	.L19
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, %esi
	addq	$4, %rdi
	cmpl	%esi, %ecx
	je	.L56
.L19:
	movl	(%rdi), %eax
	cmpl	%edx, %eax
	jle	.L17
	movslq	%esi, %rdx
	subl	$1, %r8d
	movl	$0, 16(%rsp,%rdx,4)
.L18:
	testl	%r8d, %r8d
	je	.L3
	cmpl	%esi, %ecx
	cmove	%ebp, %eax
	testl	%ecx, %ecx
	jle	.L31
.L28:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, %esi
	addq	$4, %rdi
	cmpl	%esi, %ecx
	je	.L57
.L24:
	movl	(%rdi), %edx
	cmpl	%eax, %edx
	jle	.L23
	movslq	%esi, %rax
	subl	$1, %r10d
	movl	$0, 816(%rsp,%rax,4)
.L22:
	cmpl	%esi, %ecx
	cmove	%ebp, %edx
.L25:
	testl	%r10d, %r10d
	je	.L3
	addl	$1, %r9d
	cmpl	%r11d, %r9d
	jl	.L16
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r10d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%r8d, 8(%rsp)
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movl	8(%rsp), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L56:
	testl	%r8d, %r8d
	je	.L3
	xorl	%eax, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L57:
	xorl	%edx, %edx
	jmp	.L25
.L31:
	movl	%eax, %edx
	xorl	%esi, %esi
	jmp	.L22
.L2:
	movq	2424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	addq	$2440, %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
.L30:
	.cfi_restore_state
	movl	%r8d, %r10d
	jmp	.L3
.L55:
	testl	%r11d, %r11d
	jg	.L14
	movl	%ecx, %r10d
	movl	%ecx, %r8d
	jmp	.L3
.L58:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.text
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB36:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	cmpl	$1, %r8d
	jle	.L59
	movq	%rdi, %rsi
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L61:
	cmpl	%r9d, %r8d
	jle	.L64
	movl	(%rsi), %ecx
	movq	%r9, %rdx
	.p2align 4,,10
	.p2align 3
.L65:
	movl	(%rdi,%rdx,4), %eax
	cmpl	%ecx, %eax
	jge	.L62
	addl	%ecx, %eax
	movl	%eax, (%rsi)
	subl	(%rdi,%rdx,4), %eax
	movl	%eax, (%rdi,%rdx,4)
	movl	(%rsi), %ecx
	addq	$1, %rdx
	subl	%eax, %ecx
	movl	%ecx, (%rsi)
	movl	n(%rip), %r8d
	cmpl	%edx, %r8d
	jg	.L65
.L64:
	addq	$1, %r9
	leal	-1(%r8), %eax
	addq	$4, %rsi
	cmpl	%r9d, %eax
	jg	.L61
.L59:
	ret
	.p2align 4,,10
	.p2align 3
.L62:
	addq	$1, %rdx
	cmpl	%edx, %r8d
	jg	.L65
	jmp	.L64
	.cfi_endproc
.LFE36:
	.size	sort, .-sort
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB37:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	addl	(%rdi), %eax
	movl	%eax, (%rdi)
	subl	(%rsi), %eax
	movl	%eax, (%rsi)
	subl	%eax, (%rdi)
	ret
	.cfi_endproc
.LFE37:
	.size	swap, .-swap
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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
	leaq	.LC0(%rip), %r14
	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
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$2440, %rsp
	.cfi_def_cfa_offset 2496
	movq	%fs:40, %rax
	movq	%rax, 2424(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L27:
	leaq	n(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %r8d
	testl	%r8d, %r8d
	je	.L2
	movl	$0, %eax
	movl	$100, %ecx
	movq	%rbx, %rdi
	rep stosq
	leaq	1616(%rsp), %r13
	leaq	816(%rsp), %rdi
	movl	$100, %ecx
	movq	%rdi, 8(%rsp)
	rep stosq
	movl	$100, %ecx
	movq	%r13, %rdi
	rep stosq
	jle	.L30
	movq	%rbx, %r12
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	call	__isoc99_scanf@PLT
	movl	n(%rip), %ecx
	addq	$4, %r12
	cmpl	%r15d, %ecx
	jg	.L4
	leal	-1(%rcx), %r8d
	movq	%rbx, %rdi
	xorl	%r9d, %r9d
	testl	%r8d, %r8d
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rdi), %r10d
	movq	%rdi, %rdx
	movl	%r9d, %esi
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rdx), %eax
	cmpl	%eax, %r10d
	jle	.L8
	addl	%r10d, %eax
	movl	%eax, (%rdi)
	subl	(%rdx), %eax
	movl	%eax, (%rdx)
	movl	(%rdi), %r10d
	subl	%eax, %r10d
	movl	%r10d, (%rdi)
.L8:
	addl	$1, %esi
	addq	$4, %rdx
	cmpl	%esi, %ecx
	jg	.L9
	addl	$1, %r9d
	addq	$4, %rdi
	cmpl	%r8d, %r9d
	jne	.L10
.L11:
	leal	(%rcx,%rcx), %r11d
	testl	%ecx, %ecx
	jle	.L55
	movq	%rbx, %rax
	leaq	20(%rsp,%r8,4), %rsi
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	(%rax), %rdx
	addq	$4, %rax
	movl	$1, 1616(%rsp,%rdx,4)
	cmpq	%rsi, %rax
	jne	.L12
.L14:
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	0(%r13,%rax,4), %esi
	testl	%esi, %esi
	jne	.L15
	movslq	%edx, %rsi
	addl	$1, %edx
	movl	%eax, 816(%rsp,%rsi,4)
.L15:
	addq	$1, %rax
	cmpl	%eax, %r11d
	jge	.L13
	movl	%ecx, %r10d
	movl	%ecx, %r8d
	xorl	%r9d, %r9d
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%edx, %eax
	testl	%ecx, %ecx
	jg	.L19
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L17:
	addl	$1, %esi
	addq	$4, %rdi
	cmpl	%esi, %ecx
	je	.L56
.L19:
	movl	(%rdi), %eax
	cmpl	%edx, %eax
	jle	.L17
	movslq	%esi, %rdx
	subl	$1, %r8d
	movl	$0, 16(%rsp,%rdx,4)
.L18:
	testl	%r8d, %r8d
	je	.L3
	cmpl	%esi, %ecx
	cmove	%ebp, %eax
	testl	%ecx, %ecx
	jle	.L31
.L28:
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L23:
	addl	$1, %esi
	addq	$4, %rdi
	cmpl	%esi, %ecx
	je	.L57
.L24:
	movl	(%rdi), %edx
	cmpl	%eax, %edx
	jle	.L23
	movslq	%esi, %rax
	subl	$1, %r10d
	movl	$0, 816(%rsp,%rax,4)
.L22:
	cmpl	%esi, %ecx
	cmove	%ebp, %edx
.L25:
	testl	%r10d, %r10d
	je	.L3
	addl	$1, %r9d
	cmpl	%r11d, %r9d
	jl	.L16
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r10d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%r8d, 8(%rsp)
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movl	8(%rsp), %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L56:
	testl	%r8d, %r8d
	je	.L3
	xorl	%eax, %eax
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L57:
	xorl	%edx, %edx
	jmp	.L25
.L31:
	movl	%eax, %edx
	xorl	%esi, %esi
	jmp	.L22
.L2:
	movq	2424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	addq	$2440, %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
.L30:
	.cfi_restore_state
	movl	%r8d, %r10d
	jmp	.L3
.L55:
	testl	%r11d, %r11d
	jg	.L14
	movl	%ecx, %r10d
	movl	%ecx, %r8d
	jmp	.L3
.L58:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.text
	.p2align 4
	.globl	sort
	.type	sort, @function
sort:
.LFB36:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	cmpl	$1, %r8d
	jle	.L59
	movq	%rdi, %rsi
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L61:
	cmpl	%r9d, %r8d
	jle	.L64
	movl	(%rsi), %ecx
	movq	%r9, %rdx
	.p2align 4,,10
	.p2align 3
.L65:
	movl	(%rdi,%rdx,4), %eax
	cmpl	%ecx, %eax
	jge	.L62
	addl	%ecx, %eax
	movl	%eax, (%rsi)
	subl	(%rdi,%rdx,4), %eax
	movl	%eax, (%rdi,%rdx,4)
	movl	(%rsi), %ecx
	addq	$1, %rdx
	subl	%eax, %ecx
	movl	%ecx, (%rsi)
	movl	n(%rip), %r8d
	cmpl	%edx, %r8d
	jg	.L65
.L64:
	addq	$1, %r9
	leal	-1(%r8), %eax
	addq	$4, %rsi
	cmpl	%r9d, %eax
	jg	.L61
.L59:
	ret
	.p2align 4,,10
	.p2align 3
.L62:
	addq	$1, %rdx
	cmpl	%edx, %r8d
	jg	.L65
	jmp	.L64
	.cfi_endproc
.LFE36:
	.size	sort, .-sort
	.p2align 4
	.globl	swap
	.type	swap, @function
swap:
.LFB37:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	addl	(%rdi), %eax
	movl	%eax, (%rdi)
	subl	(%rsi), %eax
	movl	%eax, (%rsi)
	subl	%eax, (%rdi)
	ret
	.cfi_endproc
.LFE37:
	.size	swap, .-swap
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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>
#include <string.h>

void sort(int a[]);
void swap(int *a, int *b);

int n;

int main(void)
{
	int taro[200];
	int hanako[200];
	int t_count, h_count;
	int flag;
	int bord;
	int i, j;
	int list[200];

	while (1){
		scanf("%d", &n);

		if (n == 0){
			break;
		}

		memset(taro, 0, sizeof(taro));
		memset(hanako, 0, sizeof(hanako));
		memset(list, 0, sizeof(list));

		for (i = 0; i < n; i++){
			scanf("%d", &taro[i]);
		}

		sort(taro);

		for (i = 0; i < n; i++){
			list[taro[i]] = 1;
		}

		j = 0;

		for (i = 1; i <= 2 * n; i++){
			if (list[i] == 0){
				hanako[j] = i;
				j++;
			}
		}

		bord = 0;
		t_count = h_count = n;

		for (i = 0; i < 2 * n; i++){
			flag = 0;
			for (j = 0; j < n; j++){
				if (bord < taro[j]){
					bord = taro[j];
					taro[j] = 0;
					t_count--;
					break;
				}
				flag++;
			}
			if (t_count == 0){
				break;
			}
			if (flag == n){
				bord = 0;
			}
			flag = 0;
			for (j = 0; j < n; j++){
				if (bord < hanako[j]){
					bord = hanako[j];
					hanako[j] = 0;
					h_count--;
					break;
				}
				flag++;
			}
			if (flag == n){
				bord = 0;
			}
			if (h_count == 0){
				break;
			}
		}

		printf("%d\n", h_count);
		printf("%d\n", t_count);
	}

	return (0);
}

void sort(int a[])
{
	int i, j;

	for (i = 0; i < n - 1; i++){
		for (j = i; j < n; j++){
			if (a[i] > a[j]){
				swap(&a[i], &a[j]);
			}
		}
	}
}

void swap(int *a, int *b)
{
	*a += *b;
	*b = *a - *b;
	*a -= *b;
}
5
1
7
9
6
10
10
8
7
14
18
2
11
3
17
5
19
0
 5
1
7
9
6
5
10
8
7
14
18
4
11
6
17
5
19
0
 5
1
7
9
6
10
10
4
7
14
18
2
11
3
17
5
19
0
 5
1
7
9
6
5
10
8
7
13
18
1
11
6
17
5
19
0
 5
1
7
9
6
10
10
8
7
14
18
2
11
3
1
5
19
0
 5
1
2
9
6
10
10
8
7
14
18
4
11
6
17
5
19
0
 5
1
7
9
6
10
10
8
7
14
18
2
17
3
1
5
19
0
 5
2
7
9
6
8
10
8
7
14
18
2
17
3
1
5
19
0
 5
1
7
9
6
5
10
8
7
13
18
1
11
6
16
5
19
0
 5
1
7
9
6
4
10
10
7
13
18
1
11
12
17
5
19
0

3
0
1
0
 1
0
1
0
 3
0
2
0
 1
0
2
0
 3
0
0
2
 2
0
1
0
 3
0
0
1
 2
0
0
1
 1
0
0
1
 0
1
2
0

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>
#include <string.h>

void sort(int a[]);
void swap(int *a, int *b);

int n;

int main(void)
{
	int taro[200];
	int hanako[200];
	int t_count, h_count;
	int flag;
	int bord;
	int i, j;
	int list[200];

	while (1){
		scanf("%d", &n);

		if (n == 0){
			break;
		}

		memset(taro, 0, sizeof(taro));
		memset(hanako, 0, sizeof(hanako));
		memset(list, 0, sizeof(list));

		for (i = 0; i < n; i++){
			scanf("%d", &taro[i]);
		}

		sort(taro);

		for (i = 0; i < n; i++){
			list[taro[i]] = 1;
		}

		j = 0;

		for (i = 1; i <= 2 * n; i++){
			if (list[i] == 0){
				hanako[j] = i;
				j++;
			}
		}

		bord = 0;
		t_count = h_count = n;

		for (i = 0; i < 2 * n; i++){
			flag = 0;
			for (j = 0; j < n; j++){
				if (bord < taro[j]){
					bord = taro[j];
					taro[j] = 0;
					t_count--;
					break;
				}
				flag++;
			}
			if (t_count == 0){
				break;
			}
			if (flag == n){
				bord = 0;
			}
			flag = 0;
			for (j = 0; j < n; j++){
				if (bord < hanako[j]){
					bord = hanako[j];
					hanako[j] = 0;
					h_count--;
					break;
				}
				flag++;
			}
			if (flag == n){
				bord = 0;
			}
			if (h_count == 0){
				break;
			}
		}

		printf("%d\n", h_count);
		printf("%d\n", t_count);
	}

	return (0);
}

void sort(int a[])
{
	int i, j;

	for (i = 0; i < n - 1; i++){
		for (j = i; j < n; j++){
			if (a[i] > a[j]){
				swap(&a[i], &a[j]);
			}
		}
	}
}

void swap(int *a, int *b)
{
	*a += *b;
	*b = *a - *b;
	*a -= *b;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L26:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L30
	leaq	-2416(%rbp), %rax
	movl	$800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-1616(%rbp), %rax
	movl	$800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-816(%rbp), %rax
	movl	$800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -2424(%rbp)
	jmp	.L4
.L5:
	leaq	-2416(%rbp), %rdx
	movl	-2424(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -2424(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -2424(%rbp)
	jl	.L5
	leaq	-2416(%rbp), %rax
	movq	%rax, %rdi
	call	sort
	movl	$0, -2424(%rbp)
	jmp	.L6
.L7:
	movl	-2424(%rbp), %eax
	cltq
	movl	-2416(%rbp,%rax,4), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
	addl	$1, -2424(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -2424(%rbp)
	jl	.L7
	movl	$0, -2420(%rbp)
	movl	$1, -2424(%rbp)
	jmp	.L8
.L10:
	movl	-2424(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-2420(%rbp), %eax
	cltq
	movl	-2424(%rbp), %edx
	movl	%edx, -1616(%rbp,%rax,4)
	addl	$1, -2420(%rbp)
.L9:
	addl	$1, -2424(%rbp)
.L8:
	movl	n(%rip), %eax
	addl	%eax, %eax
	cmpl	%eax, -2424(%rbp)
	jle	.L10
	movl	$0, -2428(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -2436(%rbp)
	movl	-2436(%rbp), %eax
	movl	%eax, -2440(%rbp)
	movl	$0, -2424(%rbp)
	jmp	.L11
.L25:
	movl	$0, -2432(%rbp)
	movl	$0, -2420(%rbp)
	jmp	.L12
.L15:
	movl	-2420(%rbp), %eax
	cltq
	movl	-2416(%rbp,%rax,4), %eax
	cmpl	%eax, -2428(%rbp)
	jge	.L13
	movl	-2420(%rbp), %eax
	cltq
	movl	-2416(%rbp,%rax,4), %eax
	movl	%eax, -2428(%rbp)
	movl	-2420(%rbp), %eax
	cltq
	movl	$0, -2416(%rbp,%rax,4)
	subl	$1, -2440(%rbp)
	jmp	.L14
.L13:
	addl	$1, -2432(%rbp)
	addl	$1, -2420(%rbp)
.L12:
	movl	n(%rip), %eax
	cmpl	%eax, -2420(%rbp)
	jl	.L15
.L14:
	cmpl	$0, -2440(%rbp)
	je	.L31
	movl	n(%rip), %eax
	cmpl	%eax, -2432(%rbp)
	jne	.L18
	movl	$0, -2428(%rbp)
.L18:
	movl	$0, -2432(%rbp)
	movl	$0, -2420(%rbp)
	jmp	.L19
.L22:
	movl	-2420(%rbp), %eax
	cltq
	movl	-1616(%rbp,%rax,4), %eax
	cmpl	%eax, -2428(%rbp)
	jge	.L20
	movl	-2420(%rbp), %eax
	cltq
	movl	-1616(%rbp,%rax,4), %eax
	movl	%eax, -2428(%rbp)
	movl	-2420(%rbp), %eax
	cltq
	movl	$0, -1616(%rbp,%rax,4)
	subl	$1, -2436(%rbp)
	jmp	.L21
.L20:
	addl	$1, -2432(%rbp)
	addl	$1, -2420(%rbp)
.L19:
	movl	n(%rip), %eax
	cmpl	%eax, -2420(%rbp)
	jl	.L22
.L21:
	movl	n(%rip), %eax
	cmpl	%eax, -2432(%rbp)
	jne	.L23
	movl	$0, -2428(%rbp)
.L23:
	cmpl	$0, -2436(%rbp)
	je	.L32
	addl	$1, -2424(%rbp)
.L11:
	movl	n(%rip), %eax
	addl	%eax, %eax
	cmpl	%eax, -2424(%rbp)
	jl	.L25
	jmp	.L17
.L31:
	nop
	jmp	.L17
.L32:
	nop
.L17:
	movl	-2436(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-2440(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L30:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	sort
	.type	sort, @function
sort:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L34
.L38:
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L35
.L37:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L36
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L36:
	addl	$1, -4(%rbp)
.L35:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L37
	addl	$1, -8(%rbp)
.L34:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jl	.L38
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	sort, .-sort
	.globl	swap
	.type	swap, @function
swap:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	subl	%eax, %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	subl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	swap, .-swap
	.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	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$2448, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L26:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L30
	leaq	-2416(%rbp), %rax
	movl	$800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-1616(%rbp), %rax
	movl	$800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	leaq	-816(%rbp), %rax
	movl	$800, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -2424(%rbp)
	jmp	.L4
.L5:
	leaq	-2416(%rbp), %rdx
	movl	-2424(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -2424(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -2424(%rbp)
	jl	.L5
	leaq	-2416(%rbp), %rax
	movq	%rax, %rdi
	call	sort
	movl	$0, -2424(%rbp)
	jmp	.L6
.L7:
	movl	-2424(%rbp), %eax
	cltq
	movl	-2416(%rbp,%rax,4), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
	addl	$1, -2424(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -2424(%rbp)
	jl	.L7
	movl	$0, -2420(%rbp)
	movl	$1, -2424(%rbp)
	jmp	.L8
.L10:
	movl	-2424(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-2420(%rbp), %eax
	cltq
	movl	-2424(%rbp), %edx
	movl	%edx, -1616(%rbp,%rax,4)
	addl	$1, -2420(%rbp)
.L9:
	addl	$1, -2424(%rbp)
.L8:
	movl	n(%rip), %eax
	addl	%eax, %eax
	cmpl	%eax, -2424(%rbp)
	jle	.L10
	movl	$0, -2428(%rbp)
	movl	n(%rip), %eax
	movl	%eax, -2436(%rbp)
	movl	-2436(%rbp), %eax
	movl	%eax, -2440(%rbp)
	movl	$0, -2424(%rbp)
	jmp	.L11
.L25:
	movl	$0, -2432(%rbp)
	movl	$0, -2420(%rbp)
	jmp	.L12
.L15:
	movl	-2420(%rbp), %eax
	cltq
	movl	-2416(%rbp,%rax,4), %eax
	cmpl	%eax, -2428(%rbp)
	jge	.L13
	movl	-2420(%rbp), %eax
	cltq
	movl	-2416(%rbp,%rax,4), %eax
	movl	%eax, -2428(%rbp)
	movl	-2420(%rbp), %eax
	cltq
	movl	$0, -2416(%rbp,%rax,4)
	subl	$1, -2440(%rbp)
	jmp	.L14
.L13:
	addl	$1, -2432(%rbp)
	addl	$1, -2420(%rbp)
.L12:
	movl	n(%rip), %eax
	cmpl	%eax, -2420(%rbp)
	jl	.L15
.L14:
	cmpl	$0, -2440(%rbp)
	je	.L31
	movl	n(%rip), %eax
	cmpl	%eax, -2432(%rbp)
	jne	.L18
	movl	$0, -2428(%rbp)
.L18:
	movl	$0, -2432(%rbp)
	movl	$0, -2420(%rbp)
	jmp	.L19
.L22:
	movl	-2420(%rbp), %eax
	cltq
	movl	-1616(%rbp,%rax,4), %eax
	cmpl	%eax, -2428(%rbp)
	jge	.L20
	movl	-2420(%rbp), %eax
	cltq
	movl	-1616(%rbp,%rax,4), %eax
	movl	%eax, -2428(%rbp)
	movl	-2420(%rbp), %eax
	cltq
	movl	$0, -1616(%rbp,%rax,4)
	subl	$1, -2436(%rbp)
	jmp	.L21
.L20:
	addl	$1, -2432(%rbp)
	addl	$1, -2420(%rbp)
.L19:
	movl	n(%rip), %eax
	cmpl	%eax, -2420(%rbp)
	jl	.L22
.L21:
	movl	n(%rip), %eax
	cmpl	%eax, -2432(%rbp)
	jne	.L23
	movl	$0, -2428(%rbp)
.L23:
	cmpl	$0, -2436(%rbp)
	je	.L32
	addl	$1, -2424(%rbp)
.L11:
	movl	n(%rip), %eax
	addl	%eax, %eax
	cmpl	%eax, -2424(%rbp)
	jl	.L25
	jmp	.L17
.L31:
	nop
	jmp	.L17
.L32:
	nop
.L17:
	movl	-2436(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	-2440(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L26
.L30:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L28
	call	__stack_chk_fail@PLT
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	sort
	.type	sort, @function
sort:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L34
.L38:
	movl	-8(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L35
.L37:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jle	.L36
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-24(%rbp), %rax
	addq	%rcx, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	swap
.L36:
	addl	$1, -4(%rbp)
.L35:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L37
	addl	$1, -8(%rbp)
.L34:
	movl	n(%rip), %eax
	subl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jl	.L38
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	sort, .-sort
	.globl	swap
	.type	swap, @function
swap:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	addl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	subl	%eax, %edx
	movq	-16(%rbp), %rax
	movl	%edx, (%rax)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	subl	%eax, %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	swap, .-swap
	.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:
