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;
    char s[16];
    char new_num[8] = { 0, 1, 2, 3, 5, 7, 8, 9 };
    int i;

    while (1){
        scanf("%d", &n);
        if (n == 0){
            break;
        }

        sprintf(s, "%o", n);
        for (i = 0; s[i] != '\0'; i++){
            if (s[i] >= '5'){
                s[i]++;
            }
            if (s[i] >= '4'){
                s[i]++;
            }
        }
        printf("%s\n", s);
    }

    return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%o"
	.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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L2
	leaq	16(%rsp), %r13
	movl	$16, %edx
	movq	%r12, %rcx
	xorl	%eax, %eax
	movl	$1, %esi
	movq	%r13, %rdi
	call	__sprintf_chk@PLT
	movzbl	16(%rsp), %eax
	movq	%r13, %rdx
	testb	%al, %al
	je	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$52, %al
	jle	.L5
	addl	$1, %eax
	movb	%al, (%rdx)
.L5:
	cmpb	$51, %al
	jle	.L6
	addl	$1, %eax
	addq	$1, %rdx
	movb	%al, -1(%rdx)
	movzbl	(%rdx), %eax
	testb	%al, %al
	jne	.L9
.L8:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	1(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	jne	.L9
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$56, %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
.L17:
	.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:
```

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	"%o"
	.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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L2
	leaq	16(%rsp), %r13
	movl	$16, %edx
	movq	%r12, %rcx
	xorl	%eax, %eax
	movl	$1, %esi
	movq	%r13, %rdi
	call	__sprintf_chk@PLT
	movzbl	16(%rsp), %eax
	movq	%r13, %rdx
	testb	%al, %al
	je	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$52, %al
	jle	.L5
	addl	$1, %eax
	movb	%al, (%rdx)
.L5:
	cmpb	$51, %al
	jle	.L6
	addl	$1, %eax
	addq	$1, %rdx
	movb	%al, -1(%rdx)
	movzbl	(%rdx), %eax
	testb	%al, %al
	jne	.L9
.L8:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	1(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	jne	.L9
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$56, %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
.L17:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%o"
	.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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L2
	leaq	16(%rsp), %r13
	movl	$16, %edx
	movq	%r12, %rcx
	xorl	%eax, %eax
	movl	$1, %esi
	movq	%r13, %rdi
	call	__sprintf_chk@PLT
	movzbl	16(%rsp), %eax
	movq	%r13, %rdx
	testb	%al, %al
	je	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$52, %al
	jle	.L5
	addl	$1, %eax
	movb	%al, (%rdx)
.L5:
	cmpb	$51, %al
	jle	.L6
	addl	$1, %eax
	addq	$1, %rdx
	movb	%al, -1(%rdx)
	movzbl	(%rdx), %eax
	testb	%al, %al
	jne	.L9
.L8:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	1(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	jne	.L9
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$56, %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
.L17:
	.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:
```
```c
#include <stdio.h>

int main(void)
{
    int n;
    char s[16];
    char new_num[8] = { 0, 1, 2, 3, 5, 7, 8, 9 };
    int i;

    while (1){
        scanf("%d", &n);
        if (n == 0){
            break;
        }

        sprintf(s, "%o", n);
        for (i = 0; s[i] != '\0'; i++){
            if (s[i] >= '5'){
                s[i]++;
            }
            if (s[i] >= '4'){
                s[i]++;
            }
        }
        printf("%s\n", s);
    }

    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;
    char s[16];
    char new_num[8] = { 0, 1, 2, 3, 5, 7, 8, 9 };
    int i;

    while (1){
        scanf("%d", &n);
        if (n == 0){
            break;
        }

        sprintf(s, "%o", n);
        for (i = 0; s[i] != '\0'; i++){
            if (s[i] >= '5'){
                s[i]++;
            }
            if (s[i] >= '4'){
                s[i]++;
            }
        }
        printf("%s\n", s);
    }

    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(void)
{
    int n;
    char s[16];
    char new_num[8] = { 0, 1, 2, 3, 5, 7, 8, 9 };
    int i;

    while (1){
        scanf("%d", &n);
        if (n == 0){
            break;
        }

        sprintf(s, "%o", n);
        for (i = 0; s[i] != '\0'; i++){
            if (s[i] >= '5'){
                s[i]++;
            }
            if (s[i] >= '4'){
                s[i]++;
            }
        }
        printf("%s\n", s);
    }

    return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%o"
	.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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L2
	leaq	16(%rsp), %r13
	movl	$16, %edx
	movq	%r12, %rcx
	xorl	%eax, %eax
	movl	$1, %esi
	movq	%r13, %rdi
	call	__sprintf_chk@PLT
	movzbl	16(%rsp), %eax
	movq	%r13, %rdx
	testb	%al, %al
	je	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$52, %al
	jle	.L5
	addl	$1, %eax
	movb	%al, (%rdx)
.L5:
	cmpb	$51, %al
	jle	.L6
	addl	$1, %eax
	addq	$1, %rdx
	movb	%al, -1(%rdx)
	movzbl	(%rdx), %eax
	testb	%al, %al
	jne	.L9
.L8:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	1(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	jne	.L9
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$56, %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
.L17:
	.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:
```

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	"%o"
	.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
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L2
	leaq	16(%rsp), %r13
	movl	$16, %edx
	movq	%r12, %rcx
	xorl	%eax, %eax
	movl	$1, %esi
	movq	%r13, %rdi
	call	__sprintf_chk@PLT
	movzbl	16(%rsp), %eax
	movq	%r13, %rdx
	testb	%al, %al
	je	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	cmpb	$52, %al
	jle	.L5
	addl	$1, %eax
	movb	%al, (%rdx)
.L5:
	cmpb	$51, %al
	jle	.L6
	addl	$1, %eax
	addq	$1, %rdx
	movb	%al, -1(%rdx)
	movzbl	(%rdx), %eax
	testb	%al, %al
	jne	.L9
.L8:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movzbl	1(%rdx), %eax
	addq	$1, %rdx
	testb	%al, %al
	jne	.L9
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$56, %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
.L17:
	.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:
```