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(int argc, const char * argv[]) {
    
    int n,i,j,sum=0,count=0,x=1,h=0;
    while (1) {
        
        scanf("%d",&n);
        
        if (n==0) {
            break;
        }
        for (h = 0; h < n; h++) {
            for (i = 1; i < n-h; i++) {
                for (j = n-h; j >= i; j--) {
                    sum+=j;
                }
            
                if (sum == n) {
                    count++;
                }
                sum=0;
            
            }
        }
        
        printf("%d\n",count);
        count=0;
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
.L11:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L2
	movdqa	.LC1(%rip), %xmm3
	jle	.L13
	movl	%r10d, %edi
	leal	-1(%r10), %r14d
	leal	-2(%r10), %r13d
	xorl	%r8d, %r8d
	leal	-3(%r10), %r12d
	movl	$1, %r11d
	cmpl	$1, %edi
	je	.L3
	.p2align 4,,10
	.p2align 3
.L15:
	movd	%r13d, %xmm5
	movd	%r12d, %xmm6
	movd	%edi, %xmm4
	movl	$1, %edx
	movd	%r14d, %xmm7
	leal	1(%rdi), %r9d
	punpckldq	%xmm6, %xmm5
	punpckldq	%xmm7, %xmm4
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r9d, %esi
	movl	%edi, %eax
	subl	%edx, %esi
	cmpl	%edx, %edi
	cmovl	%r11d, %esi
	subl	%edx, %eax
	cmpl	$9, %eax
	jbe	.L14
	cmpl	%edx, %edi
	jl	.L14
	movl	%esi, %ecx
	movdqa	%xmm4, %xmm1
	pxor	%xmm0, %xmm0
	xorl	%eax, %eax
	shrl	$2, %ecx
	punpcklqdq	%xmm5, %xmm1
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm1, %xmm2
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%ecx, %eax
	jne	.L6
	movdqa	%xmm0, %xmm1
	movl	%esi, %r15d
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %r15d
	paddd	%xmm1, %xmm0
	subl	%r15d, %ecx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r15d, %esi
	je	.L7
.L5:
	leal	-1(%rcx), %esi
	addl	%ecx, %eax
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-2(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-3(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-4(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-5(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-6(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-7(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-8(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	subl	$9, %ecx
	leal	(%rax,%rcx), %esi
	cmpl	%ecx, %edx
	cmovle	%esi, %eax
.L7:
	cmpl	%eax, %r10d
	sete	%al
	addl	$1, %edx
	movzbl	%al, %eax
	addl	%eax, %r8d
	cmpl	%edx, %edi
	jne	.L9
	subl	$1, %edi
	subl	$1, %r14d
	subl	$1, %r13d
	subl	$1, %r12d
	cmpl	$1, %edi
	jne	.L15
.L3:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%edi, %ecx
	xorl	%eax, %eax
	jmp	.L5
.L13:
	xorl	%r8d, %r8d
	jmp	.L3
.L2:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$24, %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
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	-4
	.long	-4
	.long	-4
	.long	-4
	.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"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
.L11:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L2
	movdqa	.LC1(%rip), %xmm3
	jle	.L13
	movl	%r10d, %edi
	leal	-1(%r10), %r14d
	leal	-2(%r10), %r13d
	xorl	%r8d, %r8d
	leal	-3(%r10), %r12d
	movl	$1, %r11d
	cmpl	$1, %edi
	je	.L3
	.p2align 4,,10
	.p2align 3
.L15:
	movd	%r13d, %xmm5
	movd	%r12d, %xmm6
	movd	%edi, %xmm4
	movl	$1, %edx
	movd	%r14d, %xmm7
	leal	1(%rdi), %r9d
	punpckldq	%xmm6, %xmm5
	punpckldq	%xmm7, %xmm4
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r9d, %esi
	movl	%edi, %eax
	subl	%edx, %esi
	cmpl	%edx, %edi
	cmovl	%r11d, %esi
	subl	%edx, %eax
	cmpl	$9, %eax
	jbe	.L14
	cmpl	%edx, %edi
	jl	.L14
	movl	%esi, %ecx
	movdqa	%xmm4, %xmm1
	pxor	%xmm0, %xmm0
	xorl	%eax, %eax
	shrl	$2, %ecx
	punpcklqdq	%xmm5, %xmm1
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm1, %xmm2
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%ecx, %eax
	jne	.L6
	movdqa	%xmm0, %xmm1
	movl	%esi, %r15d
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %r15d
	paddd	%xmm1, %xmm0
	subl	%r15d, %ecx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r15d, %esi
	je	.L7
.L5:
	leal	-1(%rcx), %esi
	addl	%ecx, %eax
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-2(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-3(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-4(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-5(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-6(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-7(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-8(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	subl	$9, %ecx
	leal	(%rax,%rcx), %esi
	cmpl	%ecx, %edx
	cmovle	%esi, %eax
.L7:
	cmpl	%eax, %r10d
	sete	%al
	addl	$1, %edx
	movzbl	%al, %eax
	addl	%eax, %r8d
	cmpl	%edx, %edi
	jne	.L9
	subl	$1, %edi
	subl	$1, %r14d
	subl	$1, %r13d
	subl	$1, %r12d
	cmpl	$1, %edi
	jne	.L15
.L3:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%edi, %ecx
	xorl	%eax, %eax
	jmp	.L5
.L13:
	xorl	%r8d, %r8d
	jmp	.L3
.L2:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$24, %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
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	-4
	.long	-4
	.long	-4
	.long	-4
	.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"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
.L11:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L2
	movdqa	.LC1(%rip), %xmm3
	jle	.L13
	movl	%r10d, %edi
	leal	-1(%r10), %r14d
	leal	-2(%r10), %r13d
	xorl	%r8d, %r8d
	leal	-3(%r10), %r12d
	movl	$1, %r11d
	cmpl	$1, %edi
	je	.L3
	.p2align 4,,10
	.p2align 3
.L15:
	movd	%r13d, %xmm5
	movd	%r12d, %xmm6
	movd	%edi, %xmm4
	movl	$1, %edx
	movd	%r14d, %xmm7
	leal	1(%rdi), %r9d
	punpckldq	%xmm6, %xmm5
	punpckldq	%xmm7, %xmm4
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r9d, %esi
	movl	%edi, %eax
	subl	%edx, %esi
	cmpl	%edx, %edi
	cmovl	%r11d, %esi
	subl	%edx, %eax
	cmpl	$9, %eax
	jbe	.L14
	cmpl	%edx, %edi
	jl	.L14
	movl	%esi, %ecx
	movdqa	%xmm4, %xmm1
	pxor	%xmm0, %xmm0
	xorl	%eax, %eax
	shrl	$2, %ecx
	punpcklqdq	%xmm5, %xmm1
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm1, %xmm2
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%ecx, %eax
	jne	.L6
	movdqa	%xmm0, %xmm1
	movl	%esi, %r15d
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %r15d
	paddd	%xmm1, %xmm0
	subl	%r15d, %ecx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r15d, %esi
	je	.L7
.L5:
	leal	-1(%rcx), %esi
	addl	%ecx, %eax
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-2(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-3(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-4(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-5(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-6(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-7(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-8(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	subl	$9, %ecx
	leal	(%rax,%rcx), %esi
	cmpl	%ecx, %edx
	cmovle	%esi, %eax
.L7:
	cmpl	%eax, %r10d
	sete	%al
	addl	$1, %edx
	movzbl	%al, %eax
	addl	%eax, %r8d
	cmpl	%edx, %edi
	jne	.L9
	subl	$1, %edi
	subl	$1, %r14d
	subl	$1, %r13d
	subl	$1, %r12d
	cmpl	$1, %edi
	jne	.L15
.L3:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%edi, %ecx
	xorl	%eax, %eax
	jmp	.L5
.L13:
	xorl	%r8d, %r8d
	jmp	.L3
.L2:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$24, %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
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	-4
	.long	-4
	.long	-4
	.long	-4
	.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(int argc, const char * argv[]) {
    
    int n,i,j,sum=0,count=0,x=1,h=0;
    while (1) {
        
        scanf("%d",&n);
        
        if (n==0) {
            break;
        }
        for (h = 0; h < n; h++) {
            for (i = 1; i < n-h; i++) {
                for (j = n-h; j >= i; j--) {
                    sum+=j;
                }
            
                if (sum == n) {
                    count++;
                }
                sum=0;
            
            }
        }
        
        printf("%d\n",count);
        count=0;
    }
    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(int argc, const char * argv[]) {
    
    int n,i,j,sum=0,count=0,x=1,h=0;
    while (1) {
        
        scanf("%d",&n);
        
        if (n==0) {
            break;
        }
        for (h = 0; h < n; h++) {
            for (i = 1; i < n-h; i++) {
                for (j = n-h; j >= i; j--) {
                    sum+=j;
                }
            
                if (sum == n) {
                    count++;
                }
                sum=0;
            
            }
        }
        
        printf("%d\n",count);
        count=0;
    }
    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:

9
256
0
 9
160
0
 9
213
0
 9
200
0
 9
135
0
 9
350
0
 9
0
-1
 9
162
0
 9
315
0
 9
225
0

2
0
 2
1
 2
3
 2
2
 2
7
 2
5
 2
 2
4
 2
11
 2
8

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(int argc, const char * argv[]) {
    
    int n,i,j,sum=0,count=0,x=1,h=0;
    while (1) {
        
        scanf("%d",&n);
        
        if (n==0) {
            break;
        }
        for (h = 0; h < n; h++) {
            for (i = 1; i < n-h; i++) {
                for (j = n-h; j >= i; j--) {
                    sum+=j;
                }
            
                if (sum == n) {
                    count++;
                }
                sum=0;
            
            }
        }
        
        printf("%d\n",count);
        count=0;
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
.L11:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L2
	movdqa	.LC1(%rip), %xmm3
	jle	.L13
	movl	%r10d, %edi
	leal	-1(%r10), %r14d
	leal	-2(%r10), %r13d
	xorl	%r8d, %r8d
	leal	-3(%r10), %r12d
	movl	$1, %r11d
	cmpl	$1, %edi
	je	.L3
	.p2align 4,,10
	.p2align 3
.L15:
	movd	%r13d, %xmm5
	movd	%r12d, %xmm6
	movd	%edi, %xmm4
	movl	$1, %edx
	movd	%r14d, %xmm7
	leal	1(%rdi), %r9d
	punpckldq	%xmm6, %xmm5
	punpckldq	%xmm7, %xmm4
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r9d, %esi
	movl	%edi, %eax
	subl	%edx, %esi
	cmpl	%edx, %edi
	cmovl	%r11d, %esi
	subl	%edx, %eax
	cmpl	$9, %eax
	jbe	.L14
	cmpl	%edx, %edi
	jl	.L14
	movl	%esi, %ecx
	movdqa	%xmm4, %xmm1
	pxor	%xmm0, %xmm0
	xorl	%eax, %eax
	shrl	$2, %ecx
	punpcklqdq	%xmm5, %xmm1
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm1, %xmm2
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%ecx, %eax
	jne	.L6
	movdqa	%xmm0, %xmm1
	movl	%esi, %r15d
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %r15d
	paddd	%xmm1, %xmm0
	subl	%r15d, %ecx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r15d, %esi
	je	.L7
.L5:
	leal	-1(%rcx), %esi
	addl	%ecx, %eax
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-2(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-3(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-4(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-5(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-6(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-7(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-8(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	subl	$9, %ecx
	leal	(%rax,%rcx), %esi
	cmpl	%ecx, %edx
	cmovle	%esi, %eax
.L7:
	cmpl	%eax, %r10d
	sete	%al
	addl	$1, %edx
	movzbl	%al, %eax
	addl	%eax, %r8d
	cmpl	%edx, %edi
	jne	.L9
	subl	$1, %edi
	subl	$1, %r14d
	subl	$1, %r13d
	subl	$1, %r12d
	cmpl	$1, %edi
	jne	.L15
.L3:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%edi, %ecx
	xorl	%eax, %eax
	jmp	.L5
.L13:
	xorl	%r8d, %r8d
	jmp	.L3
.L2:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$24, %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
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	-4
	.long	-4
	.long	-4
	.long	-4
	.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"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rbp
.L11:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L2
	movdqa	.LC1(%rip), %xmm3
	jle	.L13
	movl	%r10d, %edi
	leal	-1(%r10), %r14d
	leal	-2(%r10), %r13d
	xorl	%r8d, %r8d
	leal	-3(%r10), %r12d
	movl	$1, %r11d
	cmpl	$1, %edi
	je	.L3
	.p2align 4,,10
	.p2align 3
.L15:
	movd	%r13d, %xmm5
	movd	%r12d, %xmm6
	movd	%edi, %xmm4
	movl	$1, %edx
	movd	%r14d, %xmm7
	leal	1(%rdi), %r9d
	punpckldq	%xmm6, %xmm5
	punpckldq	%xmm7, %xmm4
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r9d, %esi
	movl	%edi, %eax
	subl	%edx, %esi
	cmpl	%edx, %edi
	cmovl	%r11d, %esi
	subl	%edx, %eax
	cmpl	$9, %eax
	jbe	.L14
	cmpl	%edx, %edi
	jl	.L14
	movl	%esi, %ecx
	movdqa	%xmm4, %xmm1
	pxor	%xmm0, %xmm0
	xorl	%eax, %eax
	shrl	$2, %ecx
	punpcklqdq	%xmm5, %xmm1
	.p2align 4,,10
	.p2align 3
.L6:
	movdqa	%xmm1, %xmm2
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%ecx, %eax
	jne	.L6
	movdqa	%xmm0, %xmm1
	movl	%esi, %r15d
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %r15d
	paddd	%xmm1, %xmm0
	subl	%r15d, %ecx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%r15d, %esi
	je	.L7
.L5:
	leal	-1(%rcx), %esi
	addl	%ecx, %eax
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-2(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-3(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-4(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-5(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-6(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-7(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	leal	-8(%rcx), %esi
	cmpl	%esi, %edx
	jg	.L7
	addl	%esi, %eax
	subl	$9, %ecx
	leal	(%rax,%rcx), %esi
	cmpl	%ecx, %edx
	cmovle	%esi, %eax
.L7:
	cmpl	%eax, %r10d
	sete	%al
	addl	$1, %edx
	movzbl	%al, %eax
	addl	%eax, %r8d
	cmpl	%edx, %edi
	jne	.L9
	subl	$1, %edi
	subl	$1, %r14d
	subl	$1, %r13d
	subl	$1, %r12d
	cmpl	$1, %edi
	jne	.L15
.L3:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%edi, %ecx
	xorl	%eax, %eax
	jmp	.L5
.L13:
	xorl	%r8d, %r8d
	jmp	.L3
.L2:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$24, %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
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	-4
	.long	-4
	.long	-4
	.long	-4
	.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:
```