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>
#include<math.h>
#include <stdlib.h>
#include<string.h>
#include<limits.h>

int  hantei(char str[],int i){
	switch(str[i]){
		case '0':
		return 0;
		break;
		
		case '1':
		return 1;
		break;
		
		case '2':
		return 2;
		break;
		
		case '3':
		return 3;
		break;
		
		case '4':
		return 4;
		break;
		
		case '5':
		return 5;
		break;
		
		case '6':
		return 6;
		break;
		
		case '7':
		return 7;
		break;
		
		case '8':
		return 8;
		break;
		
		case '9':
		return 9;
		break;
	}
}

int fx(int n){
	if(n!=0){
		return n*fx(n-1);
	}
	else return 1;
}

int main(){
	int num=1,n=0,i,j,k=0;
	int ans[100000]={0},flag=0,count=0;
	
	
	while(scanf("%d",&n)!=EOF){
		if(n==0)break;
		ans[0]=1;
	for(i=1;i<=n;i++){
		for(j=0;j<=k;j++){
			ans[j]*=i;
		}
		
		for(j=0;j<=k;j++){
			if(ans[j]>=10000){
				ans[j+1]+=ans[j]/10000;
				ans[j]%=10000;
				if(j==k)k++;
			}
		}
	}
		for(i=0;;i++){
			if(ans[i]!=0){
				if(ans[i]%1000==0)count+=3;
				else if(ans[i]%100==0)count+=2;
				else if(ans[i]%10==0)count++;
				break;
			}
			count+=4;
		}
	printf("%d\n",count);
		for(i=0;i<=k;i++)ans[i]=0;
		count=0;
		num=1;
		k=0;
	}
return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	hantei
	.type	hantei, @function
hantei:
.LFB6:
	.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)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L2
	movl	%eax, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L4(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L4(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L13-.L4
	.long	.L12-.L4
	.long	.L11-.L4
	.long	.L10-.L4
	.long	.L9-.L4
	.long	.L8-.L4
	.long	.L7-.L4
	.long	.L6-.L4
	.long	.L5-.L4
	.long	.L3-.L4
	.text
.L13:
	movl	$0, %eax
	jmp	.L1
.L12:
	movl	$1, %eax
	jmp	.L1
.L11:
	movl	$2, %eax
	jmp	.L1
.L10:
	movl	$3, %eax
	jmp	.L1
.L9:
	movl	$4, %eax
	jmp	.L1
.L8:
	movl	$5, %eax
	jmp	.L1
.L7:
	movl	$6, %eax
	jmp	.L1
.L6:
	movl	$7, %eax
	jmp	.L1
.L5:
	movl	$8, %eax
	jmp	.L1
.L3:
	movl	$9, %eax
	jmp	.L1
.L2:
.L1:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	hantei, .-hantei
	.globl	fx
	.type	fx, @function
fx:
.LFB7:
	.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	.L16
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	fx
	imull	-4(%rbp), %eax
	jmp	.L17
.L16:
	movl	$1, %eax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fx, .-fx
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -400024(%rbp)
	movl	$0, -400044(%rbp)
	movl	$0, -400032(%rbp)
	leaq	-400016(%rbp), %rax
	movl	$400000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -400020(%rbp)
	movl	$0, -400028(%rbp)
	jmp	.L19
.L37:
	movl	-400044(%rbp), %eax
	testl	%eax, %eax
	je	.L40
	movl	$1, -400016(%rbp)
	movl	$1, -400040(%rbp)
	jmp	.L22
.L28:
	movl	$0, -400036(%rbp)
	jmp	.L23
.L24:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	imull	-400040(%rbp), %eax
	movl	%eax, %edx
	movl	-400036(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400036(%rbp)
.L23:
	movl	-400036(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jle	.L24
	movl	$0, -400036(%rbp)
	jmp	.L25
.L27:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	$9999, %eax
	jle	.L26
	movl	-400036(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %ecx
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1759218605, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$12, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-400036(%rbp), %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%edx, %rax
	imulq	$1759218605, %rax, %rax
	shrq	$32, %rax
	sarl	$12, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$10000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-400036(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400016(%rbp,%rdx,4)
	movl	-400036(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jne	.L26
	addl	$1, -400032(%rbp)
.L26:
	addl	$1, -400036(%rbp)
.L25:
	movl	-400036(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jle	.L27
	addl	$1, -400040(%rbp)
.L22:
	movl	-400044(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jle	.L28
	movl	$0, -400040(%rbp)
.L34:
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L29
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rax
	shrq	$32, %rax
	sarl	$6, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L30
	addl	$3, -400028(%rbp)
	jmp	.L41
.L30:
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L32
	addl	$2, -400028(%rbp)
	jmp	.L41
.L32:
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %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
	testl	%edx, %edx
	jne	.L41
	addl	$1, -400028(%rbp)
	jmp	.L41
.L29:
	addl	$4, -400028(%rbp)
	addl	$1, -400040(%rbp)
	jmp	.L34
.L41:
	nop
	movl	-400028(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -400040(%rbp)
	jmp	.L35
.L36:
	movl	-400040(%rbp), %eax
	cltq
	movl	$0, -400016(%rbp,%rax,4)
	addl	$1, -400040(%rbp)
.L35:
	movl	-400040(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jle	.L36
	movl	$0, -400028(%rbp)
	movl	$1, -400024(%rbp)
	movl	$0, -400032(%rbp)
.L19:
	leaq	-400044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L37
	jmp	.L21
.L40:
	nop
.L21:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	hantei
	.type	hantei, @function
hantei:
.LFB51:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	movsbl	(%rdi,%rsi), %eax
	leal	-48(%rax), %edx
	cmpb	$9, %dl
	ja	.L2
	subl	$48, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	ret
	.cfi_endproc
.LFE51:
	.size	hantei, .-hantei
	.p2align 4
	.globl	fx
	.type	fx, @function
fx:
.LFB52:
	.cfi_startproc
	endbr64
	movl	$1, %eax
	testl	%edi, %edi
	je	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	imull	%edi, %eax
	subl	$1, %edi
	jne	.L6
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	ret
	.cfi_endproc
.LFE52:
	.size	fx, .-fx
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.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	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	movl	$400000, %edx
	xorl	%esi, %esi
	movl	$4, %r15d
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %rbp
	movl	$0, 12(%rsp)
	movq	%r14, %rdi
	subl	%r14d, %r15d
	call	memset@PLT
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L11
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	je	.L11
	movl	$1, 16(%rsp)
	jle	.L25
	addl	$1, %r9d
	xorl	%edi, %edi
	leaq	32(%rsp), %r10
	movl	$1, %r8d
	movl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	$2, %edi
	jle	.L26
	movl	%r13d, %edx
	movd	%r8d, %xmm4
	movq	%r14, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm2
	subl	$1, %edx
	movdqa	%xmm2, %xmm3
	salq	$4, %rdx
	psrlq	$32, %xmm3
	addq	%r10, %rdx
	.p2align 4,,10
	.p2align 3
.L14:
	movdqa	(%rax), %xmm0
	movdqa	%xmm2, %xmm1
	pmuludq	(%rax), %xmm1
	addq	$16, %rax
	pshufd	$8, %xmm1, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm3, %xmm0
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	movaps	%xmm1, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L14
	movl	%r13d, %eax
	andl	$-4, %eax
	testb	$3, %r13b
	je	.L15
.L13:
	movslq	%eax, %rdx
	movl	16(%rsp,%rdx,4), %ecx
	imull	%r8d, %ecx
	movl	%ecx, 16(%rsp,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jl	.L15
	movslq	%edx, %rdx
	addl	$2, %eax
	movl	16(%rsp,%rdx,4), %ecx
	imull	%r8d, %ecx
	movl	%ecx, 16(%rsp,%rdx,4)
	cmpl	%eax, %edi
	jl	.L15
	cltq
	movl	16(%rsp,%rax,4), %edx
	imull	%r8d, %edx
	movl	%edx, 16(%rsp,%rax,4)
.L15:
	movq	%r14, %rdx
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%rdx), %ecx
	cmpl	$9999, %ecx
	jle	.L16
	movslq	%ecx, %rax
	movl	%ecx, %r11d
	imulq	$1759218605, %rax, %rax
	sarl	$31, %r11d
	sarq	$44, %rax
	subl	%r11d, %eax
	addl	%eax, 4(%rdx)
	imull	$10000, %eax, %eax
	subl	%eax, %ecx
	movl	%ecx, (%rdx)
	cmpl	%esi, %edi
	jne	.L16
	movl	%r13d, %edi
	addl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L16:
	addq	$1, %rsi
	addq	$4, %rdx
	cmpl	%esi, %edi
	jge	.L17
	addl	$1, %r8d
	movl	16(%rsp), %ecx
	cmpl	%r9d, %r8d
	jne	.L18
	testl	%ecx, %ecx
	jne	.L37
	movq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L19:
	leal	(%r15,%rax), %edx
	movl	4(%rax), %ecx
	addq	$4, %rax
	testl	%ecx, %ecx
	je	.L19
	movslq	%ecx, %rsi
	movl	%ecx, %eax
	imulq	$274877907, %rsi, %rsi
	sarl	$31, %eax
	sarq	$38, %rsi
	subl	%eax, %esi
	imull	$1000, %esi, %eax
	movl	%ecx, %esi
	subl	%eax, %esi
.L22:
	testl	%esi, %esi
	jne	.L20
	addl	$3, %edx
.L12:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	%r13d, %rdx
	xorl	%esi, %esi
	movq	%r14, %rdi
	salq	$2, %rdx
	call	memset@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	xorl	%eax, %eax
	jmp	.L13
.L20:
	imull	$-1030792151, %ecx, %eax
	addl	$85899344, %eax
	rorl	$2, %eax
	cmpl	$42949672, %eax
	ja	.L21
	addl	$2, %edx
	jmp	.L12
.L21:
	imull	$-858993459, %ecx, %eax
	addl	$429496728, %eax
	rorl	%eax
	cmpl	$429496729, %eax
	adcl	$0, %edx
	jmp	.L12
.L11:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$400040, %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
.L25:
	.cfi_restore_state
	xorl	%edx, %edx
	movl	$1, %r13d
	jmp	.L12
.L37:
	movl	%ecx, %eax
	movl	$1000, %edi
	cltd
	idivl	%edi
	movl	%edx, %esi
	xorl	%edx, %edx
	jmp	.L22
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.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	hantei
	.type	hantei, @function
hantei:
.LFB51:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	movsbl	(%rdi,%rsi), %eax
	leal	-48(%rax), %edx
	cmpb	$9, %dl
	ja	.L2
	subl	$48, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	ret
	.cfi_endproc
.LFE51:
	.size	hantei, .-hantei
	.p2align 4
	.globl	fx
	.type	fx, @function
fx:
.LFB52:
	.cfi_startproc
	endbr64
	movl	$1, %eax
	testl	%edi, %edi
	je	.L7
	.p2align 4,,10
	.p2align 3
.L6:
	imull	%edi, %eax
	subl	$1, %edi
	jne	.L6
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	ret
	.cfi_endproc
.LFE52:
	.size	fx, .-fx
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.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	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	movl	$400000, %edx
	xorl	%esi, %esi
	movl	$4, %r15d
	leaq	.LC1(%rip), %rbx
	leaq	.LC0(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r14
	leaq	12(%rsp), %rbp
	movl	$0, 12(%rsp)
	movq	%r14, %rdi
	subl	%r14d, %r15d
	call	memset@PLT
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L11
	movl	12(%rsp), %r9d
	testl	%r9d, %r9d
	je	.L11
	movl	$1, 16(%rsp)
	jle	.L25
	addl	$1, %r9d
	xorl	%edi, %edi
	leaq	32(%rsp), %r10
	movl	$1, %r8d
	movl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L18:
	cmpl	$2, %edi
	jle	.L26
	movl	%r13d, %edx
	movd	%r8d, %xmm4
	movq	%r14, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm2
	subl	$1, %edx
	movdqa	%xmm2, %xmm3
	salq	$4, %rdx
	psrlq	$32, %xmm3
	addq	%r10, %rdx
	.p2align 4,,10
	.p2align 3
.L14:
	movdqa	(%rax), %xmm0
	movdqa	%xmm2, %xmm1
	pmuludq	(%rax), %xmm1
	addq	$16, %rax
	pshufd	$8, %xmm1, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm3, %xmm0
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	movaps	%xmm1, -16(%rax)
	cmpq	%rax, %rdx
	jne	.L14
	movl	%r13d, %eax
	andl	$-4, %eax
	testb	$3, %r13b
	je	.L15
.L13:
	movslq	%eax, %rdx
	movl	16(%rsp,%rdx,4), %ecx
	imull	%r8d, %ecx
	movl	%ecx, 16(%rsp,%rdx,4)
	leal	1(%rax), %edx
	cmpl	%edx, %edi
	jl	.L15
	movslq	%edx, %rdx
	addl	$2, %eax
	movl	16(%rsp,%rdx,4), %ecx
	imull	%r8d, %ecx
	movl	%ecx, 16(%rsp,%rdx,4)
	cmpl	%eax, %edi
	jl	.L15
	cltq
	movl	16(%rsp,%rax,4), %edx
	imull	%r8d, %edx
	movl	%edx, 16(%rsp,%rax,4)
.L15:
	movq	%r14, %rdx
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L17:
	movl	(%rdx), %ecx
	cmpl	$9999, %ecx
	jle	.L16
	movslq	%ecx, %rax
	movl	%ecx, %r11d
	imulq	$1759218605, %rax, %rax
	sarl	$31, %r11d
	sarq	$44, %rax
	subl	%r11d, %eax
	addl	%eax, 4(%rdx)
	imull	$10000, %eax, %eax
	subl	%eax, %ecx
	movl	%ecx, (%rdx)
	cmpl	%esi, %edi
	jne	.L16
	movl	%r13d, %edi
	addl	$1, %r13d
	.p2align 4,,10
	.p2align 3
.L16:
	addq	$1, %rsi
	addq	$4, %rdx
	cmpl	%esi, %edi
	jge	.L17
	addl	$1, %r8d
	movl	16(%rsp), %ecx
	cmpl	%r9d, %r8d
	jne	.L18
	testl	%ecx, %ecx
	jne	.L37
	movq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L19:
	leal	(%r15,%rax), %edx
	movl	4(%rax), %ecx
	addq	$4, %rax
	testl	%ecx, %ecx
	je	.L19
	movslq	%ecx, %rsi
	movl	%ecx, %eax
	imulq	$274877907, %rsi, %rsi
	sarl	$31, %eax
	sarq	$38, %rsi
	subl	%eax, %esi
	imull	$1000, %esi, %eax
	movl	%ecx, %esi
	subl	%eax, %esi
.L22:
	testl	%esi, %esi
	jne	.L20
	addl	$3, %edx
.L12:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movslq	%r13d, %rdx
	xorl	%esi, %esi
	movq	%r14, %rdi
	salq	$2, %rdx
	call	memset@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L26:
	xorl	%eax, %eax
	jmp	.L13
.L20:
	imull	$-1030792151, %ecx, %eax
	addl	$85899344, %eax
	rorl	$2, %eax
	cmpl	$42949672, %eax
	ja	.L21
	addl	$2, %edx
	jmp	.L12
.L21:
	imull	$-858993459, %ecx, %eax
	addl	$429496728, %eax
	rorl	%eax
	cmpl	$429496729, %eax
	adcl	$0, %edx
	jmp	.L12
.L11:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$400040, %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
.L25:
	.cfi_restore_state
	xorl	%edx, %edx
	movl	$1, %r13d
	jmp	.L12
.L37:
	movl	%ecx, %eax
	movl	$1000, %edi
	cltd
	idivl	%edi
	movl	%edx, %esi
	xorl	%edx, %edx
	jmp	.L22
.L38:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE53:
	.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>
#include<math.h>
#include <stdlib.h>
#include<string.h>
#include<limits.h>

int  hantei(char str[],int i){
	switch(str[i]){
		case '0':
		return 0;
		break;
		
		case '1':
		return 1;
		break;
		
		case '2':
		return 2;
		break;
		
		case '3':
		return 3;
		break;
		
		case '4':
		return 4;
		break;
		
		case '5':
		return 5;
		break;
		
		case '6':
		return 6;
		break;
		
		case '7':
		return 7;
		break;
		
		case '8':
		return 8;
		break;
		
		case '9':
		return 9;
		break;
	}
}

int fx(int n){
	if(n!=0){
		return n*fx(n-1);
	}
	else return 1;
}

int main(){
	int num=1,n=0,i,j,k=0;
	int ans[100000]={0},flag=0,count=0;
	
	
	while(scanf("%d",&n)!=EOF){
		if(n==0)break;
		ans[0]=1;
	for(i=1;i<=n;i++){
		for(j=0;j<=k;j++){
			ans[j]*=i;
		}
		
		for(j=0;j<=k;j++){
			if(ans[j]>=10000){
				ans[j+1]+=ans[j]/10000;
				ans[j]%=10000;
				if(j==k)k++;
			}
		}
	}
		for(i=0;;i++){
			if(ans[i]!=0){
				if(ans[i]%1000==0)count+=3;
				else if(ans[i]%100==0)count+=2;
				else if(ans[i]%10==0)count++;
				break;
			}
			count+=4;
		}
	printf("%d\n",count);
		for(i=0;i<=k;i++)ans[i]=0;
		count=0;
		num=1;
		k=0;
	}
return 0;
}
2
21
10000
0
 2
21
11000
0
 2
6
11000
0
 2
6
11100
0
 2
6
10000
0
 2
42
11000
0
 2
3
11100
0
 2
6
10101
0
 2
1
11110
0
 2
12
11000
0

0
4
2499
 0
4
2748
 0
1
2748
 0
1
2772
 0
1
2499
 0
9
2748
 0
0
2772
 0
1
2523
 0
0
2774
 0
2
2748

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>
#include<math.h>
#include <stdlib.h>
#include<string.h>
#include<limits.h>

int  hantei(char str[],int i){
	switch(str[i]){
		case '0':
		return 0;
		break;
		
		case '1':
		return 1;
		break;
		
		case '2':
		return 2;
		break;
		
		case '3':
		return 3;
		break;
		
		case '4':
		return 4;
		break;
		
		case '5':
		return 5;
		break;
		
		case '6':
		return 6;
		break;
		
		case '7':
		return 7;
		break;
		
		case '8':
		return 8;
		break;
		
		case '9':
		return 9;
		break;
	}
}

int fx(int n){
	if(n!=0){
		return n*fx(n-1);
	}
	else return 1;
}

int main(){
	int num=1,n=0,i,j,k=0;
	int ans[100000]={0},flag=0,count=0;
	
	
	while(scanf("%d",&n)!=EOF){
		if(n==0)break;
		ans[0]=1;
	for(i=1;i<=n;i++){
		for(j=0;j<=k;j++){
			ans[j]*=i;
		}
		
		for(j=0;j<=k;j++){
			if(ans[j]>=10000){
				ans[j+1]+=ans[j]/10000;
				ans[j]%=10000;
				if(j==k)k++;
			}
		}
	}
		for(i=0;;i++){
			if(ans[i]!=0){
				if(ans[i]%1000==0)count+=3;
				else if(ans[i]%100==0)count+=2;
				else if(ans[i]%10==0)count++;
				break;
			}
			count+=4;
		}
	printf("%d\n",count);
		for(i=0;i<=k;i++)ans[i]=0;
		count=0;
		num=1;
		k=0;
	}
return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	hantei
	.type	hantei, @function
hantei:
.LFB6:
	.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)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L2
	movl	%eax, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L4(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L4(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L13-.L4
	.long	.L12-.L4
	.long	.L11-.L4
	.long	.L10-.L4
	.long	.L9-.L4
	.long	.L8-.L4
	.long	.L7-.L4
	.long	.L6-.L4
	.long	.L5-.L4
	.long	.L3-.L4
	.text
.L13:
	movl	$0, %eax
	jmp	.L1
.L12:
	movl	$1, %eax
	jmp	.L1
.L11:
	movl	$2, %eax
	jmp	.L1
.L10:
	movl	$3, %eax
	jmp	.L1
.L9:
	movl	$4, %eax
	jmp	.L1
.L8:
	movl	$5, %eax
	jmp	.L1
.L7:
	movl	$6, %eax
	jmp	.L1
.L6:
	movl	$7, %eax
	jmp	.L1
.L5:
	movl	$8, %eax
	jmp	.L1
.L3:
	movl	$9, %eax
	jmp	.L1
.L2:
.L1:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	hantei, .-hantei
	.globl	fx
	.type	fx, @function
fx:
.LFB7:
	.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	.L16
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	fx
	imull	-4(%rbp), %eax
	jmp	.L17
.L16:
	movl	$1, %eax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fx, .-fx
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -400024(%rbp)
	movl	$0, -400044(%rbp)
	movl	$0, -400032(%rbp)
	leaq	-400016(%rbp), %rax
	movl	$400000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -400020(%rbp)
	movl	$0, -400028(%rbp)
	jmp	.L19
.L37:
	movl	-400044(%rbp), %eax
	testl	%eax, %eax
	je	.L40
	movl	$1, -400016(%rbp)
	movl	$1, -400040(%rbp)
	jmp	.L22
.L28:
	movl	$0, -400036(%rbp)
	jmp	.L23
.L24:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	imull	-400040(%rbp), %eax
	movl	%eax, %edx
	movl	-400036(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400036(%rbp)
.L23:
	movl	-400036(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jle	.L24
	movl	$0, -400036(%rbp)
	jmp	.L25
.L27:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	$9999, %eax
	jle	.L26
	movl	-400036(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %ecx
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1759218605, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$12, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-400036(%rbp), %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%edx, %rax
	imulq	$1759218605, %rax, %rax
	shrq	$32, %rax
	sarl	$12, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$10000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-400036(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400016(%rbp,%rdx,4)
	movl	-400036(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jne	.L26
	addl	$1, -400032(%rbp)
.L26:
	addl	$1, -400036(%rbp)
.L25:
	movl	-400036(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jle	.L27
	addl	$1, -400040(%rbp)
.L22:
	movl	-400044(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jle	.L28
	movl	$0, -400040(%rbp)
.L34:
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L29
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rax
	shrq	$32, %rax
	sarl	$6, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L30
	addl	$3, -400028(%rbp)
	jmp	.L41
.L30:
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L32
	addl	$2, -400028(%rbp)
	jmp	.L41
.L32:
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %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
	testl	%edx, %edx
	jne	.L41
	addl	$1, -400028(%rbp)
	jmp	.L41
.L29:
	addl	$4, -400028(%rbp)
	addl	$1, -400040(%rbp)
	jmp	.L34
.L41:
	nop
	movl	-400028(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -400040(%rbp)
	jmp	.L35
.L36:
	movl	-400040(%rbp), %eax
	cltq
	movl	$0, -400016(%rbp,%rax,4)
	addl	$1, -400040(%rbp)
.L35:
	movl	-400040(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jle	.L36
	movl	$0, -400028(%rbp)
	movl	$1, -400024(%rbp)
	movl	$0, -400032(%rbp)
.L19:
	leaq	-400044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L37
	jmp	.L21
.L40:
	nop
.L21:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	hantei
	.type	hantei, @function
hantei:
.LFB6:
	.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)
	movl	%esi, -12(%rbp)
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L2
	movl	%eax, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L4(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L4(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L13-.L4
	.long	.L12-.L4
	.long	.L11-.L4
	.long	.L10-.L4
	.long	.L9-.L4
	.long	.L8-.L4
	.long	.L7-.L4
	.long	.L6-.L4
	.long	.L5-.L4
	.long	.L3-.L4
	.text
.L13:
	movl	$0, %eax
	jmp	.L1
.L12:
	movl	$1, %eax
	jmp	.L1
.L11:
	movl	$2, %eax
	jmp	.L1
.L10:
	movl	$3, %eax
	jmp	.L1
.L9:
	movl	$4, %eax
	jmp	.L1
.L8:
	movl	$5, %eax
	jmp	.L1
.L7:
	movl	$6, %eax
	jmp	.L1
.L6:
	movl	$7, %eax
	jmp	.L1
.L5:
	movl	$8, %eax
	jmp	.L1
.L3:
	movl	$9, %eax
	jmp	.L1
.L2:
.L1:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	hantei, .-hantei
	.globl	fx
	.type	fx, @function
fx:
.LFB7:
	.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	.L16
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	fx
	imull	-4(%rbp), %eax
	jmp	.L17
.L16:
	movl	$1, %eax
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fx, .-fx
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1, -400024(%rbp)
	movl	$0, -400044(%rbp)
	movl	$0, -400032(%rbp)
	leaq	-400016(%rbp), %rax
	movl	$400000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -400020(%rbp)
	movl	$0, -400028(%rbp)
	jmp	.L19
.L37:
	movl	-400044(%rbp), %eax
	testl	%eax, %eax
	je	.L40
	movl	$1, -400016(%rbp)
	movl	$1, -400040(%rbp)
	jmp	.L22
.L28:
	movl	$0, -400036(%rbp)
	jmp	.L23
.L24:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	imull	-400040(%rbp), %eax
	movl	%eax, %edx
	movl	-400036(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	addl	$1, -400036(%rbp)
.L23:
	movl	-400036(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jle	.L24
	movl	$0, -400036(%rbp)
	jmp	.L25
.L27:
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	$9999, %eax
	jle	.L26
	movl	-400036(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %ecx
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1759218605, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$12, %edx
	sarl	$31, %eax
	subl	%eax, %edx
	movl	-400036(%rbp), %eax
	addl	$1, %eax
	addl	%ecx, %edx
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
	movl	-400036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%edx, %rax
	imulq	$1759218605, %rax, %rax
	shrq	$32, %rax
	sarl	$12, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$10000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	-400036(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400016(%rbp,%rdx,4)
	movl	-400036(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jne	.L26
	addl	$1, -400032(%rbp)
.L26:
	addl	$1, -400036(%rbp)
.L25:
	movl	-400036(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jle	.L27
	addl	$1, -400040(%rbp)
.L22:
	movl	-400044(%rbp), %eax
	cmpl	%eax, -400040(%rbp)
	jle	.L28
	movl	$0, -400040(%rbp)
.L34:
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L29
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rax
	shrq	$32, %rax
	sarl	$6, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L30
	addl	$3, -400028(%rbp)
	jmp	.L41
.L30:
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movslq	%edx, %rax
	imulq	$1374389535, %rax, %rax
	shrq	$32, %rax
	sarl	$5, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$100, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L32
	addl	$2, -400028(%rbp)
	jmp	.L41
.L32:
	movl	-400040(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %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
	testl	%edx, %edx
	jne	.L41
	addl	$1, -400028(%rbp)
	jmp	.L41
.L29:
	addl	$4, -400028(%rbp)
	addl	$1, -400040(%rbp)
	jmp	.L34
.L41:
	nop
	movl	-400028(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -400040(%rbp)
	jmp	.L35
.L36:
	movl	-400040(%rbp), %eax
	cltq
	movl	$0, -400016(%rbp,%rax,4)
	addl	$1, -400040(%rbp)
.L35:
	movl	-400040(%rbp), %eax
	cmpl	-400032(%rbp), %eax
	jle	.L36
	movl	$0, -400028(%rbp)
	movl	$1, -400024(%rbp)
	movl	$0, -400032(%rbp)
.L19:
	leaq	-400044(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	jne	.L37
	jmp	.L21
.L40:
	nop
.L21:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L39
	call	__stack_chk_fail@PLT
.L39:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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:
