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 MAX 40

int n,pos=0;
int cout = 0;
int Pre[MAX],In[MAX],Ans[MAX];

int distance(int start,int key){
  int i,count=0;
  for(i=start;i<MAX;i++){
    if(In[i]!=key)
      count++;
    else break;
  }
  return count;
}
  
  
int solve(int l,int r){
  int root,d;
  if(l-r>=0)return -1;
  root=Pre[pos];
  pos++;
  d=distance(0,root);
  if(d>n)return -1;
  solve(l, d);
  solve(d+1, r);
  Ans[cout++]=root;
  return 0;
}

int main(){
  int m,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&m);
    Pre[i]=m;
  }
  for(i=0;i<n;i++){
      scanf("%d",&m);
      In[i]=m;
  }
  solve(0,n);

  printf("%d",Ans[0]);
  for(i=1;i<n;i++)
    printf(" %d",Ans[i]);
  printf("\n");
	   
  return 0;
}
    ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	pos
	.align 4
	.type	pos, @object
	.size	pos, 4
pos:
	.zero	4
	.globl	cout
	.align 4
	.type	cout, @object
	.size	cout, 4
cout:
	.zero	4
	.globl	Pre
	.align 32
	.type	Pre, @object
	.size	Pre, 160
Pre:
	.zero	160
	.globl	In
	.align 32
	.type	In, @object
	.size	In, 160
In:
	.zero	160
	.globl	Ans
	.align 32
	.type	Ans, @object
	.size	Ans, 160
Ans:
	.zero	160
	.text
	.globl	distance
	.type	distance, @function
distance:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	In(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	je	.L8
	addl	$1, -4(%rbp)
	addl	$1, -8(%rbp)
.L2:
	cmpl	$39, -8(%rbp)
	jle	.L6
	jmp	.L5
.L8:
	nop
.L5:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	distance, .-distance
	.globl	solve
	.type	solve, @function
solve:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	testl	%eax, %eax
	js	.L10
	movl	$-1, %eax
	jmp	.L11
.L10:
	movl	pos(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Pre(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	pos(%rip), %eax
	addl	$1, %eax
	movl	%eax, pos(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	distance
	movl	%eax, -4(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	$-1, %eax
	jmp	.L11
.L12:
	movl	-4(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	solve
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	solve
	movl	cout(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, cout(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Ans(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %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, -12(%rbp)
	jmp	.L14
.L15:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Pre(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L15
	movl	$0, -12(%rbp)
	jmp	.L16
.L17:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	In(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L16:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L17
	movl	n(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	solve
	movl	Ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -12(%rbp)
	jmp	.L18
.L19:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L18:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	distance
	.type	distance, @function
distance:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$39, %edi
	jg	.L4
	leaq	In(%rip), %rax
	movslq	%edi, %rdx
	movl	$40, %ecx
	leaq	(%rax,%rdx,4), %rdx
	subl	%edi, %ecx
	xorl	%eax, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%ecx, %eax
	je	.L7
.L3:
	cmpl	%esi, (%rdx)
	jne	.L8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	ret
.L4:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	distance, .-distance
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB24:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	%esi, 8(%rsp)
	cmpl	%esi, %edi
	jge	.L14
	movslq	pos(%rip), %rax
	leaq	Pre(%rip), %r13
	leaq	In(%rip), %rbx
	leal	1(%rax), %ecx
	movl	0(%r13,%rax,4), %r12d
	movq	%rax, %rsi
	xorl	%eax, %eax
	movl	%ecx, pos(%rip)
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%eax, %ebp
	cmpl	(%rbx,%rax,4), %r12d
	je	.L12
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L13
	movl	$40, %ebp
.L12:
	movl	n(%rip), %eax
	cmpl	%eax, %ebp
	jg	.L14
	cmpl	%ebp, %edi
	jge	.L117
	leal	2(%rsi), %r9d
	movslq	%ecx, %rcx
	movl	%r9d, pos(%rip)
	movl	0(%r13,%rcx,4), %r8d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%ecx, %r14d
	cmpl	(%rbx,%rcx,4), %r8d
	je	.L17
	addq	$1, %rcx
	cmpq	$40, %rcx
	jne	.L18
	movl	$40, %r14d
.L17:
	leaq	Ans(%rip), %r15
	cmpl	%r14d, %eax
	jl	.L16
	cmpl	%r14d, %edi
	jge	.L21
	leal	3(%rsi), %r11d
	movslq	%r9d, %r9
	xorl	%r10d, %r10d
	movl	%r11d, pos(%rip)
	movl	0(%r13,%r9,4), %r9d
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%r10d, %ecx
	cmpl	(%rbx,%r10,4), %r9d
	je	.L22
	addq	$1, %r10
	cmpq	$40, %r10
	jne	.L23
	movl	$40, %ecx
.L22:
	leaq	Ans(%rip), %r15
	cmpl	%ecx, %eax
	jl	.L21
	cmpl	%ecx, %edi
	jge	.L26
	addl	$4, %esi
	movslq	%r11d, %r11
	movl	%esi, pos(%rip)
	movl	0(%r13,%r11,4), %r10d
	xorl	%r11d, %r11d
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r11d, %esi
	cmpl	(%rbx,%r11,4), %r10d
	je	.L27
	addq	$1, %r11
	cmpq	$40, %r11
	jne	.L28
	movl	$40, %esi
.L27:
	movl	%r10d, 12(%rsp)
	leaq	Ans(%rip), %r15
	cmpl	%esi, %eax
	jl	.L26
	movl	%r9d, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%ecx, 28(%rsp)
	movl	%esi, 16(%rsp)
	call	solve
	movl	16(%rsp), %esi
	movl	28(%rsp), %ecx
	leal	1(%rsi), %edi
	movl	%ecx, %esi
	movl	%ecx, 16(%rsp)
	call	solve
	movslq	cout(%rip), %rax
	movl	12(%rsp), %r10d
	movl	24(%rsp), %r9d
	movl	20(%rsp), %r8d
	leal	1(%rax), %esi
	movl	%r10d, (%r15,%rax,4)
	movl	16(%rsp), %ecx
	movl	%esi, cout(%rip)
.L26:
	leal	1(%rcx), %edi
	cmpl	%r14d, %edi
	jge	.L110
	movslq	pos(%rip), %rcx
	movq	%rcx, %rax
	movl	0(%r13,%rcx,4), %r10d
	addl	$1, %eax
	movl	%eax, pos(%rip)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L33:
	movl	%eax, %esi
	cmpl	(%rbx,%rax,4), %r10d
	je	.L32
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L33
	movl	$40, %esi
.L32:
	cmpl	%esi, n(%rip)
	jl	.L110
	movl	%r10d, 24(%rsp)
	movl	%r9d, 20(%rsp)
	movl	%r8d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	solve
	movl	12(%rsp), %esi
	leal	1(%rsi), %edi
	movl	%r14d, %esi
	call	solve
	movl	24(%rsp), %r10d
	movl	20(%rsp), %r9d
	movslq	cout(%rip), %rcx
	movl	16(%rsp), %r8d
	movl	%r10d, (%r15,%rcx,4)
	leal	1(%rcx), %eax
.L31:
	leal	1(%rax), %ecx
	cltq
	movl	%ecx, cout(%rip)
	movl	%r9d, (%r15,%rax,4)
.L21:
	leal	1(%r14), %edi
	cmpl	%ebp, %edi
	jge	.L112
	movslq	pos(%rip), %rax
	leal	1(%rax), %r9d
	movl	0(%r13,%rax,4), %ecx
	movq	%rax, %rsi
	xorl	%eax, %eax
	movl	%r9d, pos(%rip)
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%eax, %r14d
	cmpl	(%rbx,%rax,4), %ecx
	je	.L37
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L38
	movl	$40, %r14d
.L37:
	movl	n(%rip), %r10d
	cmpl	%r14d, %r10d
	jl	.L112
	cmpl	%r14d, %edi
	jge	.L41
	addl	$2, %esi
	movslq	%r9d, %r9
	xorl	%eax, %eax
	movl	%esi, pos(%rip)
	movl	0(%r13,%r9,4), %r9d
	.p2align 4,,10
	.p2align 3
.L43:
	movl	%eax, %esi
	cmpl	(%rbx,%rax,4), %r9d
	je	.L42
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L43
	movl	$40, %esi
.L42:
	movl	%r9d, 12(%rsp)
	cmpl	%esi, %r10d
	jl	.L41
	movl	%ecx, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%esi, 16(%rsp)
	call	solve
	movl	16(%rsp), %esi
	leal	1(%rsi), %edi
	movl	%r14d, %esi
	call	solve
	movslq	cout(%rip), %rax
	movl	12(%rsp), %r9d
	movl	24(%rsp), %ecx
	movl	20(%rsp), %r8d
	leal	1(%rax), %esi
	movl	%r9d, (%r15,%rax,4)
	movl	%esi, cout(%rip)
.L41:
	leal	1(%r14), %edi
	cmpl	%ebp, %edi
	jge	.L111
	movslq	pos(%rip), %rsi
	movq	%rsi, %rax
	movl	0(%r13,%rsi,4), %r9d
	addl	$1, %eax
	movl	%eax, pos(%rip)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%eax, %r14d
	cmpl	(%rbx,%rax,4), %r9d
	je	.L47
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L48
	movl	$40, %r14d
.L47:
	cmpl	%r14d, n(%rip)
	jl	.L111
	movl	%r14d, %esi
	movl	%r9d, 20(%rsp)
	movl	%ecx, 16(%rsp)
	movl	%r8d, 12(%rsp)
	call	solve
	movl	%ebp, %esi
	leal	1(%r14), %edi
	call	solve
	movslq	cout(%rip), %rax
	movl	20(%rsp), %r9d
	movl	16(%rsp), %ecx
	movl	12(%rsp), %r8d
	movl	%r9d, (%r15,%rax,4)
	leal	1(%rax), %esi
.L46:
	leal	1(%rsi), %eax
	movslq	%esi, %rsi
	movl	%ecx, (%r15,%rsi,4)
.L36:
	leal	1(%rax), %ecx
	cltq
	movl	%ecx, cout(%rip)
	movl	%r8d, (%r15,%rax,4)
.L16:
	leal	1(%rbp), %edi
	cmpl	8(%rsp), %edi
	jge	.L116
	movslq	pos(%rip), %rax
	leal	1(%rax), %r8d
	movl	0(%r13,%rax,4), %r14d
	movq	%rax, %rsi
	xorl	%eax, %eax
	movl	%r8d, pos(%rip)
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%eax, %ecx
	cmpl	(%rbx,%rax,4), %r14d
	je	.L52
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L53
	movl	$40, %ecx
.L52:
	movl	n(%rip), %r10d
	cmpl	%ecx, %r10d
	jl	.L116
	cmpl	%ecx, %edi
	jge	.L56
	leal	2(%rsi), %r9d
	movslq	%r8d, %r8
	xorl	%eax, %eax
	movl	%r9d, pos(%rip)
	movl	0(%r13,%r8,4), %r8d
	.p2align 4,,10
	.p2align 3
.L58:
	movl	%eax, %ebp
	cmpl	(%rbx,%rax,4), %r8d
	je	.L57
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L58
	movl	$40, %ebp
.L57:
	cmpl	%ebp, %r10d
	jl	.L56
	cmpl	%ebp, %edi
	jge	.L61
	addl	$3, %esi
	movslq	%r9d, %r9
	xorl	%eax, %eax
	movl	%esi, pos(%rip)
	movl	0(%r13,%r9,4), %r9d
	.p2align 4,,10
	.p2align 3
.L63:
	movl	%eax, %esi
	cmpl	(%rbx,%rax,4), %r9d
	je	.L62
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L63
	movl	$40, %esi
.L62:
	movl	%r9d, 12(%rsp)
	cmpl	%esi, %r10d
	jl	.L61
	movl	%r8d, 24(%rsp)
	movl	%ecx, 20(%rsp)
	movl	%esi, 16(%rsp)
	call	solve
	movl	16(%rsp), %esi
	leal	1(%rsi), %edi
	movl	%ebp, %esi
	call	solve
	movslq	cout(%rip), %rax
	movl	12(%rsp), %r9d
	movl	24(%rsp), %r8d
	movl	20(%rsp), %ecx
	leal	1(%rax), %esi
	movl	%r9d, (%r15,%rax,4)
	movl	%esi, cout(%rip)
.L61:
	leal	1(%rbp), %edi
	cmpl	%ecx, %edi
	jge	.L113
	movslq	pos(%rip), %rsi
	movq	%rsi, %rax
	movl	0(%r13,%rsi,4), %r9d
	addl	$1, %eax
	movl	%eax, pos(%rip)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L68:
	movl	%eax, %ebp
	cmpl	(%rbx,%rax,4), %r9d
	je	.L67
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L68
	movl	$40, %ebp
.L67:
	cmpl	%ebp, n(%rip)
	jl	.L113
	movl	%ebp, %esi
	movl	%r9d, 20(%rsp)
	movl	%r8d, 16(%rsp)
	movl	%ecx, 12(%rsp)
	call	solve
	movl	12(%rsp), %esi
	leal	1(%rbp), %edi
	call	solve
	movslq	cout(%rip), %rsi
	movl	20(%rsp), %r9d
	movl	16(%rsp), %r8d
	movl	12(%rsp), %ecx
	movl	%r9d, (%r15,%rsi,4)
	leal	1(%rsi), %eax
.L66:
	leal	1(%rax), %esi
	cltq
	movl	%esi, cout(%rip)
	movl	%r8d, (%r15,%rax,4)
.L56:
	leal	1(%rcx), %edi
	cmpl	8(%rsp), %edi
	jge	.L115
	movslq	pos(%rip), %rax
	leal	1(%rax), %ecx
	movl	0(%r13,%rax,4), %r8d
	movq	%rax, %rsi
	xorl	%eax, %eax
	movl	%ecx, pos(%rip)
	.p2align 4,,10
	.p2align 3
.L73:
	movl	%eax, %ebp
	cmpl	(%rbx,%rax,4), %r8d
	je	.L72
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L73
	movl	$40, %ebp
.L72:
	movl	n(%rip), %eax
	cmpl	%ebp, %eax
	jl	.L115
	cmpl	%ebp, %edi
	jge	.L76
	leal	2(%rsi), %r11d
	movslq	%ecx, %rcx
	xorl	%r10d, %r10d
	movl	%r11d, pos(%rip)
	movl	0(%r13,%rcx,4), %r9d
	.p2align 4,,10
	.p2align 3
.L78:
	movl	%r10d, %ecx
	cmpl	(%rbx,%r10,4), %r9d
	je	.L77
	addq	$1, %r10
	cmpq	$40, %r10
	jne	.L78
	movl	$40, %ecx
.L77:
	cmpl	%ecx, %eax
	jl	.L76
	cmpl	%ecx, %edi
	jge	.L81
	addl	$3, %esi
	movslq	%r11d, %r11
	movl	%esi, pos(%rip)
	movl	0(%r13,%r11,4), %r10d
	xorl	%r11d, %r11d
	.p2align 4,,10
	.p2align 3
.L83:
	movl	%r11d, %esi
	cmpl	(%rbx,%r11,4), %r10d
	je	.L82
	addq	$1, %r11
	cmpq	$40, %r11
	jne	.L83
	movl	$40, %esi
.L82:
	movl	%r10d, 12(%rsp)
	cmpl	%esi, %eax
	jl	.L81
	movl	%r9d, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%ecx, 28(%rsp)
	movl	%esi, 16(%rsp)
	call	solve
	movl	16(%rsp), %esi
	movl	28(%rsp), %ecx
	leal	1(%rsi), %edi
	movl	%ecx, %esi
	movl	%ecx, 16(%rsp)
	call	solve
	movslq	cout(%rip), %rax
	movl	12(%rsp), %r10d
	movl	24(%rsp), %r9d
	movl	20(%rsp), %r8d
	leal	1(%rax), %esi
	movl	%r10d, (%r15,%rax,4)
	movl	16(%rsp), %ecx
	movl	%esi, cout(%rip)
.L81:
	leal	1(%rcx), %edi
	movl	%ebp, %esi
	movl	%r9d, 16(%rsp)
	movl	%r8d, 12(%rsp)
	call	solve
	movl	16(%rsp), %r9d
	movl	12(%rsp), %r8d
	movslq	cout(%rip), %rax
	leal	1(%rax), %ecx
	movl	%r9d, (%r15,%rax,4)
	movl	%ecx, cout(%rip)
.L76:
	leal	1(%rbp), %edi
	cmpl	8(%rsp), %edi
	jge	.L114
	movslq	pos(%rip), %rcx
	movq	%rcx, %rax
	movl	0(%r13,%rcx,4), %edx
	addl	$1, %eax
	movl	%eax, pos(%rip)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L88:
	movl	%eax, %ebp
	cmpl	(%rbx,%rax,4), %edx
	je	.L87
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L88
	movl	$40, %ebp
.L87:
	cmpl	%ebp, n(%rip)
	jl	.L114
	movl	%ebp, %esi
	movl	%edx, 16(%rsp)
	movl	%r8d, 12(%rsp)
	call	solve
	movl	8(%rsp), %esi
	leal	1(%rbp), %edi
	call	solve
	movslq	cout(%rip), %rcx
	movl	16(%rsp), %edx
	movl	12(%rsp), %r8d
	movl	%edx, (%r15,%rcx,4)
	leal	1(%rcx), %eax
.L86:
	leal	1(%rax), %edx
	cltq
	movl	%r8d, (%r15,%rax,4)
.L71:
	leal	1(%rdx), %eax
	movslq	%edx, %rdx
	movl	%r14d, (%r15,%rdx,4)
.L51:
	leal	1(%rax), %edx
	cltq
	movl	%edx, cout(%rip)
	movl	%r12d, (%r15,%rax,4)
	xorl	%eax, %eax
.L9:
	addq	$40, %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
.L14:
	.cfi_restore_state
	movl	$-1, %eax
	jmp	.L9
.L116:
	movl	cout(%rip), %eax
	jmp	.L51
.L115:
	movl	cout(%rip), %edx
	jmp	.L71
.L112:
	movl	cout(%rip), %eax
	jmp	.L36
.L111:
	movl	cout(%rip), %esi
	jmp	.L46
.L113:
	movl	cout(%rip), %eax
	jmp	.L66
.L114:
	movl	cout(%rip), %eax
	jmp	.L86
.L110:
	movl	cout(%rip), %eax
	jmp	.L31
.L117:
	leaq	Ans(%rip), %r15
	jmp	.L16
	.cfi_endproc
.LFE24:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	n(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %esi
	testl	%esi, %esi
	jle	.L119
	xorl	%ebx, %ebx
	leaq	4(%rsp), %r12
	leaq	Pre(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L120:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movl	n(%rip), %esi
	movl	%eax, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L120
	testl	%esi, %esi
	jle	.L119
	xorl	%ebx, %ebx
	leaq	In(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L121:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movl	n(%rip), %esi
	movl	%eax, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L121
.L119:
	xorl	%edi, %edi
	movl	$1, %ebx
	leaq	Ans(%rip), %r12
	call	solve
	movl	Ans(%rip), %edx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rbp
	call	__printf_chk@PLT
	cmpl	$1, n(%rip)
	jle	.L123
	.p2align 4,,10
	.p2align 3
.L122:
	movl	(%r12,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L122
.L123:
	movl	$10, %edi
	call	putchar@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L132
	addq	$24, %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
.L132:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	Ans
	.bss
	.align 32
	.type	Ans, @object
	.size	Ans, 160
Ans:
	.zero	160
	.globl	In
	.align 32
	.type	In, @object
	.size	In, 160
In:
	.zero	160
	.globl	Pre
	.align 32
	.type	Pre, @object
	.size	Pre, 160
Pre:
	.zero	160
	.globl	cout
	.align 4
	.type	cout, @object
	.size	cout, 4
cout:
	.zero	4
	.globl	pos
	.align 4
	.type	pos, @object
	.size	pos, 4
pos:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.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	distance
	.type	distance, @function
distance:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$39, %edi
	jg	.L4
	leaq	In(%rip), %rax
	movslq	%edi, %rdx
	movl	$40, %ecx
	leaq	(%rax,%rdx,4), %rdx
	subl	%edi, %ecx
	xorl	%eax, %eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %eax
	addq	$4, %rdx
	cmpl	%ecx, %eax
	je	.L7
.L3:
	cmpl	%esi, (%rdx)
	jne	.L8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	ret
.L4:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	distance, .-distance
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB24:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	%esi, 8(%rsp)
	cmpl	%esi, %edi
	jge	.L14
	movslq	pos(%rip), %rax
	leaq	Pre(%rip), %r13
	leaq	In(%rip), %rbx
	leal	1(%rax), %ecx
	movl	0(%r13,%rax,4), %r12d
	movq	%rax, %rsi
	xorl	%eax, %eax
	movl	%ecx, pos(%rip)
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%eax, %ebp
	cmpl	(%rbx,%rax,4), %r12d
	je	.L12
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L13
	movl	$40, %ebp
.L12:
	movl	n(%rip), %eax
	cmpl	%eax, %ebp
	jg	.L14
	cmpl	%ebp, %edi
	jge	.L117
	leal	2(%rsi), %r9d
	movslq	%ecx, %rcx
	movl	%r9d, pos(%rip)
	movl	0(%r13,%rcx,4), %r8d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%ecx, %r14d
	cmpl	(%rbx,%rcx,4), %r8d
	je	.L17
	addq	$1, %rcx
	cmpq	$40, %rcx
	jne	.L18
	movl	$40, %r14d
.L17:
	leaq	Ans(%rip), %r15
	cmpl	%r14d, %eax
	jl	.L16
	cmpl	%r14d, %edi
	jge	.L21
	leal	3(%rsi), %r11d
	movslq	%r9d, %r9
	xorl	%r10d, %r10d
	movl	%r11d, pos(%rip)
	movl	0(%r13,%r9,4), %r9d
	.p2align 4,,10
	.p2align 3
.L23:
	movl	%r10d, %ecx
	cmpl	(%rbx,%r10,4), %r9d
	je	.L22
	addq	$1, %r10
	cmpq	$40, %r10
	jne	.L23
	movl	$40, %ecx
.L22:
	leaq	Ans(%rip), %r15
	cmpl	%ecx, %eax
	jl	.L21
	cmpl	%ecx, %edi
	jge	.L26
	addl	$4, %esi
	movslq	%r11d, %r11
	movl	%esi, pos(%rip)
	movl	0(%r13,%r11,4), %r10d
	xorl	%r11d, %r11d
	.p2align 4,,10
	.p2align 3
.L28:
	movl	%r11d, %esi
	cmpl	(%rbx,%r11,4), %r10d
	je	.L27
	addq	$1, %r11
	cmpq	$40, %r11
	jne	.L28
	movl	$40, %esi
.L27:
	movl	%r10d, 12(%rsp)
	leaq	Ans(%rip), %r15
	cmpl	%esi, %eax
	jl	.L26
	movl	%r9d, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%ecx, 28(%rsp)
	movl	%esi, 16(%rsp)
	call	solve
	movl	16(%rsp), %esi
	movl	28(%rsp), %ecx
	leal	1(%rsi), %edi
	movl	%ecx, %esi
	movl	%ecx, 16(%rsp)
	call	solve
	movslq	cout(%rip), %rax
	movl	12(%rsp), %r10d
	movl	24(%rsp), %r9d
	movl	20(%rsp), %r8d
	leal	1(%rax), %esi
	movl	%r10d, (%r15,%rax,4)
	movl	16(%rsp), %ecx
	movl	%esi, cout(%rip)
.L26:
	leal	1(%rcx), %edi
	cmpl	%r14d, %edi
	jge	.L110
	movslq	pos(%rip), %rcx
	movq	%rcx, %rax
	movl	0(%r13,%rcx,4), %r10d
	addl	$1, %eax
	movl	%eax, pos(%rip)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L33:
	movl	%eax, %esi
	cmpl	(%rbx,%rax,4), %r10d
	je	.L32
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L33
	movl	$40, %esi
.L32:
	cmpl	%esi, n(%rip)
	jl	.L110
	movl	%r10d, 24(%rsp)
	movl	%r9d, 20(%rsp)
	movl	%r8d, 16(%rsp)
	movl	%esi, 12(%rsp)
	call	solve
	movl	12(%rsp), %esi
	leal	1(%rsi), %edi
	movl	%r14d, %esi
	call	solve
	movl	24(%rsp), %r10d
	movl	20(%rsp), %r9d
	movslq	cout(%rip), %rcx
	movl	16(%rsp), %r8d
	movl	%r10d, (%r15,%rcx,4)
	leal	1(%rcx), %eax
.L31:
	leal	1(%rax), %ecx
	cltq
	movl	%ecx, cout(%rip)
	movl	%r9d, (%r15,%rax,4)
.L21:
	leal	1(%r14), %edi
	cmpl	%ebp, %edi
	jge	.L112
	movslq	pos(%rip), %rax
	leal	1(%rax), %r9d
	movl	0(%r13,%rax,4), %ecx
	movq	%rax, %rsi
	xorl	%eax, %eax
	movl	%r9d, pos(%rip)
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%eax, %r14d
	cmpl	(%rbx,%rax,4), %ecx
	je	.L37
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L38
	movl	$40, %r14d
.L37:
	movl	n(%rip), %r10d
	cmpl	%r14d, %r10d
	jl	.L112
	cmpl	%r14d, %edi
	jge	.L41
	addl	$2, %esi
	movslq	%r9d, %r9
	xorl	%eax, %eax
	movl	%esi, pos(%rip)
	movl	0(%r13,%r9,4), %r9d
	.p2align 4,,10
	.p2align 3
.L43:
	movl	%eax, %esi
	cmpl	(%rbx,%rax,4), %r9d
	je	.L42
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L43
	movl	$40, %esi
.L42:
	movl	%r9d, 12(%rsp)
	cmpl	%esi, %r10d
	jl	.L41
	movl	%ecx, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%esi, 16(%rsp)
	call	solve
	movl	16(%rsp), %esi
	leal	1(%rsi), %edi
	movl	%r14d, %esi
	call	solve
	movslq	cout(%rip), %rax
	movl	12(%rsp), %r9d
	movl	24(%rsp), %ecx
	movl	20(%rsp), %r8d
	leal	1(%rax), %esi
	movl	%r9d, (%r15,%rax,4)
	movl	%esi, cout(%rip)
.L41:
	leal	1(%r14), %edi
	cmpl	%ebp, %edi
	jge	.L111
	movslq	pos(%rip), %rsi
	movq	%rsi, %rax
	movl	0(%r13,%rsi,4), %r9d
	addl	$1, %eax
	movl	%eax, pos(%rip)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L48:
	movl	%eax, %r14d
	cmpl	(%rbx,%rax,4), %r9d
	je	.L47
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L48
	movl	$40, %r14d
.L47:
	cmpl	%r14d, n(%rip)
	jl	.L111
	movl	%r14d, %esi
	movl	%r9d, 20(%rsp)
	movl	%ecx, 16(%rsp)
	movl	%r8d, 12(%rsp)
	call	solve
	movl	%ebp, %esi
	leal	1(%r14), %edi
	call	solve
	movslq	cout(%rip), %rax
	movl	20(%rsp), %r9d
	movl	16(%rsp), %ecx
	movl	12(%rsp), %r8d
	movl	%r9d, (%r15,%rax,4)
	leal	1(%rax), %esi
.L46:
	leal	1(%rsi), %eax
	movslq	%esi, %rsi
	movl	%ecx, (%r15,%rsi,4)
.L36:
	leal	1(%rax), %ecx
	cltq
	movl	%ecx, cout(%rip)
	movl	%r8d, (%r15,%rax,4)
.L16:
	leal	1(%rbp), %edi
	cmpl	8(%rsp), %edi
	jge	.L116
	movslq	pos(%rip), %rax
	leal	1(%rax), %r8d
	movl	0(%r13,%rax,4), %r14d
	movq	%rax, %rsi
	xorl	%eax, %eax
	movl	%r8d, pos(%rip)
	.p2align 4,,10
	.p2align 3
.L53:
	movl	%eax, %ecx
	cmpl	(%rbx,%rax,4), %r14d
	je	.L52
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L53
	movl	$40, %ecx
.L52:
	movl	n(%rip), %r10d
	cmpl	%ecx, %r10d
	jl	.L116
	cmpl	%ecx, %edi
	jge	.L56
	leal	2(%rsi), %r9d
	movslq	%r8d, %r8
	xorl	%eax, %eax
	movl	%r9d, pos(%rip)
	movl	0(%r13,%r8,4), %r8d
	.p2align 4,,10
	.p2align 3
.L58:
	movl	%eax, %ebp
	cmpl	(%rbx,%rax,4), %r8d
	je	.L57
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L58
	movl	$40, %ebp
.L57:
	cmpl	%ebp, %r10d
	jl	.L56
	cmpl	%ebp, %edi
	jge	.L61
	addl	$3, %esi
	movslq	%r9d, %r9
	xorl	%eax, %eax
	movl	%esi, pos(%rip)
	movl	0(%r13,%r9,4), %r9d
	.p2align 4,,10
	.p2align 3
.L63:
	movl	%eax, %esi
	cmpl	(%rbx,%rax,4), %r9d
	je	.L62
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L63
	movl	$40, %esi
.L62:
	movl	%r9d, 12(%rsp)
	cmpl	%esi, %r10d
	jl	.L61
	movl	%r8d, 24(%rsp)
	movl	%ecx, 20(%rsp)
	movl	%esi, 16(%rsp)
	call	solve
	movl	16(%rsp), %esi
	leal	1(%rsi), %edi
	movl	%ebp, %esi
	call	solve
	movslq	cout(%rip), %rax
	movl	12(%rsp), %r9d
	movl	24(%rsp), %r8d
	movl	20(%rsp), %ecx
	leal	1(%rax), %esi
	movl	%r9d, (%r15,%rax,4)
	movl	%esi, cout(%rip)
.L61:
	leal	1(%rbp), %edi
	cmpl	%ecx, %edi
	jge	.L113
	movslq	pos(%rip), %rsi
	movq	%rsi, %rax
	movl	0(%r13,%rsi,4), %r9d
	addl	$1, %eax
	movl	%eax, pos(%rip)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L68:
	movl	%eax, %ebp
	cmpl	(%rbx,%rax,4), %r9d
	je	.L67
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L68
	movl	$40, %ebp
.L67:
	cmpl	%ebp, n(%rip)
	jl	.L113
	movl	%ebp, %esi
	movl	%r9d, 20(%rsp)
	movl	%r8d, 16(%rsp)
	movl	%ecx, 12(%rsp)
	call	solve
	movl	12(%rsp), %esi
	leal	1(%rbp), %edi
	call	solve
	movslq	cout(%rip), %rsi
	movl	20(%rsp), %r9d
	movl	16(%rsp), %r8d
	movl	12(%rsp), %ecx
	movl	%r9d, (%r15,%rsi,4)
	leal	1(%rsi), %eax
.L66:
	leal	1(%rax), %esi
	cltq
	movl	%esi, cout(%rip)
	movl	%r8d, (%r15,%rax,4)
.L56:
	leal	1(%rcx), %edi
	cmpl	8(%rsp), %edi
	jge	.L115
	movslq	pos(%rip), %rax
	leal	1(%rax), %ecx
	movl	0(%r13,%rax,4), %r8d
	movq	%rax, %rsi
	xorl	%eax, %eax
	movl	%ecx, pos(%rip)
	.p2align 4,,10
	.p2align 3
.L73:
	movl	%eax, %ebp
	cmpl	(%rbx,%rax,4), %r8d
	je	.L72
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L73
	movl	$40, %ebp
.L72:
	movl	n(%rip), %eax
	cmpl	%ebp, %eax
	jl	.L115
	cmpl	%ebp, %edi
	jge	.L76
	leal	2(%rsi), %r11d
	movslq	%ecx, %rcx
	xorl	%r10d, %r10d
	movl	%r11d, pos(%rip)
	movl	0(%r13,%rcx,4), %r9d
	.p2align 4,,10
	.p2align 3
.L78:
	movl	%r10d, %ecx
	cmpl	(%rbx,%r10,4), %r9d
	je	.L77
	addq	$1, %r10
	cmpq	$40, %r10
	jne	.L78
	movl	$40, %ecx
.L77:
	cmpl	%ecx, %eax
	jl	.L76
	cmpl	%ecx, %edi
	jge	.L81
	addl	$3, %esi
	movslq	%r11d, %r11
	movl	%esi, pos(%rip)
	movl	0(%r13,%r11,4), %r10d
	xorl	%r11d, %r11d
	.p2align 4,,10
	.p2align 3
.L83:
	movl	%r11d, %esi
	cmpl	(%rbx,%r11,4), %r10d
	je	.L82
	addq	$1, %r11
	cmpq	$40, %r11
	jne	.L83
	movl	$40, %esi
.L82:
	movl	%r10d, 12(%rsp)
	cmpl	%esi, %eax
	jl	.L81
	movl	%r9d, 24(%rsp)
	movl	%r8d, 20(%rsp)
	movl	%ecx, 28(%rsp)
	movl	%esi, 16(%rsp)
	call	solve
	movl	16(%rsp), %esi
	movl	28(%rsp), %ecx
	leal	1(%rsi), %edi
	movl	%ecx, %esi
	movl	%ecx, 16(%rsp)
	call	solve
	movslq	cout(%rip), %rax
	movl	12(%rsp), %r10d
	movl	24(%rsp), %r9d
	movl	20(%rsp), %r8d
	leal	1(%rax), %esi
	movl	%r10d, (%r15,%rax,4)
	movl	16(%rsp), %ecx
	movl	%esi, cout(%rip)
.L81:
	leal	1(%rcx), %edi
	movl	%ebp, %esi
	movl	%r9d, 16(%rsp)
	movl	%r8d, 12(%rsp)
	call	solve
	movl	16(%rsp), %r9d
	movl	12(%rsp), %r8d
	movslq	cout(%rip), %rax
	leal	1(%rax), %ecx
	movl	%r9d, (%r15,%rax,4)
	movl	%ecx, cout(%rip)
.L76:
	leal	1(%rbp), %edi
	cmpl	8(%rsp), %edi
	jge	.L114
	movslq	pos(%rip), %rcx
	movq	%rcx, %rax
	movl	0(%r13,%rcx,4), %edx
	addl	$1, %eax
	movl	%eax, pos(%rip)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L88:
	movl	%eax, %ebp
	cmpl	(%rbx,%rax,4), %edx
	je	.L87
	addq	$1, %rax
	cmpq	$40, %rax
	jne	.L88
	movl	$40, %ebp
.L87:
	cmpl	%ebp, n(%rip)
	jl	.L114
	movl	%ebp, %esi
	movl	%edx, 16(%rsp)
	movl	%r8d, 12(%rsp)
	call	solve
	movl	8(%rsp), %esi
	leal	1(%rbp), %edi
	call	solve
	movslq	cout(%rip), %rcx
	movl	16(%rsp), %edx
	movl	12(%rsp), %r8d
	movl	%edx, (%r15,%rcx,4)
	leal	1(%rcx), %eax
.L86:
	leal	1(%rax), %edx
	cltq
	movl	%r8d, (%r15,%rax,4)
.L71:
	leal	1(%rdx), %eax
	movslq	%edx, %rdx
	movl	%r14d, (%r15,%rdx,4)
.L51:
	leal	1(%rax), %edx
	cltq
	movl	%edx, cout(%rip)
	movl	%r12d, (%r15,%rax,4)
	xorl	%eax, %eax
.L9:
	addq	$40, %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
.L14:
	.cfi_restore_state
	movl	$-1, %eax
	jmp	.L9
.L116:
	movl	cout(%rip), %eax
	jmp	.L51
.L115:
	movl	cout(%rip), %edx
	jmp	.L71
.L112:
	movl	cout(%rip), %eax
	jmp	.L36
.L111:
	movl	cout(%rip), %esi
	jmp	.L46
.L113:
	movl	cout(%rip), %eax
	jmp	.L66
.L114:
	movl	cout(%rip), %eax
	jmp	.L86
.L110:
	movl	cout(%rip), %eax
	jmp	.L31
.L117:
	leaq	Ans(%rip), %r15
	jmp	.L16
	.cfi_endproc
.LFE24:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	n(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rbp, %rdi
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %esi
	testl	%esi, %esi
	jle	.L119
	xorl	%ebx, %ebx
	leaq	4(%rsp), %r12
	leaq	Pre(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L120:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movl	n(%rip), %esi
	movl	%eax, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L120
	testl	%esi, %esi
	jle	.L119
	xorl	%ebx, %ebx
	leaq	In(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L121:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	movl	n(%rip), %esi
	movl	%eax, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %esi
	jg	.L121
.L119:
	xorl	%edi, %edi
	movl	$1, %ebx
	leaq	Ans(%rip), %r12
	call	solve
	movl	Ans(%rip), %edx
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rbp
	call	__printf_chk@PLT
	cmpl	$1, n(%rip)
	jle	.L123
	.p2align 4,,10
	.p2align 3
.L122:
	movl	(%r12,%rbx,4), %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, n(%rip)
	jg	.L122
.L123:
	movl	$10, %edi
	call	putchar@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L132
	addq	$24, %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
.L132:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	Ans
	.bss
	.align 32
	.type	Ans, @object
	.size	Ans, 160
Ans:
	.zero	160
	.globl	In
	.align 32
	.type	In, @object
	.size	In, 160
In:
	.zero	160
	.globl	Pre
	.align 32
	.type	Pre, @object
	.size	Pre, 160
Pre:
	.zero	160
	.globl	cout
	.align 4
	.type	cout, @object
	.size	cout, 4
cout:
	.zero	4
	.globl	pos
	.align 4
	.type	pos, @object
	.size	pos, 4
pos:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.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 MAX 40

int n,pos=0;
int cout = 0;
int Pre[MAX],In[MAX],Ans[MAX];

int distance(int start,int key){
  int i,count=0;
  for(i=start;i<MAX;i++){
    if(In[i]!=key)
      count++;
    else break;
  }
  return count;
}
  
  
int solve(int l,int r){
  int root,d;
  if(l-r>=0)return -1;
  root=Pre[pos];
  pos++;
  d=distance(0,root);
  if(d>n)return -1;
  solve(l, d);
  solve(d+1, r);
  Ans[cout++]=root;
  return 0;
}

int main(){
  int m,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&m);
    Pre[i]=m;
  }
  for(i=0;i<n;i++){
      scanf("%d",&m);
      In[i]=m;
  }
  solve(0,n);

  printf("%d",Ans[0]);
  for(i=1;i<n;i++)
    printf(" %d",Ans[i]);
  printf("\n");
	   
  return 0;
}
    
4
1 2 3 4
2 1 3 4
 4
2 1 3 4
2 1 3 4
 4
2 1 3 4
3 1 2 4
 5
1 2 3 4 5
1 2 4 3 5
 4
2 1 3 4
1 2 3 4
 5
1 3 2 4 5
3 2 4 1 5
 4
1 4 3 2
1 2 3 4
 5
1 2 3 4 5
3 4 2 1 5
 4
1 2 3 4
1 2 4 3
 4
2 1 3 4
2 1 4 3

2 4 3 1
 4 3 1 2
 3 1 4 2
 4 5 3 2 1
 1 4 3 2
 4 2 3 5 1
 2 3 4 1
 4 3 2 5 1
 4 3 2 1
 4 3 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>

#define MAX 40

int n,pos=0;
int cout = 0;
int Pre[MAX],In[MAX],Ans[MAX];

int distance(int start,int key){
  int i,count=0;
  for(i=start;i<MAX;i++){
    if(In[i]!=key)
      count++;
    else break;
  }
  return count;
}
  
  
int solve(int l,int r){
  int root,d;
  if(l-r>=0)return -1;
  root=Pre[pos];
  pos++;
  d=distance(0,root);
  if(d>n)return -1;
  solve(l, d);
  solve(d+1, r);
  Ans[cout++]=root;
  return 0;
}

int main(){
  int m,i;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&m);
    Pre[i]=m;
  }
  for(i=0;i<n;i++){
      scanf("%d",&m);
      In[i]=m;
  }
  solve(0,n);

  printf("%d",Ans[0]);
  for(i=1;i<n;i++)
    printf(" %d",Ans[i]);
  printf("\n");
	   
  return 0;
}
    ```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	pos
	.align 4
	.type	pos, @object
	.size	pos, 4
pos:
	.zero	4
	.globl	cout
	.align 4
	.type	cout, @object
	.size	cout, 4
cout:
	.zero	4
	.globl	Pre
	.align 32
	.type	Pre, @object
	.size	Pre, 160
Pre:
	.zero	160
	.globl	In
	.align 32
	.type	In, @object
	.size	In, 160
In:
	.zero	160
	.globl	Ans
	.align 32
	.type	Ans, @object
	.size	Ans, 160
Ans:
	.zero	160
	.text
	.globl	distance
	.type	distance, @function
distance:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	In(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	je	.L8
	addl	$1, -4(%rbp)
	addl	$1, -8(%rbp)
.L2:
	cmpl	$39, -8(%rbp)
	jle	.L6
	jmp	.L5
.L8:
	nop
.L5:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	distance, .-distance
	.globl	solve
	.type	solve, @function
solve:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	testl	%eax, %eax
	js	.L10
	movl	$-1, %eax
	jmp	.L11
.L10:
	movl	pos(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Pre(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	pos(%rip), %eax
	addl	$1, %eax
	movl	%eax, pos(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	distance
	movl	%eax, -4(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	$-1, %eax
	jmp	.L11
.L12:
	movl	-4(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	solve
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	solve
	movl	cout(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, cout(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Ans(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %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, -12(%rbp)
	jmp	.L14
.L15:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Pre(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L15
	movl	$0, -12(%rbp)
	jmp	.L16
.L17:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	In(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L16:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L17
	movl	n(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	solve
	movl	Ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -12(%rbp)
	jmp	.L18
.L19:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L18:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	pos
	.align 4
	.type	pos, @object
	.size	pos, 4
pos:
	.zero	4
	.globl	cout
	.align 4
	.type	cout, @object
	.size	cout, 4
cout:
	.zero	4
	.globl	Pre
	.align 32
	.type	Pre, @object
	.size	Pre, 160
Pre:
	.zero	160
	.globl	In
	.align 32
	.type	In, @object
	.size	In, 160
In:
	.zero	160
	.globl	Ans
	.align 32
	.type	Ans, @object
	.size	Ans, 160
Ans:
	.zero	160
	.text
	.globl	distance
	.type	distance, @function
distance:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -4(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L6:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	In(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -24(%rbp)
	je	.L8
	addl	$1, -4(%rbp)
	addl	$1, -8(%rbp)
.L2:
	cmpl	$39, -8(%rbp)
	jle	.L6
	jmp	.L5
.L8:
	nop
.L5:
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	distance, .-distance
	.globl	solve
	.type	solve, @function
solve:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	-20(%rbp), %eax
	subl	-24(%rbp), %eax
	testl	%eax, %eax
	js	.L10
	movl	$-1, %eax
	jmp	.L11
.L10:
	movl	pos(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Pre(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -8(%rbp)
	movl	pos(%rip), %eax
	addl	$1, %eax
	movl	%eax, pos(%rip)
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	distance
	movl	%eax, -4(%rbp)
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	$-1, %eax
	jmp	.L11
.L12:
	movl	-4(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	solve
	movl	-4(%rbp), %eax
	leal	1(%rax), %edx
	movl	-24(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	solve
	movl	cout(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, cout(%rip)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	Ans(%rip), %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	$0, %eax
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	" %d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %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, -12(%rbp)
	jmp	.L14
.L15:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	Pre(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L15
	movl	$0, -12(%rbp)
	jmp	.L16
.L17:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-16(%rbp), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	In(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -12(%rbp)
.L16:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L17
	movl	n(%rip), %eax
	movl	%eax, %esi
	movl	$0, %edi
	call	solve
	movl	Ans(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$1, -12(%rbp)
	jmp	.L18
.L19:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	Ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -12(%rbp)
.L18:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L19
	movl	$10, %edi
	call	putchar@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
