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<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

typedef struct snode{
  int64 val;
  int index;
} node;

int cmp(const void *a,const void *b){
  node *aa=(node *)a;
  node *bb=(node *)b;
  if(aa->val!=bb->val) return aa->val-bb->val<0?-1:1;
  if(aa->index!=bb->index) return aa->index-bb->index<0?-1:1;
  return 0;
}

void run(void){
  int n;
  scanf("%d",&n);
  int *a=(int *)malloc(sizeof(int)*n);
  int i;
  for(i=0;i<n;i++) scanf("%d",a+i);
  node *b=(node *)malloc(sizeof(node)*(n+1));
  node *c=(node *)malloc(sizeof(node)*(n+1));
  b[0].val=0;
  b[0].index=0;
  c[0]=b[0];
  for(i=1;i<=n;i++){
    b[i].val=b[i-1].val+a[i-1];
    b[i].index=i;
    c[i]=b[i];
  }
  qsort(c,n+1,sizeof(node),cmp);

  int64 cnt=0;
  for(i=0;i<n;i++){
    node t=b[i];
    int l=0;
    int r=n+1;
    while(l+1<r){
      int m=(l+r)/2;
      if(cmp(&t,&(c[m]))>=0){
	l=m;
      } else 
	r=m;{
      }
    }
    if(r<n+1 && c[r].val!=t.val) continue;
    int ll=r;
    l=0;
    r=n+1;
    while(l+1<r){
      int m=(l+r)/2;
      if(t.val-c[m].val>=0){
	l=m;
      } else {
	r=m;
      }
    }
    int rr=l;
    cnt+=rr-ll+1;
  }
  printf("%lld\n",cnt);
}

int main(void){
  run();
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	je	.L2
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	testq	%rax, %rax
	jns	.L3
	movl	$-1, %eax
	jmp	.L5
.L3:
	movl	$1, %eax
	jmp	.L5
.L2:
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	je	.L6
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jns	.L7
	movl	$-1, %eax
	jmp	.L5
.L7:
	movl	$1, %eax
	jmp	.L5
.L6:
	movl	$0, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-96(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L10
.L11:
	movl	-92(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -92(%rbp)
.L10:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L11
	movl	-96(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	-96(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	-48(%rbp), %rax
	movq	$0, (%rax)
	movq	-48(%rbp), %rax
	movl	$0, 8(%rax)
	movq	-40(%rbp), %rcx
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	movl	$1, -92(%rbp)
	jmp	.L12
.L13:
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	leaq	-16(%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rsi
	movq	-48(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-92(%rbp), %eax
	movl	%eax, 8(%rdx)
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addl	$1, -92(%rbp)
.L12:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jle	.L13
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rsi
	movq	-40(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -64(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L14
.L23:
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movl	$0, -88(%rbp)
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -84(%rbp)
	jmp	.L15
.L17:
	movl	-88(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -68(%rbp)
	movl	-68(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	leaq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	cmp
	testl	%eax, %eax
	js	.L16
	movl	-68(%rbp), %eax
	movl	%eax, -88(%rbp)
	jmp	.L15
.L16:
	movl	-68(%rbp), %eax
	movl	%eax, -84(%rbp)
.L15:
	movl	-88(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -84(%rbp)
	jg	.L17
	movl	-96(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jg	.L18
	movl	-84(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jne	.L25
.L18:
	movl	-84(%rbp), %eax
	movl	%eax, -80(%rbp)
	movl	$0, -88(%rbp)
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -84(%rbp)
	jmp	.L20
.L22:
	movl	-88(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -72(%rbp)
	movq	-32(%rbp), %rax
	movl	-72(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	subq	%rdx, %rax
	testq	%rax, %rax
	js	.L21
	movl	-72(%rbp), %eax
	movl	%eax, -88(%rbp)
	jmp	.L20
.L21:
	movl	-72(%rbp), %eax
	movl	%eax, -84(%rbp)
.L20:
	movl	-88(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -84(%rbp)
	jg	.L22
	movl	-88(%rbp), %eax
	movl	%eax, -76(%rbp)
	movl	-76(%rbp), %eax
	subl	-80(%rbp), %eax
	addl	$1, %eax
	cltq
	addq	%rax, -64(%rbp)
	jmp	.L19
.L25:
	nop
.L19:
	addl	$1, -92(%rbp)
.L14:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L23
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	jne	.L7
	movl	8(%rsi), %edx
	xorl	%eax, %eax
	cmpl	%edx, 8(%rdi)
	je	.L1
.L7:
	setge	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$2, %rdi
	call	malloc@PLT
	testl	%ebx, %ebx
	jle	.L10
	movq	%rax, %r12
	movq	%rax, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r13d
	addq	$4, %rbp
	cmpl	%ebx, %r13d
	jg	.L11
	leal	1(%r13), %r14d
	movslq	%r14d, %r15
	movq	%r15, %rbx
	salq	$4, %rbx
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	$0, 0(%rbp)
	movl	$0, 8(%rbp)
	movdqu	0(%rbp), %xmm1
	movq	%rax, %rbx
	movups	%xmm1, (%rax)
	testl	%r13d, %r13d
	jle	.L12
	movl	%r14d, %edi
	movl	$16, %eax
	movl	$1, %edx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	-4(%r12,%rdx,4), %rsi
	movl	%edx, 8(%rbp,%rax)
	addq	$1, %rdx
	addq	%rsi, %rcx
	movq	%rcx, 0(%rbp,%rax)
	movdqu	0(%rbp,%rax), %xmm0
	movups	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rdx, %rdi
	jne	.L13
.L12:
	leaq	cmp(%rip), %rcx
	movl	$16, %edx
	movq	%r15, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	jle	.L24
	movl	%r10d, %r9d
	leal	1(%r10), %r8d
	movq	%rbp, %rdi
	xorl	%r11d, %r11d
	salq	$4, %r9
	addq	%rbp, %r9
	.p2align 4,,10
	.p2align 3
.L22:
	movq	(%rdi), %rsi
	movl	8(%rdi), %r12d
	movl	%r8d, %ecx
	xorl	%ebp, %ebp
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	cmpl	8(%rax), %r12d
	jne	.L36
	movl	%edx, %ebp
	leal	1(%rbp), %eax
	cmpl	%ecx, %eax
	jge	.L37
.L17:
	leal	(%rcx,%rbp), %edx
	sarl	%edx
	movslq	%edx, %rax
	salq	$4, %rax
	addq	%rbx, %rax
	cmpq	(%rax), %rsi
	je	.L15
.L36:
	cmovge	%edx, %ebp
	cmovl	%edx, %ecx
	leal	1(%rbp), %eax
	cmpl	%ecx, %eax
	jl	.L17
.L37:
	cmpl	%r10d, %ecx
	jg	.L28
	movslq	%ecx, %rax
	salq	$4, %rax
	cmpq	%rsi, (%rbx,%rax)
	je	.L28
.L19:
	addq	$16, %rdi
	cmpq	%rdi, %r9
	jne	.L22
.L14:
	xorl	%eax, %eax
	movq	%r11, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	movl	%r8d, %r12d
	xorl	%ebp, %ebp
	movl	$1, %r13d
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L21:
	leal	(%r12,%rbp), %eax
	sarl	%eax
	movslq	%eax, %rdx
	salq	$4, %rdx
	cmpq	(%rbx,%rdx), %rsi
	jl	.L39
	movl	%eax, %ebp
	leal	1(%rax), %r13d
.L20:
	cmpl	%r13d, %r12d
	jg	.L21
	subl	%ecx, %ebp
	leal	1(%rbp), %eax
	cltq
	addq	%rax, %r11
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L39:
	movl	%eax, %r12d
	jmp	.L20
.L10:
	addl	$1, %ebx
	movslq	%ebx, %r15
	movq	%r15, %r12
	salq	$4, %r12
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	$0, 0(%rbp)
	movl	$0, 8(%rbp)
	movdqu	0(%rbp), %xmm2
	movq	%rax, %rbx
	movups	%xmm2, (%rax)
	jmp	.L12
.L24:
	xorl	%r11d, %r11d
	jmp	.L14
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	cmp
	.type	cmp, @function
cmp:
.LFB39:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	cmpq	%rax, (%rdi)
	jne	.L7
	movl	8(%rsi), %edx
	xorl	%eax, %eax
	cmpl	%edx, 8(%rdi)
	je	.L1
.L7:
	setge	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	cmp, .-cmp
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$2, %rdi
	call	malloc@PLT
	testl	%ebx, %ebx
	jle	.L10
	movq	%rax, %r12
	movq	%rax, %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L11:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r13d
	addq	$4, %rbp
	cmpl	%ebx, %r13d
	jg	.L11
	leal	1(%r13), %r14d
	movslq	%r14d, %r15
	movq	%r15, %rbx
	salq	$4, %rbx
	movq	%rbx, %rdi
	call	malloc@PLT
	movq	%rbx, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	$0, 0(%rbp)
	movl	$0, 8(%rbp)
	movdqu	0(%rbp), %xmm1
	movq	%rax, %rbx
	movups	%xmm1, (%rax)
	testl	%r13d, %r13d
	jle	.L12
	movl	%r14d, %edi
	movl	$16, %eax
	movl	$1, %edx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	-4(%r12,%rdx,4), %rsi
	movl	%edx, 8(%rbp,%rax)
	addq	$1, %rdx
	addq	%rsi, %rcx
	movq	%rcx, 0(%rbp,%rax)
	movdqu	0(%rbp,%rax), %xmm0
	movups	%xmm0, (%rbx,%rax)
	addq	$16, %rax
	cmpq	%rdx, %rdi
	jne	.L13
.L12:
	leaq	cmp(%rip), %rcx
	movl	$16, %edx
	movq	%r15, %rsi
	movq	%rbx, %rdi
	call	qsort@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	jle	.L24
	movl	%r10d, %r9d
	leal	1(%r10), %r8d
	movq	%rbp, %rdi
	xorl	%r11d, %r11d
	salq	$4, %r9
	addq	%rbp, %r9
	.p2align 4,,10
	.p2align 3
.L22:
	movq	(%rdi), %rsi
	movl	8(%rdi), %r12d
	movl	%r8d, %ecx
	xorl	%ebp, %ebp
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L15:
	cmpl	8(%rax), %r12d
	jne	.L36
	movl	%edx, %ebp
	leal	1(%rbp), %eax
	cmpl	%ecx, %eax
	jge	.L37
.L17:
	leal	(%rcx,%rbp), %edx
	sarl	%edx
	movslq	%edx, %rax
	salq	$4, %rax
	addq	%rbx, %rax
	cmpq	(%rax), %rsi
	je	.L15
.L36:
	cmovge	%edx, %ebp
	cmovl	%edx, %ecx
	leal	1(%rbp), %eax
	cmpl	%ecx, %eax
	jl	.L17
.L37:
	cmpl	%r10d, %ecx
	jg	.L28
	movslq	%ecx, %rax
	salq	$4, %rax
	cmpq	%rsi, (%rbx,%rax)
	je	.L28
.L19:
	addq	$16, %rdi
	cmpq	%rdi, %r9
	jne	.L22
.L14:
	xorl	%eax, %eax
	movq	%r11, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	movl	%r8d, %r12d
	xorl	%ebp, %ebp
	movl	$1, %r13d
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L21:
	leal	(%r12,%rbp), %eax
	sarl	%eax
	movslq	%eax, %rdx
	salq	$4, %rdx
	cmpq	(%rbx,%rdx), %rsi
	jl	.L39
	movl	%eax, %ebp
	leal	1(%rax), %r13d
.L20:
	cmpl	%r13d, %r12d
	jg	.L21
	subl	%ecx, %ebp
	leal	1(%rbp), %eax
	cltq
	addq	%rax, %r11
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L39:
	movl	%eax, %r12d
	jmp	.L20
.L10:
	addl	$1, %ebx
	movslq	%ebx, %r15
	movq	%r15, %r12
	salq	$4, %r12
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, %rbp
	call	malloc@PLT
	movq	$0, 0(%rbp)
	movl	$0, 8(%rbp)
	movdqu	0(%rbp), %xmm2
	movq	%rax, %rbx
	movups	%xmm2, (%rax)
	jmp	.L12
.L24:
	xorl	%r11d, %r11d
	jmp	.L14
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB41:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#include<stdlib.h>
#include<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

typedef struct snode{
  int64 val;
  int index;
} node;

int cmp(const void *a,const void *b){
  node *aa=(node *)a;
  node *bb=(node *)b;
  if(aa->val!=bb->val) return aa->val-bb->val<0?-1:1;
  if(aa->index!=bb->index) return aa->index-bb->index<0?-1:1;
  return 0;
}

void run(void){
  int n;
  scanf("%d",&n);
  int *a=(int *)malloc(sizeof(int)*n);
  int i;
  for(i=0;i<n;i++) scanf("%d",a+i);
  node *b=(node *)malloc(sizeof(node)*(n+1));
  node *c=(node *)malloc(sizeof(node)*(n+1));
  b[0].val=0;
  b[0].index=0;
  c[0]=b[0];
  for(i=1;i<=n;i++){
    b[i].val=b[i-1].val+a[i-1];
    b[i].index=i;
    c[i]=b[i];
  }
  qsort(c,n+1,sizeof(node),cmp);

  int64 cnt=0;
  for(i=0;i<n;i++){
    node t=b[i];
    int l=0;
    int r=n+1;
    while(l+1<r){
      int m=(l+r)/2;
      if(cmp(&t,&(c[m]))>=0){
	l=m;
      } else 
	r=m;{
      }
    }
    if(r<n+1 && c[r].val!=t.val) continue;
    int ll=r;
    l=0;
    r=n+1;
    while(l+1<r){
      int m=(l+r)/2;
      if(t.val-c[m].val>=0){
	l=m;
      } else {
	r=m;
      }
    }
    int rr=l;
    cnt+=rr-ll+1;
  }
  printf("%lld\n",cnt);
}

int main(void){
  run();
  return 0;
}
7
0 -1 1 -1 1 -1 1
 5
1 -2 5 -4 5
 6
1 3 -2 2 2 -2
 7
0 -1 0 -1 1 -1 1
 5
1 -1 5 -4 5
 7
0 -1 0 -1 1 -1 0
 7
0 -1 0 -2 1 -1 0
 7
0 -1 0 -2 1 0 -1
 6
0 1 -4 3 0 -2
 7
0 -1 1 -4 0 0 0

13
 1
 3
 8
 2
 7
 5
 4
 6
 9

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<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

typedef struct snode{
  int64 val;
  int index;
} node;

int cmp(const void *a,const void *b){
  node *aa=(node *)a;
  node *bb=(node *)b;
  if(aa->val!=bb->val) return aa->val-bb->val<0?-1:1;
  if(aa->index!=bb->index) return aa->index-bb->index<0?-1:1;
  return 0;
}

void run(void){
  int n;
  scanf("%d",&n);
  int *a=(int *)malloc(sizeof(int)*n);
  int i;
  for(i=0;i<n;i++) scanf("%d",a+i);
  node *b=(node *)malloc(sizeof(node)*(n+1));
  node *c=(node *)malloc(sizeof(node)*(n+1));
  b[0].val=0;
  b[0].index=0;
  c[0]=b[0];
  for(i=1;i<=n;i++){
    b[i].val=b[i-1].val+a[i-1];
    b[i].index=i;
    c[i]=b[i];
  }
  qsort(c,n+1,sizeof(node),cmp);

  int64 cnt=0;
  for(i=0;i<n;i++){
    node t=b[i];
    int l=0;
    int r=n+1;
    while(l+1<r){
      int m=(l+r)/2;
      if(cmp(&t,&(c[m]))>=0){
	l=m;
      } else 
	r=m;{
      }
    }
    if(r<n+1 && c[r].val!=t.val) continue;
    int ll=r;
    l=0;
    r=n+1;
    while(l+1<r){
      int m=(l+r)/2;
      if(t.val-c[m].val>=0){
	l=m;
      } else {
	r=m;
      }
    }
    int rr=l;
    cnt+=rr-ll+1;
  }
  printf("%lld\n",cnt);
}

int main(void){
  run();
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	cmp
	.type	cmp, @function
cmp:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	je	.L2
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	testq	%rax, %rax
	jns	.L3
	movl	$-1, %eax
	jmp	.L5
.L3:
	movl	$1, %eax
	jmp	.L5
.L2:
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	je	.L6
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jns	.L7
	movl	$-1, %eax
	jmp	.L5
.L7:
	movl	$1, %eax
	jmp	.L5
.L6:
	movl	$0, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-96(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L10
.L11:
	movl	-92(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -92(%rbp)
.L10:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L11
	movl	-96(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	-96(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	-48(%rbp), %rax
	movq	$0, (%rax)
	movq	-48(%rbp), %rax
	movl	$0, 8(%rax)
	movq	-40(%rbp), %rcx
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	movl	$1, -92(%rbp)
	jmp	.L12
.L13:
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	leaq	-16(%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rsi
	movq	-48(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-92(%rbp), %eax
	movl	%eax, 8(%rdx)
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addl	$1, -92(%rbp)
.L12:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jle	.L13
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rsi
	movq	-40(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -64(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L14
.L23:
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movl	$0, -88(%rbp)
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -84(%rbp)
	jmp	.L15
.L17:
	movl	-88(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -68(%rbp)
	movl	-68(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	leaq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	cmp
	testl	%eax, %eax
	js	.L16
	movl	-68(%rbp), %eax
	movl	%eax, -88(%rbp)
	jmp	.L15
.L16:
	movl	-68(%rbp), %eax
	movl	%eax, -84(%rbp)
.L15:
	movl	-88(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -84(%rbp)
	jg	.L17
	movl	-96(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jg	.L18
	movl	-84(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jne	.L25
.L18:
	movl	-84(%rbp), %eax
	movl	%eax, -80(%rbp)
	movl	$0, -88(%rbp)
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -84(%rbp)
	jmp	.L20
.L22:
	movl	-88(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -72(%rbp)
	movq	-32(%rbp), %rax
	movl	-72(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	subq	%rdx, %rax
	testq	%rax, %rax
	js	.L21
	movl	-72(%rbp), %eax
	movl	%eax, -88(%rbp)
	jmp	.L20
.L21:
	movl	-72(%rbp), %eax
	movl	%eax, -84(%rbp)
.L20:
	movl	-88(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -84(%rbp)
	jg	.L22
	movl	-88(%rbp), %eax
	movl	%eax, -76(%rbp)
	movl	-76(%rbp), %eax
	subl	-80(%rbp), %eax
	addl	$1, %eax
	cltq
	addq	%rax, -64(%rbp)
	jmp	.L19
.L25:
	nop
.L19:
	addl	$1, -92(%rbp)
.L14:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L23
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	cmp
	.type	cmp, @function
cmp:
.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, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rdx
	je	.L2
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	testq	%rax, %rax
	jns	.L3
	movl	$-1, %eax
	jmp	.L5
.L3:
	movl	$1, %eax
	jmp	.L5
.L2:
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %eax
	cmpl	%eax, %edx
	je	.L6
	movq	-16(%rbp), %rax
	movl	8(%rax), %edx
	movq	-8(%rbp), %rax
	movl	8(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jns	.L7
	movl	$-1, %eax
	jmp	.L5
.L7:
	movl	$1, %eax
	jmp	.L5
.L6:
	movl	$0, %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	cmp, .-cmp
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-96(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -56(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L10
.L11:
	movl	-92(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -92(%rbp)
.L10:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L11
	movl	-96(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -48(%rbp)
	movl	-96(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -40(%rbp)
	movq	-48(%rbp), %rax
	movq	$0, (%rax)
	movq	-48(%rbp), %rax
	movl	$0, 8(%rax)
	movq	-40(%rbp), %rcx
	movq	-48(%rbp), %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	movl	$1, -92(%rbp)
	jmp	.L12
.L13:
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	leaq	-16(%rax), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-92(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movslq	%eax, %rdx
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rsi
	movq	-48(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rax, %rdx
	movl	-92(%rbp), %eax
	movl	%eax, 8(%rdx)
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rdx, %rcx
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	%rdx, 8(%rcx)
	addl	$1, -92(%rbp)
.L12:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jle	.L13
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rsi
	movq	-40(%rbp), %rax
	leaq	cmp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$16, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movq	$0, -64(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L14
.L23:
	movl	-92(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	8(%rax), %rdx
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rdx, -24(%rbp)
	movl	$0, -88(%rbp)
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -84(%rbp)
	jmp	.L15
.L17:
	movl	-88(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -68(%rbp)
	movl	-68(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rax, %rdx
	leaq	-32(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	cmp
	testl	%eax, %eax
	js	.L16
	movl	-68(%rbp), %eax
	movl	%eax, -88(%rbp)
	jmp	.L15
.L16:
	movl	-68(%rbp), %eax
	movl	%eax, -84(%rbp)
.L15:
	movl	-88(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -84(%rbp)
	jg	.L17
	movl	-96(%rbp), %eax
	cmpl	%eax, -84(%rbp)
	jg	.L18
	movl	-84(%rbp), %eax
	cltq
	salq	$4, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movq	-32(%rbp), %rax
	cmpq	%rax, %rdx
	jne	.L25
.L18:
	movl	-84(%rbp), %eax
	movl	%eax, -80(%rbp)
	movl	$0, -88(%rbp)
	movl	-96(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -84(%rbp)
	jmp	.L20
.L22:
	movl	-88(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -72(%rbp)
	movq	-32(%rbp), %rax
	movl	-72(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rdx, %rcx
	salq	$4, %rcx
	movq	-40(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rdx), %rdx
	subq	%rdx, %rax
	testq	%rax, %rax
	js	.L21
	movl	-72(%rbp), %eax
	movl	%eax, -88(%rbp)
	jmp	.L20
.L21:
	movl	-72(%rbp), %eax
	movl	%eax, -84(%rbp)
.L20:
	movl	-88(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -84(%rbp)
	jg	.L22
	movl	-88(%rbp), %eax
	movl	%eax, -76(%rbp)
	movl	-76(%rbp), %eax
	subl	-80(%rbp), %eax
	addl	$1, %eax
	cltq
	addq	%rax, -64(%rbp)
	jmp	.L19
.L25:
	nop
.L19:
	addl	$1, -92(%rbp)
.L14:
	movl	-96(%rbp), %eax
	cmpl	%eax, -92(%rbp)
	jl	.L23
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
