Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<string.h>

long long down(const void *a,const void *b){
  return *(long long *)b - *(long long *)a;
}

int main(void){
  long long  n;
  scanf("%lld\n",&n);

  long long a[n];
  for(int i = 0;i < n;i ++){
    scanf("%lld",&a[i]);
  }

  qsort(a,n,sizeof(long long),down);

  /*for(int i = 0;i < n;i ++){
    printf("%lld\n",a[i]);
  }*/

  long long ans = 0;
  int count = 0;
  for(int i = 0;i < n-1;i ++){
    if(a[i] == a[i+1]){
      if(ans == 0){
        ans = 1;
      }
      ans *= a[i];
      i ++;
      count ++;
    }
    if(count > 1){
      i += n;
    }
  }
  if(count == 2){
  printf("%lld\n",ans);
  }
  
  else{
    printf("0\n");
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	down
	.type	down, @function
down:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	down, .-down
	.section	.rodata
.LC0:
	.string	"%lld\n"
.LC1:
	.string	"%lld"
.LC2:
	.string	"0"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -100(%rbp)
	jmp	.L7
.L8:
	movl	-100(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -100(%rbp)
.L7:
	movl	-100(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L8
	movq	-88(%rbp), %rsi
	movq	-64(%rbp), %rax
	leaq	down(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movq	$0, -80(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L9
.L13:
	movq	-64(%rbp), %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movl	-92(%rbp), %eax
	leal	1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jne	.L10
	cmpq	$0, -80(%rbp)
	jne	.L11
	movq	$1, -80(%rbp)
.L11:
	movq	-64(%rbp), %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-80(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -80(%rbp)
	addl	$1, -92(%rbp)
	addl	$1, -96(%rbp)
.L10:
	cmpl	$1, -96(%rbp)
	jle	.L12
	movq	-88(%rbp), %rax
	movl	%eax, %edx
	movl	-92(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -92(%rbp)
.L12:
	addl	$1, -92(%rbp)
.L9:
	movl	-92(%rbp), %eax
	cltq
	movq	-88(%rbp), %rdx
	subq	$1, %rdx
	cmpq	%rdx, %rax
	jl	.L13
	cmpl	$2, -96(%rbp)
	jne	.L14
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	down
	.type	down, @function
down:
.LFB35:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	subq	(%rdi), %rax
	ret
	.cfi_endproc
.LFE35:
	.size	down, .-down
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld\n"
.LC1:
	.string	"%lld"
.LC2:
	.string	"0"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rcx
	leaq	15(,%rsi,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L5
.L25:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L25
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L26
.L6:
	movq	%rsp, %r15
	testq	%rsi, %rsi
	jle	.L7
	movq	%r15, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	addq	$8, %r12
	cmpq	%rbx, %rsi
	jg	.L8
.L7:
	leaq	down(%rip), %rcx
	movl	$8, %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	qsort@PLT
	movq	-64(%rbp), %r10
	leaq	-1(%r10), %r8
	testq	%r8, %r8
	jle	.L9
	xorl	%eax, %eax
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	(%r15,%rdx,8), %rcx
	leal	1(%rax), %edx
	movslq	%edx, %rsi
	cmpq	%rcx, (%r15,%rsi,8)
	je	.L27
.L10:
	cmpl	$1, %edi
	jle	.L12
	leal	1(%rax,%r10), %eax
	movslq	%eax, %rdx
	cmpq	%rdx, %r8
	jg	.L15
	cmpl	$2, %edi
	jne	.L9
	movq	%r9, %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L28
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	addl	$1, %eax
	movslq	%eax, %rdx
	cmpq	%rdx, %r8
	jg	.L15
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L27:
	testq	%r9, %r9
	je	.L18
	imulq	%rcx, %r9
.L11:
	addl	$1, %edi
	movl	%edx, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rcx, %r9
	jmp	.L11
.L26:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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	down
	.type	down, @function
down:
.LFB35:
	.cfi_startproc
	endbr64
	movq	(%rsi), %rax
	subq	(%rdi), %rax
	ret
	.cfi_endproc
.LFE35:
	.size	down, .-down
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld\n"
.LC1:
	.string	"%lld"
.LC2:
	.string	"0"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC0(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	movq	%rsp, %rcx
	leaq	15(,%rsi,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L5
.L25:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L25
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L26
.L6:
	movq	%rsp, %r15
	testq	%rsi, %rsi
	jle	.L7
	movq	%r15, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rsi
	addq	$8, %r12
	cmpq	%rbx, %rsi
	jg	.L8
.L7:
	leaq	down(%rip), %rcx
	movl	$8, %edx
	movq	%r15, %rdi
	xorl	%eax, %eax
	call	qsort@PLT
	movq	-64(%rbp), %r10
	leaq	-1(%r10), %r8
	testq	%r8, %r8
	jle	.L9
	xorl	%eax, %eax
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	(%r15,%rdx,8), %rcx
	leal	1(%rax), %edx
	movslq	%edx, %rsi
	cmpq	%rcx, (%r15,%rsi,8)
	je	.L27
.L10:
	cmpl	$1, %edi
	jle	.L12
	leal	1(%rax,%r10), %eax
	movslq	%eax, %rdx
	cmpq	%rdx, %r8
	jg	.L15
	cmpl	$2, %edi
	jne	.L9
	movq	%r9, %rdx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L28
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	addl	$1, %eax
	movslq	%eax, %rdx
	cmpq	%rdx, %r8
	jg	.L15
.L9:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L27:
	testq	%r9, %r9
	je	.L18
	imulq	%rcx, %r9
.L11:
	addl	$1, %edi
	movl	%edx, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L18:
	movq	%rcx, %r9
	jmp	.L11
.L26:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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<string.h>

long long down(const void *a,const void *b){
  return *(long long *)b - *(long long *)a;
}

int main(void){
  long long  n;
  scanf("%lld\n",&n);

  long long a[n];
  for(int i = 0;i < n;i ++){
    scanf("%lld",&a[i]);
  }

  qsort(a,n,sizeof(long long),down);

  /*for(int i = 0;i < n;i ++){
    printf("%lld\n",a[i]);
  }*/

  long long ans = 0;
  int count = 0;
  for(int i = 0;i < n-1;i ++){
    if(a[i] == a[i+1]){
      if(ans == 0){
        ans = 1;
      }
      ans *= a[i];
      i ++;
      count ++;
    }
    if(count > 1){
      i += n;
    }
  }
  if(count == 2){
  printf("%lld\n",ans);
  }
  
  else{
    printf("0\n");
  }
  return 0;
}
6
3 1 2 4 2 1

2

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<string.h>

long long down(const void *a,const void *b){
  return *(long long *)b - *(long long *)a;
}

int main(void){
  long long  n;
  scanf("%lld\n",&n);

  long long a[n];
  for(int i = 0;i < n;i ++){
    scanf("%lld",&a[i]);
  }

  qsort(a,n,sizeof(long long),down);

  /*for(int i = 0;i < n;i ++){
    printf("%lld\n",a[i]);
  }*/

  long long ans = 0;
  int count = 0;
  for(int i = 0;i < n-1;i ++){
    if(a[i] == a[i+1]){
      if(ans == 0){
        ans = 1;
      }
      ans *= a[i];
      i ++;
      count ++;
    }
    if(count > 1){
      i += n;
    }
  }
  if(count == 2){
  printf("%lld\n",ans);
  }
  
  else{
    printf("0\n");
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	down
	.type	down, @function
down:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	down, .-down
	.section	.rodata
.LC0:
	.string	"%lld\n"
.LC1:
	.string	"%lld"
.LC2:
	.string	"0"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -100(%rbp)
	jmp	.L7
.L8:
	movl	-100(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -100(%rbp)
.L7:
	movl	-100(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L8
	movq	-88(%rbp), %rsi
	movq	-64(%rbp), %rax
	leaq	down(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movq	$0, -80(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L9
.L13:
	movq	-64(%rbp), %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movl	-92(%rbp), %eax
	leal	1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jne	.L10
	cmpq	$0, -80(%rbp)
	jne	.L11
	movq	$1, -80(%rbp)
.L11:
	movq	-64(%rbp), %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-80(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -80(%rbp)
	addl	$1, -92(%rbp)
	addl	$1, -96(%rbp)
.L10:
	cmpl	$1, -96(%rbp)
	jle	.L12
	movq	-88(%rbp), %rax
	movl	%eax, %edx
	movl	-92(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -92(%rbp)
.L12:
	addl	$1, -92(%rbp)
.L9:
	movl	-92(%rbp), %eax
	cltq
	movq	-88(%rbp), %rdx
	subq	$1, %rdx
	cmpq	%rdx, %rax
	jl	.L13
	cmpl	$2, -96(%rbp)
	jne	.L14
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	down
	.type	down, @function
down:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	(%rax), %rdx
	movq	-8(%rbp), %rax
	movq	(%rax), %rcx
	movq	%rdx, %rax
	subq	%rcx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	down, .-down
	.section	.rodata
.LC0:
	.string	"%lld\n"
.LC1:
	.string	"%lld"
.LC2:
	.string	"0"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L4:
	cmpq	%rdx, %rsp
	je	.L5
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L4
.L5:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L6
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L6:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -100(%rbp)
	jmp	.L7
.L8:
	movl	-100(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -100(%rbp)
.L7:
	movl	-100(%rbp), %eax
	movslq	%eax, %rdx
	movq	-88(%rbp), %rax
	cmpq	%rax, %rdx
	jl	.L8
	movq	-88(%rbp), %rsi
	movq	-64(%rbp), %rax
	leaq	down(%rip), %rdx
	movq	%rdx, %rcx
	movl	$8, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movq	$0, -80(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -92(%rbp)
	jmp	.L9
.L13:
	movq	-64(%rbp), %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movl	-92(%rbp), %eax
	leal	1(%rax), %edx
	movq	-64(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, %rcx
	jne	.L10
	cmpq	$0, -80(%rbp)
	jne	.L11
	movq	$1, -80(%rbp)
.L11:
	movq	-64(%rbp), %rax
	movl	-92(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-80(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -80(%rbp)
	addl	$1, -92(%rbp)
	addl	$1, -96(%rbp)
.L10:
	cmpl	$1, -96(%rbp)
	jle	.L12
	movq	-88(%rbp), %rax
	movl	%eax, %edx
	movl	-92(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -92(%rbp)
.L12:
	addl	$1, -92(%rbp)
.L9:
	movl	-92(%rbp), %eax
	cltq
	movq	-88(%rbp), %rdx
	subq	$1, %rdx
	cmpq	%rdx, %rax
	jl	.L13
	cmpl	$2, -96(%rbp)
	jne	.L14
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L15
.L14:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
