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(){
	int i,j,n,m,a[30];
	int d[]={0,1,2,3,5,7,8,9};
	
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		m=0;
		while(n>0){
			a[m++]=d[n%8];
			n/=8;
		}
		for(i=m-1;i>=0;i--)printf("%d",a[i]);
		printf("\n");
	}
	
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$176, %rsp
	.cfi_def_cfa_offset 224
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r13
	leaq	48(%rsp), %r12
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	movl	$0, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %ecx
	movslq	%eax, %rsi
	andl	$7, %ecx
	movl	16(%rsp,%rcx,4), %ecx
	movl	%ecx, (%r12,%rax,4)
	movq	%rax, %rcx
	addq	$1, %rax
	sarl	$3, %edx
	jne	.L3
	salq	$2, %rsi
	movl	$0, 12(%rsp)
	salq	$2, %rcx
	leaq	44(%rsp,%rsi), %r14
	leaq	(%r12,%rsi), %rbx
	subq	%rcx, %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r14
	jne	.L6
.L7:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$176, %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
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	5
	.long	7
	.long	8
	.long	9
	.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
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$176, %rsp
	.cfi_def_cfa_offset 224
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r13
	leaq	48(%rsp), %r12
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	movl	$0, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %ecx
	movslq	%eax, %rsi
	andl	$7, %ecx
	movl	16(%rsp,%rcx,4), %ecx
	movl	%ecx, (%r12,%rax,4)
	movq	%rax, %rcx
	addq	$1, %rax
	sarl	$3, %edx
	jne	.L3
	salq	$2, %rsi
	movl	$0, 12(%rsp)
	salq	$2, %rcx
	leaq	44(%rsp,%rsi), %r14
	leaq	(%r12,%rsi), %rbx
	subq	%rcx, %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r14
	jne	.L6
.L7:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$176, %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
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	5
	.long	7
	.long	8
	.long	9
	.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
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$176, %rsp
	.cfi_def_cfa_offset 224
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r13
	leaq	48(%rsp), %r12
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	movl	$0, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %ecx
	movslq	%eax, %rsi
	andl	$7, %ecx
	movl	16(%rsp,%rcx,4), %ecx
	movl	%ecx, (%r12,%rax,4)
	movq	%rax, %rcx
	addq	$1, %rax
	sarl	$3, %edx
	jne	.L3
	salq	$2, %rsi
	movl	$0, 12(%rsp)
	salq	$2, %rcx
	leaq	44(%rsp,%rsi), %r14
	leaq	(%r12,%rsi), %rbx
	subq	%rcx, %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r14
	jne	.L6
.L7:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$176, %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
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	5
	.long	7
	.long	8
	.long	9
	.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(){
	int i,j,n,m,a[30];
	int d[]={0,1,2,3,5,7,8,9};
	
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		m=0;
		while(n>0){
			a[m++]=d[n%8];
			n/=8;
		}
		for(i=m-1;i>=0;i--)printf("%d",a[i]);
		printf("\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(){
	int i,j,n,m,a[30];
	int d[]={0,1,2,3,5,7,8,9};
	
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		m=0;
		while(n>0){
			a[m++]=d[n%8];
			n/=8;
		}
		for(i=m-1;i>=0;i--)printf("%d",a[i]);
		printf("\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:

15
100
1000000000
1
0
 15
110
1000000000
1
0
 15
101
1000000000
3
0
 15
110
1000000000
0
0
 15
101
1001000000
3
0
 15
100
1000000000
0
0
 15
111
1001000000
3
0
 15
000
1000000000
0
0
 15
111
1001000000
2
0
 15
111
1001000001
2
0

19
155
9358757000
1
 19
178
9358757000
1
 19
157
9358757000
3
 19
178
9358757000
 19
157
9372508100
3
 19
155
9358757000
 19
179
9372508100
3
 19
 19
179
9372508100
2
 19
179
9372508101
2

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(){
	int i,j,n,m,a[30];
	int d[]={0,1,2,3,5,7,8,9};
	
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		m=0;
		while(n>0){
			a[m++]=d[n%8];
			n/=8;
		}
		for(i=m-1;i>=0;i--)printf("%d",a[i]);
		printf("\n");
	}
	
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$176, %rsp
	.cfi_def_cfa_offset 224
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r13
	leaq	48(%rsp), %r12
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	movl	$0, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %ecx
	movslq	%eax, %rsi
	andl	$7, %ecx
	movl	16(%rsp,%rcx,4), %ecx
	movl	%ecx, (%r12,%rax,4)
	movq	%rax, %rcx
	addq	$1, %rax
	sarl	$3, %edx
	jne	.L3
	salq	$2, %rsi
	movl	$0, 12(%rsp)
	salq	$2, %rcx
	leaq	44(%rsp,%rsi), %r14
	leaq	(%r12,%rsi), %rbx
	subq	%rcx, %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r14
	jne	.L6
.L7:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$176, %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
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	5
	.long	7
	.long	8
	.long	9
	.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
.LC2:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC2(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$176, %rsp
	.cfi_def_cfa_offset 224
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 168(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r13
	leaq	48(%rsp), %r12
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC1(%rip), %xmm0
	movaps	%xmm0, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	movl	$0, %eax
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%edx, %ecx
	movslq	%eax, %rsi
	andl	$7, %ecx
	movl	16(%rsp,%rcx,4), %ecx
	movl	%ecx, (%r12,%rax,4)
	movq	%rax, %rcx
	addq	$1, %rax
	sarl	$3, %edx
	jne	.L3
	salq	$2, %rsi
	movl	$0, 12(%rsp)
	salq	$2, %rcx
	leaq	44(%rsp,%rsi), %r14
	leaq	(%r12,%rsi), %rbx
	subq	%rcx, %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	subq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r14
	jne	.L6
.L7:
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	movq	168(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$176, %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
.L17:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	5
	.long	7
	.long	8
	.long	9
	.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:
```