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>
#include<string.h>
#define df 0
#define MAX 100010
int dc=100000;
typedef long int li;

li que[2*MAX];
int head=0,tail=0;
void enque(li a){
  que[tail++]=a;
}
li deque(){
  return que[head++];
}
int comp(const void* a,const void* b){
  li x=*((li*)a),y=*((li*)b);
  return (x-y>0)?1:-1;
}
typedef struct{
  li b;
  li c;
}data;
data change[MAX];

int comp_c(const void* a,const void* b){
  data x=*((data*)a),y=*((data*)b);
  return (y.c-x.c>0)?1:-1;
}

int main(){
  if(df)printf("*** debug mode ***\n");
  int n,m,i;
  scanf("%d%d",&n,&m);
  for(i=0;i<n;i++){
    li a;
    scanf("%ld",&a);
    enque(a);
  }
  qsort(que,n,sizeof(li),comp);
  if(df){
    for(i=head;i<tail;i++)
      printf("%d ",que[i]);
    printf(":que\n");
  }
  for(i=0;i<m;i++){
    li b,c;
    scanf("%ld%ld",&b,&c);
    change[i].b=b;
    change[i].c=c;
  }
  qsort(change,m,sizeof(data),comp_c);
  if(df){
    for(i=0;i<m;i++)
      printf("%d(%d) ",change[i].c,change[i].b);
    printf(":change\n");
  }
  i=0;
  while(i<m && que[head]<change[i].c){
    int j;
    for(j=0;j<change[i].b;j++){
      if(que[head]>change[i].c)break;
      deque();
      enque(change[i].c);
    }
    if(df){
      for(i=head;i<tail;i++)
	printf("%d ",que[i]);
      printf(":que\n");
    }
    i++;
  }

  li sum=0;
  for(i=head;i<tail;i++){
    sum+=que[i];
  }

  printf("%ld",sum);
  return 0;
}


/// confirm df==0 ///
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	dc
	.data
	.align 4
	.type	dc, @object
	.size	dc, 4
dc:
	.long	100000
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 1600160
que:
	.zero	1600160
	.globl	head
	.align 4
	.type	head, @object
	.size	head, 4
head:
	.zero	4
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.text
	.globl	enque
	.type	enque, @function
enque:
.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)
	movl	tail(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, tail(%rip)
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	enque, .-enque
	.globl	deque
	.type	deque, @function
deque:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	head(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, head(%rip)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	deque, .-deque
	.globl	comp
	.type	comp, @function
comp:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	subq	-8(%rbp), %rax
	testq	%rax, %rax
	jle	.L5
	movl	$1, %eax
	jmp	.L7
.L5:
	movl	$-1, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	comp, .-comp
	.globl	change
	.bss
	.align 32
	.type	change, @object
	.size	change, 1600160
change:
	.zero	1600160
	.text
	.globl	comp_c
	.type	comp_c, @function
comp_c:
.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, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	%rdx, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	-24(%rbp), %rdx
	subq	%rdx, %rax
	testq	%rax, %rax
	jle	.L9
	movl	$1, %eax
	jmp	.L11
.L9:
	movl	$-1, %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	comp_c, .-comp_c
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld%ld"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -40(%rbp)
	jmp	.L13
.L14:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	enque
	addl	$1, -40(%rbp)
.L13:
	movl	-48(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L14
	movl	-48(%rbp), %eax
	cltq
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	que(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40(%rbp)
	jmp	.L15
.L16:
	leaq	-24(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-32(%rbp), %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	change(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	-24(%rbp), %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+change(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -40(%rbp)
.L15:
	movl	-44(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L16
	movl	-44(%rbp), %eax
	cltq
	leaq	comp_c(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	change(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40(%rbp)
	jmp	.L17
.L23:
	movl	$0, -36(%rbp)
	jmp	.L18
.L21:
	movl	head(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+change(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jg	.L29
	movl	$0, %eax
	call	deque
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+change(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rdi
	call	enque
	addl	$1, -36(%rbp)
.L18:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	change(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jl	.L21
	jmp	.L28
.L29:
	nop
.L28:
	addl	$1, -40(%rbp)
.L17:
	movl	-44(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L22
	movl	head(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+change(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jl	.L23
.L22:
	movq	$0, -16(%rbp)
	movl	head(%rip), %eax
	movl	%eax, -40(%rbp)
	jmp	.L24
.L25:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
	addl	$1, -40(%rbp)
.L24:
	movl	tail(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L25
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	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	comp
	.type	comp, @function
comp:
.LFB53:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	setg	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
	ret
	.cfi_endproc
.LFE53:
	.size	comp, .-comp
	.p2align 4
	.globl	comp_c
	.type	comp_c, @function
comp_c:
.LFB54:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rax
	cmpq	%rax, 8(%rsi)
	setg	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
	ret
	.cfi_endproc
.LFE54:
	.size	comp_c, .-comp_c
	.p2align 4
	.globl	enque
	.type	enque, @function
enque:
.LFB51:
	.cfi_startproc
	endbr64
	movslq	tail(%rip), %rax
	leal	1(%rax), %edx
	movl	%edx, tail(%rip)
	leaq	que(%rip), %rdx
	movq	%rdi, (%rdx,%rax,8)
	ret
	.cfi_endproc
.LFE51:
	.size	enque, .-enque
	.p2align 4
	.globl	deque
	.type	deque, @function
deque:
.LFB52:
	.cfi_startproc
	endbr64
	movslq	head(%rip), %rax
	leal	1(%rax), %edx
	movl	%edx, head(%rip)
	leaq	que(%rip), %rdx
	movq	(%rdx,%rax,8), %rax
	ret
	.cfi_endproc
.LFE52:
	.size	deque, .-deque
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	que(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	xorl	%r13d, %r13d
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	tail(%rip), %rax
	leal	1(%rax), %edx
	movl	%edx, tail(%rip)
	movq	16(%rsp), %rdx
	movq	%rdx, (%rbx,%rax,8)
	movl	(%rsp), %eax
	cmpl	%r13d, %eax
	jg	.L12
.L11:
	movslq	%eax, %rsi
	leaq	comp(%rip), %rcx
	movl	$8, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	leaq	change(%rip), %r13
	xorl	%r15d, %r15d
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r12, %rdx
	movq	%r14, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %xmm0
	movl	4(%rsp), %eax
	addl	$1, %r15d
	addq	$16, %r13
	movhps	16(%rsp), %xmm0
	movaps	%xmm0, -16(%r13)
	cmpl	%r15d, %eax
	jg	.L14
.L13:
	movslq	%eax, %rsi
	leaq	comp_c(%rip), %rcx
	movl	$16, %edx
	leaq	change(%rip), %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	movl	tail(%rip), %r14d
	movl	head(%rip), %r13d
	testl	%eax, %eax
	jle	.L16
	leal	-1(%rax), %r12d
	movl	head(%rip), %r13d
	movl	tail(%rip), %r14d
	leaq	change(%rip), %r11
	leaq	16(%r11), %rax
	salq	$4, %r12
	leaq	-8+que(%rip), %r10
	addq	%rax, %r12
	movl	%r13d, %edi
	movl	%r14d, %r9d
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%edi, %r8
	movq	8(%r11), %rcx
	cmpq	%rcx, (%rbx,%r8,8)
	jge	.L21
	movq	(%r11), %rsi
	testq	%rsi, %rsi
	jle	.L18
	addl	$1, %r9d
	addl	$1, %edi
	addq	%rsi, %r8
	movslq	%r9d, %rdx
	movslq	%edi, %rax
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rcx, (%r10,%rdx,8)
	movl	%eax, %edi
	movl	%edx, %r9d
	cmpq	%r8, %rax
	je	.L29
	movq	(%rbx,%rax,8), %rsi
	addq	$1, %rdx
	addq	$1, %rax
	cmpq	%rcx, %rsi
	jle	.L22
.L29:
	movl	$1, %eax
.L18:
	addq	$16, %r11
	cmpq	%r12, %r11
	jne	.L17
.L21:
	testb	%al, %al
	je	.L16
	movl	%r9d, tail(%rip)
	movl	%r9d, %r14d
	movl	%edi, %r13d
	movl	%edi, head(%rip)
.L16:
	movl	%r13d, %eax
	cmpl	%r13d, %r14d
	jle	.L30
	subl	%r13d, %r14d
	cmpl	$1, %r14d
	je	.L31
	movslq	%r13d, %rax
	pxor	%xmm0, %xmm0
	leaq	(%rbx,%rax,8), %rdx
	movl	%r14d, %eax
	shrl	%eax
	leal	-1(%rax), %ecx
	leaq	16(%rdx), %rax
	salq	$4, %rcx
	addq	%rax, %rcx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L47:
	addq	$16, %rax
.L25:
	movdqu	(%rdx), %xmm1
	movq	%rax, %rdx
	paddq	%xmm1, %xmm0
	cmpq	%rcx, %rax
	jne	.L47
	movdqa	%xmm0, %xmm1
	movl	%r14d, %ecx
	psrldq	$8, %xmm1
	andl	$-2, %ecx
	paddq	%xmm1, %xmm0
	leal	0(%r13,%rcx), %eax
	movq	%xmm0, %rdx
	cmpl	%ecx, %r14d
	je	.L23
.L24:
	cltq
	addq	(%rbx,%rax,8), %rdx
.L23:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L30:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L23
.L31:
	xorl	%edx, %edx
	jmp	.L24
.L48:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	change
	.bss
	.align 32
	.type	change, @object
	.size	change, 1600160
change:
	.zero	1600160
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	head
	.align 4
	.type	head, @object
	.size	head, 4
head:
	.zero	4
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 1600160
que:
	.zero	1600160
	.globl	dc
	.data
	.align 4
	.type	dc, @object
	.size	dc, 4
dc:
	.long	100000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	comp
	.type	comp, @function
comp:
.LFB53:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	setg	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
	ret
	.cfi_endproc
.LFE53:
	.size	comp, .-comp
	.p2align 4
	.globl	comp_c
	.type	comp_c, @function
comp_c:
.LFB54:
	.cfi_startproc
	endbr64
	movq	8(%rdi), %rax
	cmpq	%rax, 8(%rsi)
	setg	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
	ret
	.cfi_endproc
.LFE54:
	.size	comp_c, .-comp_c
	.p2align 4
	.globl	enque
	.type	enque, @function
enque:
.LFB51:
	.cfi_startproc
	endbr64
	movslq	tail(%rip), %rax
	leal	1(%rax), %edx
	movl	%edx, tail(%rip)
	leaq	que(%rip), %rdx
	movq	%rdi, (%rdx,%rax,8)
	ret
	.cfi_endproc
.LFE51:
	.size	enque, .-enque
	.p2align 4
	.globl	deque
	.type	deque, @function
deque:
.LFB52:
	.cfi_startproc
	endbr64
	movslq	head(%rip), %rax
	leal	1(%rax), %edx
	movl	%edx, head(%rip)
	leaq	que(%rip), %rdx
	movq	(%rdx,%rax,8), %rax
	ret
	.cfi_endproc
.LFE52:
	.size	deque, .-deque
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB55:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	que(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	xorl	%r13d, %r13d
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movslq	tail(%rip), %rax
	leal	1(%rax), %edx
	movl	%edx, tail(%rip)
	movq	16(%rsp), %rdx
	movq	%rdx, (%rbx,%rax,8)
	movl	(%rsp), %eax
	cmpl	%r13d, %eax
	jg	.L12
.L11:
	movslq	%eax, %rsi
	leaq	comp(%rip), %rcx
	movl	$8, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L13
	leaq	change(%rip), %r13
	xorl	%r15d, %r15d
	leaq	16(%rsp), %r12
	leaq	8(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L14:
	movq	%r12, %rdx
	movq	%r14, %rsi
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %xmm0
	movl	4(%rsp), %eax
	addl	$1, %r15d
	addq	$16, %r13
	movhps	16(%rsp), %xmm0
	movaps	%xmm0, -16(%r13)
	cmpl	%r15d, %eax
	jg	.L14
.L13:
	movslq	%eax, %rsi
	leaq	comp_c(%rip), %rcx
	movl	$16, %edx
	leaq	change(%rip), %rdi
	call	qsort@PLT
	movl	4(%rsp), %eax
	movl	tail(%rip), %r14d
	movl	head(%rip), %r13d
	testl	%eax, %eax
	jle	.L16
	leal	-1(%rax), %r12d
	movl	head(%rip), %r13d
	movl	tail(%rip), %r14d
	leaq	change(%rip), %r11
	leaq	16(%r11), %rax
	salq	$4, %r12
	leaq	-8+que(%rip), %r10
	addq	%rax, %r12
	movl	%r13d, %edi
	movl	%r14d, %r9d
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	%edi, %r8
	movq	8(%r11), %rcx
	cmpq	%rcx, (%rbx,%r8,8)
	jge	.L21
	movq	(%r11), %rsi
	testq	%rsi, %rsi
	jle	.L18
	addl	$1, %r9d
	addl	$1, %edi
	addq	%rsi, %r8
	movslq	%r9d, %rdx
	movslq	%edi, %rax
	.p2align 4,,10
	.p2align 3
.L22:
	movq	%rcx, (%r10,%rdx,8)
	movl	%eax, %edi
	movl	%edx, %r9d
	cmpq	%r8, %rax
	je	.L29
	movq	(%rbx,%rax,8), %rsi
	addq	$1, %rdx
	addq	$1, %rax
	cmpq	%rcx, %rsi
	jle	.L22
.L29:
	movl	$1, %eax
.L18:
	addq	$16, %r11
	cmpq	%r12, %r11
	jne	.L17
.L21:
	testb	%al, %al
	je	.L16
	movl	%r9d, tail(%rip)
	movl	%r9d, %r14d
	movl	%edi, %r13d
	movl	%edi, head(%rip)
.L16:
	movl	%r13d, %eax
	cmpl	%r13d, %r14d
	jle	.L30
	subl	%r13d, %r14d
	cmpl	$1, %r14d
	je	.L31
	movslq	%r13d, %rax
	pxor	%xmm0, %xmm0
	leaq	(%rbx,%rax,8), %rdx
	movl	%r14d, %eax
	shrl	%eax
	leal	-1(%rax), %ecx
	leaq	16(%rdx), %rax
	salq	$4, %rcx
	addq	%rax, %rcx
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L47:
	addq	$16, %rax
.L25:
	movdqu	(%rdx), %xmm1
	movq	%rax, %rdx
	paddq	%xmm1, %xmm0
	cmpq	%rcx, %rax
	jne	.L47
	movdqa	%xmm0, %xmm1
	movl	%r14d, %ecx
	psrldq	$8, %xmm1
	andl	$-2, %ecx
	paddq	%xmm1, %xmm0
	leal	0(%r13,%rcx), %eax
	movq	%xmm0, %rdx
	cmpl	%ecx, %r14d
	je	.L23
.L24:
	cltq
	addq	(%rbx,%rax,8), %rdx
.L23:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L30:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L23
.L31:
	xorl	%edx, %edx
	jmp	.L24
.L48:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE55:
	.size	main, .-main
	.globl	change
	.bss
	.align 32
	.type	change, @object
	.size	change, 1600160
change:
	.zero	1600160
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.globl	head
	.align 4
	.type	head, @object
	.size	head, 4
head:
	.zero	4
	.globl	que
	.align 32
	.type	que, @object
	.size	que, 1600160
que:
	.zero	1600160
	.globl	dc
	.data
	.align 4
	.type	dc, @object
	.size	dc, 4
dc:
	.long	100000
	.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>
#include<string.h>
#define df 0
#define MAX 100010
int dc=100000;
typedef long int li;

li que[2*MAX];
int head=0,tail=0;
void enque(li a){
  que[tail++]=a;
}
li deque(){
  return que[head++];
}
int comp(const void* a,const void* b){
  li x=*((li*)a),y=*((li*)b);
  return (x-y>0)?1:-1;
}
typedef struct{
  li b;
  li c;
}data;
data change[MAX];

int comp_c(const void* a,const void* b){
  data x=*((data*)a),y=*((data*)b);
  return (y.c-x.c>0)?1:-1;
}

int main(){
  if(df)printf("*** debug mode ***\n");
  int n,m,i;
  scanf("%d%d",&n,&m);
  for(i=0;i<n;i++){
    li a;
    scanf("%ld",&a);
    enque(a);
  }
  qsort(que,n,sizeof(li),comp);
  if(df){
    for(i=head;i<tail;i++)
      printf("%d ",que[i]);
    printf(":que\n");
  }
  for(i=0;i<m;i++){
    li b,c;
    scanf("%ld%ld",&b,&c);
    change[i].b=b;
    change[i].c=c;
  }
  qsort(change,m,sizeof(data),comp_c);
  if(df){
    for(i=0;i<m;i++)
      printf("%d(%d) ",change[i].c,change[i].b);
    printf(":change\n");
  }
  i=0;
  while(i<m && que[head]<change[i].c){
    int j;
    for(j=0;j<change[i].b;j++){
      if(que[head]>change[i].c)break;
      deque();
      enque(change[i].c);
    }
    if(df){
      for(i=head;i<tail;i++)
	printf("%d ",que[i]);
      printf(":que\n");
    }
    i++;
  }

  li sum=0;
  for(i=head;i<tail;i++){
    sum+=que[i];
  }

  printf("%ld",sum);
  return 0;
}


/// confirm df==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<stdlib.h>
#include<string.h>
#define df 0
#define MAX 100010
int dc=100000;
typedef long int li;

li que[2*MAX];
int head=0,tail=0;
void enque(li a){
  que[tail++]=a;
}
li deque(){
  return que[head++];
}
int comp(const void* a,const void* b){
  li x=*((li*)a),y=*((li*)b);
  return (x-y>0)?1:-1;
}
typedef struct{
  li b;
  li c;
}data;
data change[MAX];

int comp_c(const void* a,const void* b){
  data x=*((data*)a),y=*((data*)b);
  return (y.c-x.c>0)?1:-1;
}

int main(){
  if(df)printf("*** debug mode ***\n");
  int n,m,i;
  scanf("%d%d",&n,&m);
  for(i=0;i<n;i++){
    li a;
    scanf("%ld",&a);
    enque(a);
  }
  qsort(que,n,sizeof(li),comp);
  if(df){
    for(i=head;i<tail;i++)
      printf("%d ",que[i]);
    printf(":que\n");
  }
  for(i=0;i<m;i++){
    li b,c;
    scanf("%ld%ld",&b,&c);
    change[i].b=b;
    change[i].c=c;
  }
  qsort(change,m,sizeof(data),comp_c);
  if(df){
    for(i=0;i<m;i++)
      printf("%d(%d) ",change[i].c,change[i].b);
    printf(":change\n");
  }
  i=0;
  while(i<m && que[head]<change[i].c){
    int j;
    for(j=0;j<change[i].b;j++){
      if(que[head]>change[i].c)break;
      deque();
      enque(change[i].c);
    }
    if(df){
      for(i=head;i<tail;i++)
	printf("%d ",que[i]);
      printf(":que\n");
    }
    i++;
  }

  li sum=0;
  for(i=head;i<tail;i++){
    sum+=que[i];
  }

  printf("%ld",sum);
  return 0;
}


/// confirm df==0 ///
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	dc
	.data
	.align 4
	.type	dc, @object
	.size	dc, 4
dc:
	.long	100000
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 1600160
que:
	.zero	1600160
	.globl	head
	.align 4
	.type	head, @object
	.size	head, 4
head:
	.zero	4
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.text
	.globl	enque
	.type	enque, @function
enque:
.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)
	movl	tail(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, tail(%rip)
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	enque, .-enque
	.globl	deque
	.type	deque, @function
deque:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	head(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, head(%rip)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	deque, .-deque
	.globl	comp
	.type	comp, @function
comp:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	subq	-8(%rbp), %rax
	testq	%rax, %rax
	jle	.L5
	movl	$1, %eax
	jmp	.L7
.L5:
	movl	$-1, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	comp, .-comp
	.globl	change
	.bss
	.align 32
	.type	change, @object
	.size	change, 1600160
change:
	.zero	1600160
	.text
	.globl	comp_c
	.type	comp_c, @function
comp_c:
.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, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	%rdx, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	-24(%rbp), %rdx
	subq	%rdx, %rax
	testq	%rax, %rax
	jle	.L9
	movl	$1, %eax
	jmp	.L11
.L9:
	movl	$-1, %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	comp_c, .-comp_c
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld%ld"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -40(%rbp)
	jmp	.L13
.L14:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	enque
	addl	$1, -40(%rbp)
.L13:
	movl	-48(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L14
	movl	-48(%rbp), %eax
	cltq
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	que(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40(%rbp)
	jmp	.L15
.L16:
	leaq	-24(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-32(%rbp), %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	change(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	-24(%rbp), %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+change(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -40(%rbp)
.L15:
	movl	-44(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L16
	movl	-44(%rbp), %eax
	cltq
	leaq	comp_c(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	change(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40(%rbp)
	jmp	.L17
.L23:
	movl	$0, -36(%rbp)
	jmp	.L18
.L21:
	movl	head(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+change(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jg	.L29
	movl	$0, %eax
	call	deque
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+change(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rdi
	call	enque
	addl	$1, -36(%rbp)
.L18:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	change(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jl	.L21
	jmp	.L28
.L29:
	nop
.L28:
	addl	$1, -40(%rbp)
.L17:
	movl	-44(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L22
	movl	head(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+change(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jl	.L23
.L22:
	movq	$0, -16(%rbp)
	movl	head(%rip), %eax
	movl	%eax, -40(%rbp)
	jmp	.L24
.L25:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
	addl	$1, -40(%rbp)
.L24:
	movl	tail(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L25
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	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	dc
	.data
	.align 4
	.type	dc, @object
	.size	dc, 4
dc:
	.long	100000
	.globl	que
	.bss
	.align 32
	.type	que, @object
	.size	que, 1600160
que:
	.zero	1600160
	.globl	head
	.align 4
	.type	head, @object
	.size	head, 4
head:
	.zero	4
	.globl	tail
	.align 4
	.type	tail, @object
	.size	tail, 4
tail:
	.zero	4
	.text
	.globl	enque
	.type	enque, @function
enque:
.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)
	movl	tail(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, tail(%rip)
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	que(%rip), %rdx
	movq	-8(%rbp), %rax
	movq	%rax, (%rcx,%rdx)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	enque, .-enque
	.globl	deque
	.type	deque, @function
deque:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	head(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, head(%rip)
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	deque, .-deque
	.globl	comp
	.type	comp, @function
comp:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	subq	-8(%rbp), %rax
	testq	%rax, %rax
	jle	.L5
	movl	$1, %eax
	jmp	.L7
.L5:
	movl	$-1, %eax
.L7:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	comp, .-comp
	.globl	change
	.bss
	.align 32
	.type	change, @object
	.size	change, 1600160
change:
	.zero	1600160
	.text
	.globl	comp_c
	.type	comp_c, @function
comp_c:
.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, -40(%rbp)
	movq	%rsi, -48(%rbp)
	movq	-40(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movq	%rdx, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	-24(%rbp), %rdx
	subq	%rdx, %rax
	testq	%rax, %rax
	jle	.L9
	movl	$1, %eax
	jmp	.L11
.L9:
	movl	$-1, %eax
.L11:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	comp_c, .-comp_c
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld%ld"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -40(%rbp)
	jmp	.L13
.L14:
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	enque
	addl	$1, -40(%rbp)
.L13:
	movl	-48(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L14
	movl	-48(%rbp), %eax
	cltq
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	que(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40(%rbp)
	jmp	.L15
.L16:
	leaq	-24(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-32(%rbp), %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	change(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	movq	-24(%rbp), %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	leaq	8+change(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
	addl	$1, -40(%rbp)
.L15:
	movl	-44(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L16
	movl	-44(%rbp), %eax
	cltq
	leaq	comp_c(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rsi
	leaq	change(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40(%rbp)
	jmp	.L17
.L23:
	movl	$0, -36(%rbp)
	jmp	.L18
.L21:
	movl	head(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+change(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jg	.L29
	movl	$0, %eax
	call	deque
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	leaq	8+change(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, %rdi
	call	enque
	addl	$1, -36(%rbp)
.L18:
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	change(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jl	.L21
	jmp	.L28
.L29:
	nop
.L28:
	addl	$1, -40(%rbp)
.L17:
	movl	-44(%rbp), %eax
	cmpl	%eax, -40(%rbp)
	jge	.L22
	movl	head(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rcx
	leaq	8+change(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	jl	.L23
.L22:
	movq	$0, -16(%rbp)
	movl	head(%rip), %eax
	movl	%eax, -40(%rbp)
	jmp	.L24
.L25:
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	que(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
	addl	$1, -40(%rbp)
.L24:
	movl	tail(%rip), %eax
	cmpl	%eax, -40(%rbp)
	jl	.L25
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	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:
