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>
int main()
{
    int n;
    scanf("%d", &n);
    int a[100], b[100], c[100], d[105];
    int i;
    for (i = 0; i < n; i++)
        scanf("%d %d", &a[i], &b[i]);
    for (i = 0; i < n; i++)
        scanf("%d %d", &c[i], &d[i]);
    int ans = 0;
    int x;
    for (i = 0; i < n - 1; i++)
    {
        if (a[i] < a[i + 1])
        {
            x = a[i];
            a[i] = a[i + 1];
            a[i + 1] = x;
            x = b[i];
            b[i] = b[i + 1];
            b[i + 1] = x;
            if (i != 0)
                i -= 2;
        }
        if (a[i] == a[i + 1])
        {
            if (b[i] < b[i + 1])
            {
                x = a[i];
                a[i] = a[i + 1];
                a[i + 1] = x;
                x = b[i];
                b[i] = b[i + 1];
                b[i + 1] = x;
                if (i != 0)
                    i -= 2;
            }
        }
    }
    for (i = 0; i < n - 1; i++)
    {
        if (c[i] < c[i + 1])
        {
            x = c[i];
            c[i] = c[i + 1];
            c[i + 1] = x;
            x = d[i];
            d[i] = d[i + 1];
            d[i + 1] = x;
            if (i != 0)
                i -= 2;
            continue;
        }
        if (c[i] == c[i + 1])
        {
            if (d[i] < d[i + 1])
            {
                x = c[i];
                c[i] = c[i + 1];
                c[i + 1] = x;
                x = d[i];
                d[i] = d[i + 1];
                d[i + 1] = x;
                if (i != 0)
                    i -= 2;
            }
        }
    }
    int j;
    int y;
    d[103] = 9999;
    for (i = 0; i < n; i++)
    {
        y = 103;
        for (j = 0; j < n; j++)
        {
            if (a[i] < c[j] && b[i] < d[j])
            {
                if (d[y] > d[j])
                    y = j;
            }
        }
        if (y != 103)
        {
            ans++;
            c[y] = d[y] = 0;
        }
    }
    printf("%d\n", ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.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	$1664, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1656(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1652(%rbp)
	jmp	.L2
.L3:
	leaq	-1232(%rbp), %rdx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1632(%rbp), %rcx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1652(%rbp)
.L2:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L3
	movl	$0, -1652(%rbp)
	jmp	.L4
.L5:
	leaq	-432(%rbp), %rdx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-832(%rbp), %rcx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1652(%rbp)
.L4:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L5
	movl	$0, -1648(%rbp)
	movl	$0, -1652(%rbp)
	jmp	.L6
.L9:
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1232(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1232(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L7
	subl	$2, -1652(%rbp)
.L7:
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L8
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1232(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L8
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1232(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1232(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L8
	subl	$2, -1652(%rbp)
.L8:
	addl	$1, -1652(%rbp)
.L6:
	movl	-1656(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L9
	movl	$0, -1652(%rbp)
	jmp	.L10
.L14:
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -432(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -432(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L23
	subl	$2, -1652(%rbp)
	jmp	.L23
.L11:
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	-1652(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -432(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -432(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L13
	subl	$2, -1652(%rbp)
	jmp	.L13
.L23:
	nop
.L13:
	addl	$1, -1652(%rbp)
.L10:
	movl	-1656(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L14
	movl	$9999, -20(%rbp)
	movl	$0, -1652(%rbp)
	jmp	.L15
.L20:
	movl	$103, -1640(%rbp)
	movl	$0, -1644(%rbp)
	jmp	.L16
.L18:
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1644(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1644(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-1640(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1644(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	-1644(%rbp), %eax
	movl	%eax, -1640(%rbp)
.L17:
	addl	$1, -1644(%rbp)
.L16:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1644(%rbp)
	jl	.L18
	cmpl	$103, -1640(%rbp)
	je	.L19
	addl	$1, -1648(%rbp)
	movl	-1640(%rbp), %eax
	cltq
	movl	$0, -432(%rbp,%rax,4)
	movl	-1640(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1640(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
.L19:
	addl	$1, -1652(%rbp)
.L15:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L20
	movl	-1648(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.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
	leaq	.LC0(%rip), %rdi
	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	$1672, %rsp
	.cfi_def_cfa_offset 1728
	movq	%fs:40, %rax
	movq	%rax, 1656(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rax
	xorl	%ebx, %ebx
	leaq	432(%rsp), %r12
	movq	%rax, 8(%rsp)
	movq	%rax, %rbp
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx,4), %rdx
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L2
	leaq	832(%rsp), %rbx
	xorl	%r15d, %r15d
	leaq	1232(%rsp), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	0(%rbp,%r15,4), %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	addq	$1, %r15
	addq	$4, %r13
	cmpl	%r15d, %ecx
	jg	.L4
	leal	-1(%rcx), %edi
	xorl	%edx, %edx
	movl	$1, %r11d
	testl	%edi, %edi
	jg	.L5
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L48:
	movq	%xmm1, (%r9)
	rolq	$32, (%r12,%rsi)
	testl	%edx, %edx
	jne	.L9
	movl	32(%rsp), %r8d
	movl	36(%rsp), %eax
	xorl	%esi, %esi
	movl	$1, %edx
.L8:
	cmpl	%eax, %r8d
	je	.L46
.L10:
	cmpl	%edx, %edi
	jle	.L47
.L5:
	movq	8(%rsp), %rax
	movslq	%edx, %rsi
	leal	1(%rdx), %r10d
	salq	$2, %rsi
	leaq	(%rax,%rsi), %r9
	movq	(%r9), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %r8d
	movd	%xmm3, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %eax
	jg	.L48
	movl	%edx, %esi
	movl	%r10d, %edx
	cmpl	%eax, %r8d
	jne	.L10
.L46:
	movslq	%esi, %r9
	movslq	%edx, %rax
	movl	432(%rsp,%r9,4), %r10d
	movl	432(%rsp,%rax,4), %r14d
	cmpl	%r14d, %r10d
	jge	.L10
	leal	-1(%rsi), %edx
	testl	%esi, %esi
	movl	%r8d, 32(%rsp,%r9,4)
	cmove	%r11d, %edx
	movl	%r14d, 432(%rsp,%r9,4)
	movl	%r8d, 32(%rsp,%rax,4)
	movl	%r10d, 432(%rsp,%rax,4)
	cmpl	%edx, %edi
	jg	.L5
	.p2align 4,,10
	.p2align 3
.L47:
	xorl	%esi, %esi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L11:
	je	.L49
.L26:
	movl	%r10d, %esi
.L13:
	cmpl	%esi, %edi
	jle	.L16
.L15:
	movslq	%esi, %rdx
	leal	1(%rsi), %r10d
	salq	$2, %rdx
	leaq	(%rbx,%rdx), %r8
	movq	(%r8), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %r9d
	movd	%xmm4, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r9d, %eax
	jle	.L11
	movq	%xmm1, (%r8)
	rolq	$32, 0(%rbp,%rdx)
	testl	%esi, %esi
	jne	.L43
.L14:
	movl	$1, %esi
	cmpl	%esi, %edi
	jg	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$9999, 1644(%rsp)
	testl	%ecx, %ecx
	jle	.L44
	movq	8(%rsp), %r13
	movq	%r12, %r8
	leaq	436(%rsp,%rdi,4), %r11
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L20:
	movl	0(%r13), %edi
	xorl	%eax, %eax
	movl	$103, %edx
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	(%rbx,%rax,4), %edi
	jge	.L17
	movl	0(%rbp,%rax,4), %esi
	cmpl	%esi, (%r8)
	jge	.L17
	movslq	%edx, %r9
	cmpl	1232(%rsp,%r9,4), %esi
	cmovl	%eax, %edx
.L17:
	addq	$1, %rax
	cmpq	%rax, %rcx
	jne	.L18
	cmpl	$103, %edx
	je	.L19
	movslq	%edx, %rdx
	addl	$1, %r10d
	movl	$0, 1232(%rsp,%rdx,4)
	movl	$0, 832(%rsp,%rdx,4)
.L19:
	addq	$4, %r8
	addq	$4, %r13
	cmpq	%r11, %r8
	jne	.L20
.L7:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	1656(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	addq	$1672, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	leal	-2(%rdx), %esi
	subl	$1, %edx
	movslq	%esi, %rax
	movl	32(%rsp,%rax,4), %r8d
	movslq	%edx, %rax
	movl	32(%rsp,%rax,4), %eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L49:
	addq	%rbp, %rdx
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %eax
	movd	%xmm5, %r9d
	pshufd	$225, %xmm0, %xmm2
	cmpl	%eax, %r9d
	jle	.L26
	movq	%xmm1, (%r8)
	movq	%xmm2, (%rdx)
	testl	%esi, %esi
	je	.L14
.L43:
	subl	$1, %esi
	jmp	.L13
.L2:
	movl	$9999, 1644(%rsp)
.L44:
	xorl	%r10d, %r10d
	jmp	.L7
.L50:
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.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
	leaq	.LC0(%rip), %rdi
	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	$1672, %rsp
	.cfi_def_cfa_offset 1728
	movq	%fs:40, %rax
	movq	%rax, 1656(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	32(%rsp), %rax
	xorl	%ebx, %ebx
	leaq	432(%rsp), %r12
	movq	%rax, 8(%rsp)
	movq	%rax, %rbp
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%rbx,4), %rdx
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	addq	$1, %rbx
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L2
	leaq	832(%rsp), %rbx
	xorl	%r15d, %r15d
	leaq	1232(%rsp), %rbp
	movq	%rbx, %r13
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	0(%rbp,%r15,4), %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ecx
	addq	$1, %r15
	addq	$4, %r13
	cmpl	%r15d, %ecx
	jg	.L4
	leal	-1(%rcx), %edi
	xorl	%edx, %edx
	movl	$1, %r11d
	testl	%edi, %edi
	jg	.L5
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L48:
	movq	%xmm1, (%r9)
	rolq	$32, (%r12,%rsi)
	testl	%edx, %edx
	jne	.L9
	movl	32(%rsp), %r8d
	movl	36(%rsp), %eax
	xorl	%esi, %esi
	movl	$1, %edx
.L8:
	cmpl	%eax, %r8d
	je	.L46
.L10:
	cmpl	%edx, %edi
	jle	.L47
.L5:
	movq	8(%rsp), %rax
	movslq	%edx, %rsi
	leal	1(%rdx), %r10d
	salq	$2, %rsi
	leaq	(%rax,%rsi), %r9
	movq	(%r9), %xmm0
	pshufd	$0xe5, %xmm0, %xmm3
	movd	%xmm0, %r8d
	movd	%xmm3, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r8d, %eax
	jg	.L48
	movl	%edx, %esi
	movl	%r10d, %edx
	cmpl	%eax, %r8d
	jne	.L10
.L46:
	movslq	%esi, %r9
	movslq	%edx, %rax
	movl	432(%rsp,%r9,4), %r10d
	movl	432(%rsp,%rax,4), %r14d
	cmpl	%r14d, %r10d
	jge	.L10
	leal	-1(%rsi), %edx
	testl	%esi, %esi
	movl	%r8d, 32(%rsp,%r9,4)
	cmove	%r11d, %edx
	movl	%r14d, 432(%rsp,%r9,4)
	movl	%r8d, 32(%rsp,%rax,4)
	movl	%r10d, 432(%rsp,%rax,4)
	cmpl	%edx, %edi
	jg	.L5
	.p2align 4,,10
	.p2align 3
.L47:
	xorl	%esi, %esi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L11:
	je	.L49
.L26:
	movl	%r10d, %esi
.L13:
	cmpl	%esi, %edi
	jle	.L16
.L15:
	movslq	%esi, %rdx
	leal	1(%rsi), %r10d
	salq	$2, %rdx
	leaq	(%rbx,%rdx), %r8
	movq	(%r8), %xmm0
	pshufd	$0xe5, %xmm0, %xmm4
	movd	%xmm0, %r9d
	movd	%xmm4, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%r9d, %eax
	jle	.L11
	movq	%xmm1, (%r8)
	rolq	$32, 0(%rbp,%rdx)
	testl	%esi, %esi
	jne	.L43
.L14:
	movl	$1, %esi
	cmpl	%esi, %edi
	jg	.L15
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$9999, 1644(%rsp)
	testl	%ecx, %ecx
	jle	.L44
	movq	8(%rsp), %r13
	movq	%r12, %r8
	leaq	436(%rsp,%rdi,4), %r11
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L20:
	movl	0(%r13), %edi
	xorl	%eax, %eax
	movl	$103, %edx
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	(%rbx,%rax,4), %edi
	jge	.L17
	movl	0(%rbp,%rax,4), %esi
	cmpl	%esi, (%r8)
	jge	.L17
	movslq	%edx, %r9
	cmpl	1232(%rsp,%r9,4), %esi
	cmovl	%eax, %edx
.L17:
	addq	$1, %rax
	cmpq	%rax, %rcx
	jne	.L18
	cmpl	$103, %edx
	je	.L19
	movslq	%edx, %rdx
	addl	$1, %r10d
	movl	$0, 1232(%rsp,%rdx,4)
	movl	$0, 832(%rsp,%rdx,4)
.L19:
	addq	$4, %r8
	addq	$4, %r13
	cmpq	%r11, %r8
	jne	.L20
.L7:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	1656(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	addq	$1672, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	leal	-2(%rdx), %esi
	subl	$1, %edx
	movslq	%esi, %rax
	movl	32(%rsp,%rax,4), %r8d
	movslq	%edx, %rax
	movl	32(%rsp,%rax,4), %eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L49:
	addq	%rbp, %rdx
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm5
	movd	%xmm0, %eax
	movd	%xmm5, %r9d
	pshufd	$225, %xmm0, %xmm2
	cmpl	%eax, %r9d
	jle	.L26
	movq	%xmm1, (%r8)
	movq	%xmm2, (%rdx)
	testl	%esi, %esi
	je	.L14
.L43:
	subl	$1, %esi
	jmp	.L13
.L2:
	movl	$9999, 1644(%rsp)
.L44:
	xorl	%r10d, %r10d
	jmp	.L7
.L50:
	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:

#include<stdio.h>
int main()
{
    int n;
    scanf("%d", &n);
    int a[100], b[100], c[100], d[105];
    int i;
    for (i = 0; i < n; i++)
        scanf("%d %d", &a[i], &b[i]);
    for (i = 0; i < n; i++)
        scanf("%d %d", &c[i], &d[i]);
    int ans = 0;
    int x;
    for (i = 0; i < n - 1; i++)
    {
        if (a[i] < a[i + 1])
        {
            x = a[i];
            a[i] = a[i + 1];
            a[i + 1] = x;
            x = b[i];
            b[i] = b[i + 1];
            b[i + 1] = x;
            if (i != 0)
                i -= 2;
        }
        if (a[i] == a[i + 1])
        {
            if (b[i] < b[i + 1])
            {
                x = a[i];
                a[i] = a[i + 1];
                a[i + 1] = x;
                x = b[i];
                b[i] = b[i + 1];
                b[i + 1] = x;
                if (i != 0)
                    i -= 2;
            }
        }
    }
    for (i = 0; i < n - 1; i++)
    {
        if (c[i] < c[i + 1])
        {
            x = c[i];
            c[i] = c[i + 1];
            c[i + 1] = x;
            x = d[i];
            d[i] = d[i + 1];
            d[i + 1] = x;
            if (i != 0)
                i -= 2;
            continue;
        }
        if (c[i] == c[i + 1])
        {
            if (d[i] < d[i + 1])
            {
                x = c[i];
                c[i] = c[i + 1];
                c[i + 1] = x;
                x = d[i];
                d[i] = d[i + 1];
                d[i + 1] = x;
                if (i != 0)
                    i -= 2;
            }
        }
    }
    int j;
    int y;
    d[103] = 9999;
    for (i = 0; i < n; i++)
    {
        y = 103;
        for (j = 0; j < n; j++)
        {
            if (a[i] < c[j] && b[i] < d[j])
            {
                if (d[y] > d[j])
                    y = j;
            }
        }
        if (y != 103)
        {
            ans++;
            c[y] = d[y] = 0;
        }
    }
    printf("%d\n", ans);
    return 0;
}
2
2 2
3 5
0 0
1 1
 5
0 0
7 3
2 2
4 8
1 6
8 5
6 9
5 4
9 1
2 7
 5
0 0
1 1
5 5
6 6
7 11
2 2
3 3
4 4
8 8
9 9
 3
0 0
1 1
10 2
2 3
3 4
4 5
 5
0 0
4 1
5 5
6 6
13 11
2 2
3 3
2 4
8 8
9 16
 2
0 0
6 -1
0 0
1 1
 2
2 2
3 0
0 0
1 1
 5
-1 0
7 3
2 2
4 8
1 6
8 5
6 9
5 4
9 1
2 7
 5
0 0
1 1
5 5
6 6
7 11
2 2
3 3
2 4
8 8
9 9
 3
0 0
1 1
10 2
2 0
3 4
4 5

0
 5
 4
 2
 3
 1
 0
 5
 4
 2

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>
int main()
{
    int n;
    scanf("%d", &n);
    int a[100], b[100], c[100], d[105];
    int i;
    for (i = 0; i < n; i++)
        scanf("%d %d", &a[i], &b[i]);
    for (i = 0; i < n; i++)
        scanf("%d %d", &c[i], &d[i]);
    int ans = 0;
    int x;
    for (i = 0; i < n - 1; i++)
    {
        if (a[i] < a[i + 1])
        {
            x = a[i];
            a[i] = a[i + 1];
            a[i + 1] = x;
            x = b[i];
            b[i] = b[i + 1];
            b[i + 1] = x;
            if (i != 0)
                i -= 2;
        }
        if (a[i] == a[i + 1])
        {
            if (b[i] < b[i + 1])
            {
                x = a[i];
                a[i] = a[i + 1];
                a[i + 1] = x;
                x = b[i];
                b[i] = b[i + 1];
                b[i + 1] = x;
                if (i != 0)
                    i -= 2;
            }
        }
    }
    for (i = 0; i < n - 1; i++)
    {
        if (c[i] < c[i + 1])
        {
            x = c[i];
            c[i] = c[i + 1];
            c[i + 1] = x;
            x = d[i];
            d[i] = d[i + 1];
            d[i + 1] = x;
            if (i != 0)
                i -= 2;
            continue;
        }
        if (c[i] == c[i + 1])
        {
            if (d[i] < d[i + 1])
            {
                x = c[i];
                c[i] = c[i + 1];
                c[i + 1] = x;
                x = d[i];
                d[i] = d[i + 1];
                d[i + 1] = x;
                if (i != 0)
                    i -= 2;
            }
        }
    }
    int j;
    int y;
    d[103] = 9999;
    for (i = 0; i < n; i++)
    {
        y = 103;
        for (j = 0; j < n; j++)
        {
            if (a[i] < c[j] && b[i] < d[j])
            {
                if (d[y] > d[j])
                    y = j;
            }
        }
        if (y != 103)
        {
            ans++;
            c[y] = d[y] = 0;
        }
    }
    printf("%d\n", ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.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	$1664, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1656(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1652(%rbp)
	jmp	.L2
.L3:
	leaq	-1232(%rbp), %rdx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1632(%rbp), %rcx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1652(%rbp)
.L2:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L3
	movl	$0, -1652(%rbp)
	jmp	.L4
.L5:
	leaq	-432(%rbp), %rdx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-832(%rbp), %rcx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1652(%rbp)
.L4:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L5
	movl	$0, -1648(%rbp)
	movl	$0, -1652(%rbp)
	jmp	.L6
.L9:
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1232(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1232(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L7
	subl	$2, -1652(%rbp)
.L7:
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L8
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1232(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L8
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1232(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1232(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L8
	subl	$2, -1652(%rbp)
.L8:
	addl	$1, -1652(%rbp)
.L6:
	movl	-1656(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L9
	movl	$0, -1652(%rbp)
	jmp	.L10
.L14:
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -432(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -432(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L23
	subl	$2, -1652(%rbp)
	jmp	.L23
.L11:
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	-1652(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -432(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -432(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L13
	subl	$2, -1652(%rbp)
	jmp	.L13
.L23:
	nop
.L13:
	addl	$1, -1652(%rbp)
.L10:
	movl	-1656(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L14
	movl	$9999, -20(%rbp)
	movl	$0, -1652(%rbp)
	jmp	.L15
.L20:
	movl	$103, -1640(%rbp)
	movl	$0, -1644(%rbp)
	jmp	.L16
.L18:
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1644(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1644(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-1640(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1644(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	-1644(%rbp), %eax
	movl	%eax, -1640(%rbp)
.L17:
	addl	$1, -1644(%rbp)
.L16:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1644(%rbp)
	jl	.L18
	cmpl	$103, -1640(%rbp)
	je	.L19
	addl	$1, -1648(%rbp)
	movl	-1640(%rbp), %eax
	cltq
	movl	$0, -432(%rbp,%rax,4)
	movl	-1640(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1640(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
.L19:
	addl	$1, -1652(%rbp)
.L15:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L20
	movl	-1648(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.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	$1664, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1656(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1652(%rbp)
	jmp	.L2
.L3:
	leaq	-1232(%rbp), %rdx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1632(%rbp), %rcx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1652(%rbp)
.L2:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L3
	movl	$0, -1652(%rbp)
	jmp	.L4
.L5:
	leaq	-432(%rbp), %rdx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-832(%rbp), %rcx
	movl	-1652(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1652(%rbp)
.L4:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L5
	movl	$0, -1648(%rbp)
	movl	$0, -1652(%rbp)
	jmp	.L6
.L9:
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1232(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1232(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L7
	subl	$2, -1652(%rbp)
.L7:
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L8
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1232(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L8
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1632(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -1232(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -1232(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L8
	subl	$2, -1652(%rbp)
.L8:
	addl	$1, -1652(%rbp)
.L6:
	movl	-1656(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L9
	movl	$0, -1652(%rbp)
	jmp	.L10
.L14:
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L11
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -432(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -432(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L23
	subl	$2, -1652(%rbp)
	jmp	.L23
.L11:
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L13
	movl	-1652(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L13
	movl	-1652(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-832(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -832(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	movl	%eax, -1636(%rbp)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1652(%rbp), %eax
	cltq
	movl	%edx, -432(%rbp,%rax,4)
	movl	-1652(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-1636(%rbp), %edx
	movl	%edx, -432(%rbp,%rax,4)
	cmpl	$0, -1652(%rbp)
	je	.L13
	subl	$2, -1652(%rbp)
	jmp	.L13
.L23:
	nop
.L13:
	addl	$1, -1652(%rbp)
.L10:
	movl	-1656(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L14
	movl	$9999, -20(%rbp)
	movl	$0, -1652(%rbp)
	jmp	.L15
.L20:
	movl	$103, -1640(%rbp)
	movl	$0, -1644(%rbp)
	jmp	.L16
.L18:
	movl	-1652(%rbp), %eax
	cltq
	movl	-1632(%rbp,%rax,4), %edx
	movl	-1644(%rbp), %eax
	cltq
	movl	-832(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-1652(%rbp), %eax
	cltq
	movl	-1232(%rbp,%rax,4), %edx
	movl	-1644(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-1640(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1644(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jle	.L17
	movl	-1644(%rbp), %eax
	movl	%eax, -1640(%rbp)
.L17:
	addl	$1, -1644(%rbp)
.L16:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1644(%rbp)
	jl	.L18
	cmpl	$103, -1640(%rbp)
	je	.L19
	addl	$1, -1648(%rbp)
	movl	-1640(%rbp), %eax
	cltq
	movl	$0, -432(%rbp,%rax,4)
	movl	-1640(%rbp), %eax
	cltq
	movl	-432(%rbp,%rax,4), %edx
	movl	-1640(%rbp), %eax
	cltq
	movl	%edx, -832(%rbp,%rax,4)
.L19:
	addl	$1, -1652(%rbp)
.L15:
	movl	-1656(%rbp), %eax
	cmpl	%eax, -1652(%rbp)
	jl	.L20
	movl	-1648(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
