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 asc(const void* n1,const void* n2)
{
  return *(int*)n1 - *(int*)n2;
}

int main(void)
{
  int A,B,M;
  int min = 1000000;
  scanf("%d%d%d",&A,&B,&M);

  int a[A+1],b[B+1],x[M+1],y[M+1],c[M+1];

  for(int i=1; i<=A; i++){
    scanf("%d",&a[i]);
  }

  for(int i=1; i<=B; i++){
    scanf("%d",&b[i]);
  }

  for(int i=1; i<=M; i++){
    scanf("%d",&x[i]);
    scanf("%d",&y[i]);
    scanf("%d",&c[i]);
  }

  for(int i=1; i<=M; i++){
    if(min > a[x[i]]+b[y[i]]-c[i]){
      min = a[x[i]]+b[y[i]]-c[i];
    }
  }

  qsort(a+1,A,sizeof(int),asc);
  qsort(b+1,A,sizeof(int),asc);  

  if(min > a[1]+b[1]){
    min = a[1]+b[1];
  }
//  printf("%d %d",a[1],b[1]);  



  printf("%d",min);
  return 0;

}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	asc
	.type	asc, @function
asc:
.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), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asc, .-asc
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$264, %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
	movl	$1000000, -156(%rbp)
	leaq	-160(%rbp), %rcx
	leaq	-164(%rbp), %rdx
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-168(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -136(%rbp)
	movslq	%edx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movslq	%edx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L4:
	cmpq	%rcx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L6
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -128(%rbp)
	movl	-164(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%edx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L7:
	cmpq	%rcx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L9
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -112(%rbp)
	movl	-160(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	-160(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -272(%rbp)
	movq	$0, -264(%rbp)
	cltq
	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
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	-160(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -304(%rbp)
	movq	$0, -296(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L18
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L18:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$1, -152(%rbp)
	jmp	.L19
.L20:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-128(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -152(%rbp)
.L19:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jle	.L20
	movl	$1, -148(%rbp)
	jmp	.L21
.L22:
	movl	-148(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -148(%rbp)
.L21:
	movl	-164(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L22
	movl	$1, -144(%rbp)
	jmp	.L23
.L24:
	movl	-144(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -144(%rbp)
.L23:
	movl	-160(%rbp), %eax
	cmpl	%eax, -144(%rbp)
	jle	.L24
	movl	$1, -140(%rbp)
	jmp	.L25
.L27:
	movq	-96(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-128(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-80(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-112(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, %ecx
	movq	-64(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	cmpl	%eax, -156(%rbp)
	jle	.L26
	movq	-96(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-128(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-80(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-112(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, %ecx
	movq	-64(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -156(%rbp)
.L26:
	addl	$1, -140(%rbp)
.L25:
	movl	-160(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jle	.L27
	movl	-168(%rbp), %eax
	cltq
	movq	-128(%rbp), %rdx
	leaq	4(%rdx), %rdi
	leaq	asc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-168(%rbp), %eax
	cltq
	movq	-112(%rbp), %rdx
	leaq	4(%rdx), %rdi
	leaq	asc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movq	-128(%rbp), %rax
	movl	4(%rax), %edx
	movq	-112(%rbp), %rax
	movl	4(%rax), %eax
	addl	%edx, %eax
	cmpl	%eax, -156(%rbp)
	jle	.L28
	movq	-128(%rbp), %rax
	movl	4(%rax), %edx
	movq	-112(%rbp), %rax
	movl	4(%rax), %eax
	addl	%edx, %eax
	movl	%eax, -156(%rbp)
.L28:
	movl	-156(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	asc
	.type	asc, @function
asc:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$120, %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
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %ecx
	movq	%rsp, %rsi
	leal	1(%rcx), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L5
.L53:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L53
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L54
.L6:
	leaq	3(%rsp), %r13
	movq	%rsp, %rsi
	movq	%r13, %rax
	andq	$-4, %r13
	shrq	$2, %rax
	movq	%r13, -88(%rbp)
	movq	%rax, -144(%rbp)
	movl	-64(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rsi
.L7:
	cmpq	%rsi, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L54:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L8:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L55
.L9:
	leaq	3(%rsp), %r14
	movq	%rsp, %rsi
	movq	%r14, %rax
	andq	$-4, %r14
	shrq	$2, %rax
	movq	%r14, -104(%rbp)
	movq	%rax, -152(%rbp)
	movl	-60(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
.L10:
	cmpq	%rsi, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L55:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L9
.L11:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L12
	orq	$0, -8(%rsp,%rdx)
.L12:
	movq	%rax, %rdi
	movq	%rsp, -120(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
.L13:
	cmpq	%rsi, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L15
	orq	$0, -8(%rsp,%rdx)
.L15:
	movq	%rsp, -128(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rsi
.L16:
	cmpq	%rsi, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L18
	orq	$0, -8(%rsp,%rax)
.L18:
	movq	%rsp, -136(%rbp)
	movq	-88(%rbp), %rax
	testl	%ecx, %ecx
	jle	.L56
	addq	$4, %rax
	movl	$1, %ebx
	leaq	.LC1(%rip), %r15
	movq	%rax, -112(%rbp)
	movq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r12
	cmpl	%ebx, -68(%rbp)
	jge	.L22
.L23:
	movq	-104(%rbp), %rax
	movl	-64(%rbp), %edx
	movl	$1, %ebx
	addq	$4, %rax
	movq	%rax, -96(%rbp)
	movq	%rax, %r12
	testl	%edx, %edx
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r12
	cmpl	%ebx, -64(%rbp)
	jge	.L26
.L21:
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jle	.L25
	movq	-120(%rbp), %rax
	movl	$1, %r14d
	leaq	4(%rax), %r13
	movq	-128(%rbp), %rax
	leaq	4(%rax), %r12
	movq	-136(%rbp), %rax
	leaq	4(%rax), %rbx
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addq	$4, %r13
	addq	$4, %r12
	addq	$4, %rbx
	cmpl	%r14d, %eax
	jge	.L28
	testl	%eax, %eax
	jle	.L25
	movq	-88(%rbp), %rdi
	movq	-104(%rbp), %r8
	leal	1(%rax), %esi
	movl	$1, %edx
	movq	-120(%rbp), %r9
	movq	-128(%rbp), %r10
	movl	$1000000, %ebx
	movq	-136(%rbp), %r11
	.p2align 4,,10
	.p2align 3
.L29:
	movslq	(%r9,%rdx,4), %rcx
	movslq	(%r10,%rdx,4), %rax
	movl	(%r8,%rax,4), %eax
	addl	(%rdi,%rcx,4), %eax
	subl	(%r11,%rdx,4), %eax
	cmpl	%eax, %ebx
	cmovg	%eax, %ebx
	addq	$1, %rdx
	cmpq	%rdx, %rsi
	jne	.L29
.L27:
	movslq	-68(%rbp), %rsi
	movq	-112(%rbp), %rdi
	movl	$4, %edx
	leaq	asc(%rip), %r12
	movq	%r12, %rcx
	call	qsort@PLT
	movslq	-68(%rbp), %rsi
	movq	-96(%rbp), %rdi
	movq	%r12, %rcx
	movl	$4, %edx
	call	qsort@PLT
	movq	-152(%rbp), %rax
	movq	%r15, %rsi
	movl	$1, %edi
	movl	4(,%rax,4), %edx
	movq	-144(%rbp), %rax
	addl	4(,%rax,4), %edx
	cmpl	%ebx, %edx
	cmovg	%ebx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L57
	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
.L25:
	.cfi_restore_state
	movl	$1000000, %ebx
	jmp	.L27
.L56:
	addq	$4, %rax
	leaq	.LC1(%rip), %r15
	movq	%rax, -112(%rbp)
	jmp	.L23
.L57:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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	asc
	.type	asc, @function
asc:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$120, %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
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %ecx
	movq	%rsp, %rsi
	leal	1(%rcx), %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L5
.L53:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L53
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L54
.L6:
	leaq	3(%rsp), %r13
	movq	%rsp, %rsi
	movq	%r13, %rax
	andq	$-4, %r13
	shrq	$2, %rax
	movq	%r13, -88(%rbp)
	movq	%rax, -144(%rbp)
	movl	-64(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rsi
.L7:
	cmpq	%rsi, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L54:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L8:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L55
.L9:
	leaq	3(%rsp), %r14
	movq	%rsp, %rsi
	movq	%r14, %rax
	andq	$-4, %r14
	shrq	$2, %rax
	movq	%r14, -104(%rbp)
	movq	%rax, -152(%rbp)
	movl	-60(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
.L10:
	cmpq	%rsi, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L55:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L9
.L11:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L12
	orq	$0, -8(%rsp,%rdx)
.L12:
	movq	%rax, %rdi
	movq	%rsp, -120(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
.L13:
	cmpq	%rsi, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	je	.L15
	orq	$0, -8(%rsp,%rdx)
.L15:
	movq	%rsp, -128(%rbp)
	movq	%rax, %rdx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	andq	$-16, %rdx
	subq	%rax, %rsi
.L16:
	cmpq	%rsi, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	testq	%rax, %rax
	je	.L18
	orq	$0, -8(%rsp,%rax)
.L18:
	movq	%rsp, -136(%rbp)
	movq	-88(%rbp), %rax
	testl	%ecx, %ecx
	jle	.L56
	addq	$4, %rax
	movl	$1, %ebx
	leaq	.LC1(%rip), %r15
	movq	%rax, -112(%rbp)
	movq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r12
	cmpl	%ebx, -68(%rbp)
	jge	.L22
.L23:
	movq	-104(%rbp), %rax
	movl	-64(%rbp), %edx
	movl	$1, %ebx
	addq	$4, %rax
	movq	%rax, -96(%rbp)
	movq	%rax, %r12
	testl	%edx, %edx
	jle	.L21
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r12
	cmpl	%ebx, -64(%rbp)
	jge	.L26
.L21:
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jle	.L25
	movq	-120(%rbp), %rax
	movl	$1, %r14d
	leaq	4(%rax), %r13
	movq	-128(%rbp), %rax
	leaq	4(%rax), %r12
	movq	-136(%rbp), %rax
	leaq	4(%rax), %rbx
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%r13, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	addq	$4, %r13
	addq	$4, %r12
	addq	$4, %rbx
	cmpl	%r14d, %eax
	jge	.L28
	testl	%eax, %eax
	jle	.L25
	movq	-88(%rbp), %rdi
	movq	-104(%rbp), %r8
	leal	1(%rax), %esi
	movl	$1, %edx
	movq	-120(%rbp), %r9
	movq	-128(%rbp), %r10
	movl	$1000000, %ebx
	movq	-136(%rbp), %r11
	.p2align 4,,10
	.p2align 3
.L29:
	movslq	(%r9,%rdx,4), %rcx
	movslq	(%r10,%rdx,4), %rax
	movl	(%r8,%rax,4), %eax
	addl	(%rdi,%rcx,4), %eax
	subl	(%r11,%rdx,4), %eax
	cmpl	%eax, %ebx
	cmovg	%eax, %ebx
	addq	$1, %rdx
	cmpq	%rdx, %rsi
	jne	.L29
.L27:
	movslq	-68(%rbp), %rsi
	movq	-112(%rbp), %rdi
	movl	$4, %edx
	leaq	asc(%rip), %r12
	movq	%r12, %rcx
	call	qsort@PLT
	movslq	-68(%rbp), %rsi
	movq	-96(%rbp), %rdi
	movq	%r12, %rcx
	movl	$4, %edx
	call	qsort@PLT
	movq	-152(%rbp), %rax
	movq	%r15, %rsi
	movl	$1, %edi
	movl	4(,%rax,4), %edx
	movq	-144(%rbp), %rax
	addl	4(,%rax,4), %edx
	cmpl	%ebx, %edx
	cmovg	%ebx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L57
	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
.L25:
	.cfi_restore_state
	movl	$1000000, %ebx
	jmp	.L27
.L56:
	addq	$4, %rax
	leaq	.LC1(%rip), %r15
	movq	%rax, -112(%rbp)
	jmp	.L23
.L57:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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 asc(const void* n1,const void* n2)
{
  return *(int*)n1 - *(int*)n2;
}

int main(void)
{
  int A,B,M;
  int min = 1000000;
  scanf("%d%d%d",&A,&B,&M);

  int a[A+1],b[B+1],x[M+1],y[M+1],c[M+1];

  for(int i=1; i<=A; i++){
    scanf("%d",&a[i]);
  }

  for(int i=1; i<=B; i++){
    scanf("%d",&b[i]);
  }

  for(int i=1; i<=M; i++){
    scanf("%d",&x[i]);
    scanf("%d",&y[i]);
    scanf("%d",&c[i]);
  }

  for(int i=1; i<=M; i++){
    if(min > a[x[i]]+b[y[i]]-c[i]){
      min = a[x[i]]+b[y[i]]-c[i];
    }
  }

  qsort(a+1,A,sizeof(int),asc);
  qsort(b+1,A,sizeof(int),asc);  

  if(min > a[1]+b[1]){
    min = a[1]+b[1];
  }
//  printf("%d %d",a[1],b[1]);  



  printf("%d",min);
  return 0;

}


1 1 2
10
10
1 0 5
1 1 10
 2 2 1
3 1
3 5
2 2 2
 2 3 1
3 3
3 6 3
1 2 1
 2 2 1
3 2
3 8
2 2 2
 1 1 2
17
10
1 0 0
1 1 10
 1 1 0
10
6
1 0 0
1 1 10
 1 1 2
17
10
1 0 0
1 1 14
 2 4 0
3 5
3 6 0
0 2 1
 2 4 0
2 1
1 5
1 2 2
 2 4 0
2 1
0 5
1 2 2

5 4 6 5 17 16 13 6 2 1
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 asc(const void* n1,const void* n2)
{
  return *(int*)n1 - *(int*)n2;
}

int main(void)
{
  int A,B,M;
  int min = 1000000;
  scanf("%d%d%d",&A,&B,&M);

  int a[A+1],b[B+1],x[M+1],y[M+1],c[M+1];

  for(int i=1; i<=A; i++){
    scanf("%d",&a[i]);
  }

  for(int i=1; i<=B; i++){
    scanf("%d",&b[i]);
  }

  for(int i=1; i<=M; i++){
    scanf("%d",&x[i]);
    scanf("%d",&y[i]);
    scanf("%d",&c[i]);
  }

  for(int i=1; i<=M; i++){
    if(min > a[x[i]]+b[y[i]]-c[i]){
      min = a[x[i]]+b[y[i]]-c[i];
    }
  }

  qsort(a+1,A,sizeof(int),asc);
  qsort(b+1,A,sizeof(int),asc);  

  if(min > a[1]+b[1]){
    min = a[1]+b[1];
  }
//  printf("%d %d",a[1],b[1]);  



  printf("%d",min);
  return 0;

}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	asc
	.type	asc, @function
asc:
.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), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asc, .-asc
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$264, %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
	movl	$1000000, -156(%rbp)
	leaq	-160(%rbp), %rcx
	leaq	-164(%rbp), %rdx
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-168(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -136(%rbp)
	movslq	%edx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movslq	%edx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L4:
	cmpq	%rcx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L6
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -128(%rbp)
	movl	-164(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%edx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L7:
	cmpq	%rcx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L9
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -112(%rbp)
	movl	-160(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	-160(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -272(%rbp)
	movq	$0, -264(%rbp)
	cltq
	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
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	-160(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -304(%rbp)
	movq	$0, -296(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L18
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L18:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$1, -152(%rbp)
	jmp	.L19
.L20:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-128(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -152(%rbp)
.L19:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jle	.L20
	movl	$1, -148(%rbp)
	jmp	.L21
.L22:
	movl	-148(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -148(%rbp)
.L21:
	movl	-164(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L22
	movl	$1, -144(%rbp)
	jmp	.L23
.L24:
	movl	-144(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -144(%rbp)
.L23:
	movl	-160(%rbp), %eax
	cmpl	%eax, -144(%rbp)
	jle	.L24
	movl	$1, -140(%rbp)
	jmp	.L25
.L27:
	movq	-96(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-128(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-80(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-112(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, %ecx
	movq	-64(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	cmpl	%eax, -156(%rbp)
	jle	.L26
	movq	-96(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-128(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-80(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-112(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, %ecx
	movq	-64(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -156(%rbp)
.L26:
	addl	$1, -140(%rbp)
.L25:
	movl	-160(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jle	.L27
	movl	-168(%rbp), %eax
	cltq
	movq	-128(%rbp), %rdx
	leaq	4(%rdx), %rdi
	leaq	asc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-168(%rbp), %eax
	cltq
	movq	-112(%rbp), %rdx
	leaq	4(%rdx), %rdi
	leaq	asc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movq	-128(%rbp), %rax
	movl	4(%rax), %edx
	movq	-112(%rbp), %rax
	movl	4(%rax), %eax
	addl	%edx, %eax
	cmpl	%eax, -156(%rbp)
	jle	.L28
	movq	-128(%rbp), %rax
	movl	4(%rax), %edx
	movq	-112(%rbp), %rax
	movl	4(%rax), %eax
	addl	%edx, %eax
	movl	%eax, -156(%rbp)
.L28:
	movl	-156(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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	asc
	.type	asc, @function
asc:
.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), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asc, .-asc
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
	.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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$264, %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
	movl	$1000000, -156(%rbp)
	leaq	-160(%rbp), %rcx
	leaq	-164(%rbp), %rdx
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-168(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -136(%rbp)
	movslq	%edx, %rax
	movq	%rax, %r12
	movl	$0, %r13d
	movslq	%edx, %rax
	movq	%rax, %r14
	movl	$0, %r15d
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L4:
	cmpq	%rcx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L6
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -128(%rbp)
	movl	-164(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -120(%rbp)
	movslq	%edx, %rax
	movq	%rax, -192(%rbp)
	movq	$0, -184(%rbp)
	movslq	%edx, %rax
	movq	%rax, -208(%rbp)
	movq	$0, -200(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rdx
	movq	%rdx, %rax
	andq	$-4096, %rax
	movq	%rsp, %rcx
	subq	%rax, %rcx
.L7:
	cmpq	%rcx, %rsp
	je	.L8
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L7
.L8:
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	%rax, %rsp
	movq	%rdx, %rax
	andl	$4095, %eax
	testq	%rax, %rax
	je	.L9
	movq	%rdx, %rax
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L9:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -112(%rbp)
	movl	-160(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	subq	$1, %rax
	movq	%rax, -104(%rbp)
	movslq	%edx, %rax
	movq	%rax, -224(%rbp)
	movq	$0, -216(%rbp)
	movslq	%edx, %rax
	movq	%rax, -240(%rbp)
	movq	$0, -232(%rbp)
	movslq	%edx, %rax
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -96(%rbp)
	movl	-160(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -256(%rbp)
	movq	$0, -248(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -272(%rbp)
	movq	$0, -264(%rbp)
	cltq
	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
.L13:
	cmpq	%rdx, %rsp
	je	.L14
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L13
.L14:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L15
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L15:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -80(%rbp)
	movl	-160(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -288(%rbp)
	movq	$0, -280(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -304(%rbp)
	movq	$0, -296(%rbp)
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L16:
	cmpq	%rdx, %rsp
	je	.L17
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L16
.L17:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L18
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L18:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$1, -152(%rbp)
	jmp	.L19
.L20:
	movl	-152(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-128(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -152(%rbp)
.L19:
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	jle	.L20
	movl	$1, -148(%rbp)
	jmp	.L21
.L22:
	movl	-148(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -148(%rbp)
.L21:
	movl	-164(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jle	.L22
	movl	$1, -144(%rbp)
	jmp	.L23
.L24:
	movl	-144(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-96(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-144(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -144(%rbp)
.L23:
	movl	-160(%rbp), %eax
	cmpl	%eax, -144(%rbp)
	jle	.L24
	movl	$1, -140(%rbp)
	jmp	.L25
.L27:
	movq	-96(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-128(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-80(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-112(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, %ecx
	movq	-64(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	cmpl	%eax, -156(%rbp)
	jle	.L26
	movq	-96(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-128(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %ecx
	movq	-80(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movq	-112(%rbp), %rax
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	addl	%eax, %ecx
	movq	-64(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, -156(%rbp)
.L26:
	addl	$1, -140(%rbp)
.L25:
	movl	-160(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jle	.L27
	movl	-168(%rbp), %eax
	cltq
	movq	-128(%rbp), %rdx
	leaq	4(%rdx), %rdi
	leaq	asc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movl	-168(%rbp), %eax
	cltq
	movq	-112(%rbp), %rdx
	leaq	4(%rdx), %rdi
	leaq	asc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	call	qsort@PLT
	movq	-128(%rbp), %rax
	movl	4(%rax), %edx
	movq	-112(%rbp), %rax
	movl	4(%rax), %eax
	addl	%edx, %eax
	cmpl	%eax, -156(%rbp)
	jle	.L28
	movq	-128(%rbp), %rax
	movl	4(%rax), %edx
	movq	-112(%rbp), %rax
	movl	4(%rax), %eax
	addl	%edx, %eax
	movl	%eax, -156(%rbp)
.L28:
	movl	-156(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.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:
