Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
P(n){n/4&&P(n/4);putchar(48+n%4);}main(n){for(;scanf("%d",&n)+n;)puts("",P(n));}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	P
	.type	P, @function
P:
.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)
	movl	-4(%rbp), %eax
	addl	$3, %eax
	cmpl	$6, %eax
	jbe	.L3
	movl	-4(%rbp), %eax
	leal	3(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$2, %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	P
	testl	%eax, %eax
.L3:
	movl	-4(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	addl	$48, %eax
	movl	%eax, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	P, .-P
	.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
	movl	%edi, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	P
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L5:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L6
	movl	$0, %eax
	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
	.globl	P
	.type	P, @function
P:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%edi, %ebx
	addl	$3, %edi
	cmpl	$6, %edi
	ja	.L7
.L2:
	movl	%ebx, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%rbx,%rax), %edi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	andl	$3, %edi
	popq	%r12
	.cfi_def_cfa_offset 8
	subl	%eax, %edi
	addl	$48, %edi
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	testl	%ebx, %ebx
	cmovns	%ebx, %edi
	sarl	$2, %edi
	leal	3(%rdi), %eax
	movl	%edi, %ebp
	cmpl	$6, %eax
	ja	.L8
.L3:
	movl	%ebp, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	0(%rbp,%rax), %edi
	andl	$3, %edi
	subl	%eax, %edi
	addl	$48, %edi
	call	putchar@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	testl	%edi, %edi
	cmovns	%edi, %eax
	movl	%eax, %r12d
	sarl	$2, %r12d
	leal	3(%r12), %eax
	cmpl	$6, %eax
	ja	.L9
.L4:
	movl	%r12d, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%r12,%rax), %edi
	andl	$3, %edi
	subl	%eax, %edi
	addl	$48, %edi
	call	putchar@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L9:
	testl	%r12d, %r12d
	cmovns	%r12d, %eax
	movl	%eax, %edi
	xorl	%eax, %eax
	sarl	$2, %edi
	call	P
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	P, .-P
	.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:
.LFB1:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	%edi, 28(%rsp)
	leaq	28(%rsp), %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ebx, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%rbx,%rax), %edi
	andl	$3, %edi
	subl	%eax, %edi
	addl	$48, %edi
	call	putchar@PLT
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	puts@PLT
.L11:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	movl	28(%rsp), %ebx
	addl	%ebx, %eax
	je	.L22
	leal	3(%rbx), %edi
	cmpl	$6, %edi
	jbe	.L12
	testl	%ebx, %ebx
	cmovns	%ebx, %edi
	sarl	$2, %edi
	leal	3(%rdi), %eax
	movl	%edi, %r14d
	cmpl	$6, %eax
	ja	.L23
.L13:
	movl	%r14d, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%r14,%rax), %edi
	andl	$3, %edi
	subl	%eax, %edi
	addl	$48, %edi
	call	putchar@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L22:
	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
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	testl	%edi, %edi
	cmovns	%edi, %eax
	movl	%eax, %edi
	sarl	$2, %edi
	leal	3(%rdi), %eax
	movl	%edi, %r15d
	cmpl	$6, %eax
	ja	.L24
.L14:
	movl	%r15d, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%r15,%rax), %edi
	andl	$3, %edi
	subl	%eax, %edi
	addl	$48, %edi
	call	putchar@PLT
	jmp	.L13
.L24:
	movl	%r15d, %eax
	movl	$4, %edi
	cltd
	idivl	%edi
	movl	%eax, %esi
	leal	3(%rax), %eax
	cmpl	$6, %eax
	ja	.L25
.L15:
	movl	%esi, %eax
	movl	$4, %edi
	cltd
	idivl	%edi
	leal	48(%rdx), %edi
	call	putchar@PLT
	jmp	.L14
.L25:
	movl	%esi, %eax
	cltd
	idivl	%edi
	movl	%eax, %r8d
	leal	3(%rax), %eax
	cmpl	$6, %eax
	ja	.L26
.L16:
	movl	%r8d, %eax
	movl	$4, %edi
	movl	%esi, 8(%rsp)
	cltd
	idivl	%edi
	leal	48(%rdx), %edi
	call	putchar@PLT
	movl	8(%rsp), %esi
	jmp	.L15
.L26:
	movl	%r8d, %eax
	cltd
	idivl	%edi
	movl	%eax, %r9d
	leal	3(%rax), %eax
	cmpl	$6, %eax
	ja	.L27
.L17:
	movl	%r9d, %eax
	movl	$4, %edi
	movl	%r8d, 12(%rsp)
	cltd
	movl	%esi, 8(%rsp)
	idivl	%edi
	leal	48(%rdx), %edi
	call	putchar@PLT
	movl	12(%rsp), %r8d
	movl	8(%rsp), %esi
	jmp	.L16
.L27:
	movl	%r9d, %eax
	cltd
	idivl	%edi
	movl	%eax, 8(%rsp)
	addl	$3, %eax
	cmpl	$6, %eax
	ja	.L28
.L18:
	movl	8(%rsp), %eax
	movl	$4, %edi
	movl	%r9d, 20(%rsp)
	movl	%r8d, 16(%rsp)
	cltd
	movl	%esi, 12(%rsp)
	idivl	%edi
	leal	48(%rdx), %edi
	call	putchar@PLT
	movl	20(%rsp), %r9d
	movl	16(%rsp), %r8d
	movl	12(%rsp), %esi
	jmp	.L17
.L28:
	movl	8(%rsp), %eax
	cltd
	idivl	%edi
	movl	%eax, %r10d
	leal	3(%rax), %eax
	cmpl	$6, %eax
	ja	.L29
.L19:
	movl	%r10d, %eax
	movl	$4, %edi
	movl	%r9d, 20(%rsp)
	cltd
	movl	%r8d, 16(%rsp)
	idivl	%edi
	movl	%esi, 12(%rsp)
	leal	48(%rdx), %edi
	call	putchar@PLT
	movl	20(%rsp), %r9d
	movl	16(%rsp), %r8d
	movl	12(%rsp), %esi
	jmp	.L18
.L29:
	movl	%r10d, %eax
	movl	%r9d, 24(%rsp)
	cltd
	movl	%r8d, 20(%rsp)
	idivl	%edi
	movl	%esi, 16(%rsp)
	movl	%r10d, 12(%rsp)
	movl	%eax, %edi
	xorl	%eax, %eax
	call	P
	movl	24(%rsp), %r9d
	movl	20(%rsp), %r8d
	movl	16(%rsp), %esi
	movl	12(%rsp), %r10d
	jmp	.L19
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	P
	.type	P, @function
P:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%edi, %ebx
	addl	$3, %edi
	cmpl	$6, %edi
	ja	.L7
.L2:
	movl	%ebx, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%rbx,%rax), %edi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	andl	$3, %edi
	popq	%r12
	.cfi_def_cfa_offset 8
	subl	%eax, %edi
	addl	$48, %edi
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	testl	%ebx, %ebx
	cmovns	%ebx, %edi
	sarl	$2, %edi
	leal	3(%rdi), %eax
	movl	%edi, %ebp
	cmpl	$6, %eax
	ja	.L8
.L3:
	movl	%ebp, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	0(%rbp,%rax), %edi
	andl	$3, %edi
	subl	%eax, %edi
	addl	$48, %edi
	call	putchar@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	testl	%edi, %edi
	cmovns	%edi, %eax
	movl	%eax, %r12d
	sarl	$2, %r12d
	leal	3(%r12), %eax
	cmpl	$6, %eax
	ja	.L9
.L4:
	movl	%r12d, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%r12,%rax), %edi
	andl	$3, %edi
	subl	%eax, %edi
	addl	$48, %edi
	call	putchar@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L9:
	testl	%r12d, %r12d
	cmovns	%r12d, %eax
	movl	%eax, %edi
	xorl	%eax, %eax
	sarl	$2, %edi
	call	P
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	P, .-P
	.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:
.LFB1:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movl	%edi, 28(%rsp)
	leaq	28(%rsp), %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%ebx, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%rbx,%rax), %edi
	andl	$3, %edi
	subl	%eax, %edi
	addl	$48, %edi
	call	putchar@PLT
	xorl	%esi, %esi
	movq	%r13, %rdi
	call	puts@PLT
.L11:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	movl	28(%rsp), %ebx
	addl	%ebx, %eax
	je	.L22
	leal	3(%rbx), %edi
	cmpl	$6, %edi
	jbe	.L12
	testl	%ebx, %ebx
	cmovns	%ebx, %edi
	sarl	$2, %edi
	leal	3(%rdi), %eax
	movl	%edi, %r14d
	cmpl	$6, %eax
	ja	.L23
.L13:
	movl	%r14d, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%r14,%rax), %edi
	andl	$3, %edi
	subl	%eax, %edi
	addl	$48, %edi
	call	putchar@PLT
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L22:
	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
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_restore_state
	testl	%edi, %edi
	cmovns	%edi, %eax
	movl	%eax, %edi
	sarl	$2, %edi
	leal	3(%rdi), %eax
	movl	%edi, %r15d
	cmpl	$6, %eax
	ja	.L24
.L14:
	movl	%r15d, %eax
	sarl	$31, %eax
	shrl	$30, %eax
	leal	(%r15,%rax), %edi
	andl	$3, %edi
	subl	%eax, %edi
	addl	$48, %edi
	call	putchar@PLT
	jmp	.L13
.L24:
	movl	%r15d, %eax
	movl	$4, %edi
	cltd
	idivl	%edi
	movl	%eax, %esi
	leal	3(%rax), %eax
	cmpl	$6, %eax
	ja	.L25
.L15:
	movl	%esi, %eax
	movl	$4, %edi
	cltd
	idivl	%edi
	leal	48(%rdx), %edi
	call	putchar@PLT
	jmp	.L14
.L25:
	movl	%esi, %eax
	cltd
	idivl	%edi
	movl	%eax, %r8d
	leal	3(%rax), %eax
	cmpl	$6, %eax
	ja	.L26
.L16:
	movl	%r8d, %eax
	movl	$4, %edi
	movl	%esi, 8(%rsp)
	cltd
	idivl	%edi
	leal	48(%rdx), %edi
	call	putchar@PLT
	movl	8(%rsp), %esi
	jmp	.L15
.L26:
	movl	%r8d, %eax
	cltd
	idivl	%edi
	movl	%eax, %r9d
	leal	3(%rax), %eax
	cmpl	$6, %eax
	ja	.L27
.L17:
	movl	%r9d, %eax
	movl	$4, %edi
	movl	%r8d, 12(%rsp)
	cltd
	movl	%esi, 8(%rsp)
	idivl	%edi
	leal	48(%rdx), %edi
	call	putchar@PLT
	movl	12(%rsp), %r8d
	movl	8(%rsp), %esi
	jmp	.L16
.L27:
	movl	%r9d, %eax
	cltd
	idivl	%edi
	movl	%eax, 8(%rsp)
	addl	$3, %eax
	cmpl	$6, %eax
	ja	.L28
.L18:
	movl	8(%rsp), %eax
	movl	$4, %edi
	movl	%r9d, 20(%rsp)
	movl	%r8d, 16(%rsp)
	cltd
	movl	%esi, 12(%rsp)
	idivl	%edi
	leal	48(%rdx), %edi
	call	putchar@PLT
	movl	20(%rsp), %r9d
	movl	16(%rsp), %r8d
	movl	12(%rsp), %esi
	jmp	.L17
.L28:
	movl	8(%rsp), %eax
	cltd
	idivl	%edi
	movl	%eax, %r10d
	leal	3(%rax), %eax
	cmpl	$6, %eax
	ja	.L29
.L19:
	movl	%r10d, %eax
	movl	$4, %edi
	movl	%r9d, 20(%rsp)
	cltd
	movl	%r8d, 16(%rsp)
	idivl	%edi
	movl	%esi, 12(%rsp)
	leal	48(%rdx), %edi
	call	putchar@PLT
	movl	20(%rsp), %r9d
	movl	16(%rsp), %r8d
	movl	12(%rsp), %esi
	jmp	.L18
.L29:
	movl	%r10d, %eax
	movl	%r9d, 24(%rsp)
	cltd
	movl	%r8d, 20(%rsp)
	idivl	%edi
	movl	%esi, 16(%rsp)
	movl	%r10d, 12(%rsp)
	movl	%eax, %edi
	xorl	%eax, %eax
	call	P
	movl	24(%rsp), %r9d
	movl	20(%rsp), %r8d
	movl	16(%rsp), %esi
	movl	12(%rsp), %r10d
	jmp	.L19
	.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:

P(n){n/4&&P(n/4);putchar(48+n%4);}main(n){for(;scanf("%d",&n)+n;)puts("",P(n));}
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
P(n){n/4&&P(n/4);putchar(48+n%4);}main(n){for(;scanf("%d",&n)+n;)puts("",P(n));}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	P
	.type	P, @function
P:
.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)
	movl	-4(%rbp), %eax
	addl	$3, %eax
	cmpl	$6, %eax
	jbe	.L3
	movl	-4(%rbp), %eax
	leal	3(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$2, %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	P
	testl	%eax, %eax
.L3:
	movl	-4(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	addl	$48, %eax
	movl	%eax, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	P, .-P
	.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
	movl	%edi, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	P
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L5:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L6
	movl	$0, %eax
	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	P
	.type	P, @function
P:
.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)
	movl	-4(%rbp), %eax
	addl	$3, %eax
	cmpl	$6, %eax
	jbe	.L3
	movl	-4(%rbp), %eax
	leal	3(%rax), %edx
	testl	%eax, %eax
	cmovs	%edx, %eax
	sarl	$2, %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	P
	testl	%eax, %eax
.L3:
	movl	-4(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	addl	$48, %eax
	movl	%eax, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	P, .-P
	.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
	movl	%edi, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	P
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L5:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L6
	movl	$0, %eax
	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:
