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>
 
void f(int n)
{
    if(!n)
        return;
    f(n/4);
    printf("%d",n%4);
}
int main()
{
    int s;
    for(;scanf("%d",&s),s!=-1;s?f(s):printf("%d",0),puts(""));
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	f
	.type	f, @function
f:
.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	3(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$2, %eax
	movl	%eax, %edi
	call	f
	movl	-4(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L1
.L4:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC1:
	.string	""
	.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
	je	.L7
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	f
	jmp	.L8
.L7:
	movl	$0, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	cmpl	$-1, %eax
	jne	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.text
	.p2align 4
	.type	f.part.0, @function
f.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	.LC0(%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	3(%rdi), %ebp
	cmovns	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edi, %ebx
	sarl	$2, %ebp
	jne	.L20
.L2:
	movl	%ebx, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%rbx,%rax), %edx
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	andl	$3, %edx
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	subl	%eax, %edx
	popq	%r14
	.cfi_def_cfa_offset 8
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	testl	%ebp, %ebp
	leal	3(%rbp), %r12d
	cmovns	%ebp, %r12d
	sarl	$2, %r12d
	je	.L3
	testl	%r12d, %r12d
	leal	3(%r12), %r14d
	cmovns	%r12d, %r14d
	sarl	$2, %r14d
	jne	.L21
.L4:
	movl	%r12d, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%r12,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L3:
	movl	%ebp, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	0(%rbp,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L21:
	testl	%r14d, %r14d
	leal	3(%r14), %edi
	cmovns	%r14d, %edi
	sarl	$2, %edi
	je	.L5
	call	f.part.0
.L5:
	movl	%r14d, %eax
	leaq	.LC0(%rip), %r13
	movl	$1, %edi
	sarl	$31, %eax
	movq	%r13, %rsi
	shrl	$30, %eax
	leal	(%r14,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.cfi_endproc
.LFE25:
	.size	f.part.0, .-f.part.0
	.p2align 4
	.globl	f
	.type	f, @function
f:
.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	3(%rdi), %ebp
	movl	%edi, %ebx
	leaq	.LC0(%rip), %r13
	cmovns	%edi, %ebp
	sarl	$2, %ebp
	je	.L24
	testl	%ebp, %ebp
	leal	3(%rbp), %r12d
	cmovns	%ebp, %r12d
	sarl	$2, %r12d
	jne	.L38
.L25:
	movl	%ebp, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	0(%rbp,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L24:
	movl	%ebx, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%r13, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%rbx,%rax), %edx
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	andl	$3, %edx
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	subl	%eax, %edx
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	testl	%r12d, %r12d
	leal	3(%r12), %edi
	cmovns	%r12d, %edi
	sarl	$2, %edi
	je	.L26
	call	f.part.0
.L26:
	movl	%r12d, %eax
	leaq	.LC0(%rip), %r13
	movl	$1, %edi
	sarl	$31, %eax
	movq	%r13, %rsi
	shrl	$30, %eax
	leal	(%r12,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L25
	.cfi_endproc
.LFE23:
	.size	f, .-f
	.section	.rodata.str1.1
.LC1:
	.string	""
	.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	.LC1(%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	.LC0(%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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L40:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebx
	cmpl	$-1, %ebx
	je	.L70
	testl	%ebx, %ebx
	je	.L41
	leal	3(%rbx), %ebp
	cmovns	%ebx, %ebp
	sarl	$2, %ebp
	je	.L42
	testl	%ebp, %ebp
	leal	3(%rbp), %r15d
	cmovns	%ebp, %r15d
	sarl	$2, %r15d
	je	.L43
	testl	%r15d, %r15d
	leal	3(%r15), %eax
	cmovns	%r15d, %eax
	sarl	$2, %eax
	movl	%eax, %ecx
	jne	.L71
.L44:
	movl	%r15d, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%r15,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L43:
	movl	%ebp, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	0(%rbp,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L42:
	movl	%ebx, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%rbx,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L48:
	movq	%r14, %rdi
	call	puts@PLT
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L41:
	xorl	%edx, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L70:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L72
	addq	$40, %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
.L71:
	.cfi_restore_state
	movl	$4, %esi
	cltd
	idivl	%esi
	movl	%eax, %r8d
	testl	%eax, %eax
	je	.L45
	cltd
	idivl	%esi
	movl	%eax, %r9d
	testl	%eax, %eax
	jne	.L73
.L46:
	movl	%r8d, %eax
	movl	$4, %esi
	movl	$1, %edi
	movl	%ecx, 4(%rsp)
	cltd
	idivl	%esi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	4(%rsp), %ecx
.L45:
	movl	%ecx, %eax
	movl	$4, %esi
	movl	$1, %edi
	cltd
	idivl	%esi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L44
.L73:
	cltd
	idivl	%esi
	testl	%eax, %eax
	je	.L47
	movl	%eax, %edi
	movl	%r9d, 12(%rsp)
	movl	%r8d, 8(%rsp)
	movl	%ecx, 4(%rsp)
	call	f.part.0
	movl	12(%rsp), %r9d
	movl	8(%rsp), %r8d
	movl	4(%rsp), %ecx
.L47:
	movl	%r9d, %eax
	movl	$4, %esi
	movl	$1, %edi
	movl	%r8d, 8(%rsp)
	cltd
	movl	%ecx, 4(%rsp)
	idivl	%esi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	8(%rsp), %r8d
	movl	4(%rsp), %ecx
	jmp	.L46
.L72:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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"
	.text
	.p2align 4
	.type	f.part.0, @function
f.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	.LC0(%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	3(%rdi), %ebp
	cmovns	%edi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movl	%edi, %ebx
	sarl	$2, %ebp
	jne	.L20
.L2:
	movl	%ebx, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%rbx,%rax), %edx
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	andl	$3, %edx
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	subl	%eax, %edx
	popq	%r14
	.cfi_def_cfa_offset 8
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	testl	%ebp, %ebp
	leal	3(%rbp), %r12d
	cmovns	%ebp, %r12d
	sarl	$2, %r12d
	je	.L3
	testl	%r12d, %r12d
	leal	3(%r12), %r14d
	cmovns	%r12d, %r14d
	sarl	$2, %r14d
	jne	.L21
.L4:
	movl	%r12d, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%r12,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L3:
	movl	%ebp, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	0(%rbp,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L21:
	testl	%r14d, %r14d
	leal	3(%r14), %edi
	cmovns	%r14d, %edi
	sarl	$2, %edi
	je	.L5
	call	f.part.0
.L5:
	movl	%r14d, %eax
	leaq	.LC0(%rip), %r13
	movl	$1, %edi
	sarl	$31, %eax
	movq	%r13, %rsi
	shrl	$30, %eax
	leal	(%r14,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L4
	.cfi_endproc
.LFE25:
	.size	f.part.0, .-f.part.0
	.p2align 4
	.globl	f
	.type	f, @function
f:
.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	3(%rdi), %ebp
	movl	%edi, %ebx
	leaq	.LC0(%rip), %r13
	cmovns	%edi, %ebp
	sarl	$2, %ebp
	je	.L24
	testl	%ebp, %ebp
	leal	3(%rbp), %r12d
	cmovns	%ebp, %r12d
	sarl	$2, %r12d
	jne	.L38
.L25:
	movl	%ebp, %eax
	movq	%r13, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	0(%rbp,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L24:
	movl	%ebx, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%r13, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%rbx,%rax), %edx
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	andl	$3, %edx
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	subl	%eax, %edx
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	testl	%r12d, %r12d
	leal	3(%r12), %edi
	cmovns	%r12d, %edi
	sarl	$2, %edi
	je	.L26
	call	f.part.0
.L26:
	movl	%r12d, %eax
	leaq	.LC0(%rip), %r13
	movl	$1, %edi
	sarl	$31, %eax
	movq	%r13, %rsi
	shrl	$30, %eax
	leal	(%r12,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L25
	.cfi_endproc
.LFE23:
	.size	f, .-f
	.section	.rodata.str1.1
.LC1:
	.string	""
	.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	.LC1(%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	.LC0(%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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L40:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ebx
	cmpl	$-1, %ebx
	je	.L70
	testl	%ebx, %ebx
	je	.L41
	leal	3(%rbx), %ebp
	cmovns	%ebx, %ebp
	sarl	$2, %ebp
	je	.L42
	testl	%ebp, %ebp
	leal	3(%rbp), %r15d
	cmovns	%ebp, %r15d
	sarl	$2, %r15d
	je	.L43
	testl	%r15d, %r15d
	leal	3(%r15), %eax
	cmovns	%r15d, %eax
	sarl	$2, %eax
	movl	%eax, %ecx
	jne	.L71
.L44:
	movl	%r15d, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%r15,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L43:
	movl	%ebp, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	0(%rbp,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L42:
	movl	%ebx, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%rbx,%rax), %edx
	andl	$3, %edx
	subl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L48:
	movq	%r14, %rdi
	call	puts@PLT
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L41:
	xorl	%edx, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L48
	.p2align 4,,10
	.p2align 3
.L70:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L72
	addq	$40, %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
.L71:
	.cfi_restore_state
	movl	$4, %esi
	cltd
	idivl	%esi
	movl	%eax, %r8d
	testl	%eax, %eax
	je	.L45
	cltd
	idivl	%esi
	movl	%eax, %r9d
	testl	%eax, %eax
	jne	.L73
.L46:
	movl	%r8d, %eax
	movl	$4, %esi
	movl	$1, %edi
	movl	%ecx, 4(%rsp)
	cltd
	idivl	%esi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	4(%rsp), %ecx
.L45:
	movl	%ecx, %eax
	movl	$4, %esi
	movl	$1, %edi
	cltd
	idivl	%esi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L44
.L73:
	cltd
	idivl	%esi
	testl	%eax, %eax
	je	.L47
	movl	%eax, %edi
	movl	%r9d, 12(%rsp)
	movl	%r8d, 8(%rsp)
	movl	%ecx, 4(%rsp)
	call	f.part.0
	movl	12(%rsp), %r9d
	movl	8(%rsp), %r8d
	movl	4(%rsp), %ecx
.L47:
	movl	%r9d, %eax
	movl	$4, %esi
	movl	$1, %edi
	movl	%r8d, 8(%rsp)
	cltd
	movl	%ecx, 4(%rsp)
	idivl	%esi
	movq	%r12, %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	8(%rsp), %r8d
	movl	4(%rsp), %ecx
	jmp	.L46
.L72:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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>
 
void f(int n)
{
    if(!n)
        return;
    f(n/4);
    printf("%d",n%4);
}
int main()
{
    int s;
    for(;scanf("%d",&s),s!=-1;s?f(s):printf("%d",0),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>
 
void f(int n)
{
    if(!n)
        return;
    f(n/4);
    printf("%d",n%4);
}
int main()
{
    int s;
    for(;scanf("%d",&s),s!=-1;s?f(s):printf("%d",0),puts(""));
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	f
	.type	f, @function
f:
.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	3(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$2, %eax
	movl	%eax, %edi
	call	f
	movl	-4(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L1
.L4:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC1:
	.string	""
	.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
	je	.L7
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	f
	jmp	.L8
.L7:
	movl	$0, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	cmpl	$-1, %eax
	jne	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	f
	.type	f, @function
f:
.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	3(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$2, %eax
	movl	%eax, %edi
	call	f
	movl	-4(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L1
.L4:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	f, .-f
	.section	.rodata
.LC1:
	.string	""
	.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
	je	.L7
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	f
	jmp	.L8
.L7:
	movl	$0, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L8:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	cmpl	$-1, %eax
	jne	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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:
