Given the following C code and 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;

}
```

Assembly Code:

```assembly
	.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:
```

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.
Optimized Assembly Code:

user
```assembly
	.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
```assembly
	.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:
```
```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;

}
```
Given the following C 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;

}
```

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.
Optimized Assembly Code:

4
3 3 3 3

1
Given the following C code and 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;

}
```

Assembly Code:

```assembly
	.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:
```

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.
Optimized Assembly Code:

train
```assembly
	.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:
```