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>
int main(){
  int n;
  scanf("%d",&n);
  int a[n];
  int i;
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  int ans=0;
  int count[100001]={0};
  for(i=0;i<n;i++){
    if(a[i]<100001){
      count[a[i]]++;
    }
    else{
      ans++;
    }
  }
  for(i=1;i<100001;i++){
    if(count[i]<i){
      ans+=count[i];
    }
    else{
      ans+=count[i]-i;
    }
  }

  printf("%d",ans);

  return 0;

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %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	-400092(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400092(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -400080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -400072(%rbp)
	movl	$0, -400088(%rbp)
	jmp	.L5
.L6:
	movl	-400088(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-400072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400088(%rbp)
.L5:
	movl	-400092(%rbp), %eax
	cmpl	%eax, -400088(%rbp)
	jl	.L6
	movl	$0, -400084(%rbp)
	leaq	-400064(%rbp), %rax
	movl	$400004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -400088(%rbp)
	jmp	.L7
.L10:
	movq	-400072(%rbp), %rax
	movl	-400088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$100000, %eax
	jg	.L8
	movq	-400072(%rbp), %rax
	movl	-400088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	jmp	.L9
.L8:
	addl	$1, -400084(%rbp)
.L9:
	addl	$1, -400088(%rbp)
.L7:
	movl	-400092(%rbp), %eax
	cmpl	%eax, -400088(%rbp)
	jl	.L10
	movl	$1, -400088(%rbp)
	jmp	.L11
.L14:
	movl	-400088(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400088(%rbp)
	jle	.L12
	movl	-400088(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	addl	%eax, -400084(%rbp)
	jmp	.L13
.L12:
	movl	-400088(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	subl	-400088(%rbp), %eax
	addl	%eax, -400084(%rbp)
.L13:
	addl	$1, -400088(%rbp)
.L11:
	cmpl	$100000, -400088(%rbp)
	jle	.L14
	movl	-400084(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-400068(%rbp), %rsi
	call	__isoc99_scanf@PLT
	movslq	-400068(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rdx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L25:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L25
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L26
.L4:
	movq	%rsp, %r14
	testl	%edx, %edx
	jle	.L5
	movq	%r14, %rbx
	movq	%r14, %r15
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	-400068(%rbp), %ecx
	addq	$4, %r15
	cmpl	%r13d, %ecx
	jg	.L6
	leaq	-400064(%rbp), %r8
	movl	$400004, %edx
	xorl	%esi, %esi
	movl	%ecx, -400084(%rbp)
	movq	%r8, %rdi
	call	memset@PLT
	movl	-400084(%rbp), %ecx
	movq	%rax, %r8
	testl	%ecx, %ecx
	jle	.L15
	leaq	(%r14,%rcx,4), %rcx
	xorl	%edx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$4, %rbx
	addl	$1, -400064(%rbp,%rax,4)
	cmpq	%rcx, %rbx
	je	.L7
.L10:
	movslq	(%rbx), %rax
	cmpl	$100000, %eax
	jle	.L27
	addq	$4, %rbx
	addl	$1, %edx
	cmpq	%rcx, %rbx
	jne	.L10
.L7:
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%r8,%rax,4), %ecx
	movl	%ecx, %edi
	leal	(%rdx,%rcx), %esi
	subl	%eax, %edi
	addl	%edi, %edx
	cmpl	%eax, %ecx
	cmovl	%esi, %edx
	addq	$1, %rax
	cmpq	$100001, %rax
	jne	.L13
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	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
.L26:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L5:
	leaq	-400064(%rbp), %r8
	movl	$400004, %edx
	xorl	%esi, %esi
	movq	%r8, %rdi
	call	memset@PLT
	xorl	%edx, %edx
	movq	%rax, %r8
	jmp	.L7
.L28:
	call	__stack_chk_fail@PLT
.L15:
	xorl	%edx, %edx
	jmp	.L7
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-400068(%rbp), %rsi
	call	__isoc99_scanf@PLT
	movslq	-400068(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rdx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L25:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L25
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L26
.L4:
	movq	%rsp, %r14
	testl	%edx, %edx
	jle	.L5
	movq	%r14, %rbx
	movq	%r14, %r15
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	-400068(%rbp), %ecx
	addq	$4, %r15
	cmpl	%r13d, %ecx
	jg	.L6
	leaq	-400064(%rbp), %r8
	movl	$400004, %edx
	xorl	%esi, %esi
	movl	%ecx, -400084(%rbp)
	movq	%r8, %rdi
	call	memset@PLT
	movl	-400084(%rbp), %ecx
	movq	%rax, %r8
	testl	%ecx, %ecx
	jle	.L15
	leaq	(%r14,%rcx,4), %rcx
	xorl	%edx, %edx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$4, %rbx
	addl	$1, -400064(%rbp,%rax,4)
	cmpq	%rcx, %rbx
	je	.L7
.L10:
	movslq	(%rbx), %rax
	cmpl	$100000, %eax
	jle	.L27
	addq	$4, %rbx
	addl	$1, %edx
	cmpq	%rcx, %rbx
	jne	.L10
.L7:
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%r8,%rax,4), %ecx
	movl	%ecx, %edi
	leal	(%rdx,%rcx), %esi
	subl	%eax, %edi
	addl	%edi, %edx
	cmpl	%eax, %ecx
	cmovl	%esi, %edx
	addq	$1, %rax
	cmpq	$100001, %rax
	jne	.L13
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	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
.L26:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L5:
	leaq	-400064(%rbp), %r8
	movl	$400004, %edx
	xorl	%esi, %esi
	movq	%r8, %rdi
	call	memset@PLT
	xorl	%edx, %edx
	movq	%rax, %r8
	jmp	.L7
.L28:
	call	__stack_chk_fail@PLT
.L15:
	xorl	%edx, %edx
	jmp	.L7
	.cfi_endproc
.LFE23:
	.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>
int main(){
  int n;
  scanf("%d",&n);
  int a[n];
  int i;
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  int ans=0;
  int count[100001]={0};
  for(i=0;i<n;i++){
    if(a[i]<100001){
      count[a[i]]++;
    }
    else{
      ans++;
    }
  }
  for(i=1;i<100001;i++){
    if(count[i]<i){
      ans+=count[i];
    }
    else{
      ans+=count[i]-i;
    }
  }

  printf("%d",ans);

  return 0;

}

4
3 3 3 3

1
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>
int main(){
  int n;
  scanf("%d",&n);
  int a[n];
  int i;
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  int ans=0;
  int count[100001]={0};
  for(i=0;i<n;i++){
    if(a[i]<100001){
      count[a[i]]++;
    }
    else{
      ans++;
    }
  }
  for(i=1;i<100001;i++){
    if(count[i]<i){
      ans+=count[i];
    }
    else{
      ans+=count[i]-i;
    }
  }

  printf("%d",ans);

  return 0;

}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %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	-400092(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400092(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -400080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -400072(%rbp)
	movl	$0, -400088(%rbp)
	jmp	.L5
.L6:
	movl	-400088(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-400072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400088(%rbp)
.L5:
	movl	-400092(%rbp), %eax
	cmpl	%eax, -400088(%rbp)
	jl	.L6
	movl	$0, -400084(%rbp)
	leaq	-400064(%rbp), %rax
	movl	$400004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -400088(%rbp)
	jmp	.L7
.L10:
	movq	-400072(%rbp), %rax
	movl	-400088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$100000, %eax
	jg	.L8
	movq	-400072(%rbp), %rax
	movl	-400088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	jmp	.L9
.L8:
	addl	$1, -400084(%rbp)
.L9:
	addl	$1, -400088(%rbp)
.L7:
	movl	-400092(%rbp), %eax
	cmpl	%eax, -400088(%rbp)
	jl	.L10
	movl	$1, -400088(%rbp)
	jmp	.L11
.L14:
	movl	-400088(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400088(%rbp)
	jle	.L12
	movl	-400088(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	addl	%eax, -400084(%rbp)
	jmp	.L13
.L12:
	movl	-400088(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	subl	-400088(%rbp), %eax
	addl	%eax, -400084(%rbp)
.L13:
	addl	$1, -400088(%rbp)
.L11:
	cmpl	$100000, -400088(%rbp)
	jle	.L14
	movl	-400084(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %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	-400092(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400092(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -400080(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -400072(%rbp)
	movl	$0, -400088(%rbp)
	jmp	.L5
.L6:
	movl	-400088(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-400072(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -400088(%rbp)
.L5:
	movl	-400092(%rbp), %eax
	cmpl	%eax, -400088(%rbp)
	jl	.L6
	movl	$0, -400084(%rbp)
	leaq	-400064(%rbp), %rax
	movl	$400004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -400088(%rbp)
	jmp	.L7
.L10:
	movq	-400072(%rbp), %rax
	movl	-400088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	cmpl	$100000, %eax
	jg	.L8
	movq	-400072(%rbp), %rax
	movl	-400088(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movslq	%eax, %rdx
	movl	-400064(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -400064(%rbp,%rax,4)
	jmp	.L9
.L8:
	addl	$1, -400084(%rbp)
.L9:
	addl	$1, -400088(%rbp)
.L7:
	movl	-400092(%rbp), %eax
	cmpl	%eax, -400088(%rbp)
	jl	.L10
	movl	$1, -400088(%rbp)
	jmp	.L11
.L14:
	movl	-400088(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	cmpl	%eax, -400088(%rbp)
	jle	.L12
	movl	-400088(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	addl	%eax, -400084(%rbp)
	jmp	.L13
.L12:
	movl	-400088(%rbp), %eax
	cltq
	movl	-400064(%rbp,%rax,4), %eax
	subl	-400088(%rbp), %eax
	addl	%eax, -400084(%rbp)
.L13:
	addl	$1, -400088(%rbp)
.L11:
	cmpl	$100000, -400088(%rbp)
	jle	.L14
	movl	-400084(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
