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>

char oc[] = "01235789";

void oct(int a){
  if(a == 0)return;
  oct(a / 8);
  putchar(oc[a % 8]);
}

int main(){
  int a;
  while(scanf("%d", &a)){
    if(a == 0)return 0;
    oct(a);
    puts("");
  }  
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	oc
	.data
	.align 8
	.type	oc, @object
	.size	oc, 9
oc:
	.string	"01235789"
	.text
	.globl	oct
	.type	oct, @function
oct:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L4
	movl	-4(%rbp), %eax
	leal	7(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$3, %eax
	movl	%eax, %edi
	call	oct
	movl	-4(%rbp), %eax
	cltd
	shrl	$29, %edx
	addl	%edx, %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	leaq	oc(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	jmp	.L1
.L4:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	oct, .-oct
	.section	.rodata
.LC0:
	.string	""
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L9:
	movl	-12(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	jmp	.L8
.L7:
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	oct
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L9
	movl	$0, %eax
.L8:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.type	oct.part.0, @function
oct.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	testl	%edi, %edi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	oc(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leal	7(%rdi), %ebp
	cmovns	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edi, %ebx
	sarl	$3, %ebp
	jne	.L20
.L2:
	movl	%ebx, %eax
	movq	stdout(%rip), %rsi
	sarl	$31, %eax
	shrl	$29, %eax
	addl	%eax, %ebx
	andl	$7, %ebx
	subl	%eax, %ebx
	movslq	%ebx, %rbx
	movsbl	0(%r13,%rbx), %edi
	popq	%rbx
	.cfi_remember_state
	.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
	jmp	putc@PLT
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	testl	%ebp, %ebp
	leal	7(%rbp), %r12d
	cmovns	%ebp, %r12d
	sarl	$3, %r12d
	je	.L3
	testl	%r12d, %r12d
	leal	7(%r12), %r14d
	cmovns	%r12d, %r14d
	sarl	$3, %r14d
	jne	.L21
.L4:
	movl	%r12d, %edx
	movq	stdout(%rip), %rsi
	sarl	$31, %edx
	shrl	$29, %edx
	leal	(%r12,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%r13,%rax), %edi
	call	putc@PLT
.L3:
	movl	%ebp, %eax
	movq	stdout(%rip), %rsi
	sarl	$31, %eax
	shrl	$29, %eax
	addl	%eax, %ebp
	andl	$7, %ebp
	subl	%eax, %ebp
	movslq	%ebp, %rbp
	movsbl	0(%r13,%rbp), %edi
	call	putc@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L21:
	testl	%r14d, %r14d
	leal	7(%r14), %edi
	cmovns	%r14d, %edi
	sarl	$3, %edi
	je	.L5
	call	oct.part.0
.L5:
	movl	%r14d, %edx
	leaq	oc(%rip), %r13
	movq	stdout(%rip), %rsi
	sarl	$31, %edx
	shrl	$29, %edx
	leal	(%r14,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%r13,%rax), %edi
	call	putc@PLT
	jmp	.L4
	.cfi_endproc
.LFE25:
	.size	oct.part.0, .-oct.part.0
	.p2align 4
	.globl	oct
	.type	oct, @function
oct:
.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
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	testl	%edi, %edi
	jne	.L37
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	leal	7(%rdi), %ebp
	movl	%edi, %ebx
	leaq	oc(%rip), %r13
	cmovns	%edi, %ebp
	sarl	$3, %ebp
	je	.L24
	testl	%ebp, %ebp
	leal	7(%rbp), %r12d
	cmovns	%ebp, %r12d
	sarl	$3, %r12d
	jne	.L38
.L25:
	movl	%ebp, %edx
	movq	stdout(%rip), %rsi
	sarl	$31, %edx
	shrl	$29, %edx
	leal	0(%rbp,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%r13,%rax), %edi
	call	putc@PLT
.L24:
	movl	%ebx, %eax
	movq	stdout(%rip), %rsi
	sarl	$31, %eax
	shrl	$29, %eax
	addl	%eax, %ebx
	andl	$7, %ebx
	subl	%eax, %ebx
	movslq	%ebx, %rbx
	movsbl	0(%r13,%rbx), %edi
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	jmp	putc@PLT
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	testl	%r12d, %r12d
	leal	7(%r12), %edi
	cmovns	%r12d, %edi
	sarl	$3, %edi
	je	.L26
	call	oct.part.0
.L26:
	movl	%r12d, %edx
	leaq	oc(%rip), %r13
	movq	stdout(%rip), %rsi
	sarl	$31, %edx
	shrl	$29, %edx
	leal	(%r12,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%r13,%rax), %edi
	call	putc@PLT
	jmp	.L25
	.cfi_endproc
.LFE23:
	.size	oct, .-oct
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	""
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	oc(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L40:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L50
	movl	36(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L50
	leal	7(%rbx), %ecx
	cmovns	%ebx, %ecx
	sarl	$3, %ecx
	movl	%ecx, %r15d
	je	.L42
	testl	%ecx, %ecx
	leal	7(%rcx), %r8d
	cmovns	%ecx, %r8d
	sarl	$3, %r8d
	je	.L43
	testl	%r8d, %r8d
	leal	7(%r8), %r9d
	cmovns	%r8d, %r9d
	sarl	$3, %r9d
	je	.L44
	testl	%r9d, %r9d
	leal	7(%r9), %eax
	cmovns	%r9d, %eax
	sarl	$3, %eax
	movl	%eax, %r10d
	jne	.L75
.L45:
	movl	%r9d, %edx
	movq	stdout(%rip), %rsi
	movl	%r8d, 12(%rsp)
	sarl	$31, %edx
	shrl	$29, %edx
	leal	(%r9,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%rbp,%rax), %edi
	call	putc@PLT
	movl	12(%rsp), %r8d
.L44:
	movl	%r8d, %edx
	movq	stdout(%rip), %rsi
	sarl	$31, %edx
	shrl	$29, %edx
	leal	(%r8,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%rbp,%rax), %edi
	call	putc@PLT
.L43:
	movl	%r15d, %eax
	movq	stdout(%rip), %rsi
	sarl	$31, %eax
	shrl	$29, %eax
	leal	(%r15,%rax), %ecx
	andl	$7, %ecx
	subl	%eax, %ecx
	movslq	%ecx, %rcx
	movsbl	0(%rbp,%rcx), %edi
	call	putc@PLT
.L42:
	movl	%ebx, %eax
	movq	stdout(%rip), %rsi
	sarl	$31, %eax
	shrl	$29, %eax
	addl	%eax, %ebx
	andl	$7, %ebx
	subl	%eax, %ebx
	movslq	%ebx, %rbx
	movsbl	0(%rbp,%rbx), %edi
	call	putc@PLT
	movq	%r14, %rdi
	call	puts@PLT
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L50:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L76
	addq	$56, %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
.L75:
	.cfi_restore_state
	movl	$8, %edi
	cltd
	idivl	%edi
	movl	%eax, %r11d
	testl	%eax, %eax
	je	.L46
	cltd
	idivl	%edi
	movl	%eax, %esi
	testl	%eax, %eax
	jne	.L77
.L47:
	movl	%r11d, %eax
	movl	$8, %esi
	movl	%r10d, 20(%rsp)
	cltd
	movl	%r9d, 16(%rsp)
	idivl	%esi
	movq	stdout(%rip), %rsi
	movl	%r8d, 12(%rsp)
	movslq	%edx, %rdx
	movsbl	0(%rbp,%rdx), %edi
	call	putc@PLT
	movl	20(%rsp), %r10d
	movl	16(%rsp), %r9d
	movl	12(%rsp), %r8d
.L46:
	movl	%r10d, %eax
	movl	$8, %esi
	movl	%r9d, 16(%rsp)
	cltd
	movl	%r8d, 12(%rsp)
	idivl	%esi
	movq	stdout(%rip), %rsi
	movslq	%edx, %rdx
	movsbl	0(%rbp,%rdx), %edi
	call	putc@PLT
	movl	16(%rsp), %r9d
	movl	12(%rsp), %r8d
	jmp	.L45
.L77:
	cltd
	idivl	%edi
	testl	%eax, %eax
	je	.L48
	movl	%eax, %edi
	movl	%esi, 28(%rsp)
	movl	%r11d, 24(%rsp)
	movl	%r10d, 20(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%r8d, 12(%rsp)
	call	oct.part.0
	movl	28(%rsp), %esi
	movl	24(%rsp), %r11d
	movl	20(%rsp), %r10d
	movl	16(%rsp), %r9d
	movl	12(%rsp), %r8d
.L48:
	movl	%esi, %eax
	movl	$8, %esi
	movl	%r11d, 24(%rsp)
	cltd
	movl	%r10d, 20(%rsp)
	idivl	%esi
	movq	stdout(%rip), %rsi
	movl	%r9d, 16(%rsp)
	movl	%r8d, 12(%rsp)
	movslq	%edx, %rdx
	movsbl	0(%rbp,%rdx), %edi
	call	putc@PLT
	movl	24(%rsp), %r11d
	movl	20(%rsp), %r10d
	movl	16(%rsp), %r9d
	movl	12(%rsp), %r8d
	jmp	.L47
.L76:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	oc
	.data
	.align 8
	.type	oc, @object
	.size	oc, 9
oc:
	.string	"01235789"
	.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
	.p2align 4
	.type	oct.part.0, @function
oct.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	testl	%edi, %edi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	oc(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leal	7(%rdi), %ebp
	cmovns	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edi, %ebx
	sarl	$3, %ebp
	jne	.L20
.L2:
	movl	%ebx, %eax
	movq	stdout(%rip), %rsi
	sarl	$31, %eax
	shrl	$29, %eax
	addl	%eax, %ebx
	andl	$7, %ebx
	subl	%eax, %ebx
	movslq	%ebx, %rbx
	movsbl	0(%r13,%rbx), %edi
	popq	%rbx
	.cfi_remember_state
	.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
	jmp	putc@PLT
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	testl	%ebp, %ebp
	leal	7(%rbp), %r12d
	cmovns	%ebp, %r12d
	sarl	$3, %r12d
	je	.L3
	testl	%r12d, %r12d
	leal	7(%r12), %r14d
	cmovns	%r12d, %r14d
	sarl	$3, %r14d
	jne	.L21
.L4:
	movl	%r12d, %edx
	movq	stdout(%rip), %rsi
	sarl	$31, %edx
	shrl	$29, %edx
	leal	(%r12,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%r13,%rax), %edi
	call	putc@PLT
.L3:
	movl	%ebp, %eax
	movq	stdout(%rip), %rsi
	sarl	$31, %eax
	shrl	$29, %eax
	addl	%eax, %ebp
	andl	$7, %ebp
	subl	%eax, %ebp
	movslq	%ebp, %rbp
	movsbl	0(%r13,%rbp), %edi
	call	putc@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L21:
	testl	%r14d, %r14d
	leal	7(%r14), %edi
	cmovns	%r14d, %edi
	sarl	$3, %edi
	je	.L5
	call	oct.part.0
.L5:
	movl	%r14d, %edx
	leaq	oc(%rip), %r13
	movq	stdout(%rip), %rsi
	sarl	$31, %edx
	shrl	$29, %edx
	leal	(%r14,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%r13,%rax), %edi
	call	putc@PLT
	jmp	.L4
	.cfi_endproc
.LFE25:
	.size	oct.part.0, .-oct.part.0
	.p2align 4
	.globl	oct
	.type	oct, @function
oct:
.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
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	testl	%edi, %edi
	jne	.L37
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	leal	7(%rdi), %ebp
	movl	%edi, %ebx
	leaq	oc(%rip), %r13
	cmovns	%edi, %ebp
	sarl	$3, %ebp
	je	.L24
	testl	%ebp, %ebp
	leal	7(%rbp), %r12d
	cmovns	%ebp, %r12d
	sarl	$3, %r12d
	jne	.L38
.L25:
	movl	%ebp, %edx
	movq	stdout(%rip), %rsi
	sarl	$31, %edx
	shrl	$29, %edx
	leal	0(%rbp,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%r13,%rax), %edi
	call	putc@PLT
.L24:
	movl	%ebx, %eax
	movq	stdout(%rip), %rsi
	sarl	$31, %eax
	shrl	$29, %eax
	addl	%eax, %ebx
	andl	$7, %ebx
	subl	%eax, %ebx
	movslq	%ebx, %rbx
	movsbl	0(%r13,%rbx), %edi
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
	jmp	putc@PLT
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	testl	%r12d, %r12d
	leal	7(%r12), %edi
	cmovns	%r12d, %edi
	sarl	$3, %edi
	je	.L26
	call	oct.part.0
.L26:
	movl	%r12d, %edx
	leaq	oc(%rip), %r13
	movq	stdout(%rip), %rsi
	sarl	$31, %edx
	shrl	$29, %edx
	leal	(%r12,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%r13,%rax), %edi
	call	putc@PLT
	jmp	.L25
	.cfi_endproc
.LFE23:
	.size	oct, .-oct
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	""
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	oc(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L40:
	xorl	%eax, %eax
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L50
	movl	36(%rsp), %ebx
	testl	%ebx, %ebx
	je	.L50
	leal	7(%rbx), %ecx
	cmovns	%ebx, %ecx
	sarl	$3, %ecx
	movl	%ecx, %r15d
	je	.L42
	testl	%ecx, %ecx
	leal	7(%rcx), %r8d
	cmovns	%ecx, %r8d
	sarl	$3, %r8d
	je	.L43
	testl	%r8d, %r8d
	leal	7(%r8), %r9d
	cmovns	%r8d, %r9d
	sarl	$3, %r9d
	je	.L44
	testl	%r9d, %r9d
	leal	7(%r9), %eax
	cmovns	%r9d, %eax
	sarl	$3, %eax
	movl	%eax, %r10d
	jne	.L75
.L45:
	movl	%r9d, %edx
	movq	stdout(%rip), %rsi
	movl	%r8d, 12(%rsp)
	sarl	$31, %edx
	shrl	$29, %edx
	leal	(%r9,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%rbp,%rax), %edi
	call	putc@PLT
	movl	12(%rsp), %r8d
.L44:
	movl	%r8d, %edx
	movq	stdout(%rip), %rsi
	sarl	$31, %edx
	shrl	$29, %edx
	leal	(%r8,%rdx), %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	movsbl	0(%rbp,%rax), %edi
	call	putc@PLT
.L43:
	movl	%r15d, %eax
	movq	stdout(%rip), %rsi
	sarl	$31, %eax
	shrl	$29, %eax
	leal	(%r15,%rax), %ecx
	andl	$7, %ecx
	subl	%eax, %ecx
	movslq	%ecx, %rcx
	movsbl	0(%rbp,%rcx), %edi
	call	putc@PLT
.L42:
	movl	%ebx, %eax
	movq	stdout(%rip), %rsi
	sarl	$31, %eax
	shrl	$29, %eax
	addl	%eax, %ebx
	andl	$7, %ebx
	subl	%eax, %ebx
	movslq	%ebx, %rbx
	movsbl	0(%rbp,%rbx), %edi
	call	putc@PLT
	movq	%r14, %rdi
	call	puts@PLT
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L50:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L76
	addq	$56, %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
.L75:
	.cfi_restore_state
	movl	$8, %edi
	cltd
	idivl	%edi
	movl	%eax, %r11d
	testl	%eax, %eax
	je	.L46
	cltd
	idivl	%edi
	movl	%eax, %esi
	testl	%eax, %eax
	jne	.L77
.L47:
	movl	%r11d, %eax
	movl	$8, %esi
	movl	%r10d, 20(%rsp)
	cltd
	movl	%r9d, 16(%rsp)
	idivl	%esi
	movq	stdout(%rip), %rsi
	movl	%r8d, 12(%rsp)
	movslq	%edx, %rdx
	movsbl	0(%rbp,%rdx), %edi
	call	putc@PLT
	movl	20(%rsp), %r10d
	movl	16(%rsp), %r9d
	movl	12(%rsp), %r8d
.L46:
	movl	%r10d, %eax
	movl	$8, %esi
	movl	%r9d, 16(%rsp)
	cltd
	movl	%r8d, 12(%rsp)
	idivl	%esi
	movq	stdout(%rip), %rsi
	movslq	%edx, %rdx
	movsbl	0(%rbp,%rdx), %edi
	call	putc@PLT
	movl	16(%rsp), %r9d
	movl	12(%rsp), %r8d
	jmp	.L45
.L77:
	cltd
	idivl	%edi
	testl	%eax, %eax
	je	.L48
	movl	%eax, %edi
	movl	%esi, 28(%rsp)
	movl	%r11d, 24(%rsp)
	movl	%r10d, 20(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%r8d, 12(%rsp)
	call	oct.part.0
	movl	28(%rsp), %esi
	movl	24(%rsp), %r11d
	movl	20(%rsp), %r10d
	movl	16(%rsp), %r9d
	movl	12(%rsp), %r8d
.L48:
	movl	%esi, %eax
	movl	$8, %esi
	movl	%r11d, 24(%rsp)
	cltd
	movl	%r10d, 20(%rsp)
	idivl	%esi
	movq	stdout(%rip), %rsi
	movl	%r9d, 16(%rsp)
	movl	%r8d, 12(%rsp)
	movslq	%edx, %rdx
	movsbl	0(%rbp,%rdx), %edi
	call	putc@PLT
	movl	24(%rsp), %r11d
	movl	20(%rsp), %r10d
	movl	16(%rsp), %r9d
	movl	12(%rsp), %r8d
	jmp	.L47
.L76:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	oc
	.data
	.align 8
	.type	oc, @object
	.size	oc, 9
oc:
	.string	"01235789"
	.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>

char oc[] = "01235789";

void oct(int a){
  if(a == 0)return;
  oct(a / 8);
  putchar(oc[a % 8]);
}

int main(){
  int a;
  while(scanf("%d", &a)){
    if(a == 0)return 0;
    oct(a);
    puts("");
  }  
}
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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

char oc[] = "01235789";

void oct(int a){
  if(a == 0)return;
  oct(a / 8);
  putchar(oc[a % 8]);
}

int main(){
  int a;
  while(scanf("%d", &a)){
    if(a == 0)return 0;
    oct(a);
    puts("");
  }  
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	oc
	.data
	.align 8
	.type	oc, @object
	.size	oc, 9
oc:
	.string	"01235789"
	.text
	.globl	oct
	.type	oct, @function
oct:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L4
	movl	-4(%rbp), %eax
	leal	7(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$3, %eax
	movl	%eax, %edi
	call	oct
	movl	-4(%rbp), %eax
	cltd
	shrl	$29, %edx
	addl	%edx, %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	leaq	oc(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	jmp	.L1
.L4:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	oct, .-oct
	.section	.rodata
.LC0:
	.string	""
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L9:
	movl	-12(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	jmp	.L8
.L7:
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	oct
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L9
	movl	$0, %eax
.L8:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.globl	oc
	.data
	.align 8
	.type	oc, @object
	.size	oc, 9
oc:
	.string	"01235789"
	.text
	.globl	oct
	.type	oct, @function
oct:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	cmpl	$0, -4(%rbp)
	je	.L4
	movl	-4(%rbp), %eax
	leal	7(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$3, %eax
	movl	%eax, %edi
	call	oct
	movl	-4(%rbp), %eax
	cltd
	shrl	$29, %edx
	addl	%edx, %eax
	andl	$7, %eax
	subl	%edx, %eax
	cltq
	leaq	oc(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	jmp	.L1
.L4:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	oct, .-oct
	.section	.rodata
.LC0:
	.string	""
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L9:
	movl	-12(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	movl	$0, %eax
	jmp	.L8
.L7:
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	oct
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	jne	.L9
	movl	$0, %eax
.L8:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
