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) {
	int n, i, len, ans[10];
	while (1) {
		scanf("%d", &n);
		if (n == -1) break;

		for (i = 0; i < 10; i++)
			ans[i] = 0;
		len = 0;
		do {
			ans[len] = n % 4;
			n /= 4;
			len++;
		} while (n != 0);
		for (i = len - 1; i >= 0; i--)
			printf("%d", ans[i]);
		putchar('\n');
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	cmpl	$-1, %eax
	je	.L2
	movq	$0, 48(%rsp)
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	sarl	$31, %ecx
	movaps	%xmm0, 16(%rsp)
	shrl	$30, %ecx
	movaps	%xmm0, 32(%rsp)
	leal	(%rax,%rcx), %edx
	andl	$3, %edx
	subl	%ecx, %edx
	testl	%eax, %eax
	movl	%edx, 16(%rsp)
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L7
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 20(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L8
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 24(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L9
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 28(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L10
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 32(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L11
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 36(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L12
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 40(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L13
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 44(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L14
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 48(%rsp)
	sarl	$2, %edx
	movl	%edx, %eax
	je	.L15
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrl	$30, %ecx
	leal	(%rdx,%rcx), %eax
	andl	$3, %eax
	subl	%ecx, %eax
	testl	%edx, %edx
	movl	%eax, 52(%rsp)
	leal	3(%rdx), %eax
	cmovns	%edx, %eax
	movl	$9, %edx
	sarl	$2, %eax
.L3:
	movl	%eax, 12(%rsp)
	movslq	%edx, %rax
	movq	%r12, %r13
	leaq	16(%rsp,%rax,4), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r13
	jne	.L4
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$72, %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
.L7:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L3
.L8:
	movl	$1, %edx
	jmp	.L3
.L9:
	movl	$2, %edx
	jmp	.L3
.L10:
	movl	$3, %edx
	jmp	.L3
.L11:
	movl	$4, %edx
	jmp	.L3
.L12:
	movl	$5, %edx
	jmp	.L3
.L13:
	movl	$6, %edx
	jmp	.L3
.L14:
	movl	$7, %edx
	jmp	.L3
.L15:
	movl	$8, %edx
	jmp	.L3
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	cmpl	$-1, %eax
	je	.L2
	movq	$0, 48(%rsp)
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	sarl	$31, %ecx
	movaps	%xmm0, 16(%rsp)
	shrl	$30, %ecx
	movaps	%xmm0, 32(%rsp)
	leal	(%rax,%rcx), %edx
	andl	$3, %edx
	subl	%ecx, %edx
	testl	%eax, %eax
	movl	%edx, 16(%rsp)
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L7
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 20(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L8
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 24(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L9
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 28(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L10
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 32(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L11
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 36(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L12
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 40(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L13
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 44(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L14
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 48(%rsp)
	sarl	$2, %edx
	movl	%edx, %eax
	je	.L15
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrl	$30, %ecx
	leal	(%rdx,%rcx), %eax
	andl	$3, %eax
	subl	%ecx, %eax
	testl	%edx, %edx
	movl	%eax, 52(%rsp)
	leal	3(%rdx), %eax
	cmovns	%edx, %eax
	movl	$9, %edx
	sarl	$2, %eax
.L3:
	movl	%eax, 12(%rsp)
	movslq	%edx, %rax
	movq	%r12, %r13
	leaq	16(%rsp,%rax,4), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r13
	jne	.L4
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$72, %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
.L7:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L3
.L8:
	movl	$1, %edx
	jmp	.L3
.L9:
	movl	$2, %edx
	jmp	.L3
.L10:
	movl	$3, %edx
	jmp	.L3
.L11:
	movl	$4, %edx
	jmp	.L3
.L12:
	movl	$5, %edx
	jmp	.L3
.L13:
	movl	$6, %edx
	jmp	.L3
.L14:
	movl	$7, %edx
	jmp	.L3
.L15:
	movl	$8, %edx
	jmp	.L3
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	cmpl	$-1, %eax
	je	.L2
	movq	$0, 48(%rsp)
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	sarl	$31, %ecx
	movaps	%xmm0, 16(%rsp)
	shrl	$30, %ecx
	movaps	%xmm0, 32(%rsp)
	leal	(%rax,%rcx), %edx
	andl	$3, %edx
	subl	%ecx, %edx
	testl	%eax, %eax
	movl	%edx, 16(%rsp)
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L7
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 20(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L8
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 24(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L9
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 28(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L10
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 32(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L11
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 36(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L12
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 40(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L13
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 44(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L14
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 48(%rsp)
	sarl	$2, %edx
	movl	%edx, %eax
	je	.L15
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrl	$30, %ecx
	leal	(%rdx,%rcx), %eax
	andl	$3, %eax
	subl	%ecx, %eax
	testl	%edx, %edx
	movl	%eax, 52(%rsp)
	leal	3(%rdx), %eax
	cmovns	%edx, %eax
	movl	$9, %edx
	sarl	$2, %eax
.L3:
	movl	%eax, 12(%rsp)
	movslq	%edx, %rax
	movq	%r12, %r13
	leaq	16(%rsp,%rax,4), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r13
	jne	.L4
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$72, %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
.L7:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L3
.L8:
	movl	$1, %edx
	jmp	.L3
.L9:
	movl	$2, %edx
	jmp	.L3
.L10:
	movl	$3, %edx
	jmp	.L3
.L11:
	movl	$4, %edx
	jmp	.L3
.L12:
	movl	$5, %edx
	jmp	.L3
.L13:
	movl	$6, %edx
	jmp	.L3
.L14:
	movl	$7, %edx
	jmp	.L3
.L15:
	movl	$8, %edx
	jmp	.L3
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#include <stdio.h>

int main(void) {
	int n, i, len, ans[10];
	while (1) {
		scanf("%d", &n);
		if (n == -1) break;

		for (i = 0; i < 10; i++)
			ans[i] = 0;
		len = 0;
		do {
			ans[len] = n % 4;
			n /= 4;
			len++;
		} while (n != 0);
		for (i = len - 1; i >= 0; i--)
			printf("%d", ans[i]);
		putchar('\n');
	}
	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) {
	int n, i, len, ans[10];
	while (1) {
		scanf("%d", &n);
		if (n == -1) break;

		for (i = 0; i < 10; i++)
			ans[i] = 0;
		len = 0;
		do {
			ans[len] = n % 4;
			n /= 4;
			len++;
		} while (n != 0);
		for (i = len - 1; i >= 0; i--)
			printf("%d", ans[i]);
		putchar('\n');
	}
	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:

7
4
0
12
10
10010
-1
 7
4
0
12
4
10000
-1
 7
4
0
13
10
10010
-1
 7
4
0
12
6
10000
-1
 7
4
0
24
10
10010
-1
 7
4
1
12
6
10000
-1
 7
4
1
24
10
10010
-1
 7
6
1
12
6
10000
-1
 7
1
1
24
10
10010
-1
 7
6
1
12
11
10000
-1

13
10
0
30
22
2130122
 13
10
0
30
10
2130100
 13
10
0
31
22
2130122
 13
10
0
30
12
2130100
 13
10
0
120
22
2130122
 13
10
1
30
12
2130100
 13
10
1
120
22
2130122
 13
12
1
30
12
2130100
 13
1
1
120
22
2130122
 13
12
1
30
23
2130100

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) {
	int n, i, len, ans[10];
	while (1) {
		scanf("%d", &n);
		if (n == -1) break;

		for (i = 0; i < 10; i++)
			ans[i] = 0;
		len = 0;
		do {
			ans[len] = n % 4;
			n /= 4;
			len++;
		} while (n != 0);
		for (i = len - 1; i >= 0; i--)
			printf("%d", ans[i]);
		putchar('\n');
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	cmpl	$-1, %eax
	je	.L2
	movq	$0, 48(%rsp)
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	sarl	$31, %ecx
	movaps	%xmm0, 16(%rsp)
	shrl	$30, %ecx
	movaps	%xmm0, 32(%rsp)
	leal	(%rax,%rcx), %edx
	andl	$3, %edx
	subl	%ecx, %edx
	testl	%eax, %eax
	movl	%edx, 16(%rsp)
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L7
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 20(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L8
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 24(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L9
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 28(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L10
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 32(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L11
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 36(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L12
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 40(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L13
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 44(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L14
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 48(%rsp)
	sarl	$2, %edx
	movl	%edx, %eax
	je	.L15
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrl	$30, %ecx
	leal	(%rdx,%rcx), %eax
	andl	$3, %eax
	subl	%ecx, %eax
	testl	%edx, %edx
	movl	%eax, 52(%rsp)
	leal	3(%rdx), %eax
	cmovns	%edx, %eax
	movl	$9, %edx
	sarl	$2, %eax
.L3:
	movl	%eax, 12(%rsp)
	movslq	%edx, %rax
	movq	%r12, %r13
	leaq	16(%rsp,%rax,4), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r13
	jne	.L4
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$72, %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
.L7:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L3
.L8:
	movl	$1, %edx
	jmp	.L3
.L9:
	movl	$2, %edx
	jmp	.L3
.L10:
	movl	$3, %edx
	jmp	.L3
.L11:
	movl	$4, %edx
	jmp	.L3
.L12:
	movl	$5, %edx
	jmp	.L3
.L13:
	movl	$6, %edx
	jmp	.L3
.L14:
	movl	$7, %edx
	jmp	.L3
.L15:
	movl	$8, %edx
	jmp	.L3
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	cmpl	$-1, %eax
	je	.L2
	movq	$0, 48(%rsp)
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	sarl	$31, %ecx
	movaps	%xmm0, 16(%rsp)
	shrl	$30, %ecx
	movaps	%xmm0, 32(%rsp)
	leal	(%rax,%rcx), %edx
	andl	$3, %edx
	subl	%ecx, %edx
	testl	%eax, %eax
	movl	%edx, 16(%rsp)
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L7
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 20(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L8
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 24(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L9
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 28(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L10
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 32(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L11
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 36(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L12
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 40(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L13
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 44(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L14
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%ecx, 48(%rsp)
	sarl	$2, %edx
	movl	%edx, %eax
	je	.L15
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrl	$30, %ecx
	leal	(%rdx,%rcx), %eax
	andl	$3, %eax
	subl	%ecx, %eax
	testl	%edx, %edx
	movl	%eax, 52(%rsp)
	leal	3(%rdx), %eax
	cmovns	%edx, %eax
	movl	$9, %edx
	sarl	$2, %eax
.L3:
	movl	%eax, 12(%rsp)
	movslq	%edx, %rax
	movq	%r12, %r13
	leaq	16(%rsp,%rax,4), %rbx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r13
	jne	.L4
	movq	stdout(%rip), %rsi
	movl	$10, %edi
	call	putc@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L2:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$72, %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
.L7:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L3
.L8:
	movl	$1, %edx
	jmp	.L3
.L9:
	movl	$2, %edx
	jmp	.L3
.L10:
	movl	$3, %edx
	jmp	.L3
.L11:
	movl	$4, %edx
	jmp	.L3
.L12:
	movl	$5, %edx
	jmp	.L3
.L13:
	movl	$6, %edx
	jmp	.L3
.L14:
	movl	$7, %edx
	jmp	.L3
.L15:
	movl	$8, %edx
	jmp	.L3
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```