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 func(const void* a,const void* b);
struct city{
    int year_of_birth;
    int prefecture;
    int number;
    unsigned long long int ans;
};

int main(){
    int n,m;
    scanf("%d %d",&n,&m);

    int prefecture_ptr[n];
    for(int i = 0;i < n;i++){
        prefecture_ptr[i] = 0;
    }

    struct city towns[m];
    for(int i = 0;i < m;i++){
        scanf("%d %d",&towns[i].prefecture,&towns[i].year_of_birth);
        towns[i].number = i;
        towns[i].ans = 0;
    }
    
    qsort(towns,m,sizeof(struct city),func);
    
    for(int i = 0;i < m;i++){
        towns[i].ans += ++prefecture_ptr[(towns[i].prefecture - 1)];
        //printf("%d\n", prefecture_ptr[towns[i].prefecture - 1]);
        //printf("%d\n", towns[i].prefecture * 1000000);
        towns[i].ans += ((unsigned long long int)towns[i].prefecture * 1000000);
    }

    unsigned long long int ans_num[m];
    int hoge;
    for(int i = 0;i < m;i++){
        hoge = towns[i].number;
        ans_num[hoge] = towns[i].ans;
    }
    for(int i = 0;i < m;i++){
        printf("%012llu\n",ans_num[i]);
    }
    return 0;
}
int func(const void* a,const void* b){
    return ((struct city*)a)->year_of_birth - ((struct city*)b)->year_of_birth;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%012llu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-132(%rbp), %rax
	leaq	-136(%rbp), %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-136(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L5
.L6:
	movq	-96(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	addl	$1, -128(%rbp)
.L5:
	movl	-136(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L6
	movl	-132(%rbp), %ecx
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movslq	%ecx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L10
.L11:
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rax, %rdx
	movl	-124(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rcx, %rax
	addq	$4, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rcx
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	8(%rax), %rdx
	movl	-124(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-80(%rbp), %rcx
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$16, %rax
	movq	$0, (%rax)
	addl	$1, -124(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L11
	movl	-132(%rbp), %eax
	movslq	%eax, %rsi
	movq	-80(%rbp), %rax
	leaq	func(%rip), %rdx
	movq	%rdx, %rcx
	movl	$24, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -120(%rbp)
	jmp	.L12
.L13:
	movq	-80(%rbp), %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	subl	$1, %eax
	movq	-96(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %esi
	movq	-96(%rbp), %rdx
	movslq	%eax, %rcx
	movl	%esi, (%rdx,%rcx,4)
	movq	-96(%rbp), %rdx
	cltq
	movl	(%rdx,%rax,4), %ecx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movq	(%rax), %rdx
	movslq	%ecx, %rax
	leaq	(%rdx,%rax), %rcx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movq	%rcx, (%rax)
	movq	-80(%rbp), %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$16, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cltq
	imulq	$1000000, %rax, %rax
	addq	%rax, %rcx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movq	%rcx, (%rax)
	addl	$1, -120(%rbp)
.L12:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L13
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -116(%rbp)
	jmp	.L17
.L18:
	movq	-80(%rbp), %rcx
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$8, %rax
	movl	(%rax), %eax
	movl	%eax, -108(%rbp)
	movq	-80(%rbp), %rcx
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$16, %rax
	movq	(%rax), %rcx
	movq	-64(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -116(%rbp)
.L17:
	movl	-132(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L18
	movl	$0, -112(%rbp)
	jmp	.L19
.L20:
	movq	-64(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -112(%rbp)
.L19:
	movl	-132(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L20
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	func
	.type	func, @function
func:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	func, .-func
	.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	func
	.type	func, @function
func:
.LFB40:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE40:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%012llu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	leaq	.LC0(%rip), %r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	movq	%r15, %rdi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rdx
	movq	%rsp, %rdi
	leaq	15(,%rdx,4), %rax
	movq	%rdx, %rsi
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rdi
	andq	$-16, %rcx
	cmpq	%rdi, %rsp
	je	.L5
.L42:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L42
.L5:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L43
.L6:
	movq	%rsp, %r13
	testl	%esi, %esi
	jle	.L13
	salq	$2, %rdx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	memset@PLT
.L13:
	movslq	-60(%rbp), %rsi
	movq	%rsp, %rdi
	leaq	(%rsi,%rsi,2), %rdx
	movq	%rsi, %rax
	leaq	15(,%rdx,8), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rdi
	andq	$-16, %rcx
	cmpq	%rdi, %rsp
	je	.L9
.L44:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L44
.L9:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L45
.L10:
	movq	%rsp, %rbx
	xorl	%r14d, %r14d
	leaq	4(%rbx), %r12
	testl	%eax, %eax
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	-4(%r12), %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	movl	%r14d, 4(%r12)
	addl	$1, %r14d
	movq	$0, 12(%r12)
	addq	$24, %r12
	cmpl	%r14d, %eax
	jg	.L14
	movslq	%eax, %rsi
.L12:
	leaq	func(%rip), %rcx
	movl	$24, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movslq	-60(%rbp), %r9
	testl	%r9d, %r9d
	jle	.L20
	leal	-1(%r9), %eax
	leaq	16(%rbx), %rcx
	leaq	(%rax,%rax,2), %rdi
	salq	$3, %rdi
	leaq	40(%rbx,%rdi), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	-12(%rcx), %rdx
	leal	-1(%rdx), %esi
	movslq	%esi, %rsi
	imulq	$1000000, %rdx, %rdx
	movl	0(%r13,%rsi,4), %eax
	addl	$1, %eax
	movl	%eax, 0(%r13,%rsi,4)
	cltq
	addq	%rdx, %rax
	addq	%rax, (%rcx)
	addq	$24, %rcx
	cmpq	%rcx, %r8
	jne	.L16
	leaq	15(,%r9,8), %rax
	movq	%rsp, %rcx
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L21:
	cmpq	%rcx, %rsp
	je	.L22
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L21
.L22:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L23
	orq	$0, -8(%rsp,%rdx)
.L23:
	movq	%rsp, %r12
	leaq	8(%rbx), %rax
	leaq	32(%rbx,%rdi), %rsi
	.p2align 4,,10
	.p2align 3
.L18:
	movslq	(%rax), %rdx
	movq	8(%rax), %rcx
	addq	$24, %rax
	movq	%rcx, (%r12,%rdx,8)
	cmpq	%rax, %rsi
	jne	.L18
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L19:
	movq	(%r12,%rbx,8), %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, -60(%rbp)
	jg	.L19
.L20:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L46
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L45:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L10
.L43:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L6
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	func
	.type	func, @function
func:
.LFB40:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE40:
	.size	func, .-func
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%012llu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	.cfi_offset 15, -24
	leaq	.LC0(%rip), %r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	movq	%r15, %rdi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rdx
	movq	%rsp, %rdi
	leaq	15(,%rdx,4), %rax
	movq	%rdx, %rsi
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rdi
	andq	$-16, %rcx
	cmpq	%rdi, %rsp
	je	.L5
.L42:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L42
.L5:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L43
.L6:
	movq	%rsp, %r13
	testl	%esi, %esi
	jle	.L13
	salq	$2, %rdx
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	memset@PLT
.L13:
	movslq	-60(%rbp), %rsi
	movq	%rsp, %rdi
	leaq	(%rsi,%rsi,2), %rdx
	movq	%rsi, %rax
	leaq	15(,%rdx,8), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rdi
	andq	$-16, %rcx
	cmpq	%rdi, %rsp
	je	.L9
.L44:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rdi, %rsp
	jne	.L44
.L9:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L45
.L10:
	movq	%rsp, %rbx
	xorl	%r14d, %r14d
	leaq	4(%rbx), %r12
	testl	%eax, %eax
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	-4(%r12), %rdx
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	movl	%r14d, 4(%r12)
	addl	$1, %r14d
	movq	$0, 12(%r12)
	addq	$24, %r12
	cmpl	%r14d, %eax
	jg	.L14
	movslq	%eax, %rsi
.L12:
	leaq	func(%rip), %rcx
	movl	$24, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movslq	-60(%rbp), %r9
	testl	%r9d, %r9d
	jle	.L20
	leal	-1(%r9), %eax
	leaq	16(%rbx), %rcx
	leaq	(%rax,%rax,2), %rdi
	salq	$3, %rdi
	leaq	40(%rbx,%rdi), %r8
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	-12(%rcx), %rdx
	leal	-1(%rdx), %esi
	movslq	%esi, %rsi
	imulq	$1000000, %rdx, %rdx
	movl	0(%r13,%rsi,4), %eax
	addl	$1, %eax
	movl	%eax, 0(%r13,%rsi,4)
	cltq
	addq	%rdx, %rax
	addq	%rax, (%rcx)
	addq	$24, %rcx
	cmpq	%rcx, %r8
	jne	.L16
	leaq	15(,%r9,8), %rax
	movq	%rsp, %rcx
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rcx
.L21:
	cmpq	%rcx, %rsp
	je	.L22
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L21
.L22:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L23
	orq	$0, -8(%rsp,%rdx)
.L23:
	movq	%rsp, %r12
	leaq	8(%rbx), %rax
	leaq	32(%rbx,%rdi), %rsi
	.p2align 4,,10
	.p2align 3
.L18:
	movslq	(%rax), %rdx
	movq	8(%rax), %rcx
	addq	$24, %rax
	movq	%rcx, (%r12,%rdx,8)
	cmpq	%rax, %rsi
	jne	.L18
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L19:
	movq	(%r12,%rbx,8), %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, -60(%rbp)
	jg	.L19
.L20:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L46
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L45:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L10
.L43:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L6
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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>
#include<stdlib.h>
int func(const void* a,const void* b);
struct city{
    int year_of_birth;
    int prefecture;
    int number;
    unsigned long long int ans;
};

int main(){
    int n,m;
    scanf("%d %d",&n,&m);

    int prefecture_ptr[n];
    for(int i = 0;i < n;i++){
        prefecture_ptr[i] = 0;
    }

    struct city towns[m];
    for(int i = 0;i < m;i++){
        scanf("%d %d",&towns[i].prefecture,&towns[i].year_of_birth);
        towns[i].number = i;
        towns[i].ans = 0;
    }
    
    qsort(towns,m,sizeof(struct city),func);
    
    for(int i = 0;i < m;i++){
        towns[i].ans += ++prefecture_ptr[(towns[i].prefecture - 1)];
        //printf("%d\n", prefecture_ptr[towns[i].prefecture - 1]);
        //printf("%d\n", towns[i].prefecture * 1000000);
        towns[i].ans += ((unsigned long long int)towns[i].prefecture * 1000000);
    }

    unsigned long long int ans_num[m];
    int hoge;
    for(int i = 0;i < m;i++){
        hoge = towns[i].number;
        ans_num[hoge] = towns[i].ans;
    }
    for(int i = 0;i < m;i++){
        printf("%012llu\n",ans_num[i]);
    }
    return 0;
}
int func(const void* a,const void* b){
    return ((struct city*)a)->year_of_birth - ((struct city*)b)->year_of_birth;
}

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 func(const void* a,const void* b);
struct city{
    int year_of_birth;
    int prefecture;
    int number;
    unsigned long long int ans;
};

int main(){
    int n,m;
    scanf("%d %d",&n,&m);

    int prefecture_ptr[n];
    for(int i = 0;i < n;i++){
        prefecture_ptr[i] = 0;
    }

    struct city towns[m];
    for(int i = 0;i < m;i++){
        scanf("%d %d",&towns[i].prefecture,&towns[i].year_of_birth);
        towns[i].number = i;
        towns[i].ans = 0;
    }
    
    qsort(towns,m,sizeof(struct city),func);
    
    for(int i = 0;i < m;i++){
        towns[i].ans += ++prefecture_ptr[(towns[i].prefecture - 1)];
        //printf("%d\n", prefecture_ptr[towns[i].prefecture - 1]);
        //printf("%d\n", towns[i].prefecture * 1000000);
        towns[i].ans += ((unsigned long long int)towns[i].prefecture * 1000000);
    }

    unsigned long long int ans_num[m];
    int hoge;
    for(int i = 0;i < m;i++){
        hoge = towns[i].number;
        ans_num[hoge] = towns[i].ans;
    }
    for(int i = 0;i < m;i++){
        printf("%012llu\n",ans_num[i]);
    }
    return 0;
}
int func(const void* a,const void* b){
    return ((struct city*)a)->year_of_birth - ((struct city*)b)->year_of_birth;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%012llu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-132(%rbp), %rax
	leaq	-136(%rbp), %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-136(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L5
.L6:
	movq	-96(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	addl	$1, -128(%rbp)
.L5:
	movl	-136(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L6
	movl	-132(%rbp), %ecx
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movslq	%ecx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L10
.L11:
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rax, %rdx
	movl	-124(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rcx, %rax
	addq	$4, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rcx
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	8(%rax), %rdx
	movl	-124(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-80(%rbp), %rcx
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$16, %rax
	movq	$0, (%rax)
	addl	$1, -124(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L11
	movl	-132(%rbp), %eax
	movslq	%eax, %rsi
	movq	-80(%rbp), %rax
	leaq	func(%rip), %rdx
	movq	%rdx, %rcx
	movl	$24, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -120(%rbp)
	jmp	.L12
.L13:
	movq	-80(%rbp), %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	subl	$1, %eax
	movq	-96(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %esi
	movq	-96(%rbp), %rdx
	movslq	%eax, %rcx
	movl	%esi, (%rdx,%rcx,4)
	movq	-96(%rbp), %rdx
	cltq
	movl	(%rdx,%rax,4), %ecx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movq	(%rax), %rdx
	movslq	%ecx, %rax
	leaq	(%rdx,%rax), %rcx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movq	%rcx, (%rax)
	movq	-80(%rbp), %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$16, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cltq
	imulq	$1000000, %rax, %rax
	addq	%rax, %rcx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movq	%rcx, (%rax)
	addl	$1, -120(%rbp)
.L12:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L13
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -116(%rbp)
	jmp	.L17
.L18:
	movq	-80(%rbp), %rcx
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$8, %rax
	movl	(%rax), %eax
	movl	%eax, -108(%rbp)
	movq	-80(%rbp), %rcx
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$16, %rax
	movq	(%rax), %rcx
	movq	-64(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -116(%rbp)
.L17:
	movl	-132(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L18
	movl	$0, -112(%rbp)
	jmp	.L19
.L20:
	movq	-64(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -112(%rbp)
.L19:
	movl	-132(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L20
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	func
	.type	func, @function
func:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	func, .-func
	.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 %d"
.LC1:
	.string	"%012llu\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$168, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-132(%rbp), %rax
	leaq	-136(%rbp), %rcx
	movq	%rax, %rdx
	movq	%rcx, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-136(%rbp), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%edx, %rax
	movq	%rax, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L5
.L6:
	movq	-96(%rbp), %rax
	movl	-128(%rbp), %edx
	movslq	%edx, %rdx
	movl	$0, (%rax,%rdx,4)
	addl	$1, -128(%rbp)
.L5:
	movl	-136(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L6
	movl	-132(%rbp), %ecx
	movslq	%ecx, %rax
	subq	$1, %rax
	movq	%rax, -88(%rbp)
	movslq	%ecx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	imulq	$192, %r15, %rdx
	imulq	$0, %r14, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r14
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movslq	%ecx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	imulq	$192, %r13, %rdx
	imulq	$0, %r12, %rax
	leaq	(%rdx,%rax), %rsi
	movl	$192, %eax
	mulq	%r12
	addq	%rdx, %rsi
	movq	%rsi, %rdx
	movslq	%ecx, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	%rax, %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L7:
	cmpq	%rdx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L9
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L10
.L11:
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rdx
	addq	%rax, %rdx
	movl	-124(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	addq	%rax, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	movq	-80(%rbp), %rcx
	addq	%rcx, %rax
	addq	$4, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rcx
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	8(%rax), %rdx
	movl	-124(%rbp), %eax
	movl	%eax, (%rdx)
	movq	-80(%rbp), %rcx
	movl	-124(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$16, %rax
	movq	$0, (%rax)
	addl	$1, -124(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L11
	movl	-132(%rbp), %eax
	movslq	%eax, %rsi
	movq	-80(%rbp), %rax
	leaq	func(%rip), %rdx
	movq	%rdx, %rcx
	movl	$24, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -120(%rbp)
	jmp	.L12
.L13:
	movq	-80(%rbp), %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	subl	$1, %eax
	movq	-96(%rbp), %rdx
	movslq	%eax, %rcx
	movl	(%rdx,%rcx,4), %edx
	leal	1(%rdx), %esi
	movq	-96(%rbp), %rdx
	movslq	%eax, %rcx
	movl	%esi, (%rdx,%rcx,4)
	movq	-96(%rbp), %rdx
	cltq
	movl	(%rdx,%rax,4), %ecx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movq	(%rax), %rdx
	movslq	%ecx, %rax
	leaq	(%rdx,%rax), %rcx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movq	%rcx, (%rax)
	movq	-80(%rbp), %rcx
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$16, %rax
	movq	(%rax), %rcx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$4, %rax
	movl	(%rax), %eax
	cltq
	imulq	$1000000, %rax, %rax
	addq	%rax, %rcx
	movq	-80(%rbp), %rsi
	movl	-120(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	addq	$16, %rax
	movq	%rcx, (%rax)
	addl	$1, -120(%rbp)
.L12:
	movl	-132(%rbp), %eax
	cmpl	%eax, -120(%rbp)
	jl	.L13
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -208(%rbp)
	movq	$0, -200(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L14:
	cmpq	%rdx, %rsp
	je	.L15
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L14
.L15:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L16
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L16:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -116(%rbp)
	jmp	.L17
.L18:
	movq	-80(%rbp), %rcx
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$8, %rax
	movl	(%rax), %eax
	movl	%eax, -108(%rbp)
	movq	-80(%rbp), %rcx
	movl	-116(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	addq	$16, %rax
	movq	(%rax), %rcx
	movq	-64(%rbp), %rax
	movl	-108(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
	addl	$1, -116(%rbp)
.L17:
	movl	-132(%rbp), %eax
	cmpl	%eax, -116(%rbp)
	jl	.L18
	movl	$0, -112(%rbp)
	jmp	.L19
.L20:
	movq	-64(%rbp), %rax
	movl	-112(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -112(%rbp)
.L19:
	movl	-132(%rbp), %eax
	cmpl	%eax, -112(%rbp)
	jl	.L20
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.globl	func
	.type	func, @function
func:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	func, .-func
	.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:
