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(void){
	while(1){
		int a[5], b[3]={0}, i, flag=1, count=0;	
		
		for(i=0; i<5; i++){
			scanf(" %d", &a[i]);
			if(a[i]==0){
				flag=0;
				break;
			}
			if(b[a[i]-1]==0) count++;
			b[a[i]-1]++;
		}
		if(flag==0) break;
		
		if(count==2){
			int memo;
			for(i=0; i<3; i++){
				if(b[i]==0) memo=i+1;
			}	
			
			//printf("memo=%d\n", memo);
			
			for(i=0; i<5; i++){
				if(a[i] == ( ((memo+1)%3==0) ? 3:(memo+1)%3) ) a[i]=1;
				else a[i]=2;
			}
		
		}
		else{
			for(i=0; i<5; i++)
				a[i] = 3;
		}
		
		for(i=0; i<5; i++)
			printf("%d\n", a[i]);
	
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	"%d\n"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L24:
	movq	$0, -44(%rbp)
	movl	$0, -36(%rbp)
	movl	$1, -56(%rbp)
	movl	$0, -52(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L2
.L6:
	leaq	-32(%rbp), %rdx
	movl	-60(%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
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L3
	movl	$0, -56(%rbp)
	jmp	.L4
.L3:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	subl	$1, %eax
	cltq
	movl	-44(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L5
	addl	$1, -52(%rbp)
.L5:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-44(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -44(%rbp,%rax,4)
	addl	$1, -60(%rbp)
.L2:
	cmpl	$4, -60(%rbp)
	jle	.L6
.L4:
	cmpl	$0, -56(%rbp)
	jne	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	jmp	.L26
.L7:
	cmpl	$2, -52(%rbp)
	jne	.L9
	movl	$0, -60(%rbp)
	jmp	.L10
.L12:
	movl	-60(%rbp), %eax
	cltq
	movl	-44(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L11
	movl	-60(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
.L11:
	addl	$1, -60(%rbp)
.L10:
	cmpl	$2, -60(%rbp)
	jle	.L12
	movl	$0, -60(%rbp)
	jmp	.L13
.L18:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %esi
	movl	-48(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L14
	movl	-48(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L15
.L14:
	movl	$3, %eax
.L15:
	cmpl	%esi, %eax
	jne	.L16
	movl	-60(%rbp), %eax
	cltq
	movl	$1, -32(%rbp,%rax,4)
	jmp	.L17
.L16:
	movl	-60(%rbp), %eax
	cltq
	movl	$2, -32(%rbp,%rax,4)
.L17:
	addl	$1, -60(%rbp)
.L13:
	cmpl	$4, -60(%rbp)
	jle	.L18
	jmp	.L19
.L9:
	movl	$0, -60(%rbp)
	jmp	.L20
.L21:
	movl	-60(%rbp), %eax
	cltq
	movl	$3, -32(%rbp,%rax,4)
	addl	$1, -60(%rbp)
.L20:
	cmpl	$4, -60(%rbp)
	jle	.L21
.L19:
	movl	$0, -60(%rbp)
	jmp	.L22
.L23:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -60(%rbp)
.L22:
	cmpl	$4, -60(%rbp)
	jle	.L23
	jmp	.L24
.L26:
	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"
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	52(%rsp), %rbp
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L15:
	movq	(%rsp), %r14
	movl	$0, 28(%rsp)
	xorl	%r15d, %r15d
	movq	$0, 20(%rsp)
	movq	%r14, %rbx
.L4:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r14), %eax
	testl	%eax, %eax
	je	.L2
	subl	$1, %eax
	cltq
	movl	20(%rsp,%rax,4), %ecx
	cmpl	$1, %ecx
	adcl	$0, %r15d
	addl	$1, %ecx
	addq	$4, %r14
	movl	%ecx, 20(%rsp,%rax,4)
	cmpq	%rbp, %r14
	jne	.L4
	cmpl	$2, %r15d
	je	.L33
	movdqa	.LC1(%rip), %xmm0
	movl	$3, %r15d
	movaps	%xmm0, 32(%rsp)
.L6:
	movl	%r15d, 48(%rsp)
.L14:
	movl	(%rbx), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L14
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L33:
	movl	20(%rsp), %eax
	movl	24(%rsp), %ecx
	movl	32(%rsp), %edx
	testl	%eax, %eax
	movl	$1, %eax
	cmovne	12(%rsp), %eax
	movl	%eax, 12(%rsp)
	movl	%eax, %edi
	movl	28(%rsp), %eax
	testl	%ecx, %ecx
	je	.L8
	testl	%eax, %eax
	je	.L19
	leal	1(%rdi), %eax
	movl	$2863311531, %edi
	movq	%rax, %rcx
	imulq	%rdi, %rax
	shrq	$33, %rax
	leal	(%rax,%rax,2), %esi
	movl	%ecx, %eax
	subl	%esi, %eax
	jne	.L9
	movl	$3, %eax
.L9:
	cmpl	%edx, %eax
	setne	%dl
	movzbl	%dl, %edx
	addl	$1, %edx
	movl	%edx, 32(%rsp)
	xorl	%edx, %edx
	cmpl	36(%rsp), %eax
	setne	%dl
	addl	$1, %edx
	movl	%edx, 36(%rsp)
	xorl	%edx, %edx
	cmpl	40(%rsp), %eax
	setne	%dl
	addl	$1, %edx
	movl	%edx, 40(%rsp)
	xorl	%edx, %edx
	cmpl	44(%rsp), %eax
	setne	%dl
	addl	$1, %edx
	cmpl	48(%rsp), %eax
	movl	$1, %eax
	movl	%edx, 44(%rsp)
	cmove	%eax, %r15d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%eax, %edi
	negl	%edi
	sbbl	%esi, %esi
	addl	$3, %esi
	cmpl	$1, %eax
	sbbl	%eax, %eax
	movl	%esi, 12(%rsp)
	andl	$-2, %eax
	addl	$3, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$72, %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
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	movl	$3, 12(%rsp)
	movl	$1, %eax
	jmp	.L9
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	3
	.long	3
	.long	3
	.long	3
	.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"
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rax
	leaq	52(%rsp), %rbp
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L15:
	movq	(%rsp), %r14
	movl	$0, 28(%rsp)
	xorl	%r15d, %r15d
	movq	$0, 20(%rsp)
	movq	%r14, %rbx
.L4:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%r14), %eax
	testl	%eax, %eax
	je	.L2
	subl	$1, %eax
	cltq
	movl	20(%rsp,%rax,4), %ecx
	cmpl	$1, %ecx
	adcl	$0, %r15d
	addl	$1, %ecx
	addq	$4, %r14
	movl	%ecx, 20(%rsp,%rax,4)
	cmpq	%rbp, %r14
	jne	.L4
	cmpl	$2, %r15d
	je	.L33
	movdqa	.LC1(%rip), %xmm0
	movl	$3, %r15d
	movaps	%xmm0, 32(%rsp)
.L6:
	movl	%r15d, 48(%rsp)
.L14:
	movl	(%rbx), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbp, %rbx
	jne	.L14
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L33:
	movl	20(%rsp), %eax
	movl	24(%rsp), %ecx
	movl	32(%rsp), %edx
	testl	%eax, %eax
	movl	$1, %eax
	cmovne	12(%rsp), %eax
	movl	%eax, 12(%rsp)
	movl	%eax, %edi
	movl	28(%rsp), %eax
	testl	%ecx, %ecx
	je	.L8
	testl	%eax, %eax
	je	.L19
	leal	1(%rdi), %eax
	movl	$2863311531, %edi
	movq	%rax, %rcx
	imulq	%rdi, %rax
	shrq	$33, %rax
	leal	(%rax,%rax,2), %esi
	movl	%ecx, %eax
	subl	%esi, %eax
	jne	.L9
	movl	$3, %eax
.L9:
	cmpl	%edx, %eax
	setne	%dl
	movzbl	%dl, %edx
	addl	$1, %edx
	movl	%edx, 32(%rsp)
	xorl	%edx, %edx
	cmpl	36(%rsp), %eax
	setne	%dl
	addl	$1, %edx
	movl	%edx, 36(%rsp)
	xorl	%edx, %edx
	cmpl	40(%rsp), %eax
	setne	%dl
	addl	$1, %edx
	movl	%edx, 40(%rsp)
	xorl	%edx, %edx
	cmpl	44(%rsp), %eax
	setne	%dl
	addl	$1, %edx
	cmpl	48(%rsp), %eax
	movl	$1, %eax
	movl	%edx, 44(%rsp)
	cmove	%eax, %r15d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%eax, %edi
	negl	%edi
	sbbl	%esi, %esi
	addl	$3, %esi
	cmpl	$1, %eax
	sbbl	%eax, %eax
	movl	%esi, 12(%rsp)
	andl	$-2, %eax
	addl	$3, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L34
	addq	$72, %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
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	movl	$3, 12(%rsp)
	movl	$1, %eax
	jmp	.L9
.L34:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	3
	.long	3
	.long	3
	.long	3
	.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(void){
	while(1){
		int a[5], b[3]={0}, i, flag=1, count=0;	
		
		for(i=0; i<5; i++){
			scanf(" %d", &a[i]);
			if(a[i]==0){
				flag=0;
				break;
			}
			if(b[a[i]-1]==0) count++;
			b[a[i]-1]++;
		}
		if(flag==0) break;
		
		if(count==2){
			int memo;
			for(i=0; i<3; i++){
				if(b[i]==0) memo=i+1;
			}	
			
			//printf("memo=%d\n", memo);
			
			for(i=0; i<5; i++){
				if(a[i] == ( ((memo+1)%3==0) ? 3:(memo+1)%3) ) a[i]=1;
				else a[i]=2;
			}
		
		}
		else{
			for(i=0; i<5; i++)
				a[i] = 3;
		}
		
		for(i=0; i<5; i++)
			printf("%d\n", a[i]);
	
	}
	return 0;
}
1
3
3
2
1
1
2
2
2
1
0
 1
1
1
2
1
1
2
2
2
1
0
 1
2
3
2
1
1
1
2
2
1
0
 1
2
2
2
1
1
1
2
2
1
0
 1
2
3
2
1
1
2
2
2
2
0
 1
3
1
2
1
1
2
1
2
1
0
 1
2
3
2
1
1
2
3
2
2
0
 1
2
2
2
1
1
2
3
2
2
0
 1
1
2
2
1
1
2
3
2
2
0
 1
3
3
1
1
1
2
3
2
2
0

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

int main(void){
	while(1){
		int a[5], b[3]={0}, i, flag=1, count=0;	
		
		for(i=0; i<5; i++){
			scanf(" %d", &a[i]);
			if(a[i]==0){
				flag=0;
				break;
			}
			if(b[a[i]-1]==0) count++;
			b[a[i]-1]++;
		}
		if(flag==0) break;
		
		if(count==2){
			int memo;
			for(i=0; i<3; i++){
				if(b[i]==0) memo=i+1;
			}	
			
			//printf("memo=%d\n", memo);
			
			for(i=0; i<5; i++){
				if(a[i] == ( ((memo+1)%3==0) ? 3:(memo+1)%3) ) a[i]=1;
				else a[i]=2;
			}
		
		}
		else{
			for(i=0; i<5; i++)
				a[i] = 3;
		}
		
		for(i=0; i<5; i++)
			printf("%d\n", a[i]);
	
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	" %d"
.LC1:
	.string	"%d\n"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L24:
	movq	$0, -44(%rbp)
	movl	$0, -36(%rbp)
	movl	$1, -56(%rbp)
	movl	$0, -52(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L2
.L6:
	leaq	-32(%rbp), %rdx
	movl	-60(%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
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L3
	movl	$0, -56(%rbp)
	jmp	.L4
.L3:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	subl	$1, %eax
	cltq
	movl	-44(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L5
	addl	$1, -52(%rbp)
.L5:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-44(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -44(%rbp,%rax,4)
	addl	$1, -60(%rbp)
.L2:
	cmpl	$4, -60(%rbp)
	jle	.L6
.L4:
	cmpl	$0, -56(%rbp)
	jne	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	jmp	.L26
.L7:
	cmpl	$2, -52(%rbp)
	jne	.L9
	movl	$0, -60(%rbp)
	jmp	.L10
.L12:
	movl	-60(%rbp), %eax
	cltq
	movl	-44(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L11
	movl	-60(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
.L11:
	addl	$1, -60(%rbp)
.L10:
	cmpl	$2, -60(%rbp)
	jle	.L12
	movl	$0, -60(%rbp)
	jmp	.L13
.L18:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %esi
	movl	-48(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L14
	movl	-48(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L15
.L14:
	movl	$3, %eax
.L15:
	cmpl	%esi, %eax
	jne	.L16
	movl	-60(%rbp), %eax
	cltq
	movl	$1, -32(%rbp,%rax,4)
	jmp	.L17
.L16:
	movl	-60(%rbp), %eax
	cltq
	movl	$2, -32(%rbp,%rax,4)
.L17:
	addl	$1, -60(%rbp)
.L13:
	cmpl	$4, -60(%rbp)
	jle	.L18
	jmp	.L19
.L9:
	movl	$0, -60(%rbp)
	jmp	.L20
.L21:
	movl	-60(%rbp), %eax
	cltq
	movl	$3, -32(%rbp,%rax,4)
	addl	$1, -60(%rbp)
.L20:
	cmpl	$4, -60(%rbp)
	jle	.L21
.L19:
	movl	$0, -60(%rbp)
	jmp	.L22
.L23:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -60(%rbp)
.L22:
	cmpl	$4, -60(%rbp)
	jle	.L23
	jmp	.L24
.L26:
	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"
	.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	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L24:
	movq	$0, -44(%rbp)
	movl	$0, -36(%rbp)
	movl	$1, -56(%rbp)
	movl	$0, -52(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L2
.L6:
	leaq	-32(%rbp), %rdx
	movl	-60(%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
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L3
	movl	$0, -56(%rbp)
	jmp	.L4
.L3:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	subl	$1, %eax
	cltq
	movl	-44(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L5
	addl	$1, -52(%rbp)
.L5:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-44(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -44(%rbp,%rax,4)
	addl	$1, -60(%rbp)
.L2:
	cmpl	$4, -60(%rbp)
	jle	.L6
.L4:
	cmpl	$0, -56(%rbp)
	jne	.L7
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	jmp	.L26
.L7:
	cmpl	$2, -52(%rbp)
	jne	.L9
	movl	$0, -60(%rbp)
	jmp	.L10
.L12:
	movl	-60(%rbp), %eax
	cltq
	movl	-44(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L11
	movl	-60(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
.L11:
	addl	$1, -60(%rbp)
.L10:
	cmpl	$2, -60(%rbp)
	jle	.L12
	movl	$0, -60(%rbp)
	jmp	.L13
.L18:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %esi
	movl	-48(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L14
	movl	-48(%rbp), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L15
.L14:
	movl	$3, %eax
.L15:
	cmpl	%esi, %eax
	jne	.L16
	movl	-60(%rbp), %eax
	cltq
	movl	$1, -32(%rbp,%rax,4)
	jmp	.L17
.L16:
	movl	-60(%rbp), %eax
	cltq
	movl	$2, -32(%rbp,%rax,4)
.L17:
	addl	$1, -60(%rbp)
.L13:
	cmpl	$4, -60(%rbp)
	jle	.L18
	jmp	.L19
.L9:
	movl	$0, -60(%rbp)
	jmp	.L20
.L21:
	movl	-60(%rbp), %eax
	cltq
	movl	$3, -32(%rbp,%rax,4)
	addl	$1, -60(%rbp)
.L20:
	cmpl	$4, -60(%rbp)
	jle	.L21
.L19:
	movl	$0, -60(%rbp)
	jmp	.L22
.L23:
	movl	-60(%rbp), %eax
	cltq
	movl	-32(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -60(%rbp)
.L22:
	cmpl	$4, -60(%rbp)
	jle	.L23
	jmp	.L24
.L26:
	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:
