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

```c
i,k;main(x){for(;;i++){scanf("%d",&x);if(!x)return 0;k+=1<<(5*x+i);if(i==4){if((k&992&&k&31744&&k&1015808)||(k&992)==992||(k&31744)==31744||(k&1015808)==1015808)for(x=5;x--;)puts("3");else if(!(k&992))for(x=0;x<5;x++)puts(k&1<<(10+x)?"1":"2");else if(!(k&31744))for(x=0;x<5;x++)puts(k&1<<(15+x)?"1":"2");else for(x=0;x<5;x++)puts(k&1<<(5+x)?"1":"2");k=0,i=-1;}}}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"3"
.LC2:
	.string	"1"
.LC3:
	.string	"2"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC3(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r12
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L52:
	addl	$1, %edx
.L4:
	movl	%edx, i(%rip)
.L21:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L40
	movl	i(%rip), %edx
	leal	(%rax,%rax,4), %ecx
	movl	$1, %eax
	addl	%edx, %ecx
	sall	%cl, %eax
	addl	k(%rip), %eax
	movl	%eax, k(%rip)
	cmpl	$4, %edx
	jne	.L52
	movl	%eax, %edx
	movl	%eax, %ecx
	andl	$31744, %edx
	andl	$992, %ecx
	je	.L5
	testl	%edx, %edx
	je	.L6
	andl	$1015808, %eax
	jne	.L7
	cmpl	$992, %ecx
	je	.L7
	cmpl	$31744, %edx
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movl	k(%rip), %esi
	addl	$5, %eax
	movq	%r13, %rdi
	btl	%eax, %esi
	jc	.L50
	movq	%r14, %rdi
.L50:
	call	puts@PLT
	movl	12(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 12(%rsp)
	cmpl	$4, %eax
	jle	.L20
.L13:
	movl	$0, k(%rip)
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	$992, %ecx
	jne	.L53
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$4, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbx, %rdi
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L10
	movl	$0, k(%rip)
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	$31744, %edx
	je	.L7
	andl	$1015808, %eax
	cmpl	$1015808, %eax
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movl	k(%rip), %eax
	addl	$10, %ecx
	movq	%r13, %rdi
	btl	%ecx, %eax
	jc	.L46
	movq	%r14, %rdi
.L46:
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%rsp)
	cmpl	$4, %ecx
	jle	.L14
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L40:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L53:
	.cfi_restore_state
	andl	$1015808, %eax
	cmpl	$1015808, %eax
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movl	k(%rip), %eax
	addl	$15, %edx
	movq	%r13, %rdi
	btl	%edx, %eax
	jc	.L48
	movq	%r14, %rdi
.L48:
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 12(%rsp)
	cmpl	$4, %edx
	jle	.L17
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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:
```

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"
.LC1:
	.string	"3"
.LC2:
	.string	"1"
.LC3:
	.string	"2"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC3(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r12
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L52:
	addl	$1, %edx
.L4:
	movl	%edx, i(%rip)
.L21:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L40
	movl	i(%rip), %edx
	leal	(%rax,%rax,4), %ecx
	movl	$1, %eax
	addl	%edx, %ecx
	sall	%cl, %eax
	addl	k(%rip), %eax
	movl	%eax, k(%rip)
	cmpl	$4, %edx
	jne	.L52
	movl	%eax, %edx
	movl	%eax, %ecx
	andl	$31744, %edx
	andl	$992, %ecx
	je	.L5
	testl	%edx, %edx
	je	.L6
	andl	$1015808, %eax
	jne	.L7
	cmpl	$992, %ecx
	je	.L7
	cmpl	$31744, %edx
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movl	k(%rip), %esi
	addl	$5, %eax
	movq	%r13, %rdi
	btl	%eax, %esi
	jc	.L50
	movq	%r14, %rdi
.L50:
	call	puts@PLT
	movl	12(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 12(%rsp)
	cmpl	$4, %eax
	jle	.L20
.L13:
	movl	$0, k(%rip)
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	$992, %ecx
	jne	.L53
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$4, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbx, %rdi
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L10
	movl	$0, k(%rip)
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	$31744, %edx
	je	.L7
	andl	$1015808, %eax
	cmpl	$1015808, %eax
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movl	k(%rip), %eax
	addl	$10, %ecx
	movq	%r13, %rdi
	btl	%ecx, %eax
	jc	.L46
	movq	%r14, %rdi
.L46:
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%rsp)
	cmpl	$4, %ecx
	jle	.L14
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L40:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L53:
	.cfi_restore_state
	andl	$1015808, %eax
	cmpl	$1015808, %eax
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movl	k(%rip), %eax
	addl	$15, %edx
	movq	%r13, %rdi
	btl	%edx, %eax
	jc	.L48
	movq	%r14, %rdi
.L48:
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 12(%rsp)
	cmpl	$4, %edx
	jle	.L17
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"3"
.LC2:
	.string	"1"
.LC3:
	.string	"2"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC3(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r12
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L52:
	addl	$1, %edx
.L4:
	movl	%edx, i(%rip)
.L21:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L40
	movl	i(%rip), %edx
	leal	(%rax,%rax,4), %ecx
	movl	$1, %eax
	addl	%edx, %ecx
	sall	%cl, %eax
	addl	k(%rip), %eax
	movl	%eax, k(%rip)
	cmpl	$4, %edx
	jne	.L52
	movl	%eax, %edx
	movl	%eax, %ecx
	andl	$31744, %edx
	andl	$992, %ecx
	je	.L5
	testl	%edx, %edx
	je	.L6
	andl	$1015808, %eax
	jne	.L7
	cmpl	$992, %ecx
	je	.L7
	cmpl	$31744, %edx
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movl	k(%rip), %esi
	addl	$5, %eax
	movq	%r13, %rdi
	btl	%eax, %esi
	jc	.L50
	movq	%r14, %rdi
.L50:
	call	puts@PLT
	movl	12(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 12(%rsp)
	cmpl	$4, %eax
	jle	.L20
.L13:
	movl	$0, k(%rip)
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	$992, %ecx
	jne	.L53
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$4, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbx, %rdi
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L10
	movl	$0, k(%rip)
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	$31744, %edx
	je	.L7
	andl	$1015808, %eax
	cmpl	$1015808, %eax
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movl	k(%rip), %eax
	addl	$10, %ecx
	movq	%r13, %rdi
	btl	%ecx, %eax
	jc	.L46
	movq	%r14, %rdi
.L46:
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%rsp)
	cmpl	$4, %ecx
	jle	.L14
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L40:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L53:
	.cfi_restore_state
	andl	$1015808, %eax
	cmpl	$1015808, %eax
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movl	k(%rip), %eax
	addl	$15, %edx
	movq	%r13, %rdi
	btl	%edx, %eax
	jc	.L48
	movq	%r14, %rdi
.L48:
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 12(%rsp)
	cmpl	$4, %edx
	jle	.L17
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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:
```
```c
i,k;main(x){for(;;i++){scanf("%d",&x);if(!x)return 0;k+=1<<(5*x+i);if(i==4){if((k&992&&k&31744&&k&1015808)||(k&992)==992||(k&31744)==31744||(k&1015808)==1015808)for(x=5;x--;)puts("3");else if(!(k&992))for(x=0;x<5;x++)puts(k&1<<(10+x)?"1":"2");else if(!(k&31744))for(x=0;x<5;x++)puts(k&1<<(15+x)?"1":"2");else for(x=0;x<5;x++)puts(k&1<<(5+x)?"1":"2");k=0,i=-1;}}}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
i,k;main(x){for(;;i++){scanf("%d",&x);if(!x)return 0;k+=1<<(5*x+i);if(i==4){if((k&992&&k&31744&&k&1015808)||(k&992)==992||(k&31744)==31744||(k&1015808)==1015808)for(x=5;x--;)puts("3");else if(!(k&992))for(x=0;x<5;x++)puts(k&1<<(10+x)?"1":"2");else if(!(k&31744))for(x=0;x<5;x++)puts(k&1<<(15+x)?"1":"2");else for(x=0;x<5;x++)puts(k&1<<(5+x)?"1":"2");k=0,i=-1;}}}```

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
i,k;main(x){for(;;i++){scanf("%d",&x);if(!x)return 0;k+=1<<(5*x+i);if(i==4){if((k&992&&k&31744&&k&1015808)||(k&992)==992||(k&31744)==31744||(k&1015808)==1015808)for(x=5;x--;)puts("3");else if(!(k&992))for(x=0;x<5;x++)puts(k&1<<(10+x)?"1":"2");else if(!(k&31744))for(x=0;x<5;x++)puts(k&1<<(15+x)?"1":"2");else for(x=0;x<5;x++)puts(k&1<<(5+x)?"1":"2");k=0,i=-1;}}}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"3"
.LC2:
	.string	"1"
.LC3:
	.string	"2"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC3(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r12
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L52:
	addl	$1, %edx
.L4:
	movl	%edx, i(%rip)
.L21:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L40
	movl	i(%rip), %edx
	leal	(%rax,%rax,4), %ecx
	movl	$1, %eax
	addl	%edx, %ecx
	sall	%cl, %eax
	addl	k(%rip), %eax
	movl	%eax, k(%rip)
	cmpl	$4, %edx
	jne	.L52
	movl	%eax, %edx
	movl	%eax, %ecx
	andl	$31744, %edx
	andl	$992, %ecx
	je	.L5
	testl	%edx, %edx
	je	.L6
	andl	$1015808, %eax
	jne	.L7
	cmpl	$992, %ecx
	je	.L7
	cmpl	$31744, %edx
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movl	k(%rip), %esi
	addl	$5, %eax
	movq	%r13, %rdi
	btl	%eax, %esi
	jc	.L50
	movq	%r14, %rdi
.L50:
	call	puts@PLT
	movl	12(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 12(%rsp)
	cmpl	$4, %eax
	jle	.L20
.L13:
	movl	$0, k(%rip)
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	$992, %ecx
	jne	.L53
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$4, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbx, %rdi
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L10
	movl	$0, k(%rip)
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	$31744, %edx
	je	.L7
	andl	$1015808, %eax
	cmpl	$1015808, %eax
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movl	k(%rip), %eax
	addl	$10, %ecx
	movq	%r13, %rdi
	btl	%ecx, %eax
	jc	.L46
	movq	%r14, %rdi
.L46:
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%rsp)
	cmpl	$4, %ecx
	jle	.L14
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L40:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L53:
	.cfi_restore_state
	andl	$1015808, %eax
	cmpl	$1015808, %eax
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movl	k(%rip), %eax
	addl	$15, %edx
	movq	%r13, %rdi
	btl	%edx, %eax
	jc	.L48
	movq	%r14, %rdi
.L48:
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 12(%rsp)
	cmpl	$4, %edx
	jle	.L17
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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:
```

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"
.LC1:
	.string	"3"
.LC2:
	.string	"1"
.LC3:
	.string	"2"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC3(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC2(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r12
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L52:
	addl	$1, %edx
.L4:
	movl	%edx, i(%rip)
.L21:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L40
	movl	i(%rip), %edx
	leal	(%rax,%rax,4), %ecx
	movl	$1, %eax
	addl	%edx, %ecx
	sall	%cl, %eax
	addl	k(%rip), %eax
	movl	%eax, k(%rip)
	cmpl	$4, %edx
	jne	.L52
	movl	%eax, %edx
	movl	%eax, %ecx
	andl	$31744, %edx
	andl	$992, %ecx
	je	.L5
	testl	%edx, %edx
	je	.L6
	andl	$1015808, %eax
	jne	.L7
	cmpl	$992, %ecx
	je	.L7
	cmpl	$31744, %edx
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L20:
	movl	k(%rip), %esi
	addl	$5, %eax
	movq	%r13, %rdi
	btl	%eax, %esi
	jc	.L50
	movq	%r14, %rdi
.L50:
	call	puts@PLT
	movl	12(%rsp), %eax
	addl	$1, %eax
	movl	%eax, 12(%rsp)
	cmpl	$4, %eax
	jle	.L20
.L13:
	movl	$0, k(%rip)
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	$992, %ecx
	jne	.L53
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$4, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbx, %rdi
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L10
	movl	$0, k(%rip)
	xorl	%edx, %edx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	$31744, %edx
	je	.L7
	andl	$1015808, %eax
	cmpl	$1015808, %eax
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movl	k(%rip), %eax
	addl	$10, %ecx
	movq	%r13, %rdi
	btl	%ecx, %eax
	jc	.L46
	movq	%r14, %rdi
.L46:
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %ecx
	movl	%ecx, 12(%rsp)
	cmpl	$4, %ecx
	jle	.L14
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L40:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L53:
	.cfi_restore_state
	andl	$1015808, %eax
	cmpl	$1015808, %eax
	je	.L7
	movl	$0, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movl	k(%rip), %eax
	addl	$15, %edx
	movq	%r13, %rdi
	btl	%edx, %eax
	jc	.L48
	movq	%r14, %rdi
.L48:
	call	puts@PLT
	movl	12(%rsp), %eax
	leal	1(%rax), %edx
	movl	%edx, 12(%rsp)
	cmpl	$4, %edx
	jle	.L17
	jmp	.L13
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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:
```