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>
#define N 10000
#define Q 500
#define NOT_FOUND -1



int count=0,n;

int linear(int a[],int key){
  int i=0;
  a[n]=key;
  while(a[i]!=key)
    i++;
  if(i==n)return NOT_FOUND;
  return i;
}




int main(){
  int a[N],b[Q],i,q;

  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&a[i]);

  scanf("%d",&q);
  for(i=0;i<q;i++)
    scanf("%d",&b[i]);

  for(i=0;i<q;i++)
    if(linear(a,b[i])!=NOT_FOUND)count++;

  printf("%d\n",count);
  return 0;
}



```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	linear
	.type	linear, @function
linear:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L2
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L3
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L4
	movl	$-1, %eax
	jmp	.L5
.L4:
	movl	-4(%rbp), %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	linear, .-linear
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42020(%rbp)
	jmp	.L7
.L8:
	leaq	-40016(%rbp), %rdx
	movl	-42020(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -42020(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -42020(%rbp)
	jl	.L8
	leaq	-42024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42020(%rbp)
	jmp	.L9
.L10:
	leaq	-42016(%rbp), %rdx
	movl	-42020(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -42020(%rbp)
.L9:
	movl	-42024(%rbp), %eax
	cmpl	%eax, -42020(%rbp)
	jl	.L10
	movl	$0, -42020(%rbp)
	jmp	.L11
.L13:
	movl	-42020(%rbp), %eax
	cltq
	movl	-42016(%rbp,%rax,4), %edx
	leaq	-40016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	linear
	cmpl	$-1, %eax
	je	.L12
	movl	count(%rip), %eax
	addl	$1, %eax
	movl	%eax, count(%rip)
.L12:
	addl	$1, -42020(%rbp)
.L11:
	movl	-42024(%rbp), %eax
	cmpl	%eax, -42020(%rbp)
	jl	.L13
	movl	count(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.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	linear
	.type	linear, @function
linear:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %rax
	movl	%esi, (%rdi,%rax,4)
	cmpl	(%rdi), %esi
	je	.L5
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%eax, %r8d
	addq	$1, %rax
	cmpl	%esi, -4(%rdi,%rax,4)
	jne	.L3
.L2:
	cmpl	%r8d, n(%rip)
	je	.L8
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%r8d, %r8d
	jmp	.L2
.L8:
	movl	$-1, %r8d
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	linear, .-linear
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-40960(%rsp), %r11
	.cfi_def_cfa 11, 41000
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1080, %rsp
	.cfi_def_cfa_offset 42080
	leaq	.LC0(%rip), %r12
	leaq	n(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 42024(%rsp)
	xorl	%eax, %eax
	leaq	2016(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, n(%rip)
	jg	.L13
.L14:
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rbp
	testl	%eax, %eax
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L16
	movl	count(%rip), %r12d
	movl	%r12d, %r8d
	testl	%eax, %eax
	jle	.L15
	movslq	n(%rip), %rdx
	subl	$1, %eax
	leaq	4(%r13), %rdi
	xorl	%r10d, %r10d
	leaq	2016(%rsp), %rsi
	leaq	(%rdi,%rax,4), %r11
	leaq	(%rsi,%rdx,4), %rbx
	movq	%rdx, %r9
	movl	0(%r13), %edx
	movl	%edx, (%rbx)
	cmpl	2016(%rsp), %edx
	je	.L22
	.p2align 4,,10
	.p2align 3
.L36:
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpl	-4(%rsi,%rax,4), %edx
	jne	.L18
.L17:
	cmpl	%ecx, %r9d
	je	.L19
	addl	$1, %r8d
	movl	$1, %r10d
.L19:
	movq	%rdi, %r13
	cmpq	%rdi, %r11
	je	.L32
	movl	0(%r13), %edx
	addq	$4, %rdi
	movl	%edx, (%rbx)
	cmpl	2016(%rsp), %edx
	jne	.L36
.L22:
	xorl	%ecx, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L32:
	testb	%r10b, %r10b
	je	.L15
	movl	%r8d, count(%rip)
	movl	%r8d, %r12d
.L15:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	42024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	addq	$42040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L35:
	.cfi_restore_state
	movl	count(%rip), %r12d
	jmp	.L15
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	count
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.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	linear
	.type	linear, @function
linear:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %rax
	movl	%esi, (%rdi,%rax,4)
	cmpl	(%rdi), %esi
	je	.L5
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%eax, %r8d
	addq	$1, %rax
	cmpl	%esi, -4(%rdi,%rax,4)
	jne	.L3
.L2:
	cmpl	%r8d, n(%rip)
	je	.L8
.L1:
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%r8d, %r8d
	jmp	.L2
.L8:
	movl	$-1, %r8d
	jmp	.L1
	.cfi_endproc
.LFE23:
	.size	linear, .-linear
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-40960(%rsp), %r11
	.cfi_def_cfa 11, 41000
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1080, %rsp
	.cfi_def_cfa_offset 42080
	leaq	.LC0(%rip), %r12
	leaq	n(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 42024(%rsp)
	xorl	%eax, %eax
	leaq	2016(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	n(%rip), %edx
	testl	%edx, %edx
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, n(%rip)
	jg	.L13
.L14:
	leaq	12(%rsp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rbp
	testl	%eax, %eax
	jle	.L35
	.p2align 4,,10
	.p2align 3
.L16:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L16
	movl	count(%rip), %r12d
	movl	%r12d, %r8d
	testl	%eax, %eax
	jle	.L15
	movslq	n(%rip), %rdx
	subl	$1, %eax
	leaq	4(%r13), %rdi
	xorl	%r10d, %r10d
	leaq	2016(%rsp), %rsi
	leaq	(%rdi,%rax,4), %r11
	leaq	(%rsi,%rdx,4), %rbx
	movq	%rdx, %r9
	movl	0(%r13), %edx
	movl	%edx, (%rbx)
	cmpl	2016(%rsp), %edx
	je	.L22
	.p2align 4,,10
	.p2align 3
.L36:
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%eax, %ecx
	addq	$1, %rax
	cmpl	-4(%rsi,%rax,4), %edx
	jne	.L18
.L17:
	cmpl	%ecx, %r9d
	je	.L19
	addl	$1, %r8d
	movl	$1, %r10d
.L19:
	movq	%rdi, %r13
	cmpq	%rdi, %r11
	je	.L32
	movl	0(%r13), %edx
	addq	$4, %rdi
	movl	%edx, (%rbx)
	cmpl	2016(%rsp), %edx
	jne	.L36
.L22:
	xorl	%ecx, %ecx
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L32:
	testb	%r10b, %r10b
	je	.L15
	movl	%r8d, count(%rip)
	movl	%r8d, %r12d
.L15:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	42024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L37
	addq	$42040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L35:
	.cfi_restore_state
	movl	count(%rip), %r12d
	jmp	.L15
.L37:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	count
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.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>
#define N 10000
#define Q 500
#define NOT_FOUND -1



int count=0,n;

int linear(int a[],int key){
  int i=0;
  a[n]=key;
  while(a[i]!=key)
    i++;
  if(i==n)return NOT_FOUND;
  return i;
}




int main(){
  int a[N],b[Q],i,q;

  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&a[i]);

  scanf("%d",&q);
  for(i=0;i<q;i++)
    scanf("%d",&b[i]);

  for(i=0;i<q;i++)
    if(linear(a,b[i])!=NOT_FOUND)count++;

  printf("%d\n",count);
  return 0;
}




5
1 2 3 4 5
3
3 4 1

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>
#define N 10000
#define Q 500
#define NOT_FOUND -1



int count=0,n;

int linear(int a[],int key){
  int i=0;
  a[n]=key;
  while(a[i]!=key)
    i++;
  if(i==n)return NOT_FOUND;
  return i;
}




int main(){
  int a[N],b[Q],i,q;

  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&a[i]);

  scanf("%d",&q);
  for(i=0;i<q;i++)
    scanf("%d",&b[i]);

  for(i=0;i<q;i++)
    if(linear(a,b[i])!=NOT_FOUND)count++;

  printf("%d\n",count);
  return 0;
}



```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	linear
	.type	linear, @function
linear:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L2
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L3
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L4
	movl	$-1, %eax
	jmp	.L5
.L4:
	movl	-4(%rbp), %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	linear, .-linear
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42020(%rbp)
	jmp	.L7
.L8:
	leaq	-40016(%rbp), %rdx
	movl	-42020(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -42020(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -42020(%rbp)
	jl	.L8
	leaq	-42024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42020(%rbp)
	jmp	.L9
.L10:
	leaq	-42016(%rbp), %rdx
	movl	-42020(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -42020(%rbp)
.L9:
	movl	-42024(%rbp), %eax
	cmpl	%eax, -42020(%rbp)
	jl	.L10
	movl	$0, -42020(%rbp)
	jmp	.L11
.L13:
	movl	-42020(%rbp), %eax
	cltq
	movl	-42016(%rbp,%rax,4), %edx
	leaq	-40016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	linear
	cmpl	$-1, %eax
	je	.L12
	movl	count(%rip), %eax
	addl	$1, %eax
	movl	%eax, count(%rip)
.L12:
	addl	$1, -42020(%rbp)
.L11:
	movl	-42024(%rbp), %eax
	cmpl	%eax, -42020(%rbp)
	jl	.L13
	movl	count(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.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	count
	.bss
	.align 4
	.type	count, @object
	.size	count, 4
count:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.text
	.globl	linear
	.type	linear, @function
linear:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
	movl	n(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-28(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L2
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -28(%rbp)
	jne	.L3
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jne	.L4
	movl	$-1, %eax
	jmp	.L5
.L4:
	movl	-4(%rbp), %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	linear, .-linear
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	leaq	-40960(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42020(%rbp)
	jmp	.L7
.L8:
	leaq	-40016(%rbp), %rdx
	movl	-42020(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -42020(%rbp)
.L7:
	movl	n(%rip), %eax
	cmpl	%eax, -42020(%rbp)
	jl	.L8
	leaq	-42024(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -42020(%rbp)
	jmp	.L9
.L10:
	leaq	-42016(%rbp), %rdx
	movl	-42020(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -42020(%rbp)
.L9:
	movl	-42024(%rbp), %eax
	cmpl	%eax, -42020(%rbp)
	jl	.L10
	movl	$0, -42020(%rbp)
	jmp	.L11
.L13:
	movl	-42020(%rbp), %eax
	cltq
	movl	-42016(%rbp,%rax,4), %edx
	leaq	-40016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	linear
	cmpl	$-1, %eax
	je	.L12
	movl	count(%rip), %eax
	addl	$1, %eax
	movl	%eax, count(%rip)
.L12:
	addl	$1, -42020(%rbp)
.L11:
	movl	-42024(%rbp), %eax
	cmpl	%eax, -42020(%rbp)
	jl	.L13
	movl	count(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.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:
