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 p(int* x, int* y, int n)
{
    *x = n % 10;
    while (n) 
    {
        if (n / 10 == 0)
        {
            *y = n;
        }
        n /= 10;
    }
}
int main()
{
    int  count = 0, i, j, n;
    int std;
    int x1, y1, x2, y2;
    scanf("%d", &n);
    if(n < 10)
    {
        printf("%d\n", n);
    }
    else
    {
        std = (n / 10) * (n / 10) + 8;
        for (i = n / 10 * 10 + 1; i <= n; i++)
        {
            p(&x1, &y1, i);
            for (j = 1; j <= n; j++) 
            {
                p(&x2, &y2, j);
                if (x1 == y2 && x2 == y1)
                {
                    if (j == i)
                    {
                        count++;
                    }
                    else
                    {
                        count += 2;
                    }
                }
            }
        }
        printf("%d\n", count + std);
    }
    return 0;
}```

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
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movl	%edx, -20(%rbp)
	movl	-20(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	jmp	.L2
.L4:
	movl	-20(%rbp), %eax
	addl	$9, %eax
	cmpl	$18, %eax
	ja	.L3
	movq	-16(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
.L3:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
.L2:
	cmpl	$0, -20(%rbp)
	jne	.L4
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	p, .-p
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cmpl	$9, %eax
	jg	.L6
	movl	-44(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	imull	%ecx, %eax
	addl	$8, %eax
	movl	%eax, -12(%rbp)
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L13:
	movl	-20(%rbp), %edx
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	p
	movl	$1, -16(%rbp)
	jmp	.L9
.L12:
	movl	-16(%rbp), %edx
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	p
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L11
	addl	$1, -24(%rbp)
	jmp	.L10
.L11:
	addl	$2, -24(%rbp)
.L10:
	addl	$1, -16(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L12
	addl	$1, -20(%rbp)
.L8:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	movl	%edx, %ecx
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, (%rdi)
	testl	%edx, %edx
	je	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	leal	9(%rdx), %eax
	cmpl	$18, %eax
	ja	.L3
	movl	%edx, (%rsi)
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	movl	%eax, %edx
	jne	.L4
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	p, .-p
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	cmpl	$9, %edx
	jle	.L34
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	movl	%eax, %ecx
	imull	%eax, %ecx
	leal	(%rax,%rax,4), %eax
	leal	1(%rax,%rax), %r11d
	leal	8(%rcx), %r12d
	cmpl	%r11d, %edx
	jl	.L22
	leal	1(%rdx), %r10d
	xorl	%ebp, %ebp
	movl	$3435973837, %esi
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%r11d, %r9d
	movl	%r11d, %edx
	imulq	%rsi, %r9
	shrq	$35, %r9
	leal	(%r9,%r9,4), %eax
	movl	%r11d, %r9d
	addl	%eax, %eax
	subl	%eax, %r9d
	.p2align 4,,10
	.p2align 3
.L15:
	leal	9(%rdx), %eax
	movl	%edx, %ecx
	cmpl	$18, %eax
	movslq	%edx, %rax
	cmovbe	%edx, %ebx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	movl	%eax, %edx
	jne	.L15
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%r8d, %edi
	imulq	%rsi, %rdi
	shrq	$35, %rdi
	leal	(%rdi,%rdi,4), %eax
	movl	%r8d, %edi
	addl	%eax, %eax
	subl	%eax, %edi
	movl	%r8d, %eax
	.p2align 4,,10
	.p2align 3
.L30:
	leal	9(%rax), %ecx
	movl	%eax, %eax
	movq	%rax, %rdx
	imulq	%rsi, %rax
	shrq	$35, %rax
	cmpl	$18, %ecx
	ja	.L30
	testl	%eax, %eax
	jne	.L30
	cmpl	%edx, %r9d
	jne	.L17
	cmpl	%ebx, %edi
	je	.L35
.L17:
	addl	$1, %r8d
	cmpl	%r10d, %r8d
	jne	.L19
	addl	$1, %r11d
	cmpl	%r10d, %r11d
	jne	.L20
.L13:
	leal	(%r12,%rbp), %edx
.L34:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	movl	%ebp, %eax
	xorl	%ebp, %ebp
	cmpl	%r8d, %r11d
	setne	%bpl
	leal	1(%rbp,%rax), %ebp
	jmp	.L17
.L22:
	xorl	%ebp, %ebp
	jmp	.L13
.L36:
	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
	.p2align 4
	.globl	p
	.type	p, @function
p:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	movl	%edx, %ecx
	leal	(%rax,%rax,4), %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, (%rdi)
	testl	%edx, %edx
	je	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	leal	9(%rdx), %eax
	cmpl	$18, %eax
	ja	.L3
	movl	%edx, (%rsi)
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	movl	%eax, %edx
	jne	.L4
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	p, .-p
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	cmpl	$9, %edx
	jle	.L34
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	movl	%eax, %ecx
	imull	%eax, %ecx
	leal	(%rax,%rax,4), %eax
	leal	1(%rax,%rax), %r11d
	leal	8(%rcx), %r12d
	cmpl	%r11d, %edx
	jl	.L22
	leal	1(%rdx), %r10d
	xorl	%ebp, %ebp
	movl	$3435973837, %esi
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%r11d, %r9d
	movl	%r11d, %edx
	imulq	%rsi, %r9
	shrq	$35, %r9
	leal	(%r9,%r9,4), %eax
	movl	%r11d, %r9d
	addl	%eax, %eax
	subl	%eax, %r9d
	.p2align 4,,10
	.p2align 3
.L15:
	leal	9(%rdx), %eax
	movl	%edx, %ecx
	cmpl	$18, %eax
	movslq	%edx, %rax
	cmovbe	%edx, %ebx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	movl	%eax, %edx
	jne	.L15
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%r8d, %edi
	imulq	%rsi, %rdi
	shrq	$35, %rdi
	leal	(%rdi,%rdi,4), %eax
	movl	%r8d, %edi
	addl	%eax, %eax
	subl	%eax, %edi
	movl	%r8d, %eax
	.p2align 4,,10
	.p2align 3
.L30:
	leal	9(%rax), %ecx
	movl	%eax, %eax
	movq	%rax, %rdx
	imulq	%rsi, %rax
	shrq	$35, %rax
	cmpl	$18, %ecx
	ja	.L30
	testl	%eax, %eax
	jne	.L30
	cmpl	%edx, %r9d
	jne	.L17
	cmpl	%ebx, %edi
	je	.L35
.L17:
	addl	$1, %r8d
	cmpl	%r10d, %r8d
	jne	.L19
	addl	$1, %r11d
	cmpl	%r10d, %r11d
	jne	.L20
.L13:
	leal	(%r12,%rbp), %edx
.L34:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	movl	%ebp, %eax
	xorl	%ebp, %ebp
	cmpl	%r8d, %r11d
	setne	%bpl
	leal	1(%rbp,%rax), %ebp
	jmp	.L17
.L22:
	xorl	%ebp, %ebp
	jmp	.L13
.L36:
	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 p(int* x, int* y, int n)
{
    *x = n % 10;
    while (n) 
    {
        if (n / 10 == 0)
        {
            *y = n;
        }
        n /= 10;
    }
}
int main()
{
    int  count = 0, i, j, n;
    int std;
    int x1, y1, x2, y2;
    scanf("%d", &n);
    if(n < 10)
    {
        printf("%d\n", n);
    }
    else
    {
        std = (n / 10) * (n / 10) + 8;
        for (i = n / 10 * 10 + 1; i <= n; i++)
        {
            p(&x1, &y1, i);
            for (j = 1; j <= n; j++) 
            {
                p(&x2, &y2, j);
                if (x1 == y2 && x2 == y1)
                {
                    if (j == i)
                    {
                        count++;
                    }
                    else
                    {
                        count += 2;
                    }
                }
            }
        }
        printf("%d\n", count + std);
    }
    return 0;
}
73
 3093
 50
 101
 0
 11
 1020
 78
 001
 6

63
 95976
 33
 113
 0
 12
 10412
 72
 1
 6

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 p(int* x, int* y, int n)
{
    *x = n % 10;
    while (n) 
    {
        if (n / 10 == 0)
        {
            *y = n;
        }
        n /= 10;
    }
}
int main()
{
    int  count = 0, i, j, n;
    int std;
    int x1, y1, x2, y2;
    scanf("%d", &n);
    if(n < 10)
    {
        printf("%d\n", n);
    }
    else
    {
        std = (n / 10) * (n / 10) + 8;
        for (i = n / 10 * 10 + 1; i <= n; i++)
        {
            p(&x1, &y1, i);
            for (j = 1; j <= n; j++) 
            {
                p(&x2, &y2, j);
                if (x1 == y2 && x2 == y1)
                {
                    if (j == i)
                    {
                        count++;
                    }
                    else
                    {
                        count += 2;
                    }
                }
            }
        }
        printf("%d\n", count + std);
    }
    return 0;
}```

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
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movl	%edx, -20(%rbp)
	movl	-20(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	jmp	.L2
.L4:
	movl	-20(%rbp), %eax
	addl	$9, %eax
	cmpl	$18, %eax
	ja	.L3
	movq	-16(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
.L3:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
.L2:
	cmpl	$0, -20(%rbp)
	jne	.L4
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	p, .-p
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cmpl	$9, %eax
	jg	.L6
	movl	-44(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	imull	%ecx, %eax
	addl	$8, %eax
	movl	%eax, -12(%rbp)
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L13:
	movl	-20(%rbp), %edx
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	p
	movl	$1, -16(%rbp)
	jmp	.L9
.L12:
	movl	-16(%rbp), %edx
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	p
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L11
	addl	$1, -24(%rbp)
	jmp	.L10
.L11:
	addl	$2, -24(%rbp)
.L10:
	addl	$1, -16(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L12
	addl	$1, -20(%rbp)
.L8:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movl	%edx, -20(%rbp)
	movl	-20(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	movq	-8(%rbp), %rax
	movl	%edx, (%rax)
	jmp	.L2
.L4:
	movl	-20(%rbp), %eax
	addl	$9, %eax
	cmpl	$18, %eax
	ja	.L3
	movq	-16(%rbp), %rax
	movl	-20(%rbp), %edx
	movl	%edx, (%rax)
.L3:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -20(%rbp)
.L2:
	cmpl	$0, -20(%rbp)
	jne	.L4
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	p, .-p
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -24(%rbp)
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	cmpl	$9, %eax
	jg	.L6
	movl	-44(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	imull	%ecx, %eax
	addl	$8, %eax
	movl	%eax, -12(%rbp)
	movl	-44(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$2, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
	jmp	.L8
.L13:
	movl	-20(%rbp), %edx
	leaq	-36(%rbp), %rcx
	leaq	-40(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	p
	movl	$1, -16(%rbp)
	jmp	.L9
.L12:
	movl	-16(%rbp), %edx
	leaq	-28(%rbp), %rcx
	leaq	-32(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	p
	movl	-40(%rbp), %edx
	movl	-28(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L10
	movl	-16(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jne	.L11
	addl	$1, -24(%rbp)
	jmp	.L10
.L11:
	addl	$2, -24(%rbp)
.L10:
	addl	$1, -16(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jle	.L12
	addl	$1, -20(%rbp)
.L8:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	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:
