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 <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b) { return *(int *)a - *(int *)b; }                            /* 1,2,3,4.. */
int cmp_char(const void *a, const void *b) { return *(char *)a - *(char *)b; }                     /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) { return strcmp(*(const char **)a, *(const char **)b); } /* aaa,aab.. */
#define min(a, b) (a < b ? a : b)
#define max(a, b) (a > b ? a : b)
int a[100001], b[100001] = {0}, c[100001], idx[100001];

int des(const void *a, const void *b)
{
  return c[*(int *)b] - c[*(int *)a];
}

int main(void)
{
  int n, m;

  scanf("%d %d", &n, &m);

  int i, j;
  for (i = 0; i < n; i++)
    scanf("%d", &a[i]);

  for (i = 0; i < m; i++)
    scanf("%d %d", &b[i], &c[i]);

  for (i = 0; i < m; i++)
    idx[i] = i;

  qsort(a, n, sizeof(int), acs);
  qsort(idx, m, sizeof(int), des);

  long long int max = 0;
  int now = 0;
  for (i = 0; i < n; i++)
  {
    if (b[idx[now]] > 0 && a[i] < c[idx[now]])
    {
      a[i] = c[idx[now]];
      b[idx[now]]--;
      if (b[idx[now]] < 1)
        now++;
    }
    else
      break;
  }

  for (i = 0; i < n; i++)
    max += a[i];

  printf("%lld\n", max);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	acs
	.type	acs, @function
acs:
.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	acs, .-acs
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.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
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp_char, .-cmp_char
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp_str, .-cmp_str
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400004
a:
	.zero	400004
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 400004
b:
	.zero	400004
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 400004
c:
	.zero	400004
	.globl	idx
	.align 32
	.type	idx, @object
	.size	idx, 400004
idx:
	.zero	400004
	.text
	.globl	des
	.type	des, @function
des:
.LFB9:
	.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	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	des, .-des
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L10:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
	movl	$0, -24(%rbp)
	jmp	.L12
.L13:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	addq	%rax, %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	b(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L12:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L13
	movl	$0, -24(%rbp)
	jmp	.L14
.L15:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	idx(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L14:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L15
	movl	-32(%rbp), %eax
	cltq
	leaq	acs(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	des(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	idx(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L16
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L17
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	idx(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	b(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L18
	addl	$1, -20(%rbp)
.L18:
	addl	$1, -24(%rbp)
.L16:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L19
.L17:
	movl	$0, -24(%rbp)
	jmp	.L20
.L21:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -16(%rbp)
	addl	$1, -24(%rbp)
.L20:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	acs
	.type	acs, @function
acs:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	acs, .-acs
	.p2align 4
	.globl	des
	.type	des, @function
des:
.LFB54:
	.cfi_startproc
	endbr64
	movslq	(%rsi), %rax
	movslq	(%rdi), %rcx
	leaq	c(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	subl	(%rdx,%rcx,4), %eax
	ret
	.cfi_endproc
.LFE54:
	.size	des, .-des
	.p2align 4
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB52:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %eax
	movsbl	(%rsi), %edx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	cmp_char, .-cmp_char
	.p2align 4
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB53:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rsi
	movq	(%rdi), %rdi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE53:
	.size	cmp_str, .-cmp_str
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d"
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC2(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	a(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rbp, %r12
	xorl	%ebx, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r12
	cmpl	%ebx, (%rsp)
	jg	.L10
.L11:
	movl	4(%rsp), %eax
	leaq	b(%rip), %r12
	xorl	%ebx, %ebx
	leaq	c(%rip), %r14
	testl	%eax, %eax
	jle	.L42
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	(%r14,%rbx,4), %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$1, %rbx
	addq	$4, %r12
	cmpl	%ebx, %eax
	jg	.L14
	testl	%eax, %eax
	jle	.L42
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L28
	movl	%eax, %ecx
	leaq	idx(%rip), %rbx
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC3(%rip), %xmm2
	shrl	$2, %ecx
	leaq	16(%rbx), %rsi
	movq	%rbx, %rdx
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L16:
	movdqa	%xmm0, %xmm1
	addq	$16, %rdx
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rdx)
	cmpq	%rcx, %rdx
	jne	.L16
	movl	%eax, %edx
	andl	$-4, %edx
	testb	$3, %al
	je	.L9
.L15:
	movslq	%edx, %rcx
	movl	%edx, (%rbx,%rcx,4)
	leal	1(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L9
	movslq	%ecx, %rsi
	addl	$2, %edx
	movl	%ecx, (%rbx,%rsi,4)
	cmpl	%edx, %eax
	jle	.L9
	movslq	%edx, %rax
	movl	%edx, (%rbx,%rax,4)
.L9:
	movslq	(%rsp), %rsi
	leaq	acs(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movslq	4(%rsp), %rsi
	movl	$4, %edx
	movq	%rbx, %rdi
	leaq	des(%rip), %rcx
	call	qsort@PLT
	movl	(%rsp), %r11d
	xorl	%edx, %edx
	testl	%r11d, %r11d
	jle	.L13
	leaq	a(%rip), %r8
	leal	-1(%r11), %edx
	xorl	%esi, %esi
	leaq	4(%r8), %rax
	movq	%rdx, %r13
	movq	%r8, %rbp
	leaq	(%rax,%rdx,4), %r12
	leaq	b(%rip), %r9
	movq	%r8, %rdx
	leaq	c(%rip), %r10
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L19:
	movl	(%r10,%rcx,4), %edi
	cmpl	%edi, (%rdx)
	jge	.L22
	subl	$1, %eax
	movl	%edi, (%rdx)
	cmpl	$1, %eax
	movl	%eax, (%r9,%rcx,4)
	adcl	$0, %esi
	addq	$4, %rdx
	cmpq	%r12, %rdx
	je	.L22
.L24:
	movslq	%esi, %rax
	movslq	(%rbx,%rax,4), %rcx
	movl	(%r9,%rcx,4), %eax
	testl	%eax, %eax
	jg	.L19
.L22:
	cmpl	$2, %r13d
	jbe	.L29
	movl	%r11d, %eax
	leaq	16+a(%rip), %rdx
	pxor	%xmm1, %xmm1
	shrl	$2, %eax
	pxor	%xmm4, %xmm4
	subl	$1, %eax
	salq	$4, %rax
	addq	%rdx, %rax
	.p2align 4,,10
	.p2align 3
.L21:
	movdqa	(%r8), %xmm0
	movdqa	%xmm4, %xmm2
	addq	$16, %r8
	pcmpgtd	%xmm0, %xmm2
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm0
	paddq	%xmm3, %xmm1
	paddq	%xmm0, %xmm1
	cmpq	%rax, %r8
	jne	.L21
	movdqa	%xmm1, %xmm0
	movl	%r11d, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rdx
	testb	$3, %r11b
	je	.L13
.L20:
	movslq	%eax, %rcx
	movslq	0(%rbp,%rcx,4), %rcx
	addq	%rcx, %rdx
	leal	1(%rax), %ecx
	cmpl	%r11d, %ecx
	jge	.L13
	movslq	%ecx, %rcx
	addl	$2, %eax
	movslq	0(%rbp,%rcx,4), %rcx
	addq	%rcx, %rdx
	cmpl	%eax, %r11d
	jle	.L13
	cltq
	movslq	0(%rbp,%rax,4), %rax
	addq	%rax, %rdx
.L13:
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	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
.L42:
	.cfi_restore_state
	leaq	idx(%rip), %rbx
	jmp	.L9
.L29:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L20
.L28:
	xorl	%edx, %edx
	leaq	idx(%rip), %rbx
	jmp	.L15
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	idx
	.bss
	.align 32
	.type	idx, @object
	.size	idx, 400004
idx:
	.zero	400004
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 400004
c:
	.zero	400004
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 400004
b:
	.zero	400004
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400004
a:
	.zero	400004
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.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	acs
	.type	acs, @function
acs:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	acs, .-acs
	.p2align 4
	.globl	des
	.type	des, @function
des:
.LFB54:
	.cfi_startproc
	endbr64
	movslq	(%rsi), %rax
	movslq	(%rdi), %rcx
	leaq	c(%rip), %rdx
	movl	(%rdx,%rax,4), %eax
	subl	(%rdx,%rcx,4), %eax
	ret
	.cfi_endproc
.LFE54:
	.size	des, .-des
	.p2align 4
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.LFB52:
	.cfi_startproc
	endbr64
	movsbl	(%rdi), %eax
	movsbl	(%rsi), %edx
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE52:
	.size	cmp_char, .-cmp_char
	.p2align 4
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB53:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rsi
	movq	(%rdi), %rdi
	jmp	strcmp@PLT
	.cfi_endproc
.LFE53:
	.size	cmp_str, .-cmp_str
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d"
.LC4:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC2(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	a(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rbp, %r12
	xorl	%ebx, %ebx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %r12
	cmpl	%ebx, (%rsp)
	jg	.L10
.L11:
	movl	4(%rsp), %eax
	leaq	b(%rip), %r12
	xorl	%ebx, %ebx
	leaq	c(%rip), %r14
	testl	%eax, %eax
	jle	.L42
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	(%r14,%rbx,4), %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addq	$1, %rbx
	addq	$4, %r12
	cmpl	%ebx, %eax
	jg	.L14
	testl	%eax, %eax
	jle	.L42
	leal	-1(%rax), %edx
	cmpl	$2, %edx
	jbe	.L28
	movl	%eax, %ecx
	leaq	idx(%rip), %rbx
	movdqa	.LC0(%rip), %xmm0
	movdqa	.LC3(%rip), %xmm2
	shrl	$2, %ecx
	leaq	16(%rbx), %rsi
	movq	%rbx, %rdx
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rsi, %rcx
	.p2align 4,,10
	.p2align 3
.L16:
	movdqa	%xmm0, %xmm1
	addq	$16, %rdx
	paddd	%xmm2, %xmm0
	movaps	%xmm1, -16(%rdx)
	cmpq	%rcx, %rdx
	jne	.L16
	movl	%eax, %edx
	andl	$-4, %edx
	testb	$3, %al
	je	.L9
.L15:
	movslq	%edx, %rcx
	movl	%edx, (%rbx,%rcx,4)
	leal	1(%rdx), %ecx
	cmpl	%ecx, %eax
	jle	.L9
	movslq	%ecx, %rsi
	addl	$2, %edx
	movl	%ecx, (%rbx,%rsi,4)
	cmpl	%edx, %eax
	jle	.L9
	movslq	%edx, %rax
	movl	%edx, (%rbx,%rax,4)
.L9:
	movslq	(%rsp), %rsi
	leaq	acs(%rip), %rcx
	movl	$4, %edx
	movq	%rbp, %rdi
	call	qsort@PLT
	movslq	4(%rsp), %rsi
	movl	$4, %edx
	movq	%rbx, %rdi
	leaq	des(%rip), %rcx
	call	qsort@PLT
	movl	(%rsp), %r11d
	xorl	%edx, %edx
	testl	%r11d, %r11d
	jle	.L13
	leaq	a(%rip), %r8
	leal	-1(%r11), %edx
	xorl	%esi, %esi
	leaq	4(%r8), %rax
	movq	%rdx, %r13
	movq	%r8, %rbp
	leaq	(%rax,%rdx,4), %r12
	leaq	b(%rip), %r9
	movq	%r8, %rdx
	leaq	c(%rip), %r10
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L19:
	movl	(%r10,%rcx,4), %edi
	cmpl	%edi, (%rdx)
	jge	.L22
	subl	$1, %eax
	movl	%edi, (%rdx)
	cmpl	$1, %eax
	movl	%eax, (%r9,%rcx,4)
	adcl	$0, %esi
	addq	$4, %rdx
	cmpq	%r12, %rdx
	je	.L22
.L24:
	movslq	%esi, %rax
	movslq	(%rbx,%rax,4), %rcx
	movl	(%r9,%rcx,4), %eax
	testl	%eax, %eax
	jg	.L19
.L22:
	cmpl	$2, %r13d
	jbe	.L29
	movl	%r11d, %eax
	leaq	16+a(%rip), %rdx
	pxor	%xmm1, %xmm1
	shrl	$2, %eax
	pxor	%xmm4, %xmm4
	subl	$1, %eax
	salq	$4, %rax
	addq	%rdx, %rax
	.p2align 4,,10
	.p2align 3
.L21:
	movdqa	(%r8), %xmm0
	movdqa	%xmm4, %xmm2
	addq	$16, %r8
	pcmpgtd	%xmm0, %xmm2
	movdqa	%xmm0, %xmm3
	punpckldq	%xmm2, %xmm3
	punpckhdq	%xmm2, %xmm0
	paddq	%xmm3, %xmm1
	paddq	%xmm0, %xmm1
	cmpq	%rax, %r8
	jne	.L21
	movdqa	%xmm1, %xmm0
	movl	%r11d, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddq	%xmm0, %xmm1
	movq	%xmm1, %rdx
	testb	$3, %r11b
	je	.L13
.L20:
	movslq	%eax, %rcx
	movslq	0(%rbp,%rcx,4), %rcx
	addq	%rcx, %rdx
	leal	1(%rax), %ecx
	cmpl	%r11d, %ecx
	jge	.L13
	movslq	%ecx, %rcx
	addl	$2, %eax
	movslq	0(%rbp,%rcx,4), %rcx
	addq	%rcx, %rdx
	cmpl	%eax, %r11d
	jle	.L13
	cltq
	movslq	0(%rbp,%rax,4), %rax
	addq	%rax, %rdx
.L13:
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	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
.L42:
	.cfi_restore_state
	leaq	idx(%rip), %rbx
	jmp	.L9
.L29:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L20
.L28:
	xorl	%edx, %edx
	leaq	idx(%rip), %rbx
	jmp	.L15
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	idx
	.bss
	.align 32
	.type	idx, @object
	.size	idx, 400004
idx:
	.zero	400004
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 400004
c:
	.zero	400004
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 400004
b:
	.zero	400004
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400004
a:
	.zero	400004
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.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 <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b) { return *(int *)a - *(int *)b; }                            /* 1,2,3,4.. */
int cmp_char(const void *a, const void *b) { return *(char *)a - *(char *)b; }                     /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) { return strcmp(*(const char **)a, *(const char **)b); } /* aaa,aab.. */
#define min(a, b) (a < b ? a : b)
#define max(a, b) (a > b ? a : b)
int a[100001], b[100001] = {0}, c[100001], idx[100001];

int des(const void *a, const void *b)
{
  return c[*(int *)b] - c[*(int *)a];
}

int main(void)
{
  int n, m;

  scanf("%d %d", &n, &m);

  int i, j;
  for (i = 0; i < n; i++)
    scanf("%d", &a[i]);

  for (i = 0; i < m; i++)
    scanf("%d %d", &b[i], &c[i]);

  for (i = 0; i < m; i++)
    idx[i] = i;

  qsort(a, n, sizeof(int), acs);
  qsort(idx, m, sizeof(int), des);

  long long int max = 0;
  int now = 0;
  for (i = 0; i < n; i++)
  {
    if (b[idx[now]] > 0 && a[i] < c[idx[now]])
    {
      a[i] = c[idx[now]];
      b[idx[now]]--;
      if (b[idx[now]] < 1)
        now++;
    }
    else
      break;
  }

  for (i = 0; i < n; i++)
    max += a[i];

  printf("%lld\n", max);
  return 0;
}

10 3
1 8 5 7 100 4 7 33 13 5
3 10
4 30
1 4
 3 2
5 1 1
2 3
1 5
 3 2
100 100 100
0 99
3 99
 11 3
1 1 1 1 1 1 1 1 1 1 1
3 1000000000
4 1000000000
3 1000000001
 10 2
0 8 5 7 100 4 7 33 24 5
3 10
4 30
1 4
 3 2
5 1 1
2 3
1 7
 10 2
0 8 5 7 100 4 7 33 24 5
3 15
4 30
1 4
 3 2
5 1 1
2 3
1 6
 3 2
5 1 1
2 3
2 6
 10 2
0 4 5 7 100 4 7 33 33 5
3 15
4 30
1 4

296
 13
 300
 10000000004
 307
 15
 322
 14
 17
 331

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 <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b) { return *(int *)a - *(int *)b; }                            /* 1,2,3,4.. */
int cmp_char(const void *a, const void *b) { return *(char *)a - *(char *)b; }                     /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) { return strcmp(*(const char **)a, *(const char **)b); } /* aaa,aab.. */
#define min(a, b) (a < b ? a : b)
#define max(a, b) (a > b ? a : b)
int a[100001], b[100001] = {0}, c[100001], idx[100001];

int des(const void *a, const void *b)
{
  return c[*(int *)b] - c[*(int *)a];
}

int main(void)
{
  int n, m;

  scanf("%d %d", &n, &m);

  int i, j;
  for (i = 0; i < n; i++)
    scanf("%d", &a[i]);

  for (i = 0; i < m; i++)
    scanf("%d %d", &b[i], &c[i]);

  for (i = 0; i < m; i++)
    idx[i] = i;

  qsort(a, n, sizeof(int), acs);
  qsort(idx, m, sizeof(int), des);

  long long int max = 0;
  int now = 0;
  for (i = 0; i < n; i++)
  {
    if (b[idx[now]] > 0 && a[i] < c[idx[now]])
    {
      a[i] = c[idx[now]];
      b[idx[now]]--;
      if (b[idx[now]] < 1)
        now++;
    }
    else
      break;
  }

  for (i = 0; i < n; i++)
    max += a[i];

  printf("%lld\n", max);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	acs
	.type	acs, @function
acs:
.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	acs, .-acs
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.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
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp_char, .-cmp_char
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp_str, .-cmp_str
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400004
a:
	.zero	400004
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 400004
b:
	.zero	400004
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 400004
c:
	.zero	400004
	.globl	idx
	.align 32
	.type	idx, @object
	.size	idx, 400004
idx:
	.zero	400004
	.text
	.globl	des
	.type	des, @function
des:
.LFB9:
	.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	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	des, .-des
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L10:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
	movl	$0, -24(%rbp)
	jmp	.L12
.L13:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	addq	%rax, %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	b(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L12:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L13
	movl	$0, -24(%rbp)
	jmp	.L14
.L15:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	idx(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L14:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L15
	movl	-32(%rbp), %eax
	cltq
	leaq	acs(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	des(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	idx(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L16
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L17
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	idx(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	b(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L18
	addl	$1, -20(%rbp)
.L18:
	addl	$1, -24(%rbp)
.L16:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L19
.L17:
	movl	$0, -24(%rbp)
	jmp	.L20
.L21:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -16(%rbp)
	addl	$1, -24(%rbp)
.L20:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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	acs
	.type	acs, @function
acs:
.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	acs, .-acs
	.globl	cmp_char
	.type	cmp_char, @function
cmp_char:
.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
	movzbl	(%rax), %eax
	movsbl	%al, %edx
	movq	-16(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	cmp_char, .-cmp_char
	.globl	cmp_str
	.type	cmp_str, @function
cmp_str:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	cmp_str, .-cmp_str
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400004
a:
	.zero	400004
	.globl	b
	.align 32
	.type	b, @object
	.size	b, 400004
b:
	.zero	400004
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 400004
c:
	.zero	400004
	.globl	idx
	.align 32
	.type	idx, @object
	.size	idx, 400004
idx:
	.zero	400004
	.text
	.globl	des
	.type	des, @function
des:
.LFB9:
	.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	-16(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rax
	movl	(%rcx,%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	des, .-des
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L10
.L11:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L10:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L11
	movl	$0, -24(%rbp)
	jmp	.L12
.L13:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	addq	%rax, %rdx
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	b(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -24(%rbp)
.L12:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L13
	movl	$0, -24(%rbp)
	jmp	.L14
.L15:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	idx(%rip), %rdx
	movl	-24(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	addl	$1, -24(%rbp)
.L14:
	movl	-28(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L15
	movl	-32(%rbp), %eax
	cltq
	leaq	acs(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	a(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	-28(%rbp), %eax
	cltq
	leaq	des(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rsi
	leaq	idx(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -16(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L16
.L19:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L17
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	idx(%rip), %rax
	movl	(%rcx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jge	.L17
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	-24(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	b(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	-1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	idx(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	b(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jg	.L18
	addl	$1, -20(%rbp)
.L18:
	addl	$1, -24(%rbp)
.L16:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L19
.L17:
	movl	$0, -24(%rbp)
	jmp	.L20
.L21:
	movl	-24(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	addq	%rax, -16(%rbp)
	addl	$1, -24(%rbp)
.L20:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L21
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.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:
