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){
		long n;
		int four[100]={0};
		int i=0, j;
		
		scanf(" %ld", &n);
		if(n==-1) break;
		else if(n==0) {
			printf("%ld\n", n);
			continue;
		}
		
		while(n > 0){
			four[i] = n%4;
			i++;
			n /= 4;
		}
		
		for(j=i-1; j>=0; j--)
			printf("%d", four[j]);
		printf("\n");

	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	" %ld"
.LC1:
	.string	"%ld\n"
.LC2:
	.string	"%d"
	.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	$432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L10:
	leaq	-416(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$0, -432(%rbp)
	leaq	-424(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-424(%rbp), %rax
	cmpq	$-1, %rax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	jmp	.L12
.L2:
	movq	-424(%rbp), %rax
	testq	%rax, %rax
	jne	.L6
	movq	-424(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L7:
	movq	-424(%rbp), %rax
	cqto
	shrq	$62, %rdx
	addq	%rdx, %rax
	andl	$3, %eax
	subq	%rdx, %rax
	movl	%eax, %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -432(%rbp)
	movq	-424(%rbp), %rax
	leaq	3(%rax), %rdx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	sarq	$2, %rax
	movq	%rax, -424(%rbp)
.L6:
	movq	-424(%rbp), %rax
	testq	%rax, %rax
	jg	.L7
	movl	-432(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -428(%rbp)
	jmp	.L8
.L9:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	subl	$1, -428(%rbp)
.L8:
	cmpl	$0, -428(%rbp)
	jns	.L9
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L10
.L12:
	call	__stack_chk_fail@PLT
.L11:
	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	" %ld"
.LC1:
	.string	"%ld\n"
.LC2:
	.string	"%d"
	.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
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	32(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	24(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movl	$50, %ecx
	movq	%rbp, %rdi
	movq	%r15, %rsi
	rep stosq
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rdx
	cmpq	$-1, %rdx
	je	.L3
	testq	%rdx, %rdx
	je	.L4
	movl	$0, %eax
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rdx, %rcx
	movl	%eax, %esi
	movq	%rax, %rdi
	andl	$3, %ecx
	movl	%ecx, 0(%rbp,%rax,4)
	addq	$1, %rax
	sarq	$2, %rdx
	jne	.L5
	movq	$0, 24(%rsp)
	movslq	%esi, %rbx
	salq	$2, %rdi
	salq	$2, %rbx
	leaq	0(%rbp,%rbx), %r13
	addq	8(%rsp), %rbx
	subq	%rdi, %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	0(%r13), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %r13
	call	__printf_chk@PLT
	cmpq	%rbx, %r13
	jne	.L8
.L9:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%edx, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$456, %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
.L19:
	.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	" %ld"
.LC1:
	.string	"%ld\n"
.LC2:
	.string	"%d"
	.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
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rax
	leaq	32(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	24(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movl	$50, %ecx
	movq	%rbp, %rdi
	movq	%r15, %rsi
	rep stosq
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rdx
	cmpq	$-1, %rdx
	je	.L3
	testq	%rdx, %rdx
	je	.L4
	movl	$0, %eax
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rdx, %rcx
	movl	%eax, %esi
	movq	%rax, %rdi
	andl	$3, %ecx
	movl	%ecx, 0(%rbp,%rax,4)
	addq	$1, %rax
	sarq	$2, %rdx
	jne	.L5
	movq	$0, 24(%rsp)
	movslq	%esi, %rbx
	salq	$2, %rdi
	salq	$2, %rbx
	leaq	0(%rbp,%rbx), %r13
	addq	8(%rsp), %rbx
	subq	%rdi, %rbx
	.p2align 4,,10
	.p2align 3
.L8:
	movl	0(%r13), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %r13
	call	__printf_chk@PLT
	cmpq	%rbx, %r13
	jne	.L8
.L9:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%edx, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$456, %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
.L19:
	.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){
	while(1){
		long n;
		int four[100]={0};
		int i=0, j;
		
		scanf(" %ld", &n);
		if(n==-1) break;
		else if(n==0) {
			printf("%ld\n", n);
			continue;
		}
		
		while(n > 0){
			four[i] = n%4;
			i++;
			n /= 4;
		}
		
		for(j=i-1; j>=0; j--)
			printf("%d", four[j]);
		printf("\n");

	}

	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){
	while(1){
		long n;
		int four[100]={0};
		int i=0, j;
		
		scanf(" %ld", &n);
		if(n==-1) break;
		else if(n==0) {
			printf("%ld\n", n);
			continue;
		}
		
		while(n > 0){
			four[i] = n%4;
			i++;
			n /= 4;
		}
		
		for(j=i-1; j>=0; j--)
			printf("%d", four[j]);
		printf("\n");

	}

	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	" %ld"
.LC1:
	.string	"%ld\n"
.LC2:
	.string	"%d"
	.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	$432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L10:
	leaq	-416(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$0, -432(%rbp)
	leaq	-424(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-424(%rbp), %rax
	cmpq	$-1, %rax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	jmp	.L12
.L2:
	movq	-424(%rbp), %rax
	testq	%rax, %rax
	jne	.L6
	movq	-424(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L7:
	movq	-424(%rbp), %rax
	cqto
	shrq	$62, %rdx
	addq	%rdx, %rax
	andl	$3, %eax
	subq	%rdx, %rax
	movl	%eax, %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -432(%rbp)
	movq	-424(%rbp), %rax
	leaq	3(%rax), %rdx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	sarq	$2, %rax
	movq	%rax, -424(%rbp)
.L6:
	movq	-424(%rbp), %rax
	testq	%rax, %rax
	jg	.L7
	movl	-432(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -428(%rbp)
	jmp	.L8
.L9:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	subl	$1, -428(%rbp)
.L8:
	cmpl	$0, -428(%rbp)
	jns	.L9
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L10
.L12:
	call	__stack_chk_fail@PLT
.L11:
	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	" %ld"
.LC1:
	.string	"%ld\n"
.LC2:
	.string	"%d"
	.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	$432, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L10:
	leaq	-416(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$0, -432(%rbp)
	leaq	-424(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-424(%rbp), %rax
	cmpq	$-1, %rax
	jne	.L2
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	jmp	.L12
.L2:
	movq	-424(%rbp), %rax
	testq	%rax, %rax
	jne	.L6
	movq	-424(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L7:
	movq	-424(%rbp), %rax
	cqto
	shrq	$62, %rdx
	addq	%rdx, %rax
	andl	$3, %eax
	subq	%rdx, %rax
	movl	%eax, %edx
	movl	-432(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -432(%rbp)
	movq	-424(%rbp), %rax
	leaq	3(%rax), %rdx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	sarq	$2, %rax
	movq	%rax, -424(%rbp)
.L6:
	movq	-424(%rbp), %rax
	testq	%rax, %rax
	jg	.L7
	movl	-432(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -428(%rbp)
	jmp	.L8
.L9:
	movl	-428(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	subl	$1, -428(%rbp)
.L8:
	cmpl	$0, -428(%rbp)
	jns	.L9
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L10
.L12:
	call	__stack_chk_fail@PLT
.L11:
	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:
