Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(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;
}```

Assembly Code:

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

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
.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
```assembly
	.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:
```
```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;
}```
Given the following C 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;
}```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

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 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;
}```

Assembly Code:

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

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" %d"
.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:
```