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,i,j,count,check,turn,seq[16],sub[16];

  while(1){
    scanf("%d",&n);
    if(n == 0)break;
    else
      {
	turn=0;
	for(i=0;i<n;i++)scanf("%d",&seq[i]);
	while(1){
	  count=0;
	  check=0;
	
	for(i=0;i<n;i++){
	  count=0;
	  for(j=0;j<n;j++){
	    if(seq[i]==seq[j])count++;
	  }
	  sub[i]=count;
	}
	for(i=0;i<n;i++){
	  if(seq[i]==sub[i])check++;}
	if(check==n)break;
	else{
	  turn++;
	  for(i=0;i<n;i++){
	    seq[i]=sub[i];
	    sub[i]=0;
	  }
	}
	}
	printf("%d\n",turn);
	for(i=0;i<n;i++){
	  if(i==0)printf("%d",seq[i]);
	  else{
	    printf(" %d",seq[i]);}
	}
	printf("\n");
      }
  }



  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.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
	subq	$176, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L23:
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-168(%rbp), %eax
	testl	%eax, %eax
	je	.L28
	movl	$0, -148(%rbp)
	movl	$0, -164(%rbp)
	jmp	.L4
.L5:
	leaq	-144(%rbp), %rdx
	movl	-164(%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, -164(%rbp)
.L4:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L5
.L18:
	movl	$0, -156(%rbp)
	movl	$0, -152(%rbp)
	movl	$0, -164(%rbp)
	jmp	.L6
.L10:
	movl	$0, -156(%rbp)
	movl	$0, -160(%rbp)
	jmp	.L7
.L9:
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %edx
	movl	-160(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L8
	addl	$1, -156(%rbp)
.L8:
	addl	$1, -160(%rbp)
.L7:
	movl	-168(%rbp), %eax
	cmpl	%eax, -160(%rbp)
	jl	.L9
	movl	-164(%rbp), %eax
	cltq
	movl	-156(%rbp), %edx
	movl	%edx, -80(%rbp,%rax,4)
	addl	$1, -164(%rbp)
.L6:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L10
	movl	$0, -164(%rbp)
	jmp	.L11
.L13:
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %edx
	movl	-164(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L12
	addl	$1, -152(%rbp)
.L12:
	addl	$1, -164(%rbp)
.L11:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L13
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	je	.L29
	addl	$1, -148(%rbp)
	movl	$0, -164(%rbp)
	jmp	.L16
.L17:
	movl	-164(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %edx
	movl	-164(%rbp), %eax
	cltq
	movl	%edx, -144(%rbp,%rax,4)
	movl	-164(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	addl	$1, -164(%rbp)
.L16:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L17
	jmp	.L18
.L29:
	nop
	movl	-148(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -164(%rbp)
	jmp	.L19
.L22:
	cmpl	$0, -164(%rbp)
	jne	.L20
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L21
.L20:
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L21:
	addl	$1, -164(%rbp)
.L19:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L22
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L23
.L28:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.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"
.LC2:
	.string	"%d\n"
.LC3:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	$312, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	156(%rsp), %rax
	movq	%rax, 136(%rsp)
.L41:
	movq	136(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	156(%rsp), %r14d
	testl	%r14d, %r14d
	je	.L2
	jle	.L3
	leaq	160(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	156(%rsp), %r14d
	addq	$4, %rbp
	cmpl	%ebx, %r14d
	jg	.L4
.L3:
	movl	%r14d, %eax
	leal	-1(%r14), %edi
	movl	$1, 28(%rsp)
	leaq	160(%rsp), %r15
	shrl	$2, %eax
	movl	%edi, 44(%rsp)
	movl	%eax, 124(%rsp)
	subl	$1, %eax
	addq	$1, %rax
	salq	$4, %rax
	movq	%rax, 128(%rsp)
	movl	%r14d, %eax
	andl	$-4, %eax
	movl	%eax, 32(%rsp)
	movl	%edi, %eax
	leaq	4(,%rax,4), %rax
	movq	%rax, 112(%rsp)
	movl	28(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 120(%rsp)
	testl	%r14d, %r14d
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L144:
	cmpl	$2, 44(%rsp)
	jbe	.L46
	movl	180(%rsp), %ebx
	movl	184(%rsp), %r12d
	leaq	224(%rsp), %rbp
	movl	188(%rsp), %r13d
	movl	192(%rsp), %eax
	movd	%ebx, %xmm1
	movl	160(%rsp), %edi
	movl	164(%rsp), %r8d
	pshufd	$0, %xmm1, %xmm8
	movd	%r12d, %xmm1
	movl	%eax, 4(%rsp)
	movl	172(%rsp), %r10d
	pshufd	$0, %xmm1, %xmm10
	movd	%r13d, %xmm1
	movd	%edi, %xmm7
	movl	168(%rsp), %r9d
	pshufd	$0, %xmm1, %xmm11
	movd	%eax, %xmm1
	movd	%r8d, %xmm3
	movl	196(%rsp), %eax
	pshufd	$0, %xmm1, %xmm12
	pshufd	$0, %xmm7, %xmm6
	movd	%r10d, %xmm7
	movl	176(%rsp), %r11d
	movd	%eax, %xmm1
	movl	%eax, 8(%rsp)
	movl	200(%rsp), %eax
	pshufd	$0, %xmm3, %xmm5
	pshufd	$0, %xmm1, %xmm13
	movd	%r9d, %xmm4
	pshufd	$0, %xmm7, %xmm3
	movdqa	.LC1(%rip), %xmm9
	movd	%eax, %xmm1
	movl	%eax, 12(%rsp)
	movl	204(%rsp), %eax
	movd	%r11d, %xmm7
	pshufd	$0, %xmm1, %xmm14
	pshufd	$0, %xmm4, %xmm4
	pshufd	$0, %xmm7, %xmm7
	movq	128(%rsp), %rdx
	movd	%eax, %xmm1
	movl	%eax, 16(%rsp)
	movl	208(%rsp), %eax
	pshufd	$0, %xmm1, %xmm15
	movl	%eax, 20(%rsp)
	movd	%eax, %xmm1
	movl	212(%rsp), %eax
	pshufd	$0, %xmm1, %xmm1
	movl	%eax, 24(%rsp)
	movaps	%xmm1, 48(%rsp)
	movd	%eax, %xmm1
	movl	216(%rsp), %eax
	pshufd	$0, %xmm1, %xmm1
	movl	%eax, 36(%rsp)
	movaps	%xmm1, 64(%rsp)
	movd	%eax, %xmm1
	movl	220(%rsp), %eax
	pshufd	$0, %xmm1, %xmm1
	movaps	%xmm1, 96(%rsp)
	movd	%eax, %xmm1
	pshufd	$0, %xmm1, %xmm1
	movl	%eax, 40(%rsp)
	xorl	%eax, %eax
	movaps	%xmm1, 80(%rsp)
.L8:
	movdqa	(%r15,%rax), %xmm1
	movdqa	%xmm1, %xmm2
	movdqa	%xmm1, %xmm0
	pcmpeqd	%xmm6, %xmm2
	pcmpeqd	%xmm5, %xmm0
	pand	.LC1(%rip), %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm4, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm3, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$4, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm7, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$5, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm8, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$6, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm10, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$7, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm11, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$8, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm12, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$9, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm13, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$10, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm14, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$11, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm15, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$12, %r14d
	je	.L7
	movdqa	48(%rsp), %xmm2
	pcmpeqd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$13, %r14d
	je	.L7
	movdqa	64(%rsp), %xmm2
	pcmpeqd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$14, %r14d
	je	.L7
	movdqa	96(%rsp), %xmm2
	pcmpeqd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$15, %r14d
	je	.L7
	pcmpeqd	80(%rsp), %xmm1
	psubd	%xmm1, %xmm0
	.p2align 4,,10
	.p2align 3
.L7:
	movaps	%xmm0, 0(%rbp,%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L8
	movl	32(%rsp), %eax
	movslq	%eax, %rcx
	cmpl	%eax, %r14d
	je	.L9
	.p2align 4,,10
	.p2align 3
.L26:
	movl	(%r15,%rcx,4), %edx
	xorl	%eax, %eax
	cmpl	%edx, %edi
	sete	%al
	cmpl	$1, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r8d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$2, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r9d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$3, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r10d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$4, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r11d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$5, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%ebx, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$6, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r12d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$7, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r13d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$8, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	4(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$9, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	8(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$10, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	12(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$11, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	16(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$12, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	20(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$13, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	24(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$14, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	36(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$15, %r14d
	je	.L10
	cmpl	40(%rsp), %edx
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%eax, 0(%rbp,%rcx,4)
	addq	$1, %rcx
	cmpl	%ecx, %r14d
	jg	.L26
	cmpl	$2, 44(%rsp)
	jbe	.L47
	movdqa	.LC1(%rip), %xmm9
.L9:
	movdqa	224(%rsp), %xmm0
	movl	124(%rsp), %eax
	pcmpeqd	160(%rsp), %xmm0
	pand	%xmm9, %xmm0
	cmpl	$1, %eax
	jbe	.L30
	movdqa	176(%rsp), %xmm1
	pcmpeqd	240(%rsp), %xmm1
	psubd	%xmm1, %xmm0
	cmpl	$2, %eax
	je	.L30
	movdqa	192(%rsp), %xmm1
	pcmpeqd	256(%rsp), %xmm1
	psubd	%xmm1, %xmm0
	cmpl	$3, %eax
	je	.L30
	movdqa	208(%rsp), %xmm1
	pcmpeqd	272(%rsp), %xmm1
	psubd	%xmm1, %xmm0
.L30:
	movdqa	%xmm0, %xmm1
	movl	32(%rsp), %ebx
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movl	%ebx, %edx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%ebx, %r14d
	je	.L31
.L29:
	movslq	%edx, %rcx
	movl	160(%rsp,%rcx,4), %edi
	cmpl	%edi, 224(%rsp,%rcx,4)
	jne	.L32
	addl	$1, %eax
.L32:
	leal	1(%rdx), %ecx
	cmpl	%ecx, %r14d
	jle	.L31
	movslq	%ecx, %rcx
	movl	160(%rsp,%rcx,4), %edi
	cmpl	%edi, 224(%rsp,%rcx,4)
	jne	.L33
	addl	$1, %eax
.L33:
	addl	$2, %edx
	cmpl	%r14d, %edx
	jge	.L31
	movslq	%edx, %rdx
	movl	224(%rsp,%rdx,4), %edi
	cmpl	%edi, 160(%rsp,%rdx,4)
	jne	.L31
	addl	$1, %eax
.L31:
	cmpl	%eax, %r14d
	je	.L43
	movq	112(%rsp), %rbx
	movq	%rbp, %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	call	memcpy@PLT
	movq	%rbx, %rdx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
.L42:
	addl	$1, 28(%rsp)
	movl	28(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 120(%rsp)
	testl	%r14d, %r14d
	jg	.L144
.L5:
	jne	.L42
.L43:
	movl	120(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	156(%rsp), %eax
	testl	%eax, %eax
	jle	.L37
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %rbp
.L40:
	testq	%rbx, %rbx
	jne	.L38
	movl	160(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	movl	$1, %ebx
	call	__printf_chk@PLT
	cmpl	$1, 156(%rsp)
	jle	.L37
.L38:
	movl	160(%rsp,%rbx,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 156(%rsp)
	jg	.L40
.L37:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L41
.L47:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L29
.L46:
	movl	192(%rsp), %eax
	movl	160(%rsp), %edi
	xorl	%ecx, %ecx
	leaq	224(%rsp), %rbp
	movl	164(%rsp), %r8d
	movl	168(%rsp), %r9d
	movl	%eax, 4(%rsp)
	movl	196(%rsp), %eax
	movl	172(%rsp), %r10d
	movl	176(%rsp), %r11d
	movl	%eax, 8(%rsp)
	movl	200(%rsp), %eax
	movl	180(%rsp), %ebx
	movl	184(%rsp), %r12d
	movl	%eax, 12(%rsp)
	movl	204(%rsp), %eax
	movl	188(%rsp), %r13d
	movl	%eax, 16(%rsp)
	movl	208(%rsp), %eax
	movl	%eax, 20(%rsp)
	movl	212(%rsp), %eax
	movl	%eax, 24(%rsp)
	movl	216(%rsp), %eax
	movl	%eax, 36(%rsp)
	movl	220(%rsp), %eax
	movl	%eax, 40(%rsp)
	jmp	.L26
.L2:
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L145
	addq	$312, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L145:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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"
.LC2:
	.string	"%d\n"
.LC3:
	.string	" %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	$312, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	156(%rsp), %rax
	movq	%rax, 136(%rsp)
.L41:
	movq	136(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	156(%rsp), %r14d
	testl	%r14d, %r14d
	je	.L2
	jle	.L3
	leaq	160(%rsp), %rbp
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	156(%rsp), %r14d
	addq	$4, %rbp
	cmpl	%ebx, %r14d
	jg	.L4
.L3:
	movl	%r14d, %eax
	leal	-1(%r14), %edi
	movl	$1, 28(%rsp)
	leaq	160(%rsp), %r15
	shrl	$2, %eax
	movl	%edi, 44(%rsp)
	movl	%eax, 124(%rsp)
	subl	$1, %eax
	addq	$1, %rax
	salq	$4, %rax
	movq	%rax, 128(%rsp)
	movl	%r14d, %eax
	andl	$-4, %eax
	movl	%eax, 32(%rsp)
	movl	%edi, %eax
	leaq	4(,%rax,4), %rax
	movq	%rax, 112(%rsp)
	movl	28(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 120(%rsp)
	testl	%r14d, %r14d
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L144:
	cmpl	$2, 44(%rsp)
	jbe	.L46
	movl	180(%rsp), %ebx
	movl	184(%rsp), %r12d
	leaq	224(%rsp), %rbp
	movl	188(%rsp), %r13d
	movl	192(%rsp), %eax
	movd	%ebx, %xmm1
	movl	160(%rsp), %edi
	movl	164(%rsp), %r8d
	pshufd	$0, %xmm1, %xmm8
	movd	%r12d, %xmm1
	movl	%eax, 4(%rsp)
	movl	172(%rsp), %r10d
	pshufd	$0, %xmm1, %xmm10
	movd	%r13d, %xmm1
	movd	%edi, %xmm7
	movl	168(%rsp), %r9d
	pshufd	$0, %xmm1, %xmm11
	movd	%eax, %xmm1
	movd	%r8d, %xmm3
	movl	196(%rsp), %eax
	pshufd	$0, %xmm1, %xmm12
	pshufd	$0, %xmm7, %xmm6
	movd	%r10d, %xmm7
	movl	176(%rsp), %r11d
	movd	%eax, %xmm1
	movl	%eax, 8(%rsp)
	movl	200(%rsp), %eax
	pshufd	$0, %xmm3, %xmm5
	pshufd	$0, %xmm1, %xmm13
	movd	%r9d, %xmm4
	pshufd	$0, %xmm7, %xmm3
	movdqa	.LC1(%rip), %xmm9
	movd	%eax, %xmm1
	movl	%eax, 12(%rsp)
	movl	204(%rsp), %eax
	movd	%r11d, %xmm7
	pshufd	$0, %xmm1, %xmm14
	pshufd	$0, %xmm4, %xmm4
	pshufd	$0, %xmm7, %xmm7
	movq	128(%rsp), %rdx
	movd	%eax, %xmm1
	movl	%eax, 16(%rsp)
	movl	208(%rsp), %eax
	pshufd	$0, %xmm1, %xmm15
	movl	%eax, 20(%rsp)
	movd	%eax, %xmm1
	movl	212(%rsp), %eax
	pshufd	$0, %xmm1, %xmm1
	movl	%eax, 24(%rsp)
	movaps	%xmm1, 48(%rsp)
	movd	%eax, %xmm1
	movl	216(%rsp), %eax
	pshufd	$0, %xmm1, %xmm1
	movl	%eax, 36(%rsp)
	movaps	%xmm1, 64(%rsp)
	movd	%eax, %xmm1
	movl	220(%rsp), %eax
	pshufd	$0, %xmm1, %xmm1
	movaps	%xmm1, 96(%rsp)
	movd	%eax, %xmm1
	pshufd	$0, %xmm1, %xmm1
	movl	%eax, 40(%rsp)
	xorl	%eax, %eax
	movaps	%xmm1, 80(%rsp)
.L8:
	movdqa	(%r15,%rax), %xmm1
	movdqa	%xmm1, %xmm2
	movdqa	%xmm1, %xmm0
	pcmpeqd	%xmm6, %xmm2
	pcmpeqd	%xmm5, %xmm0
	pand	.LC1(%rip), %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm4, %xmm2
	psubd	%xmm2, %xmm0
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm3, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$4, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm7, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$5, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm8, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$6, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm10, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$7, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm11, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$8, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm12, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$9, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm13, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$10, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm14, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$11, %r14d
	je	.L7
	movdqa	%xmm1, %xmm2
	pcmpeqd	%xmm15, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$12, %r14d
	je	.L7
	movdqa	48(%rsp), %xmm2
	pcmpeqd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$13, %r14d
	je	.L7
	movdqa	64(%rsp), %xmm2
	pcmpeqd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$14, %r14d
	je	.L7
	movdqa	96(%rsp), %xmm2
	pcmpeqd	%xmm1, %xmm2
	psubd	%xmm2, %xmm0
	cmpl	$15, %r14d
	je	.L7
	pcmpeqd	80(%rsp), %xmm1
	psubd	%xmm1, %xmm0
	.p2align 4,,10
	.p2align 3
.L7:
	movaps	%xmm0, 0(%rbp,%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L8
	movl	32(%rsp), %eax
	movslq	%eax, %rcx
	cmpl	%eax, %r14d
	je	.L9
	.p2align 4,,10
	.p2align 3
.L26:
	movl	(%r15,%rcx,4), %edx
	xorl	%eax, %eax
	cmpl	%edx, %edi
	sete	%al
	cmpl	$1, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r8d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$2, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r9d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$3, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r10d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$4, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r11d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$5, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%ebx, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$6, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r12d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$7, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	%r13d, %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$8, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	4(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$9, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	8(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$10, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	12(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$11, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	16(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$12, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	20(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$13, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	24(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$14, %r14d
	je	.L10
	xorl	%esi, %esi
	cmpl	36(%rsp), %edx
	sete	%sil
	addl	%esi, %eax
	cmpl	$15, %r14d
	je	.L10
	cmpl	40(%rsp), %edx
	sete	%dl
	movzbl	%dl, %edx
	addl	%edx, %eax
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%eax, 0(%rbp,%rcx,4)
	addq	$1, %rcx
	cmpl	%ecx, %r14d
	jg	.L26
	cmpl	$2, 44(%rsp)
	jbe	.L47
	movdqa	.LC1(%rip), %xmm9
.L9:
	movdqa	224(%rsp), %xmm0
	movl	124(%rsp), %eax
	pcmpeqd	160(%rsp), %xmm0
	pand	%xmm9, %xmm0
	cmpl	$1, %eax
	jbe	.L30
	movdqa	176(%rsp), %xmm1
	pcmpeqd	240(%rsp), %xmm1
	psubd	%xmm1, %xmm0
	cmpl	$2, %eax
	je	.L30
	movdqa	192(%rsp), %xmm1
	pcmpeqd	256(%rsp), %xmm1
	psubd	%xmm1, %xmm0
	cmpl	$3, %eax
	je	.L30
	movdqa	208(%rsp), %xmm1
	pcmpeqd	272(%rsp), %xmm1
	psubd	%xmm1, %xmm0
.L30:
	movdqa	%xmm0, %xmm1
	movl	32(%rsp), %ebx
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movl	%ebx, %edx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%ebx, %r14d
	je	.L31
.L29:
	movslq	%edx, %rcx
	movl	160(%rsp,%rcx,4), %edi
	cmpl	%edi, 224(%rsp,%rcx,4)
	jne	.L32
	addl	$1, %eax
.L32:
	leal	1(%rdx), %ecx
	cmpl	%ecx, %r14d
	jle	.L31
	movslq	%ecx, %rcx
	movl	160(%rsp,%rcx,4), %edi
	cmpl	%edi, 224(%rsp,%rcx,4)
	jne	.L33
	addl	$1, %eax
.L33:
	addl	$2, %edx
	cmpl	%r14d, %edx
	jge	.L31
	movslq	%edx, %rdx
	movl	224(%rsp,%rdx,4), %edi
	cmpl	%edi, 160(%rsp,%rdx,4)
	jne	.L31
	addl	$1, %eax
.L31:
	cmpl	%eax, %r14d
	je	.L43
	movq	112(%rsp), %rbx
	movq	%rbp, %rsi
	movq	%r15, %rdi
	movq	%rbx, %rdx
	call	memcpy@PLT
	movq	%rbx, %rdx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	call	memset@PLT
.L42:
	addl	$1, 28(%rsp)
	movl	28(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 120(%rsp)
	testl	%r14d, %r14d
	jg	.L144
.L5:
	jne	.L42
.L43:
	movl	120(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	156(%rsp), %eax
	testl	%eax, %eax
	jle	.L37
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %rbp
.L40:
	testq	%rbx, %rbx
	jne	.L38
	movl	160(%rsp), %edx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	movl	$1, %ebx
	call	__printf_chk@PLT
	cmpl	$1, 156(%rsp)
	jle	.L37
.L38:
	movl	160(%rsp,%rbx,4), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpl	%ebx, 156(%rsp)
	jg	.L40
.L37:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L41
.L47:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L29
.L46:
	movl	192(%rsp), %eax
	movl	160(%rsp), %edi
	xorl	%ecx, %ecx
	leaq	224(%rsp), %rbp
	movl	164(%rsp), %r8d
	movl	168(%rsp), %r9d
	movl	%eax, 4(%rsp)
	movl	196(%rsp), %eax
	movl	172(%rsp), %r10d
	movl	176(%rsp), %r11d
	movl	%eax, 8(%rsp)
	movl	200(%rsp), %eax
	movl	180(%rsp), %ebx
	movl	184(%rsp), %r12d
	movl	%eax, 12(%rsp)
	movl	204(%rsp), %eax
	movl	188(%rsp), %r13d
	movl	%eax, 16(%rsp)
	movl	208(%rsp), %eax
	movl	%eax, 20(%rsp)
	movl	212(%rsp), %eax
	movl	%eax, 24(%rsp)
	movl	216(%rsp), %eax
	movl	%eax, 36(%rsp)
	movl	220(%rsp), %eax
	movl	%eax, 40(%rsp)
	jmp	.L26
.L2:
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L145
	addq	$312, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L145:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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,i,j,count,check,turn,seq[16],sub[16];

  while(1){
    scanf("%d",&n);
    if(n == 0)break;
    else
      {
	turn=0;
	for(i=0;i<n;i++)scanf("%d",&seq[i]);
	while(1){
	  count=0;
	  check=0;
	
	for(i=0;i<n;i++){
	  count=0;
	  for(j=0;j<n;j++){
	    if(seq[i]==seq[j])count++;
	  }
	  sub[i]=count;
	}
	for(i=0;i<n;i++){
	  if(seq[i]==sub[i])check++;}
	if(check==n)break;
	else{
	  turn++;
	  for(i=0;i<n;i++){
	    seq[i]=sub[i];
	    sub[i]=0;
	  }
	}
	}
	printf("%d\n",turn);
	for(i=0;i<n;i++){
	  if(i==0)printf("%d",seq[i]);
	  else{
	    printf(" %d",seq[i]);}
	}
	printf("\n");
      }
  }



  return 0;
}
10
4 5 1 1 4 5 12 3 6 4
0
 10
4 5 1 1 4 5 12 3 0 5
0
 10
4 5 1 1 3 5 14 3 0 5
0
 10
4 5 1 1 3 10 14 3 0 5
0
 10
4 5 1 0 3 10 14 3 0 5
0
 10
1 5 1 0 3 10 14 3 0 5
0
 10
1 5 1 0 3 4 27 0 0 5
0
 10
2 5 1 0 3 4 27 0 0 5
0
 10
2 5 1 0 3 4 27 0 -1 5
0
 10
2 5 1 0 3 4 27 0 -2 10
0

3
6 4 4 4 6 4 6 6 6 6
 3
4 6 4 4 4 6 6 6 6 6
 3
6 6 4 4 4 6 6 4 6 6
 2
4 6 6 6 6 4 4 6 4 6
 2
4 6 4 6 6 4 4 6 6 6
 2
8 8 8 8 8 2 2 8 8 8
 3
4 4 4 6 6 6 6 6 6 4
 2
5 2 5 3 5 5 5 3 3 2
 2
6 4 6 4 6 6 6 4 6 4
 2
8 8 8 2 8 8 8 2 8 8

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,i,j,count,check,turn,seq[16],sub[16];

  while(1){
    scanf("%d",&n);
    if(n == 0)break;
    else
      {
	turn=0;
	for(i=0;i<n;i++)scanf("%d",&seq[i]);
	while(1){
	  count=0;
	  check=0;
	
	for(i=0;i<n;i++){
	  count=0;
	  for(j=0;j<n;j++){
	    if(seq[i]==seq[j])count++;
	  }
	  sub[i]=count;
	}
	for(i=0;i<n;i++){
	  if(seq[i]==sub[i])check++;}
	if(check==n)break;
	else{
	  turn++;
	  for(i=0;i<n;i++){
	    seq[i]=sub[i];
	    sub[i]=0;
	  }
	}
	}
	printf("%d\n",turn);
	for(i=0;i<n;i++){
	  if(i==0)printf("%d",seq[i]);
	  else{
	    printf(" %d",seq[i]);}
	}
	printf("\n");
      }
  }



  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.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
	subq	$176, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L23:
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-168(%rbp), %eax
	testl	%eax, %eax
	je	.L28
	movl	$0, -148(%rbp)
	movl	$0, -164(%rbp)
	jmp	.L4
.L5:
	leaq	-144(%rbp), %rdx
	movl	-164(%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, -164(%rbp)
.L4:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L5
.L18:
	movl	$0, -156(%rbp)
	movl	$0, -152(%rbp)
	movl	$0, -164(%rbp)
	jmp	.L6
.L10:
	movl	$0, -156(%rbp)
	movl	$0, -160(%rbp)
	jmp	.L7
.L9:
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %edx
	movl	-160(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L8
	addl	$1, -156(%rbp)
.L8:
	addl	$1, -160(%rbp)
.L7:
	movl	-168(%rbp), %eax
	cmpl	%eax, -160(%rbp)
	jl	.L9
	movl	-164(%rbp), %eax
	cltq
	movl	-156(%rbp), %edx
	movl	%edx, -80(%rbp,%rax,4)
	addl	$1, -164(%rbp)
.L6:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L10
	movl	$0, -164(%rbp)
	jmp	.L11
.L13:
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %edx
	movl	-164(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L12
	addl	$1, -152(%rbp)
.L12:
	addl	$1, -164(%rbp)
.L11:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L13
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	je	.L29
	addl	$1, -148(%rbp)
	movl	$0, -164(%rbp)
	jmp	.L16
.L17:
	movl	-164(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %edx
	movl	-164(%rbp), %eax
	cltq
	movl	%edx, -144(%rbp,%rax,4)
	movl	-164(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	addl	$1, -164(%rbp)
.L16:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L17
	jmp	.L18
.L29:
	nop
	movl	-148(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -164(%rbp)
	jmp	.L19
.L22:
	cmpl	$0, -164(%rbp)
	jne	.L20
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L21
.L20:
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L21:
	addl	$1, -164(%rbp)
.L19:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L22
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L23
.L28:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.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"
.LC1:
	.string	"%d\n"
.LC2:
	.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
	subq	$176, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L23:
	leaq	-168(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-168(%rbp), %eax
	testl	%eax, %eax
	je	.L28
	movl	$0, -148(%rbp)
	movl	$0, -164(%rbp)
	jmp	.L4
.L5:
	leaq	-144(%rbp), %rdx
	movl	-164(%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, -164(%rbp)
.L4:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L5
.L18:
	movl	$0, -156(%rbp)
	movl	$0, -152(%rbp)
	movl	$0, -164(%rbp)
	jmp	.L6
.L10:
	movl	$0, -156(%rbp)
	movl	$0, -160(%rbp)
	jmp	.L7
.L9:
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %edx
	movl	-160(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L8
	addl	$1, -156(%rbp)
.L8:
	addl	$1, -160(%rbp)
.L7:
	movl	-168(%rbp), %eax
	cmpl	%eax, -160(%rbp)
	jl	.L9
	movl	-164(%rbp), %eax
	cltq
	movl	-156(%rbp), %edx
	movl	%edx, -80(%rbp,%rax,4)
	addl	$1, -164(%rbp)
.L6:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L10
	movl	$0, -164(%rbp)
	jmp	.L11
.L13:
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %edx
	movl	-164(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jne	.L12
	addl	$1, -152(%rbp)
.L12:
	addl	$1, -164(%rbp)
.L11:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L13
	movl	-168(%rbp), %eax
	cmpl	%eax, -152(%rbp)
	je	.L29
	addl	$1, -148(%rbp)
	movl	$0, -164(%rbp)
	jmp	.L16
.L17:
	movl	-164(%rbp), %eax
	cltq
	movl	-80(%rbp,%rax,4), %edx
	movl	-164(%rbp), %eax
	cltq
	movl	%edx, -144(%rbp,%rax,4)
	movl	-164(%rbp), %eax
	cltq
	movl	$0, -80(%rbp,%rax,4)
	addl	$1, -164(%rbp)
.L16:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L17
	jmp	.L18
.L29:
	nop
	movl	-148(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -164(%rbp)
	jmp	.L19
.L22:
	cmpl	$0, -164(%rbp)
	jne	.L20
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L21
.L20:
	movl	-164(%rbp), %eax
	cltq
	movl	-144(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L21:
	addl	$1, -164(%rbp)
.L19:
	movl	-168(%rbp), %eax
	cmpl	%eax, -164(%rbp)
	jl	.L22
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L23
.L28:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.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:
