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

```c
/*
 * ID: 0259
 * Problem: All numbers go to 6174
 */

#include <stdio.h>

int main(void)
{
    int i, number;

    while (1) {
        scanf("%d", &number);
        if (number == 0)
            return 0;

        if (number % 1111 == 0) {
            printf("NA\n");
            continue;
        }

        int try = 0;

        while (number != 6174) {
            int count[10] = {0};
            try++;
            for (i = 0; i < 4; i++) {
                count[number % 10]++;
                number /= 10;
            }

            int large = 0;
            for (i = 9; i >= 0; i--) {
                int k = 0;
                while (count[i] > k) {
                    large *= 10;
                    large += i;
                    k++;
                }
            }

            int small = 0;
            for (i = 0; i <= 9; i++) {
                int k = 0;
                while (count[i] > k) {
                    small *= 10;
                    small += i;
                    k++;
                }
            }

            number = large - small;
            //printf("%d %d -> %d\n", large, small, number);
        }
        printf("%d\n", try);
    }

    return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L29
	imull	$-1372379289, %eax, %edx
	addl	$1932928, %edx
	cmpl	$3865856, %edx
	jbe	.L4
	xorl	%r9d, %r9d
	leaq	16(%rsp), %r8
	cmpl	$6174, %eax
	je	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	%eax, %rdx
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	addl	$1, %r9d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %ecx
	movaps	%xmm0, 16(%rsp)
	movl	$9, %edi
	movq	$0, 48(%rsp)
	movaps	%xmm0, 32(%rsp)
	sarq	$34, %rdx
	subl	%ecx, %edx
	leal	(%rdx,%rdx,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %eax
	movl	%edx, %ecx
	cltq
	sarl	$31, %ecx
	movl	$1, 16(%rsp,%rax,4)
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %esi
	movl	%eax, %ecx
	movl	%edx, %eax
	addl	%esi, %esi
	movl	%ecx, %edx
	subl	%esi, %eax
	sarl	$31, %edx
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %esi
	movl	%eax, %edx
	movl	%ecx, %eax
	addl	%esi, %esi
	movl	%edx, %ecx
	subl	%esi, %eax
	sarl	$31, %ecx
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	movl	%edx, %eax
	addl	%ecx, %ecx
	subl	%ecx, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r8,%rdi,4), %ecx
	movl	%edi, %esi
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	leal	(%rax,%rax,4), %eax
	addl	$1, %edx
	leal	(%rsi,%rax,2), %eax
	cmpl	%edx, %ecx
	jne	.L9
.L11:
	subq	$1, %rdi
	jnb	.L8
	xorl	%r10d, %r10d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r8,%r10,4), %esi
	movl	%r10d, %edi
	xorl	%edx, %edx
	testl	%esi, %esi
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%rcx,%rcx,4), %ecx
	addl	$1, %edx
	leal	(%rdi,%rcx,2), %ecx
	cmpl	%edx, %esi
	jne	.L12
.L14:
	addq	$1, %r10
	cmpq	$10, %r10
	jne	.L10
	subl	%ecx, %eax
	movl	%eax, 12(%rsp)
	cmpl	$6174, %eax
	jne	.L5
.L6:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L4:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L2
.L29:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L29
	imull	$-1372379289, %eax, %edx
	addl	$1932928, %edx
	cmpl	$3865856, %edx
	jbe	.L4
	xorl	%r9d, %r9d
	leaq	16(%rsp), %r8
	cmpl	$6174, %eax
	je	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	%eax, %rdx
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	addl	$1, %r9d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %ecx
	movaps	%xmm0, 16(%rsp)
	movl	$9, %edi
	movq	$0, 48(%rsp)
	movaps	%xmm0, 32(%rsp)
	sarq	$34, %rdx
	subl	%ecx, %edx
	leal	(%rdx,%rdx,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %eax
	movl	%edx, %ecx
	cltq
	sarl	$31, %ecx
	movl	$1, 16(%rsp,%rax,4)
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %esi
	movl	%eax, %ecx
	movl	%edx, %eax
	addl	%esi, %esi
	movl	%ecx, %edx
	subl	%esi, %eax
	sarl	$31, %edx
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %esi
	movl	%eax, %edx
	movl	%ecx, %eax
	addl	%esi, %esi
	movl	%edx, %ecx
	subl	%esi, %eax
	sarl	$31, %ecx
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	movl	%edx, %eax
	addl	%ecx, %ecx
	subl	%ecx, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r8,%rdi,4), %ecx
	movl	%edi, %esi
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	leal	(%rax,%rax,4), %eax
	addl	$1, %edx
	leal	(%rsi,%rax,2), %eax
	cmpl	%edx, %ecx
	jne	.L9
.L11:
	subq	$1, %rdi
	jnb	.L8
	xorl	%r10d, %r10d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r8,%r10,4), %esi
	movl	%r10d, %edi
	xorl	%edx, %edx
	testl	%esi, %esi
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%rcx,%rcx,4), %ecx
	addl	$1, %edx
	leal	(%rdi,%rcx,2), %ecx
	cmpl	%edx, %esi
	jne	.L12
.L14:
	addq	$1, %r10
	cmpq	$10, %r10
	jne	.L10
	subl	%ecx, %eax
	movl	%eax, 12(%rsp)
	cmpl	$6174, %eax
	jne	.L5
.L6:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L4:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L2
.L29:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L29
	imull	$-1372379289, %eax, %edx
	addl	$1932928, %edx
	cmpl	$3865856, %edx
	jbe	.L4
	xorl	%r9d, %r9d
	leaq	16(%rsp), %r8
	cmpl	$6174, %eax
	je	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	%eax, %rdx
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	addl	$1, %r9d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %ecx
	movaps	%xmm0, 16(%rsp)
	movl	$9, %edi
	movq	$0, 48(%rsp)
	movaps	%xmm0, 32(%rsp)
	sarq	$34, %rdx
	subl	%ecx, %edx
	leal	(%rdx,%rdx,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %eax
	movl	%edx, %ecx
	cltq
	sarl	$31, %ecx
	movl	$1, 16(%rsp,%rax,4)
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %esi
	movl	%eax, %ecx
	movl	%edx, %eax
	addl	%esi, %esi
	movl	%ecx, %edx
	subl	%esi, %eax
	sarl	$31, %edx
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %esi
	movl	%eax, %edx
	movl	%ecx, %eax
	addl	%esi, %esi
	movl	%edx, %ecx
	subl	%esi, %eax
	sarl	$31, %ecx
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	movl	%edx, %eax
	addl	%ecx, %ecx
	subl	%ecx, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r8,%rdi,4), %ecx
	movl	%edi, %esi
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	leal	(%rax,%rax,4), %eax
	addl	$1, %edx
	leal	(%rsi,%rax,2), %eax
	cmpl	%edx, %ecx
	jne	.L9
.L11:
	subq	$1, %rdi
	jnb	.L8
	xorl	%r10d, %r10d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r8,%r10,4), %esi
	movl	%r10d, %edi
	xorl	%edx, %edx
	testl	%esi, %esi
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%rcx,%rcx,4), %ecx
	addl	$1, %edx
	leal	(%rdi,%rcx,2), %ecx
	cmpl	%edx, %esi
	jne	.L12
.L14:
	addq	$1, %r10
	cmpq	$10, %r10
	jne	.L10
	subl	%ecx, %eax
	movl	%eax, 12(%rsp)
	cmpl	$6174, %eax
	jne	.L5
.L6:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L4:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L2
.L29:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
/*
 * ID: 0259
 * Problem: All numbers go to 6174
 */

#include <stdio.h>

int main(void)
{
    int i, number;

    while (1) {
        scanf("%d", &number);
        if (number == 0)
            return 0;

        if (number % 1111 == 0) {
            printf("NA\n");
            continue;
        }

        int try = 0;

        while (number != 6174) {
            int count[10] = {0};
            try++;
            for (i = 0; i < 4; i++) {
                count[number % 10]++;
                number /= 10;
            }

            int large = 0;
            for (i = 9; i >= 0; i--) {
                int k = 0;
                while (count[i] > k) {
                    large *= 10;
                    large += i;
                    k++;
                }
            }

            int small = 0;
            for (i = 0; i <= 9; i++) {
                int k = 0;
                while (count[i] > k) {
                    small *= 10;
                    small += i;
                    k++;
                }
            }

            number = large - small;
            //printf("%d %d -> %d\n", large, small, number);
        }
        printf("%d\n", try);
    }

    return 0;
}

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

```c
/*
 * ID: 0259
 * Problem: All numbers go to 6174
 */

#include <stdio.h>

int main(void)
{
    int i, number;

    while (1) {
        scanf("%d", &number);
        if (number == 0)
            return 0;

        if (number % 1111 == 0) {
            printf("NA\n");
            continue;
        }

        int try = 0;

        while (number != 6174) {
            int count[10] = {0};
            try++;
            for (i = 0; i < 4; i++) {
                count[number % 10]++;
                number /= 10;
            }

            int large = 0;
            for (i = 9; i >= 0; i--) {
                int k = 0;
                while (count[i] > k) {
                    large *= 10;
                    large += i;
                    k++;
                }
            }

            int small = 0;
            for (i = 0; i <= 9; i++) {
                int k = 0;
                while (count[i] > k) {
                    small *= 10;
                    small += i;
                    k++;
                }
            }

            number = large - small;
            //printf("%d %d -> %d\n", large, small, number);
        }
        printf("%d\n", try);
    }

    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:

6174
3985
3333
0000
 6174
1779
3333
0000
 6174
1779
2211
0000
 6174
2012
3078
0000
 6174
3985
5889
0000
 6174
2012
3639
0000
 6174
1794
3333
0000
 6174
1779
1275
0000
 6174
1289
3078
0000
 6174
3985
4510
0000

0
3
NA
 0
6
NA
 0
6
4
 0
3
2
 0
3
4
 0
3
3
 0
5
NA
 0
6
3
 0
2
2
 0
3
5

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

```c
/*
 * ID: 0259
 * Problem: All numbers go to 6174
 */

#include <stdio.h>

int main(void)
{
    int i, number;

    while (1) {
        scanf("%d", &number);
        if (number == 0)
            return 0;

        if (number % 1111 == 0) {
            printf("NA\n");
            continue;
        }

        int try = 0;

        while (number != 6174) {
            int count[10] = {0};
            try++;
            for (i = 0; i < 4; i++) {
                count[number % 10]++;
                number /= 10;
            }

            int large = 0;
            for (i = 9; i >= 0; i--) {
                int k = 0;
                while (count[i] > k) {
                    large *= 10;
                    large += i;
                    k++;
                }
            }

            int small = 0;
            for (i = 0; i <= 9; i++) {
                int k = 0;
                while (count[i] > k) {
                    small *= 10;
                    small += i;
                    k++;
                }
            }

            number = large - small;
            //printf("%d %d -> %d\n", large, small, number);
        }
        printf("%d\n", try);
    }

    return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L29
	imull	$-1372379289, %eax, %edx
	addl	$1932928, %edx
	cmpl	$3865856, %edx
	jbe	.L4
	xorl	%r9d, %r9d
	leaq	16(%rsp), %r8
	cmpl	$6174, %eax
	je	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	%eax, %rdx
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	addl	$1, %r9d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %ecx
	movaps	%xmm0, 16(%rsp)
	movl	$9, %edi
	movq	$0, 48(%rsp)
	movaps	%xmm0, 32(%rsp)
	sarq	$34, %rdx
	subl	%ecx, %edx
	leal	(%rdx,%rdx,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %eax
	movl	%edx, %ecx
	cltq
	sarl	$31, %ecx
	movl	$1, 16(%rsp,%rax,4)
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %esi
	movl	%eax, %ecx
	movl	%edx, %eax
	addl	%esi, %esi
	movl	%ecx, %edx
	subl	%esi, %eax
	sarl	$31, %edx
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %esi
	movl	%eax, %edx
	movl	%ecx, %eax
	addl	%esi, %esi
	movl	%edx, %ecx
	subl	%esi, %eax
	sarl	$31, %ecx
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	movl	%edx, %eax
	addl	%ecx, %ecx
	subl	%ecx, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r8,%rdi,4), %ecx
	movl	%edi, %esi
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	leal	(%rax,%rax,4), %eax
	addl	$1, %edx
	leal	(%rsi,%rax,2), %eax
	cmpl	%edx, %ecx
	jne	.L9
.L11:
	subq	$1, %rdi
	jnb	.L8
	xorl	%r10d, %r10d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r8,%r10,4), %esi
	movl	%r10d, %edi
	xorl	%edx, %edx
	testl	%esi, %esi
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%rcx,%rcx,4), %ecx
	addl	$1, %edx
	leal	(%rdi,%rcx,2), %ecx
	cmpl	%edx, %esi
	jne	.L12
.L14:
	addq	$1, %r10
	cmpq	$10, %r10
	jne	.L10
	subl	%ecx, %eax
	movl	%eax, 12(%rsp)
	cmpl	$6174, %eax
	jne	.L5
.L6:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L4:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L2
.L29:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"NA"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	.LC0(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rbp
.L2:
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L29
	imull	$-1372379289, %eax, %edx
	addl	$1932928, %edx
	cmpl	$3865856, %edx
	jbe	.L4
	xorl	%r9d, %r9d
	leaq	16(%rsp), %r8
	cmpl	$6174, %eax
	je	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	%eax, %rdx
	movl	%eax, %ecx
	pxor	%xmm0, %xmm0
	addl	$1, %r9d
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %ecx
	movaps	%xmm0, 16(%rsp)
	movl	$9, %edi
	movq	$0, 48(%rsp)
	movaps	%xmm0, 32(%rsp)
	sarq	$34, %rdx
	subl	%ecx, %edx
	leal	(%rdx,%rdx,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %eax
	movl	%edx, %ecx
	cltq
	sarl	$31, %ecx
	movl	$1, 16(%rsp,%rax,4)
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %esi
	movl	%eax, %ecx
	movl	%edx, %eax
	addl	%esi, %esi
	movl	%ecx, %edx
	subl	%esi, %eax
	sarl	$31, %edx
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %esi
	movl	%eax, %edx
	movl	%ecx, %eax
	addl	%esi, %esi
	movl	%edx, %ecx
	subl	%esi, %eax
	sarl	$31, %ecx
	cltq
	addl	$1, 16(%rsp,%rax,4)
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	movl	%edx, %eax
	addl	%ecx, %ecx
	subl	%ecx, %eax
	cltq
	addl	$1, 16(%rsp,%rax,4)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%r8,%rdi,4), %ecx
	movl	%edi, %esi
	xorl	%edx, %edx
	testl	%ecx, %ecx
	jle	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	leal	(%rax,%rax,4), %eax
	addl	$1, %edx
	leal	(%rsi,%rax,2), %eax
	cmpl	%edx, %ecx
	jne	.L9
.L11:
	subq	$1, %rdi
	jnb	.L8
	xorl	%r10d, %r10d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r8,%r10,4), %esi
	movl	%r10d, %edi
	xorl	%edx, %edx
	testl	%esi, %esi
	jle	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	leal	(%rcx,%rcx,4), %ecx
	addl	$1, %edx
	leal	(%rdi,%rcx,2), %ecx
	cmpl	%edx, %esi
	jne	.L12
.L14:
	addq	$1, %r10
	cmpq	$10, %r10
	jne	.L10
	subl	%ecx, %eax
	movl	%eax, 12(%rsp)
	cmpl	$6174, %eax
	jne	.L5
.L6:
	movl	%r9d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
.L4:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L2
.L29:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L30:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```