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 p[100005], y[100005];
int h[100005], l;
int comp_h(int a, int b)
{
	if (p[h[a]] > p[h[b]])
		return 1;
	if (p[h[a]] < p[h[b]])
		return -1;
	if (y[h[a]] > y[h[b]])
		return 1;
	else
		return -1;
}
void swap_h(int a, int b)
{
	int f = h[a];
	h[a] = h[b];
	h[b] = f;
	return;
}
void f1(int n)
{
	h[l] = n;
	int p = l;
	l++;
	while (p > 0)
	{
		if (comp_h((p - 1) / 2, p) > 0)
			swap_h((p - 1) / 2, p);
		p = (p - 1) / 2;
	}
	return;
}
int f2()
{
	l--;
	swap_h(0, l);
	int p = 0;
	for (;;)
	{
		if (2 * p + 2 < l)
		{
			if (comp_h(2 * p + 1, 2 * p + 2) > 0)
			{
				if (comp_h(p, 2 * p + 2) > 0)
					swap_h(p, 2 * p + 2);
				p = 2 * p + 2;
			}
			else
			{
				if (comp_h(p, 2 * p + 1) > 0)
					swap_h(p, 2 * p + 1);
				p = 2 * p + 1;
			}
		}
		else if (2 * p + 1 < l)
		{
			if (comp_h(p, 2 * p + 1) > 0)
				swap_h(p, 2 * p + 1);
			p = 2 * p + 1;
		}
		else
			break;
	}
	return h[l];
}
int main()
{
	int n, m;
	scanf("%d %d", &n, &m);
	int i;
	for (i = 0; i < m; i++)
		scanf("%d %d", &p[i], &y[i]);
	l = 0;
	for (i = 0; i < m; i++)
		f1(i);
	int c[100005];
	for (i = 0; i < m; i++)
		c[i] = f2();
	int x[100005];
	x[c[0]] = 1;
	for (i = 1; i < m; i++)
	{
		if (p[c[i - 1]] != p[c[i]])
			x[c[i]] = 1;
		else
			x[c[i]] = x[c[i - 1]] + 1;
	}
	for (i = 0; i < m; i++)
		printf("%06d%06d\n", p[i], x[i]);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 400020
p:
	.zero	400020
	.globl	y
	.align 32
	.type	y, @object
	.size	y, 400020
y:
	.zero	400020
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 400020
h:
	.zero	400020
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.text
	.globl	comp_h
	.type	comp_h, @function
comp_h:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	y(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	$1, %eax
	jmp	.L3
.L5:
	movl	$-1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	comp_h, .-comp_h
	.globl	swap_h
	.type	swap_h, @function
swap_h:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	swap_h, .-swap_h
	.globl	f1
	.type	f1, @function
f1:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	l(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
	jmp	.L9
.L11:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L10
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	swap_h
.L10:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
.L9:
	cmpl	$0, -4(%rbp)
	jg	.L11
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	f1, .-f1
	.globl	f2
	.type	f2, @function
f2:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	l(%rip), %eax
	subl	$1, %eax
	movl	%eax, l(%rip)
	movl	l(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	swap_h
	movl	$0, -4(%rbp)
.L22:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L15
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L16
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	swap_h
.L16:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	addl	%eax, %eax
	movl	%eax, -4(%rbp)
	jmp	.L22
.L15:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L18
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	swap_h
.L18:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L22
.L14:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	jge	.L24
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L20
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	swap_h
.L20:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L22
.L24:
	nop
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	f2, .-f2
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%06d%06d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1360, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800072(%rbp), %rdx
	leaq	-800076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800068(%rbp)
	jmp	.L26
.L27:
	movl	-800068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	addq	%rax, %rdx
	movl	-800068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800068(%rbp)
.L26:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L27
	movl	$0, l(%rip)
	movl	$0, -800068(%rbp)
	jmp	.L28
.L29:
	movl	-800068(%rbp), %eax
	movl	%eax, %edi
	call	f1
	addl	$1, -800068(%rbp)
.L28:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L29
	movl	$0, -800068(%rbp)
	jmp	.L30
.L31:
	movl	$0, %eax
	call	f2
	movl	-800068(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -800064(%rbp,%rdx,4)
	addl	$1, -800068(%rbp)
.L30:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L31
	movl	-800064(%rbp), %eax
	cltq
	movl	$1, -400032(%rbp,%rax,4)
	movl	$1, -800068(%rbp)
	jmp	.L32
.L35:
	movl	-800068(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L33
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	movl	$1, -400032(%rbp,%rax,4)
	jmp	.L34
.L33:
	movl	-800068(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %edx
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	addl	$1, %edx
	cltq
	movl	%edx, -400032(%rbp,%rax,4)
.L34:
	addl	$1, -800068(%rbp)
.L32:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L35
	movl	$0, -800068(%rbp)
	jmp	.L36
.L37:
	movl	-800068(%rbp), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %edx
	movl	-800068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800068(%rbp)
.L36:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L37
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.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	comp_h
	.type	comp_h, @function
comp_h:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	h(%rip), %rax
	movslq	%esi, %rsi
	movslq	%edi, %rdi
	movslq	(%rax,%rsi,4), %rcx
	movslq	(%rax,%rdi,4), %rdi
	leaq	p(%rip), %rdx
	movl	$1, %eax
	movl	(%rdx,%rcx,4), %esi
	cmpl	%esi, (%rdx,%rdi,4)
	jg	.L1
	movl	$-1, %eax
	jl	.L1
	leaq	y(%rip), %rax
	movl	(%rax,%rcx,4), %ecx
	cmpl	%ecx, (%rax,%rdi,4)
	setg	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	comp_h, .-comp_h
	.p2align 4
	.globl	swap_h
	.type	swap_h, @function
swap_h:
.LFB24:
	.cfi_startproc
	endbr64
	leaq	h(%rip), %rax
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	movl	(%rax,%rdi,4), %edx
	movl	(%rax,%rsi,4), %ecx
	movl	%ecx, (%rax,%rdi,4)
	movl	%edx, (%rax,%rsi,4)
	ret
	.cfi_endproc
.LFE24:
	.size	swap_h, .-swap_h
	.p2align 4
	.globl	f1
	.type	f1, @function
f1:
.LFB25:
	.cfi_startproc
	endbr64
	movslq	l(%rip), %rax
	leaq	h(%rip), %rsi
	movl	%edi, (%rsi,%rax,4)
	movq	%rax, %rdx
	addl	$1, %eax
	movl	%eax, l(%rip)
	testl	%edx, %edx
	jle	.L17
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	p(%rip), %r11
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	y(%rip), %rbx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%rsi,%rcx,4), %edi
	movslq	%eax, %rdx
.L12:
	leal	-1(%rdx), %eax
	movslq	%edi, %r9
	sarl	%eax
	movl	(%r11,%r9,4), %r14d
	movslq	%eax, %rcx
	movslq	(%rsi,%rcx,4), %r10
	movq	%r10, %r8
	cmpl	%r14d, (%r11,%r10,4)
	jg	.L10
	jl	.L11
	movl	(%rbx,%r9,4), %r14d
	cmpl	%r14d, (%rbx,%r10,4)
	jle	.L11
.L10:
	movl	%edi, (%rsi,%rcx,4)
	movl	%r8d, (%rsi,%rdx,4)
.L11:
	testl	%eax, %eax
	jne	.L20
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore 3
	.cfi_restore 14
	ret
	.cfi_endproc
.LFE25:
	.size	f1, .-f1
	.p2align 4
	.globl	f2
	.type	f2, @function
f2:
.LFB26:
	.cfi_startproc
	endbr64
	movl	l(%rip), %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	h(%rip), %rcx
	leaq	y(%rip), %r11
	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
	leal	-1(%rax), %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%r12d, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	(%rcx,%rdi,4), %edx
	movl	%r12d, l(%rip)
	movl	%eax, -12(%rsp)
	movl	h(%rip), %eax
	movq	%rdi, -8(%rsp)
	movl	%edx, h(%rip)
	movl	%r12d, -16(%rsp)
	movl	%eax, (%rcx,%rdi,4)
	xorl	%eax, %eax
	leaq	p(%rip), %rdi
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L34:
	movslq	%esi, %r8
	movslq	%edx, %r13
	movslq	(%rcx,%r8,4), %r10
	movslq	(%rcx,%r13,4), %r9
	movl	(%rdi,%r10,4), %ebp
	movl	(%rdi,%r9,4), %ebx
	movq	%r10, %r15
	movq	%r9, %r14
	cmpl	%ebx, %ebp
	jg	.L24
	jl	.L25
	movl	(%r11,%r9,4), %r12d
	cmpl	%r12d, (%r11,%r10,4)
	jg	.L24
.L25:
	movslq	(%rcx,%rax,4), %r9
	movq	%r9, %rdx
	cmpl	(%rdi,%r9,4), %ebp
	jl	.L28
	jg	.L27
	movl	(%r11,%r10,4), %ebx
	cmpl	%ebx, (%r11,%r9,4)
	jle	.L27
.L28:
	movl	%r15d, (%rcx,%rax,4)
	movl	%edx, (%rcx,%r8,4)
	.p2align 4,,10
	.p2align 3
.L27:
	movslq	%esi, %rax
.L22:
	leal	2(%rax,%rax), %edx
	leal	-1(%rdx), %esi
	cmpl	%edx, -16(%rsp)
	jg	.L34
	cmpl	%edx, -12(%rsp)
	jle	.L29
	movslq	%esi, %r8
	movslq	(%rcx,%rax,4), %rbx
	movslq	(%rcx,%r8,4), %r10
	movq	%rbx, %rdx
	movl	(%rdi,%r10,4), %r15d
	movq	%r10, %r9
	cmpl	%r15d, (%rdi,%rbx,4)
	jg	.L30
	jl	.L27
	movl	(%r11,%r10,4), %r14d
	cmpl	%r14d, (%r11,%rbx,4)
	jle	.L27
.L30:
	movl	%r9d, (%rcx,%rax,4)
	movl	%edx, (%rcx,%r8,4)
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	(%rcx,%rax,4), %r10
	movq	%r10, %r8
	cmpl	(%rdi,%r10,4), %ebx
	jl	.L26
	movl	%edx, %esi
	jg	.L27
	movl	(%r11,%r9,4), %ebx
	cmpl	%ebx, (%r11,%r10,4)
	jle	.L27
.L26:
	movl	%r14d, (%rcx,%rax,4)
	movl	%edx, %esi
	movl	%r8d, (%rcx,%r13,4)
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L29:
	movq	-8(%rsp), %rax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	movl	(%rcx,%rax,4), %eax
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE26:
	.size	f2, .-f2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%06d%06d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.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
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1368, %rsp
	.cfi_def_cfa_offset 800144
	leaq	.LC0(%rip), %r15
	movq	%r15, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800072(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L36
	leaq	p(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	y(%rip), %rbp
	movq	%rbx, %r14
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	0(%rbp,%r12,4), %rdx
	movq	%r14, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r13d
	addq	$1, %r12
	addq	$4, %r14
	cmpl	%r12d, %r13d
	jg	.L37
	movl	$0, l(%rip)
	testl	%r13d, %r13d
	jle	.L68
	movslq	%r13d, %r12
	movl	$1, %r11d
	movl	$0, h(%rip)
	leaq	h(%rip), %rsi
	movl	$1, l(%rip)
	cmpl	$1, %r13d
	je	.L39
	.p2align 4,,10
	.p2align 3
.L45:
	movl	%r11d, (%rsi,%r11,4)
	movslq	%r11d, %rdx
	movl	%r11d, %r8d
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L69:
	movl	(%rsi,%rcx,4), %r8d
	movslq	%eax, %rdx
.L44:
	leal	-1(%rdx), %eax
	movslq	%r8d, %r9
	sarl	%eax
	movl	(%rbx,%r9,4), %r15d
	movslq	%eax, %rcx
	movslq	(%rsi,%rcx,4), %r10
	movq	%r10, %rdi
	cmpl	%r15d, (%rbx,%r10,4)
	jg	.L41
	jl	.L42
	movl	0(%rbp,%r9,4), %r14d
	cmpl	%r14d, 0(%rbp,%r10,4)
	jle	.L42
.L41:
	movl	%r8d, (%rsi,%rcx,4)
	movl	%edi, (%rsi,%rdx,4)
.L42:
	testl	%eax, %eax
	jne	.L69
	addq	$1, %r11
	cmpq	%r12, %r11
	jne	.L45
	movl	%r13d, l(%rip)
.L39:
	xorl	%ebp, %ebp
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L46:
	xorl	%eax, %eax
	call	f2
	movl	12(%rsp), %edx
	movl	%eax, (%r12,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %edx
	jg	.L46
	movslq	16(%rsp), %rsi
	movl	$1, 400048(%rsp,%rsi,4)
	cmpl	$1, %edx
	jle	.L70
.L47:
	subl	$2, %edx
	leaq	20(%rsp), %rax
	leaq	24(%rsp,%rdx,4), %rdi
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L50:
	movl	$1, 400048(%rsp,%rdx,4)
	addq	$4, %rax
	cmpq	%rax, %rdi
	je	.L48
.L51:
	movslq	%ecx, %rsi
.L53:
	movslq	(%rax), %rdx
	movl	(%rbx,%rdx,4), %r11d
	movq	%rdx, %rcx
	cmpl	%r11d, (%rbx,%rsi,4)
	jne	.L50
	movl	400048(%rsp,%rsi,4), %esi
	addq	$4, %rax
	addl	$1, %esi
	movl	%esi, 400048(%rsp,%rdx,4)
	cmpq	%rax, %rdi
	jne	.L51
.L48:
	xorl	%ebp, %ebp
	leaq	400048(%rsp), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L54:
	movl	0(%r13,%rbp,4), %ecx
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L54
.L49:
	movq	800072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L71
	addq	$800088, %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
.L68:
	.cfi_restore_state
	jg	.L39
	jmp	.L49
.L36:
	movslq	16(%rsp), %rsi
	movl	12(%rsp), %edx
	movl	$0, l(%rip)
	leaq	p(%rip), %rbx
	movl	$1, 400048(%rsp,%rsi,4)
	cmpl	$1, %edx
	jg	.L47
	jmp	.L49
.L70:
	jne	.L49
	jmp	.L48
.L71:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE27:
	.size	main, .-main
	.globl	l
	.bss
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 400020
h:
	.zero	400020
	.globl	y
	.align 32
	.type	y, @object
	.size	y, 400020
y:
	.zero	400020
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 400020
p:
	.zero	400020
	.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	comp_h
	.type	comp_h, @function
comp_h:
.LFB23:
	.cfi_startproc
	endbr64
	leaq	h(%rip), %rax
	movslq	%esi, %rsi
	movslq	%edi, %rdi
	movslq	(%rax,%rsi,4), %rcx
	movslq	(%rax,%rdi,4), %rdi
	leaq	p(%rip), %rdx
	movl	$1, %eax
	movl	(%rdx,%rcx,4), %esi
	cmpl	%esi, (%rdx,%rdi,4)
	jg	.L1
	movl	$-1, %eax
	jl	.L1
	leaq	y(%rip), %rax
	movl	(%rax,%rcx,4), %ecx
	cmpl	%ecx, (%rax,%rdi,4)
	setg	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	comp_h, .-comp_h
	.p2align 4
	.globl	swap_h
	.type	swap_h, @function
swap_h:
.LFB24:
	.cfi_startproc
	endbr64
	leaq	h(%rip), %rax
	movslq	%edi, %rdi
	movslq	%esi, %rsi
	movl	(%rax,%rdi,4), %edx
	movl	(%rax,%rsi,4), %ecx
	movl	%ecx, (%rax,%rdi,4)
	movl	%edx, (%rax,%rsi,4)
	ret
	.cfi_endproc
.LFE24:
	.size	swap_h, .-swap_h
	.p2align 4
	.globl	f1
	.type	f1, @function
f1:
.LFB25:
	.cfi_startproc
	endbr64
	movslq	l(%rip), %rax
	leaq	h(%rip), %rsi
	movl	%edi, (%rsi,%rax,4)
	movq	%rax, %rdx
	addl	$1, %eax
	movl	%eax, l(%rip)
	testl	%edx, %edx
	jle	.L17
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	p(%rip), %r11
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	y(%rip), %rbx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%rsi,%rcx,4), %edi
	movslq	%eax, %rdx
.L12:
	leal	-1(%rdx), %eax
	movslq	%edi, %r9
	sarl	%eax
	movl	(%r11,%r9,4), %r14d
	movslq	%eax, %rcx
	movslq	(%rsi,%rcx,4), %r10
	movq	%r10, %r8
	cmpl	%r14d, (%r11,%r10,4)
	jg	.L10
	jl	.L11
	movl	(%rbx,%r9,4), %r14d
	cmpl	%r14d, (%rbx,%r10,4)
	jle	.L11
.L10:
	movl	%edi, (%rsi,%rcx,4)
	movl	%r8d, (%rsi,%rdx,4)
.L11:
	testl	%eax, %eax
	jne	.L20
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	.cfi_restore 3
	.cfi_restore 14
	ret
	.cfi_endproc
.LFE25:
	.size	f1, .-f1
	.p2align 4
	.globl	f2
	.type	f2, @function
f2:
.LFB26:
	.cfi_startproc
	endbr64
	movl	l(%rip), %eax
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	h(%rip), %rcx
	leaq	y(%rip), %r11
	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
	leal	-1(%rax), %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movslq	%r12d, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	(%rcx,%rdi,4), %edx
	movl	%r12d, l(%rip)
	movl	%eax, -12(%rsp)
	movl	h(%rip), %eax
	movq	%rdi, -8(%rsp)
	movl	%edx, h(%rip)
	movl	%r12d, -16(%rsp)
	movl	%eax, (%rcx,%rdi,4)
	xorl	%eax, %eax
	leaq	p(%rip), %rdi
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L34:
	movslq	%esi, %r8
	movslq	%edx, %r13
	movslq	(%rcx,%r8,4), %r10
	movslq	(%rcx,%r13,4), %r9
	movl	(%rdi,%r10,4), %ebp
	movl	(%rdi,%r9,4), %ebx
	movq	%r10, %r15
	movq	%r9, %r14
	cmpl	%ebx, %ebp
	jg	.L24
	jl	.L25
	movl	(%r11,%r9,4), %r12d
	cmpl	%r12d, (%r11,%r10,4)
	jg	.L24
.L25:
	movslq	(%rcx,%rax,4), %r9
	movq	%r9, %rdx
	cmpl	(%rdi,%r9,4), %ebp
	jl	.L28
	jg	.L27
	movl	(%r11,%r10,4), %ebx
	cmpl	%ebx, (%r11,%r9,4)
	jle	.L27
.L28:
	movl	%r15d, (%rcx,%rax,4)
	movl	%edx, (%rcx,%r8,4)
	.p2align 4,,10
	.p2align 3
.L27:
	movslq	%esi, %rax
.L22:
	leal	2(%rax,%rax), %edx
	leal	-1(%rdx), %esi
	cmpl	%edx, -16(%rsp)
	jg	.L34
	cmpl	%edx, -12(%rsp)
	jle	.L29
	movslq	%esi, %r8
	movslq	(%rcx,%rax,4), %rbx
	movslq	(%rcx,%r8,4), %r10
	movq	%rbx, %rdx
	movl	(%rdi,%r10,4), %r15d
	movq	%r10, %r9
	cmpl	%r15d, (%rdi,%rbx,4)
	jg	.L30
	jl	.L27
	movl	(%r11,%r10,4), %r14d
	cmpl	%r14d, (%r11,%rbx,4)
	jle	.L27
.L30:
	movl	%r9d, (%rcx,%rax,4)
	movl	%edx, (%rcx,%r8,4)
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L24:
	movslq	(%rcx,%rax,4), %r10
	movq	%r10, %r8
	cmpl	(%rdi,%r10,4), %ebx
	jl	.L26
	movl	%edx, %esi
	jg	.L27
	movl	(%r11,%r9,4), %ebx
	cmpl	%ebx, (%r11,%r10,4)
	jle	.L27
.L26:
	movl	%r14d, (%rcx,%rax,4)
	movl	%edx, %esi
	movl	%r8d, (%rcx,%r13,4)
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L29:
	movq	-8(%rsp), %rax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	movl	(%rcx,%rax,4), %eax
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE26:
	.size	f2, .-f2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%06d%06d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB27:
	.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
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1368, %rsp
	.cfi_def_cfa_offset 800144
	leaq	.LC0(%rip), %r15
	movq	%r15, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800072(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L36
	leaq	p(%rip), %rbx
	xorl	%r12d, %r12d
	leaq	y(%rip), %rbp
	movq	%rbx, %r14
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	0(%rbp,%r12,4), %rdx
	movq	%r14, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r13d
	addq	$1, %r12
	addq	$4, %r14
	cmpl	%r12d, %r13d
	jg	.L37
	movl	$0, l(%rip)
	testl	%r13d, %r13d
	jle	.L68
	movslq	%r13d, %r12
	movl	$1, %r11d
	movl	$0, h(%rip)
	leaq	h(%rip), %rsi
	movl	$1, l(%rip)
	cmpl	$1, %r13d
	je	.L39
	.p2align 4,,10
	.p2align 3
.L45:
	movl	%r11d, (%rsi,%r11,4)
	movslq	%r11d, %rdx
	movl	%r11d, %r8d
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L69:
	movl	(%rsi,%rcx,4), %r8d
	movslq	%eax, %rdx
.L44:
	leal	-1(%rdx), %eax
	movslq	%r8d, %r9
	sarl	%eax
	movl	(%rbx,%r9,4), %r15d
	movslq	%eax, %rcx
	movslq	(%rsi,%rcx,4), %r10
	movq	%r10, %rdi
	cmpl	%r15d, (%rbx,%r10,4)
	jg	.L41
	jl	.L42
	movl	0(%rbp,%r9,4), %r14d
	cmpl	%r14d, 0(%rbp,%r10,4)
	jle	.L42
.L41:
	movl	%r8d, (%rsi,%rcx,4)
	movl	%edi, (%rsi,%rdx,4)
.L42:
	testl	%eax, %eax
	jne	.L69
	addq	$1, %r11
	cmpq	%r12, %r11
	jne	.L45
	movl	%r13d, l(%rip)
.L39:
	xorl	%ebp, %ebp
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L46:
	xorl	%eax, %eax
	call	f2
	movl	12(%rsp), %edx
	movl	%eax, (%r12,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %edx
	jg	.L46
	movslq	16(%rsp), %rsi
	movl	$1, 400048(%rsp,%rsi,4)
	cmpl	$1, %edx
	jle	.L70
.L47:
	subl	$2, %edx
	leaq	20(%rsp), %rax
	leaq	24(%rsp,%rdx,4), %rdi
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L50:
	movl	$1, 400048(%rsp,%rdx,4)
	addq	$4, %rax
	cmpq	%rax, %rdi
	je	.L48
.L51:
	movslq	%ecx, %rsi
.L53:
	movslq	(%rax), %rdx
	movl	(%rbx,%rdx,4), %r11d
	movq	%rdx, %rcx
	cmpl	%r11d, (%rbx,%rsi,4)
	jne	.L50
	movl	400048(%rsp,%rsi,4), %esi
	addq	$4, %rax
	addl	$1, %esi
	movl	%esi, 400048(%rsp,%rdx,4)
	cmpq	%rax, %rdi
	jne	.L51
.L48:
	xorl	%ebp, %ebp
	leaq	400048(%rsp), %r13
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L54:
	movl	0(%r13,%rbp,4), %ecx
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L54
.L49:
	movq	800072(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L71
	addq	$800088, %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
.L68:
	.cfi_restore_state
	jg	.L39
	jmp	.L49
.L36:
	movslq	16(%rsp), %rsi
	movl	12(%rsp), %edx
	movl	$0, l(%rip)
	leaq	p(%rip), %rbx
	movl	$1, 400048(%rsp,%rsi,4)
	cmpl	$1, %edx
	jg	.L47
	jmp	.L49
.L70:
	jne	.L49
	jmp	.L48
.L71:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE27:
	.size	main, .-main
	.globl	l
	.bss
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 400020
h:
	.zero	400020
	.globl	y
	.align 32
	.type	y, @object
	.size	y, 400020
y:
	.zero	400020
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 400020
p:
	.zero	400020
	.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 p[100005], y[100005];
int h[100005], l;
int comp_h(int a, int b)
{
	if (p[h[a]] > p[h[b]])
		return 1;
	if (p[h[a]] < p[h[b]])
		return -1;
	if (y[h[a]] > y[h[b]])
		return 1;
	else
		return -1;
}
void swap_h(int a, int b)
{
	int f = h[a];
	h[a] = h[b];
	h[b] = f;
	return;
}
void f1(int n)
{
	h[l] = n;
	int p = l;
	l++;
	while (p > 0)
	{
		if (comp_h((p - 1) / 2, p) > 0)
			swap_h((p - 1) / 2, p);
		p = (p - 1) / 2;
	}
	return;
}
int f2()
{
	l--;
	swap_h(0, l);
	int p = 0;
	for (;;)
	{
		if (2 * p + 2 < l)
		{
			if (comp_h(2 * p + 1, 2 * p + 2) > 0)
			{
				if (comp_h(p, 2 * p + 2) > 0)
					swap_h(p, 2 * p + 2);
				p = 2 * p + 2;
			}
			else
			{
				if (comp_h(p, 2 * p + 1) > 0)
					swap_h(p, 2 * p + 1);
				p = 2 * p + 1;
			}
		}
		else if (2 * p + 1 < l)
		{
			if (comp_h(p, 2 * p + 1) > 0)
				swap_h(p, 2 * p + 1);
			p = 2 * p + 1;
		}
		else
			break;
	}
	return h[l];
}
int main()
{
	int n, m;
	scanf("%d %d", &n, &m);
	int i;
	for (i = 0; i < m; i++)
		scanf("%d %d", &p[i], &y[i]);
	l = 0;
	for (i = 0; i < m; i++)
		f1(i);
	int c[100005];
	for (i = 0; i < m; i++)
		c[i] = f2();
	int x[100005];
	x[c[0]] = 1;
	for (i = 1; i < m; i++)
	{
		if (p[c[i - 1]] != p[c[i]])
			x[c[i]] = 1;
		else
			x[c[i]] = x[c[i - 1]] + 1;
	}
	for (i = 0; i < m; i++)
		printf("%06d%06d\n", p[i], x[i]);
	return 0;
}
2 3
1 55
2 77
2 99
 2 3
2 32
2 63
1 12
 2 1
2 55
2 77
2 99
 2 2
2 55
2 77
2 99
 2 3
2 55
2 77
2 195
 2 3
1 32
2 63
1 6
 2 3
2 39
2 16
1 12
 2 2
2 55
2 29
2 195
 2 3
2 96
2 77
2 195
 2 1
1 16
2 77
2 195

000001000001
000002000001
000002000002
 000002000001
000002000002
000001000001
 000002000001
 000002000001
000002000002
 000002000001
000002000002
000002000003
 000001000002
000002000001
000001000001
 000002000002
000002000001
000001000001
 000002000002
000002000001
 000002000002
000002000001
000002000003
 000001000001

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 p[100005], y[100005];
int h[100005], l;
int comp_h(int a, int b)
{
	if (p[h[a]] > p[h[b]])
		return 1;
	if (p[h[a]] < p[h[b]])
		return -1;
	if (y[h[a]] > y[h[b]])
		return 1;
	else
		return -1;
}
void swap_h(int a, int b)
{
	int f = h[a];
	h[a] = h[b];
	h[b] = f;
	return;
}
void f1(int n)
{
	h[l] = n;
	int p = l;
	l++;
	while (p > 0)
	{
		if (comp_h((p - 1) / 2, p) > 0)
			swap_h((p - 1) / 2, p);
		p = (p - 1) / 2;
	}
	return;
}
int f2()
{
	l--;
	swap_h(0, l);
	int p = 0;
	for (;;)
	{
		if (2 * p + 2 < l)
		{
			if (comp_h(2 * p + 1, 2 * p + 2) > 0)
			{
				if (comp_h(p, 2 * p + 2) > 0)
					swap_h(p, 2 * p + 2);
				p = 2 * p + 2;
			}
			else
			{
				if (comp_h(p, 2 * p + 1) > 0)
					swap_h(p, 2 * p + 1);
				p = 2 * p + 1;
			}
		}
		else if (2 * p + 1 < l)
		{
			if (comp_h(p, 2 * p + 1) > 0)
				swap_h(p, 2 * p + 1);
			p = 2 * p + 1;
		}
		else
			break;
	}
	return h[l];
}
int main()
{
	int n, m;
	scanf("%d %d", &n, &m);
	int i;
	for (i = 0; i < m; i++)
		scanf("%d %d", &p[i], &y[i]);
	l = 0;
	for (i = 0; i < m; i++)
		f1(i);
	int c[100005];
	for (i = 0; i < m; i++)
		c[i] = f2();
	int x[100005];
	x[c[0]] = 1;
	for (i = 1; i < m; i++)
	{
		if (p[c[i - 1]] != p[c[i]])
			x[c[i]] = 1;
		else
			x[c[i]] = x[c[i - 1]] + 1;
	}
	for (i = 0; i < m; i++)
		printf("%06d%06d\n", p[i], x[i]);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 400020
p:
	.zero	400020
	.globl	y
	.align 32
	.type	y, @object
	.size	y, 400020
y:
	.zero	400020
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 400020
h:
	.zero	400020
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.text
	.globl	comp_h
	.type	comp_h, @function
comp_h:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	y(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	$1, %eax
	jmp	.L3
.L5:
	movl	$-1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	comp_h, .-comp_h
	.globl	swap_h
	.type	swap_h, @function
swap_h:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	swap_h, .-swap_h
	.globl	f1
	.type	f1, @function
f1:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	l(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
	jmp	.L9
.L11:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L10
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	swap_h
.L10:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
.L9:
	cmpl	$0, -4(%rbp)
	jg	.L11
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	f1, .-f1
	.globl	f2
	.type	f2, @function
f2:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	l(%rip), %eax
	subl	$1, %eax
	movl	%eax, l(%rip)
	movl	l(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	swap_h
	movl	$0, -4(%rbp)
.L22:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L15
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L16
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	swap_h
.L16:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	addl	%eax, %eax
	movl	%eax, -4(%rbp)
	jmp	.L22
.L15:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L18
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	swap_h
.L18:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L22
.L14:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	jge	.L24
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L20
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	swap_h
.L20:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L22
.L24:
	nop
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	f2, .-f2
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%06d%06d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1360, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800072(%rbp), %rdx
	leaq	-800076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800068(%rbp)
	jmp	.L26
.L27:
	movl	-800068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	addq	%rax, %rdx
	movl	-800068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800068(%rbp)
.L26:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L27
	movl	$0, l(%rip)
	movl	$0, -800068(%rbp)
	jmp	.L28
.L29:
	movl	-800068(%rbp), %eax
	movl	%eax, %edi
	call	f1
	addl	$1, -800068(%rbp)
.L28:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L29
	movl	$0, -800068(%rbp)
	jmp	.L30
.L31:
	movl	$0, %eax
	call	f2
	movl	-800068(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -800064(%rbp,%rdx,4)
	addl	$1, -800068(%rbp)
.L30:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L31
	movl	-800064(%rbp), %eax
	cltq
	movl	$1, -400032(%rbp,%rax,4)
	movl	$1, -800068(%rbp)
	jmp	.L32
.L35:
	movl	-800068(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L33
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	movl	$1, -400032(%rbp,%rax,4)
	jmp	.L34
.L33:
	movl	-800068(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %edx
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	addl	$1, %edx
	cltq
	movl	%edx, -400032(%rbp,%rax,4)
.L34:
	addl	$1, -800068(%rbp)
.L32:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L35
	movl	$0, -800068(%rbp)
	jmp	.L36
.L37:
	movl	-800068(%rbp), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %edx
	movl	-800068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800068(%rbp)
.L36:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L37
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.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	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 400020
p:
	.zero	400020
	.globl	y
	.align 32
	.type	y, @object
	.size	y, 400020
y:
	.zero	400020
	.globl	h
	.align 32
	.type	h, @object
	.size	h, 400020
h:
	.zero	400020
	.globl	l
	.align 4
	.type	l, @object
	.size	l, 4
l:
	.zero	4
	.text
	.globl	comp_h
	.type	comp_h, @function
comp_h:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	$-1, %eax
	jmp	.L3
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	y(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L5
	movl	$1, %eax
	jmp	.L3
.L5:
	movl	$-1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	comp_h, .-comp_h
	.globl	swap_h
	.type	swap_h, @function
swap_h:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	h(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	swap_h, .-swap_h
	.globl	f1
	.type	f1, @function
f1:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$24, %rsp
	movl	%edi, -20(%rbp)
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	h(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	l(%rip), %eax
	movl	%eax, -4(%rbp)
	movl	l(%rip), %eax
	addl	$1, %eax
	movl	%eax, l(%rip)
	jmp	.L9
.L11:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L10
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	swap_h
.L10:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -4(%rbp)
.L9:
	cmpl	$0, -4(%rbp)
	jg	.L11
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	f1, .-f1
	.globl	f2
	.type	f2, @function
f2:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	l(%rip), %eax
	subl	$1, %eax
	movl	%eax, l(%rip)
	movl	l(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	swap_h
	movl	$0, -4(%rbp)
.L22:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	jge	.L14
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L15
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L16
	movl	-4(%rbp), %eax
	addl	$1, %eax
	leal	(%rax,%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	swap_h
.L16:
	movl	-4(%rbp), %eax
	addl	$1, %eax
	addl	%eax, %eax
	movl	%eax, -4(%rbp)
	jmp	.L22
.L15:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L18
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	swap_h
.L18:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L22
.L14:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	l(%rip), %eax
	cmpl	%eax, %edx
	jge	.L24
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	comp_h
	testl	%eax, %eax
	jle	.L20
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	leal	1(%rax), %edx
	movl	-4(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	swap_h
.L20:
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L22
.L24:
	nop
	movl	l(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	h(%rip), %rax
	movl	(%rdx,%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	f2, .-f2
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%06d%06d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1360, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800072(%rbp), %rdx
	leaq	-800076(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800068(%rbp)
	jmp	.L26
.L27:
	movl	-800068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	addq	%rax, %rdx
	movl	-800068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -800068(%rbp)
.L26:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L27
	movl	$0, l(%rip)
	movl	$0, -800068(%rbp)
	jmp	.L28
.L29:
	movl	-800068(%rbp), %eax
	movl	%eax, %edi
	call	f1
	addl	$1, -800068(%rbp)
.L28:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L29
	movl	$0, -800068(%rbp)
	jmp	.L30
.L31:
	movl	$0, %eax
	call	f2
	movl	-800068(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -800064(%rbp,%rdx,4)
	addl	$1, -800068(%rbp)
.L30:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L31
	movl	-800064(%rbp), %eax
	cltq
	movl	$1, -400032(%rbp,%rax,4)
	movl	$1, -800068(%rbp)
	jmp	.L32
.L35:
	movl	-800068(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	je	.L33
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	movl	$1, -400032(%rbp,%rax,4)
	jmp	.L34
.L33:
	movl	-800068(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %edx
	movl	-800068(%rbp), %eax
	cltq
	movl	-800064(%rbp,%rax,4), %eax
	addl	$1, %edx
	cltq
	movl	%edx, -400032(%rbp,%rax,4)
.L34:
	addl	$1, -800068(%rbp)
.L32:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L35
	movl	$0, -800068(%rbp)
	jmp	.L36
.L37:
	movl	-800068(%rbp), %eax
	cltq
	movl	-400032(%rbp,%rax,4), %edx
	movl	-800068(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -800068(%rbp)
.L36:
	movl	-800072(%rbp), %eax
	cmpl	%eax, -800068(%rbp)
	jl	.L37
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.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:
