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 <stdlib.h>

int p[100010],y[100010];
int idx[100010];
int cmp(const void*a,const void*b){
	if(p[*(int*)a]<p[*(int*)b])return -1;
	if(p[*(int*)a]>p[*(int*)b])return  1;
	if(y[*(int*)a]<y[*(int*)b])return -1;
	return 1;
}

long long ans[100010];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		scanf("%d%d",p+i,y+i);
		idx[i]=i;
	}
	qsort(idx,m,sizeof(int),cmp);
	int pre=-1,cnt=0;
	for(int i=0;i<m;i++){
		if(pre==p[idx[i]])cnt++;
		else{
			pre=p[idx[i]];
			cnt=1;
		}
		ans[idx[i]]=p[idx[i]]*1000000LL+cnt;
	}
	for(int i=0;i<m;i++)printf("%012lld\n",ans[i]);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 400040
p:
	.zero	400040
	.globl	y
	.align 32
	.type	y, @object
	.size	y, 400040
y:
	.zero	400040
	.globl	idx
	.align 32
	.type	idx, @object
	.size	idx, 400040
idx:
	.zero	400040
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.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), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	y(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	$-1, %eax
	jmp	.L3
.L5:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 800080
ans:
	.zero	800080
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%012lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L7
.L8:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	addq	%rax, %rdx
	movl	-28(%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
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	idx(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L7:
	movl	-32(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L8
	movl	-32(%rbp), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	idx(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$-1, -24(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L9
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L10
	addl	$1, -20(%rbp)
	jmp	.L11
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	$1, -20(%rbp)
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	$1000000, %rax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	addq	%rsi, %rcx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L9:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	$0, -12(%rbp)
	jmp	.L13
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L13:
	movl	-32(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	%rsi, %r8
	movslq	(%rdi), %rsi
	leaq	p(%rip), %rdx
	movl	$-1, %eax
	movslq	(%r8), %rcx
	movl	(%rdx,%rcx,4), %edi
	cmpl	%edi, (%rdx,%rsi,4)
	jl	.L1
	movl	$1, %eax
	jg	.L1
	leaq	y(%rip), %rax
	movl	(%rax,%rcx,4), %ecx
	cmpl	%ecx, (%rax,%rsi,4)
	setge	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%012lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	leaq	idx(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jle	.L8
	xorl	%ebx, %ebx
	leaq	y(%rip), %r13
	leaq	p(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	0(,%rbx,4), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	0(%r13,%rsi), %rdx
	addq	%r14, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movl	%ebx, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L9
.L8:
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	leaq	idx(%rip), %rdx
	leal	-1(%rax), %ecx
	xorl	%edi, %edi
	leaq	4(%rdx), %rax
	leaq	p(%rip), %r14
	leaq	(%rax,%rcx,4), %r8
	leaq	ans(%rip), %rbp
	movq	$-1, %rax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%ecx, %rax
	addq	$4, %rdx
	imulq	$1000000, %rax, %rax
	addq	$1, %rax
	movq	%rax, 0(%rbp,%rsi,8)
	cmpq	%rdx, %r8
	je	.L13
	movl	$1, %edi
.L12:
	movslq	%ecx, %rax
.L14:
	movslq	(%rdx), %rsi
	movl	(%r14,%rsi,4), %ecx
	cmpl	%eax, %ecx
	jne	.L11
	imulq	$1000000, %rax, %rax
	addl	$1, %edi
	addq	$4, %rdx
	movslq	%edi, %r9
	addq	%r9, %rax
	movq	%rax, 0(%rbp,%rsi,8)
	cmpq	%rdx, %r8
	jne	.L12
.L13:
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	0(%rbp,%rbx,8), %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 4(%rsp)
	jg	.L15
.L16:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 800080
ans:
	.zero	800080
	.globl	idx
	.align 32
	.type	idx, @object
	.size	idx, 400040
idx:
	.zero	400040
	.globl	y
	.align 32
	.type	y, @object
	.size	y, 400040
y:
	.zero	400040
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 400040
p:
	.zero	400040
	.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	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	%rsi, %r8
	movslq	(%rdi), %rsi
	leaq	p(%rip), %rdx
	movl	$-1, %eax
	movslq	(%r8), %rcx
	movl	(%rdx,%rcx,4), %edi
	cmpl	%edi, (%rdx,%rsi,4)
	jl	.L1
	movl	$1, %eax
	jg	.L1
	leaq	y(%rip), %rax
	movl	(%rax,%rcx,4), %ecx
	cmpl	%ecx, (%rax,%rsi,4)
	setge	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%012lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	leaq	idx(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	testl	%esi, %esi
	jle	.L8
	xorl	%ebx, %ebx
	leaq	y(%rip), %r13
	leaq	p(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	0(,%rbx,4), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	leaq	0(%r13,%rsi), %rdx
	addq	%r14, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movl	%ebx, 0(%rbp,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L9
.L8:
	leaq	cmp(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	leaq	idx(%rip), %rdx
	leal	-1(%rax), %ecx
	xorl	%edi, %edi
	leaq	4(%rdx), %rax
	leaq	p(%rip), %r14
	leaq	(%rax,%rcx,4), %r8
	leaq	ans(%rip), %rbp
	movq	$-1, %rax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	movslq	%ecx, %rax
	addq	$4, %rdx
	imulq	$1000000, %rax, %rax
	addq	$1, %rax
	movq	%rax, 0(%rbp,%rsi,8)
	cmpq	%rdx, %r8
	je	.L13
	movl	$1, %edi
.L12:
	movslq	%ecx, %rax
.L14:
	movslq	(%rdx), %rsi
	movl	(%r14,%rsi,4), %ecx
	cmpl	%eax, %ecx
	jne	.L11
	imulq	$1000000, %rax, %rax
	addl	$1, %edi
	addq	$4, %rdx
	movslq	%edi, %r9
	addq	%r9, %rax
	movq	%rax, 0(%rbp,%rsi,8)
	cmpq	%rdx, %r8
	jne	.L12
.L13:
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L15:
	movq	0(%rbp,%rbx,8), %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 4(%rsp)
	jg	.L15
.L16:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L23:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 800080
ans:
	.zero	800080
	.globl	idx
	.align 32
	.type	idx, @object
	.size	idx, 400040
idx:
	.zero	400040
	.globl	y
	.align 32
	.type	y, @object
	.size	y, 400040
y:
	.zero	400040
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 400040
p:
	.zero	400040
	.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 <stdlib.h>

int p[100010],y[100010];
int idx[100010];
int cmp(const void*a,const void*b){
	if(p[*(int*)a]<p[*(int*)b])return -1;
	if(p[*(int*)a]>p[*(int*)b])return  1;
	if(y[*(int*)a]<y[*(int*)b])return -1;
	return 1;
}

long long ans[100010];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		scanf("%d%d",p+i,y+i);
		idx[i]=i;
	}
	qsort(idx,m,sizeof(int),cmp);
	int pre=-1,cnt=0;
	for(int i=0;i<m;i++){
		if(pre==p[idx[i]])cnt++;
		else{
			pre=p[idx[i]];
			cnt=1;
		}
		ans[idx[i]]=p[idx[i]]*1000000LL+cnt;
	}
	for(int i=0;i<m;i++)printf("%012lld\n",ans[i]);
}
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>
#include <stdlib.h>

int p[100010],y[100010];
int idx[100010];
int cmp(const void*a,const void*b){
	if(p[*(int*)a]<p[*(int*)b])return -1;
	if(p[*(int*)a]>p[*(int*)b])return  1;
	if(y[*(int*)a]<y[*(int*)b])return -1;
	return 1;
}

long long ans[100010];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		scanf("%d%d",p+i,y+i);
		idx[i]=i;
	}
	qsort(idx,m,sizeof(int),cmp);
	int pre=-1,cnt=0;
	for(int i=0;i<m;i++){
		if(pre==p[idx[i]])cnt++;
		else{
			pre=p[idx[i]];
			cnt=1;
		}
		ans[idx[i]]=p[idx[i]]*1000000LL+cnt;
	}
	for(int i=0;i<m;i++)printf("%012lld\n",ans[i]);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	p
	.bss
	.align 32
	.type	p, @object
	.size	p, 400040
p:
	.zero	400040
	.globl	y
	.align 32
	.type	y, @object
	.size	y, 400040
y:
	.zero	400040
	.globl	idx
	.align 32
	.type	idx, @object
	.size	idx, 400040
idx:
	.zero	400040
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.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), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	y(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	$-1, %eax
	jmp	.L3
.L5:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 800080
ans:
	.zero	800080
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%012lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L7
.L8:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	addq	%rax, %rdx
	movl	-28(%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
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	idx(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L7:
	movl	-32(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L8
	movl	-32(%rbp), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	idx(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$-1, -24(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L9
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L10
	addl	$1, -20(%rbp)
	jmp	.L11
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	$1, -20(%rbp)
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	$1000000, %rax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	addq	%rsi, %rcx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L9:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	$0, -12(%rbp)
	jmp	.L13
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L13:
	movl	-32(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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, 400040
p:
	.zero	400040
	.globl	y
	.align 32
	.type	y, @object
	.size	y, 400040
y:
	.zero	400040
	.globl	idx
	.align 32
	.type	idx, @object
	.size	idx, 400040
idx:
	.zero	400040
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB6:
	.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), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L2
	movl	$-1, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L4
	movl	$1, %eax
	jmp	.L3
.L4:
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	y(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	$-1, %eax
	jmp	.L3
.L5:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 800080
ans:
	.zero	800080
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%012lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rdx
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	jmp	.L7
.L8:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	y(%rip), %rax
	addq	%rax, %rdx
	movl	-28(%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
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	idx(%rip), %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -28(%rbp)
.L7:
	movl	-32(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L8
	movl	-32(%rbp), %eax
	cltq
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	idx(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$-1, -24(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L9
.L12:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	jne	.L10
	addl	$1, -20(%rbp)
	jmp	.L11
.L10:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	movl	$1, -20(%rbp)
.L11:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	$1000000, %rax, %rsi
	movl	-20(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	addq	%rsi, %rcx
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	%rcx, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L9:
	movl	-32(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L12
	movl	$0, -12(%rbp)
	jmp	.L13
.L14:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L13:
	movl	-32(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L14
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
