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>
#define MAX 100001

int list[MAX][2];

int compare(void *a, void *b){
  if(((int*)a)[0] == ((int*)b)[0]){
    return ((int*)b)[1] - ((int*)a)[1];
  }else{
    return ((int*)a)[0] - ((int*)b)[0];
  }
}

int main(){
  int n,m,lead[MAX],
      index,*ago,start,p,
      i,j,sum=0;
  
  scanf("%d%d", &n, &m);
  for(i=0;i<n;i++){
    scanf("%d%d", &list[i][0], &list[i][1]);
  }
  
  qsort(list, n, sizeof(int) * 2, compare);
  
  if(list[0][0] > m){
    printf("0");
    return 0;
  }
  p = 0;
  
  i=1;
  j=0;
  while(1){
    start = j;
    i = list[j][0];
    while(i == list[j][0]){
      j++;
      if(j==n)break;
    }
    if(j==n)break;
    if(list[j][0] > m)break;
    lead[start] = j;
  }
  lead[start] = -1;
  
  for(i=1;i<=m;i++){
    if(list[p][0] > i)continue;
    ago = &p;
    index = p;
    j = p;
    while(lead[j] != -1){
      if(list[lead[j]][0] > i)break;
      if(list[lead[j]][1] > list[index][1]){
        index = lead[j];
        ago = &lead[j];
      }
      j = lead[j];
    }
    sum += list[index][1];
    if(index+1 == n){
      *ago = -1;
    }else if(list[index+1][0] == list[index][0]){
      *ago += 1;
      lead[index+1] = lead[index];
    }else{
      *ago = lead[index];
    }
    if(p == -1)break;
  }
      
  printf("%d", sum);
  
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	list
	.bss
	.align 32
	.type	list, @object
	.size	list, 800008
list:
	.zero	800008
	.text
	.globl	compare
	.type	compare, @function
compare:
.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), %eax
	cmpl	%eax, %edx
	jne	.L2
	movq	-16(%rbp), %rax
	addq	$4, %rax
	movl	(%rax), %eax
	movq	-8(%rbp), %rdx
	addq	$4, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2752, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400032(%rbp)
	leaq	-400052(%rbp), %rdx
	leaq	-400056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400040(%rbp)
	jmp	.L5
.L6:
	movl	-400040(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	4(%rax), %rdx
	leaq	list(%rip), %rax
	addq	%rax, %rdx
	movl	-400040(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	list(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400040(%rbp)
.L5:
	movl	-400056(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L6
	movl	-400056(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	list(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	list(%rip), %edx
	movl	-400052(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L29
.L7:
	movl	$0, -400048(%rbp)
	movl	$1, -400040(%rbp)
	movl	$0, -400036(%rbp)
.L15:
	movl	-400036(%rbp), %eax
	movl	%eax, -400028(%rbp)
	movl	-400036(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -400040(%rbp)
	jmp	.L9
.L11:
	addl	$1, -400036(%rbp)
	movl	-400056(%rbp), %eax
	cmpl	%eax, -400036(%rbp)
	je	.L31
.L9:
	movl	-400036(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -400040(%rbp)
	je	.L11
	jmp	.L10
.L31:
	nop
.L10:
	movl	-400056(%rbp), %eax
	cmpl	%eax, -400036(%rbp)
	je	.L32
	movl	-400036(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400052(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L33
	movl	-400028(%rbp), %eax
	cltq
	movl	-400036(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	jmp	.L15
.L32:
	nop
	jmp	.L13
.L33:
	nop
.L13:
	movl	-400028(%rbp), %eax
	cltq
	movl	$-1, -400016(%rbp,%rax,4)
	movl	$1, -400040(%rbp)
	jmp	.L16
.L28:
	movl	-400048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L34
	leaq	-400048(%rbp), %rax
	movq	%rax, -400024(%rbp)
	movl	-400048(%rbp), %eax
	movl	%eax, -400044(%rbp)
	movl	-400048(%rbp), %eax
	movl	%eax, -400036(%rbp)
	jmp	.L19
.L23:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L35
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+list(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400044(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+list(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L22
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, -400044(%rbp)
	leaq	-400016(%rbp), %rdx
	movl	-400036(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, -400024(%rbp)
.L22:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, -400036(%rbp)
.L19:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	jne	.L23
	jmp	.L21
.L35:
	nop
.L21:
	movl	-400044(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+list(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -400032(%rbp)
	movl	-400044(%rbp), %eax
	leal	1(%rax), %edx
	movl	-400056(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L24
	movq	-400024(%rbp), %rax
	movl	$-1, (%rax)
	jmp	.L25
.L24:
	movl	-400044(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400044(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	list(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L26
	movq	-400024(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-400024(%rbp), %rax
	movl	%edx, (%rax)
	movl	-400044(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-400044(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -400016(%rbp,%rax,4)
	jmp	.L25
.L26:
	movl	-400044(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movq	-400024(%rbp), %rax
	movl	%edx, (%rax)
.L25:
	movl	-400048(%rbp), %eax
	cmpl	$-1, %eax
	je	.L36
	jmp	.L18
.L34:
	nop
.L18:
	addl	$1, -400040(%rbp)
.L16:
	movl	-400052(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jle	.L28
	jmp	.L27
.L36:
	nop
.L27:
	movl	-400032(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L29:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %ecx
	movl	(%rsi), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	cmpl	%edx, %ecx
	je	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	4(%rsi), %eax
	subl	4(%rdi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397360
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400080
	leaq	.LC0(%rip), %r13
	leaq	list(%rip), %rbx
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	movq	%rbx, %rbp
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L8:
	leaq	4(%rbp), %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addl	$1, %r12d
	addq	$8, %rbp
	cmpl	%r12d, %eax
	jg	.L8
.L7:
	movslq	%eax, %rsi
	leaq	compare(%rip), %rcx
	movl	$8, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	list(%rip), %r10d
	movl	8(%rsp), %r9d
	cmpl	%r9d, %r10d
	jg	.L34
	movl	$0, 12(%rsp)
	movl	4(%rsp), %r8d
	movl	%r10d, %esi
	xorl	%r11d, %r11d
	leaq	-8+list(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L13:
	leal	1(%r11), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, %ecx
	cmpl	%eax, %r8d
	je	.L11
	addq	$1, %rax
	movl	(%rdi,%rax,8), %edx
	cmpl	%esi, %edx
	je	.L12
	cmpl	%edx, %r9d
	jl	.L11
	movl	%ecx, 16(%rsp,%r11,4)
	movl	%edx, %esi
	movslq	%ecx, %r11
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$-1, 16(%rsp,%r11,4)
	testl	%r9d, %r9d
	jle	.L24
	xorl	%r11d, %r11d
	xorl	%r12d, %r12d
	leaq	12(%rsp), %r13
	movl	$1, %edi
	leaq	16(%rsp), %rbp
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L15:
	addl	$1, %edi
	cmpl	%edi, %r9d
	jl	.L14
	movslq	%r11d, %rax
	movl	(%rbx,%rax,8), %r10d
.L22:
	cmpl	%r10d, %edi
	jl	.L15
	movslq	%r11d, %rax
	movl	16(%rsp,%rax,4), %edx
	movl	4(%rbx,%rax,8), %r10d
	cmpl	$-1, %edx
	je	.L25
	movslq	%r11d, %rcx
	movq	%r13, %r14
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L35:
	movl	4(%rbx,%rax,8), %esi
	cmpl	%r10d, %esi
	jle	.L17
	leaq	0(%rbp,%rcx,4), %r14
	movl	%esi, %r10d
	movslq	%edx, %r11
.L17:
	movl	16(%rsp,%rax,4), %eax
	movslq	%edx, %rcx
	cmpl	$-1, %eax
	je	.L16
	movl	%eax, %edx
.L18:
	movslq	%edx, %rax
	cmpl	%edi, (%rbx,%rax,8)
	jle	.L35
.L16:
	leal	1(%r11), %eax
	addl	%r10d, %r12d
	cmpl	%eax, %r8d
	je	.L36
	cltq
	movl	(%rbx,%r11,8), %ecx
	cmpl	%ecx, (%rbx,%rax,8)
	je	.L37
	movl	16(%rsp,%r11,4), %eax
	movl	%eax, (%r14)
.L20:
	movslq	12(%rsp), %r11
	cmpl	$-1, %r11d
	jne	.L15
.L14:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L10:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$400032, %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
	.p2align 4,,10
	.p2align 3
.L36:
	.cfi_restore_state
	movl	$-1, (%r14)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, (%r14)
	movl	16(%rsp,%r11,4), %edx
	movl	%edx, 16(%rsp,%rax,4)
	jmp	.L20
.L25:
	movq	%r13, %r14
	jmp	.L16
.L34:
	movl	$48, %edi
	call	putchar@PLT
	jmp	.L10
.L24:
	xorl	%r12d, %r12d
	jmp	.L14
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	list
	.bss
	.align 32
	.type	list, @object
	.size	list, 800008
list:
	.zero	800008
	.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	compare
	.type	compare, @function
compare:
.LFB39:
	.cfi_startproc
	endbr64
	movl	(%rdi), %ecx
	movl	(%rsi), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	cmpl	%edx, %ecx
	je	.L5
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	movl	4(%rsi), %eax
	subl	4(%rdi), %eax
	ret
	.cfi_endproc
.LFE39:
	.size	compare, .-compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397360
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400080
	leaq	.LC0(%rip), %r13
	leaq	list(%rip), %rbx
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L7
	movq	%rbx, %rbp
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L8:
	leaq	4(%rbp), %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	addl	$1, %r12d
	addq	$8, %rbp
	cmpl	%r12d, %eax
	jg	.L8
.L7:
	movslq	%eax, %rsi
	leaq	compare(%rip), %rcx
	movl	$8, %edx
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	list(%rip), %r10d
	movl	8(%rsp), %r9d
	cmpl	%r9d, %r10d
	jg	.L34
	movl	$0, 12(%rsp)
	movl	4(%rsp), %r8d
	movl	%r10d, %esi
	xorl	%r11d, %r11d
	leaq	-8+list(%rip), %rdi
	.p2align 4,,10
	.p2align 3
.L13:
	leal	1(%r11), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%eax, %ecx
	cmpl	%eax, %r8d
	je	.L11
	addq	$1, %rax
	movl	(%rdi,%rax,8), %edx
	cmpl	%esi, %edx
	je	.L12
	cmpl	%edx, %r9d
	jl	.L11
	movl	%ecx, 16(%rsp,%r11,4)
	movl	%edx, %esi
	movslq	%ecx, %r11
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	movl	$-1, 16(%rsp,%r11,4)
	testl	%r9d, %r9d
	jle	.L24
	xorl	%r11d, %r11d
	xorl	%r12d, %r12d
	leaq	12(%rsp), %r13
	movl	$1, %edi
	leaq	16(%rsp), %rbp
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L15:
	addl	$1, %edi
	cmpl	%edi, %r9d
	jl	.L14
	movslq	%r11d, %rax
	movl	(%rbx,%rax,8), %r10d
.L22:
	cmpl	%r10d, %edi
	jl	.L15
	movslq	%r11d, %rax
	movl	16(%rsp,%rax,4), %edx
	movl	4(%rbx,%rax,8), %r10d
	cmpl	$-1, %edx
	je	.L25
	movslq	%r11d, %rcx
	movq	%r13, %r14
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L35:
	movl	4(%rbx,%rax,8), %esi
	cmpl	%r10d, %esi
	jle	.L17
	leaq	0(%rbp,%rcx,4), %r14
	movl	%esi, %r10d
	movslq	%edx, %r11
.L17:
	movl	16(%rsp,%rax,4), %eax
	movslq	%edx, %rcx
	cmpl	$-1, %eax
	je	.L16
	movl	%eax, %edx
.L18:
	movslq	%edx, %rax
	cmpl	%edi, (%rbx,%rax,8)
	jle	.L35
.L16:
	leal	1(%r11), %eax
	addl	%r10d, %r12d
	cmpl	%eax, %r8d
	je	.L36
	cltq
	movl	(%rbx,%r11,8), %ecx
	cmpl	%ecx, (%rbx,%rax,8)
	je	.L37
	movl	16(%rsp,%r11,4), %eax
	movl	%eax, (%r14)
.L20:
	movslq	12(%rsp), %r11
	cmpl	$-1, %r11d
	jne	.L15
.L14:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L10:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$400032, %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
	.p2align 4,,10
	.p2align 3
.L36:
	.cfi_restore_state
	movl	$-1, (%r14)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L37:
	addl	$1, (%r14)
	movl	16(%rsp,%r11,4), %edx
	movl	%edx, 16(%rsp,%rax,4)
	jmp	.L20
.L25:
	movq	%r13, %r14
	jmp	.L16
.L34:
	movl	$48, %edi
	call	putchar@PLT
	jmp	.L10
.L24:
	xorl	%r12d, %r12d
	jmp	.L14
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	list
	.bss
	.align 32
	.type	list, @object
	.size	list, 800008
list:
	.zero	800008
	.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>
#define MAX 100001

int list[MAX][2];

int compare(void *a, void *b){
  if(((int*)a)[0] == ((int*)b)[0]){
    return ((int*)b)[1] - ((int*)a)[1];
  }else{
    return ((int*)a)[0] - ((int*)b)[0];
  }
}

int main(){
  int n,m,lead[MAX],
      index,*ago,start,p,
      i,j,sum=0;
  
  scanf("%d%d", &n, &m);
  for(i=0;i<n;i++){
    scanf("%d%d", &list[i][0], &list[i][1]);
  }
  
  qsort(list, n, sizeof(int) * 2, compare);
  
  if(list[0][0] > m){
    printf("0");
    return 0;
  }
  p = 0;
  
  i=1;
  j=0;
  while(1){
    start = j;
    i = list[j][0];
    while(i == list[j][0]){
      j++;
      if(j==n)break;
    }
    if(j==n)break;
    if(list[j][0] > m)break;
    lead[start] = j;
  }
  lead[start] = -1;
  
  for(i=1;i<=m;i++){
    if(list[p][0] > i)continue;
    ago = &p;
    index = p;
    j = p;
    while(lead[j] != -1){
      if(list[lead[j]][0] > i)break;
      if(list[lead[j]][1] > list[index][1]){
        index = lead[j];
        ago = &lead[j];
      }
      j = lead[j];
    }
    sum += list[index][1];
    if(index+1 == n){
      *ago = -1;
    }else if(list[index+1][0] == list[index][0]){
      *ago += 1;
      lead[index+1] = lead[index];
    }else{
      *ago = lead[index];
    }
    if(p == -1)break;
  }
      
  printf("%d", sum);
  
  return 0;
}
5 3
1 2
1 3
1 4
1 1
2 3
 3 4
4 3
4 1
3 2
 5 3
1 2
1 0
1 4
1 1
2 3
 1 3
1 2
1 0
1 4
1 1
2 3
 3 4
4 3
3 0
3 4
 3 4
4 3
3 1
2 4
 3 0
4 3
3 1
2 4
 1 1
1 21
8 2
0 81
 3 5
4 3
4 1
2 2
 3 4
4 3
4 1
6 2

10 5 9 2 7 8 0 21 6 3
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>
#define MAX 100001

int list[MAX][2];

int compare(void *a, void *b){
  if(((int*)a)[0] == ((int*)b)[0]){
    return ((int*)b)[1] - ((int*)a)[1];
  }else{
    return ((int*)a)[0] - ((int*)b)[0];
  }
}

int main(){
  int n,m,lead[MAX],
      index,*ago,start,p,
      i,j,sum=0;
  
  scanf("%d%d", &n, &m);
  for(i=0;i<n;i++){
    scanf("%d%d", &list[i][0], &list[i][1]);
  }
  
  qsort(list, n, sizeof(int) * 2, compare);
  
  if(list[0][0] > m){
    printf("0");
    return 0;
  }
  p = 0;
  
  i=1;
  j=0;
  while(1){
    start = j;
    i = list[j][0];
    while(i == list[j][0]){
      j++;
      if(j==n)break;
    }
    if(j==n)break;
    if(list[j][0] > m)break;
    lead[start] = j;
  }
  lead[start] = -1;
  
  for(i=1;i<=m;i++){
    if(list[p][0] > i)continue;
    ago = &p;
    index = p;
    j = p;
    while(lead[j] != -1){
      if(list[lead[j]][0] > i)break;
      if(list[lead[j]][1] > list[index][1]){
        index = lead[j];
        ago = &lead[j];
      }
      j = lead[j];
    }
    sum += list[index][1];
    if(index+1 == n){
      *ago = -1;
    }else if(list[index+1][0] == list[index][0]){
      *ago += 1;
      lead[index+1] = lead[index];
    }else{
      *ago = lead[index];
    }
    if(p == -1)break;
  }
      
  printf("%d", sum);
  
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	list
	.bss
	.align 32
	.type	list, @object
	.size	list, 800008
list:
	.zero	800008
	.text
	.globl	compare
	.type	compare, @function
compare:
.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), %eax
	cmpl	%eax, %edx
	jne	.L2
	movq	-16(%rbp), %rax
	addq	$4, %rax
	movl	(%rax), %eax
	movq	-8(%rbp), %rdx
	addq	$4, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2752, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400032(%rbp)
	leaq	-400052(%rbp), %rdx
	leaq	-400056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400040(%rbp)
	jmp	.L5
.L6:
	movl	-400040(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	4(%rax), %rdx
	leaq	list(%rip), %rax
	addq	%rax, %rdx
	movl	-400040(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	list(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400040(%rbp)
.L5:
	movl	-400056(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L6
	movl	-400056(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	list(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	list(%rip), %edx
	movl	-400052(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L29
.L7:
	movl	$0, -400048(%rbp)
	movl	$1, -400040(%rbp)
	movl	$0, -400036(%rbp)
.L15:
	movl	-400036(%rbp), %eax
	movl	%eax, -400028(%rbp)
	movl	-400036(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -400040(%rbp)
	jmp	.L9
.L11:
	addl	$1, -400036(%rbp)
	movl	-400056(%rbp), %eax
	cmpl	%eax, -400036(%rbp)
	je	.L31
.L9:
	movl	-400036(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -400040(%rbp)
	je	.L11
	jmp	.L10
.L31:
	nop
.L10:
	movl	-400056(%rbp), %eax
	cmpl	%eax, -400036(%rbp)
	je	.L32
	movl	-400036(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400052(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L33
	movl	-400028(%rbp), %eax
	cltq
	movl	-400036(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	jmp	.L15
.L32:
	nop
	jmp	.L13
.L33:
	nop
.L13:
	movl	-400028(%rbp), %eax
	cltq
	movl	$-1, -400016(%rbp,%rax,4)
	movl	$1, -400040(%rbp)
	jmp	.L16
.L28:
	movl	-400048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L34
	leaq	-400048(%rbp), %rax
	movq	%rax, -400024(%rbp)
	movl	-400048(%rbp), %eax
	movl	%eax, -400044(%rbp)
	movl	-400048(%rbp), %eax
	movl	%eax, -400036(%rbp)
	jmp	.L19
.L23:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L35
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+list(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400044(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+list(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L22
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, -400044(%rbp)
	leaq	-400016(%rbp), %rdx
	movl	-400036(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, -400024(%rbp)
.L22:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, -400036(%rbp)
.L19:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	jne	.L23
	jmp	.L21
.L35:
	nop
.L21:
	movl	-400044(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+list(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -400032(%rbp)
	movl	-400044(%rbp), %eax
	leal	1(%rax), %edx
	movl	-400056(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L24
	movq	-400024(%rbp), %rax
	movl	$-1, (%rax)
	jmp	.L25
.L24:
	movl	-400044(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400044(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	list(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L26
	movq	-400024(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-400024(%rbp), %rax
	movl	%edx, (%rax)
	movl	-400044(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-400044(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -400016(%rbp,%rax,4)
	jmp	.L25
.L26:
	movl	-400044(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movq	-400024(%rbp), %rax
	movl	%edx, (%rax)
.L25:
	movl	-400048(%rbp), %eax
	cmpl	$-1, %eax
	je	.L36
	jmp	.L18
.L34:
	nop
.L18:
	addl	$1, -400040(%rbp)
.L16:
	movl	-400052(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jle	.L28
	jmp	.L27
.L36:
	nop
.L27:
	movl	-400032(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L29:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	list
	.bss
	.align 32
	.type	list, @object
	.size	list, 800008
list:
	.zero	800008
	.text
	.globl	compare
	.type	compare, @function
compare:
.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), %eax
	cmpl	%eax, %edx
	jne	.L2
	movq	-16(%rbp), %rax
	addq	$4, %rax
	movl	(%rax), %eax
	movq	-8(%rbp), %rdx
	addq	$4, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare, .-compare
	.section	.rodata
.LC0:
	.string	"%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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2752, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -400032(%rbp)
	leaq	-400052(%rbp), %rdx
	leaq	-400056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400040(%rbp)
	jmp	.L5
.L6:
	movl	-400040(%rbp), %eax
	cltq
	salq	$3, %rax
	leaq	4(%rax), %rdx
	leaq	list(%rip), %rax
	addq	%rax, %rdx
	movl	-400040(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	list(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400040(%rbp)
.L5:
	movl	-400056(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L6
	movl	-400056(%rbp), %eax
	cltq
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rsi
	leaq	list(%rip), %rax
	movq	%rax, %rdi
	call	qsort@PLT
	movl	list(%rip), %edx
	movl	-400052(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L7
	movl	$48, %edi
	call	putchar@PLT
	movl	$0, %eax
	jmp	.L29
.L7:
	movl	$0, -400048(%rbp)
	movl	$1, -400040(%rbp)
	movl	$0, -400036(%rbp)
.L15:
	movl	-400036(%rbp), %eax
	movl	%eax, -400028(%rbp)
	movl	-400036(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -400040(%rbp)
	jmp	.L9
.L11:
	addl	$1, -400036(%rbp)
	movl	-400056(%rbp), %eax
	cmpl	%eax, -400036(%rbp)
	je	.L31
.L9:
	movl	-400036(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -400040(%rbp)
	je	.L11
	jmp	.L10
.L31:
	nop
.L10:
	movl	-400056(%rbp), %eax
	cmpl	%eax, -400036(%rbp)
	je	.L32
	movl	-400036(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400052(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L33
	movl	-400028(%rbp), %eax
	cltq
	movl	-400036(%rbp), %edx
	movl	%edx, -400016(%rbp,%rax,4)
	jmp	.L15
.L32:
	nop
	jmp	.L13
.L33:
	nop
.L13:
	movl	-400028(%rbp), %eax
	cltq
	movl	$-1, -400016(%rbp,%rax,4)
	movl	$1, -400040(%rbp)
	jmp	.L16
.L28:
	movl	-400048(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L34
	leaq	-400048(%rbp), %rax
	movq	%rax, -400024(%rbp)
	movl	-400048(%rbp), %eax
	movl	%eax, -400044(%rbp)
	movl	-400048(%rbp), %eax
	movl	%eax, -400036(%rbp)
	jmp	.L19
.L23:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -400040(%rbp)
	jl	.L35
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+list(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400044(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	4+list(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jle	.L22
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, -400044(%rbp)
	leaq	-400016(%rbp), %rdx
	movl	-400036(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, -400024(%rbp)
.L22:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, -400036(%rbp)
.L19:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	jne	.L23
	jmp	.L21
.L35:
	nop
.L21:
	movl	-400044(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+list(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -400032(%rbp)
	movl	-400044(%rbp), %eax
	leal	1(%rax), %edx
	movl	-400056(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L24
	movq	-400024(%rbp), %rax
	movl	$-1, (%rax)
	jmp	.L25
.L24:
	movl	-400044(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	list(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-400044(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	leaq	list(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	jne	.L26
	movq	-400024(%rbp), %rax
	movl	(%rax), %eax
	leal	1(%rax), %edx
	movq	-400024(%rbp), %rax
	movl	%edx, (%rax)
	movl	-400044(%rbp), %eax
	leal	1(%rax), %ecx
	movl	-400044(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%ecx, %rax
	movl	%edx, -400016(%rbp,%rax,4)
	jmp	.L25
.L26:
	movl	-400044(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movq	-400024(%rbp), %rax
	movl	%edx, (%rax)
.L25:
	movl	-400048(%rbp), %eax
	cmpl	$-1, %eax
	je	.L36
	jmp	.L18
.L34:
	nop
.L18:
	addl	$1, -400040(%rbp)
.L16:
	movl	-400052(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jle	.L28
	jmp	.L27
.L36:
	nop
.L27:
	movl	-400032(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L29:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
