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)
{
	int n, i, array[10], f;
	
	while (scanf("%d", &n), n != -1){
		for (i = 0; i < 10; i++){
			array[i] = 0;
		}
		
		i = 0;
		while (n != 0){
			array[i] = n % 4;
			n /= 4;
			i++;
		}
		
		f = 0;
		for (i = 9; i >= 0; i--){
			if (f == 0 && array[i] != 0){
				f = 1;
			}
			if (f || !i){
				printf("%d", array[i]);
			}
		}
		puts("");
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	""
	.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
	jmp	.L2
.L12:
	movl	$0, -56(%rbp)
	jmp	.L3
.L4:
	movl	-56(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L3:
	cmpl	$9, -56(%rbp)
	jle	.L4
	movl	$0, -56(%rbp)
	jmp	.L5
.L6:
	movl	-60(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-60(%rbp), %eax
	leal	3(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$2, %eax
	movl	%eax, -60(%rbp)
	addl	$1, -56(%rbp)
.L5:
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$0, -52(%rbp)
	movl	$9, -56(%rbp)
	jmp	.L7
.L11:
	cmpl	$0, -52(%rbp)
	jne	.L8
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L8
	movl	$1, -52(%rbp)
.L8:
	cmpl	$0, -52(%rbp)
	jne	.L9
	cmpl	$0, -56(%rbp)
	jne	.L10
.L9:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	subl	$1, -56(%rbp)
.L7:
	cmpl	$0, -56(%rbp)
	jns	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cmpl	$-1, %eax
	jne	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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"
.LC1:
	.string	""
	.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
	leaq	.LC0(%rip), %rbx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rbp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L61:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%r9d, 28(%rsp)
	movl	%r8d, 24(%rsp)
	call	__printf_chk@PLT
	movl	28(%rsp), %r9d
	movl	24(%rsp), %r8d
.L21:
	movl	%r9d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%r8d, 24(%rsp)
	call	__printf_chk@PLT
	movl	24(%rsp), %r8d
.L19:
	movl	%r8d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	movl	%r14d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L15:
	movl	16(%rsp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L13:
	movl	12(%rsp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L11:
	movl	%r15d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movl	20(%rsp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movl	%r13d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movl	$1, %edi
	movl	%r12d, %edx
	movq	%rbx, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	cmpl	$-1, %eax
	je	.L5
	movq	$0, 80(%rsp)
	pxor	%xmm0, %xmm0
	xorl	%r12d, %r12d
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	testl	%eax, %eax
	je	.L7
	cltd
	shrl	$30, %edx
	leal	(%rax,%rdx), %r12d
	andl	$3, %r12d
	subl	%edx, %r12d
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 52(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 56(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 60(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 64(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 68(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 72(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 76(%rsp)
	sarl	$2, %edx
	movl	%edx, %eax
	je	.L3
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrl	$30, %ecx
	leal	(%rdx,%rcx), %eax
	andl	$3, %eax
	subl	%ecx, %eax
	testl	%edx, %edx
	movl	%eax, 80(%rsp)
	leal	3(%rdx), %eax
	cmovs	%eax, %edx
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovs	%edx, %eax
	movl	%ecx, 84(%rsp)
	sarl	$2, %eax
.L3:
	movl	84(%rsp), %edx
	movl	80(%rsp), %r9d
	movl	%eax, 44(%rsp)
	movl	68(%rsp), %eax
	movl	76(%rsp), %r8d
	movl	72(%rsp), %r14d
	movl	60(%rsp), %r15d
	movl	%eax, 16(%rsp)
	movl	64(%rsp), %eax
	movl	52(%rsp), %r13d
	movl	%eax, 12(%rsp)
	movl	56(%rsp), %eax
	movl	%eax, 20(%rsp)
	testl	%edx, %edx
	jne	.L61
	testl	%r9d, %r9d
	jne	.L21
	testl	%r8d, %r8d
	jne	.L19
	testl	%r14d, %r14d
	jne	.L17
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jne	.L15
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jne	.L13
	testl	%r15d, %r15d
	jne	.L11
	movl	20(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L9
	testl	%r13d, %r13d
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L62
	addq	$104, %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
.L62:
	.cfi_restore_state
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	""
	.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
	leaq	.LC0(%rip), %rbx
	subq	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rbp
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L61:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%r9d, 28(%rsp)
	movl	%r8d, 24(%rsp)
	call	__printf_chk@PLT
	movl	28(%rsp), %r9d
	movl	24(%rsp), %r8d
.L21:
	movl	%r9d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%r8d, 24(%rsp)
	call	__printf_chk@PLT
	movl	24(%rsp), %r8d
.L19:
	movl	%r8d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	movl	%r14d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L15:
	movl	16(%rsp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L13:
	movl	12(%rsp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L11:
	movl	%r15d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L9:
	movl	20(%rsp), %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movl	%r13d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movl	$1, %edi
	movl	%r12d, %edx
	movq	%rbx, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	cmpl	$-1, %eax
	je	.L5
	movq	$0, 80(%rsp)
	pxor	%xmm0, %xmm0
	xorl	%r12d, %r12d
	movaps	%xmm0, 48(%rsp)
	movaps	%xmm0, 64(%rsp)
	testl	%eax, %eax
	je	.L7
	cltd
	shrl	$30, %edx
	leal	(%rax,%rdx), %r12d
	andl	$3, %r12d
	subl	%edx, %r12d
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovns	%eax, %edx
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 52(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 56(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 60(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 64(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 68(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 72(%rsp)
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	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, 76(%rsp)
	sarl	$2, %edx
	movl	%edx, %eax
	je	.L3
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrl	$30, %ecx
	leal	(%rdx,%rcx), %eax
	andl	$3, %eax
	subl	%ecx, %eax
	testl	%edx, %edx
	movl	%eax, 80(%rsp)
	leal	3(%rdx), %eax
	cmovs	%eax, %edx
	movl	%edx, %eax
	sarl	$2, %eax
	je	.L3
	sarl	$31, %edx
	shrl	$30, %edx
	leal	(%rax,%rdx), %ecx
	andl	$3, %ecx
	subl	%edx, %ecx
	testl	%eax, %eax
	leal	3(%rax), %edx
	cmovs	%edx, %eax
	movl	%ecx, 84(%rsp)
	sarl	$2, %eax
.L3:
	movl	84(%rsp), %edx
	movl	80(%rsp), %r9d
	movl	%eax, 44(%rsp)
	movl	68(%rsp), %eax
	movl	76(%rsp), %r8d
	movl	72(%rsp), %r14d
	movl	60(%rsp), %r15d
	movl	%eax, 16(%rsp)
	movl	64(%rsp), %eax
	movl	52(%rsp), %r13d
	movl	%eax, 12(%rsp)
	movl	56(%rsp), %eax
	movl	%eax, 20(%rsp)
	testl	%edx, %edx
	jne	.L61
	testl	%r9d, %r9d
	jne	.L21
	testl	%r8d, %r8d
	jne	.L19
	testl	%r14d, %r14d
	jne	.L17
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jne	.L15
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jne	.L13
	testl	%r15d, %r15d
	jne	.L11
	movl	20(%rsp), %ecx
	testl	%ecx, %ecx
	jne	.L9
	testl	%r13d, %r13d
	jne	.L8
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L62
	addq	$104, %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
.L62:
	.cfi_restore_state
	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:

#include <stdio.h>

int main(void)
{
	int n, i, array[10], f;
	
	while (scanf("%d", &n), n != -1){
		for (i = 0; i < 10; i++){
			array[i] = 0;
		}
		
		i = 0;
		while (n != 0){
			array[i] = n % 4;
			n /= 4;
			i++;
		}
		
		f = 0;
		for (i = 9; i >= 0; i--){
			if (f == 0 && array[i] != 0){
				f = 1;
			}
			if (f || !i){
				printf("%d", array[i]);
			}
		}
		puts("");
	}
	
	return (0);
}
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 unoptimized 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, array[10], f;
	
	while (scanf("%d", &n), n != -1){
		for (i = 0; i < 10; i++){
			array[i] = 0;
		}
		
		i = 0;
		while (n != 0){
			array[i] = n % 4;
			n /= 4;
			i++;
		}
		
		f = 0;
		for (i = 9; i >= 0; i--){
			if (f == 0 && array[i] != 0){
				f = 1;
			}
			if (f || !i){
				printf("%d", array[i]);
			}
		}
		puts("");
	}
	
	return (0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	""
	.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
	jmp	.L2
.L12:
	movl	$0, -56(%rbp)
	jmp	.L3
.L4:
	movl	-56(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L3:
	cmpl	$9, -56(%rbp)
	jle	.L4
	movl	$0, -56(%rbp)
	jmp	.L5
.L6:
	movl	-60(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-60(%rbp), %eax
	leal	3(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$2, %eax
	movl	%eax, -60(%rbp)
	addl	$1, -56(%rbp)
.L5:
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$0, -52(%rbp)
	movl	$9, -56(%rbp)
	jmp	.L7
.L11:
	cmpl	$0, -52(%rbp)
	jne	.L8
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L8
	movl	$1, -52(%rbp)
.L8:
	cmpl	$0, -52(%rbp)
	jne	.L9
	cmpl	$0, -56(%rbp)
	jne	.L10
.L9:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	subl	$1, -56(%rbp)
.L7:
	cmpl	$0, -56(%rbp)
	jns	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cmpl	$-1, %eax
	jne	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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	""
	.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
	jmp	.L2
.L12:
	movl	$0, -56(%rbp)
	jmp	.L3
.L4:
	movl	-56(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	addl	$1, -56(%rbp)
.L3:
	cmpl	$9, -56(%rbp)
	jle	.L4
	movl	$0, -56(%rbp)
	jmp	.L5
.L6:
	movl	-60(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-56(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-60(%rbp), %eax
	leal	3(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$2, %eax
	movl	%eax, -60(%rbp)
	addl	$1, -56(%rbp)
.L5:
	movl	-60(%rbp), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$0, -52(%rbp)
	movl	$9, -56(%rbp)
	jmp	.L7
.L11:
	cmpl	$0, -52(%rbp)
	jne	.L8
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L8
	movl	$1, -52(%rbp)
.L8:
	cmpl	$0, -52(%rbp)
	jne	.L9
	cmpl	$0, -56(%rbp)
	jne	.L10
.L9:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L10:
	subl	$1, -56(%rbp)
.L7:
	cmpl	$0, -56(%rbp)
	jns	.L11
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L2:
	leaq	-60(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %eax
	cmpl	$-1, %eax
	jne	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
