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

```c
// ABC 152-D
// 2020.1.19 bal4u

#include <stdio.h>

#define gc() getchar_unlocked()

int in() {   // 非負整数の入力
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

int f1[100], f2[100];

void calc(int n) {
	int k = n % 10;
	while (n >= 10) n /= 10;
	++f1[10*k + n], ++f2[n*10 + k];
}

int main()
{
	int i, N, ans;
	
	N = in();
	while (N) calc(N--);

	ans = 0;
	for (i = 0; i < 100; ++i) ans += f1[i] * f2[i];
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	in, .-in
	.globl	f1
	.bss
	.align 32
	.type	f1, @object
	.size	f1, 400
f1:
	.zero	400
	.globl	f2
	.align 32
	.type	f2, @object
	.size	f2, 400
f2:
	.zero	400
	.text
	.globl	calc
	.type	calc, @function
calc:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -4(%rbp)
	jmp	.L5
.L6:
	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)
.L5:
	cmpl	$9, -20(%rbp)
	jg	.L6
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	f1(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f1(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	f2(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f2(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	calc, .-calc
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	jmp	.L8
.L9:
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -8(%rbp)
	movl	%eax, %edi
	call	calc
.L8:
	cmpl	$0, -8(%rbp)
	jne	.L9
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f2(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%edx, %eax
	addl	%eax, -4(%rbp)
	addl	$1, -12(%rbp)
.L10:
	cmpl	$99, -12(%rbp)
	jle	.L11
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	in
	.type	in, @function
in:
.LFB23:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L11
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L5:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L7:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L4
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	in, .-in
	.p2align 4
	.globl	calc
	.type	calc, @function
calc:
.LFB24:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdx
	movl	%edi, %eax
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %eax
	sarq	$34, %rdx
	subl	%eax, %edx
	leal	(%rdx,%rdx,4), %eax
	movl	%edi, %edx
	addl	%eax, %eax
	subl	%eax, %edx
	cmpl	$9, %edi
	jle	.L13
	movl	$3435973837, %ecx
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%edi, %edi
	movq	%rdi, %rax
	imulq	%rcx, %rdi
	shrq	$35, %rdi
	cmpl	$99, %eax
	jg	.L14
.L13:
	leal	(%rdx,%rdx,4), %eax
	leaq	f1(%rip), %rcx
	leal	(%rdi,%rax,2), %eax
	cltq
	addl	$1, (%rcx,%rax,4)
	leal	(%rdi,%rdi,4), %eax
	leal	(%rdx,%rax,2), %eax
	leaq	f2(%rip), %rdx
	cltq
	addl	$1, (%rdx,%rax,4)
	ret
	.cfi_endproc
.LFE24:
	.size	calc, .-calc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	call	in
	leaq	f1(%rip), %rsi
	leaq	f2(%rip), %rdi
	testl	%eax, %eax
	je	.L17
	movl	%eax, %r9d
	movl	$3435973837, %r8d
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%r9d, %rcx
	movl	%r9d, %edx
	movl	%r9d, %eax
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %edx
	sarq	$34, %rcx
	subl	%edx, %ecx
	leal	(%rcx,%rcx,4), %edx
	movl	%r9d, %ecx
	addl	%edx, %edx
	subl	%edx, %ecx
	cmpl	$9, %r9d
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%eax, %eax
	movq	%rax, %rdx
	imulq	%r8, %rax
	shrq	$35, %rax
	cmpl	$99, %edx
	jg	.L19
	leal	(%rcx,%rcx,4), %edx
	subl	$1, %r9d
	leal	(%rax,%rdx,2), %edx
	leal	(%rax,%rax,4), %eax
	leal	(%rcx,%rax,2), %eax
	movslq	%edx, %rdx
	cltq
	addl	$1, (%rsi,%rdx,4)
	addl	$1, (%rdi,%rax,4)
	jmp	.L21
.L18:
	leal	(%rcx,%rcx,4), %eax
	leal	(%r9,%rax,2), %eax
	cltq
	addl	$1, (%rsi,%rax,4)
	leal	(%r9,%r9,4), %eax
	leal	(%rcx,%rax,2), %eax
	cltq
	addl	$1, (%rdi,%rax,4)
	subl	$1, %r9d
	jne	.L21
.L17:
	xorl	%eax, %eax
	pxor	%xmm3, %xmm3
	.p2align 4,,10
	.p2align 3
.L22:
	movdqa	(%rdi,%rax), %xmm1
	movdqa	(%rsi,%rax), %xmm2
	movdqa	(%rdi,%rax), %xmm0
	pmuludq	(%rsi,%rax), %xmm0
	pshufd	$8, %xmm0, %xmm0
	addq	$16, %rax
	psrlq	$32, %xmm1
	psrlq	$32, %xmm2
	pmuludq	%xmm2, %xmm1
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	paddd	%xmm0, %xmm3
	cmpq	$400, %rax
	jne	.L22
	movdqa	%xmm3, %xmm0
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm3
	movdqa	%xmm3, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm3
	movd	%xmm3, %edx
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	f2
	.bss
	.align 32
	.type	f2, @object
	.size	f2, 400
f2:
	.zero	400
	.globl	f1
	.align 32
	.type	f1, @object
	.size	f1, 400
f1:
	.zero	400
	.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	in
	.type	in, @function
in:
.LFB23:
	.cfi_startproc
	endbr64
	movq	stdin(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	8(%rdi), %rax
	movq	16(%rdi), %rcx
	cmpq	%rcx, %rax
	jnb	.L11
	leaq	1(%rax), %rdx
	movq	%rdx, 8(%rdi)
	movzbl	(%rax), %eax
.L3:
	xorl	%r12d, %r12d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	1(%rdx), %rax
	movq	%rax, 8(%rdi)
	movzbl	(%rdx), %eax
	cmpl	$47, %eax
	jle	.L1
.L5:
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
.L7:
	leal	(%r12,%r12,4), %esi
	andl	$15, %eax
	leal	(%rax,%rsi,2), %r12d
	cmpq	%rcx, %rdx
	jb	.L4
	call	__uflow@PLT
	cmpl	$47, %eax
	jle	.L1
	movq	stdin(%rip), %rdi
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L1:
	movl	%r12d, %eax
	popq	%r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	__uflow@PLT
	movq	stdin(%rip), %rdi
	movq	8(%rdi), %rdx
	movq	16(%rdi), %rcx
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	in, .-in
	.p2align 4
	.globl	calc
	.type	calc, @function
calc:
.LFB24:
	.cfi_startproc
	endbr64
	movslq	%edi, %rdx
	movl	%edi, %eax
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %eax
	sarq	$34, %rdx
	subl	%eax, %edx
	leal	(%rdx,%rdx,4), %eax
	movl	%edi, %edx
	addl	%eax, %eax
	subl	%eax, %edx
	cmpl	$9, %edi
	jle	.L13
	movl	$3435973837, %ecx
	.p2align 4,,10
	.p2align 3
.L14:
	movl	%edi, %edi
	movq	%rdi, %rax
	imulq	%rcx, %rdi
	shrq	$35, %rdi
	cmpl	$99, %eax
	jg	.L14
.L13:
	leal	(%rdx,%rdx,4), %eax
	leaq	f1(%rip), %rcx
	leal	(%rdi,%rax,2), %eax
	cltq
	addl	$1, (%rcx,%rax,4)
	leal	(%rdi,%rdi,4), %eax
	leal	(%rdx,%rax,2), %eax
	leaq	f2(%rip), %rdx
	cltq
	addl	$1, (%rdx,%rax,4)
	ret
	.cfi_endproc
.LFE24:
	.size	calc, .-calc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	call	in
	leaq	f1(%rip), %rsi
	leaq	f2(%rip), %rdi
	testl	%eax, %eax
	je	.L17
	movl	%eax, %r9d
	movl	$3435973837, %r8d
	.p2align 4,,10
	.p2align 3
.L21:
	movslq	%r9d, %rcx
	movl	%r9d, %edx
	movl	%r9d, %eax
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %edx
	sarq	$34, %rcx
	subl	%edx, %ecx
	leal	(%rcx,%rcx,4), %edx
	movl	%r9d, %ecx
	addl	%edx, %edx
	subl	%edx, %ecx
	cmpl	$9, %r9d
	jle	.L18
	.p2align 4,,10
	.p2align 3
.L19:
	movl	%eax, %eax
	movq	%rax, %rdx
	imulq	%r8, %rax
	shrq	$35, %rax
	cmpl	$99, %edx
	jg	.L19
	leal	(%rcx,%rcx,4), %edx
	subl	$1, %r9d
	leal	(%rax,%rdx,2), %edx
	leal	(%rax,%rax,4), %eax
	leal	(%rcx,%rax,2), %eax
	movslq	%edx, %rdx
	cltq
	addl	$1, (%rsi,%rdx,4)
	addl	$1, (%rdi,%rax,4)
	jmp	.L21
.L18:
	leal	(%rcx,%rcx,4), %eax
	leal	(%r9,%rax,2), %eax
	cltq
	addl	$1, (%rsi,%rax,4)
	leal	(%r9,%r9,4), %eax
	leal	(%rcx,%rax,2), %eax
	cltq
	addl	$1, (%rdi,%rax,4)
	subl	$1, %r9d
	jne	.L21
.L17:
	xorl	%eax, %eax
	pxor	%xmm3, %xmm3
	.p2align 4,,10
	.p2align 3
.L22:
	movdqa	(%rdi,%rax), %xmm1
	movdqa	(%rsi,%rax), %xmm2
	movdqa	(%rdi,%rax), %xmm0
	pmuludq	(%rsi,%rax), %xmm0
	pshufd	$8, %xmm0, %xmm0
	addq	$16, %rax
	psrlq	$32, %xmm1
	psrlq	$32, %xmm2
	pmuludq	%xmm2, %xmm1
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	paddd	%xmm0, %xmm3
	cmpq	$400, %rax
	jne	.L22
	movdqa	%xmm3, %xmm0
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	psrldq	$8, %xmm0
	paddd	%xmm0, %xmm3
	movdqa	%xmm3, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm3
	movd	%xmm3, %edx
	call	__printf_chk@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	f2
	.bss
	.align 32
	.type	f2, @object
	.size	f2, 400
f2:
	.zero	400
	.globl	f1
	.align 32
	.type	f1, @object
	.size	f1, 400
f1:
	.zero	400
	.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:

// ABC 152-D
// 2020.1.19 bal4u

#include <stdio.h>

#define gc() getchar_unlocked()

int in() {   // 非負整数の入力
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

int f1[100], f2[100];

void calc(int n) {
	int k = n % 10;
	while (n >= 10) n /= 10;
	++f1[10*k + n], ++f2[n*10 + k];
}

int main()
{
	int i, N, ans;
	
	N = in();
	while (N) calc(N--);

	ans = 0;
	for (i = 0; i < 100; ++i) ans += f1[i] * f2[i];
	printf("%d\n", ans);
	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
// ABC 152-D
// 2020.1.19 bal4u

#include <stdio.h>

#define gc() getchar_unlocked()

int in() {   // 非負整数の入力
	int n = 0, c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

int f1[100], f2[100];

void calc(int n) {
	int k = n % 10;
	while (n >= 10) n /= 10;
	++f1[10*k + n], ++f2[n*10 + k];
}

int main()
{
	int i, N, ans;
	
	N = in();
	while (N) calc(N--);

	ans = 0;
	for (i = 0; i < 100; ++i) ans += f1[i] * f2[i];
	printf("%d\n", ans);
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	in
	.type	in, @function
in:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	in, .-in
	.globl	f1
	.bss
	.align 32
	.type	f1, @object
	.size	f1, 400
f1:
	.zero	400
	.globl	f2
	.align 32
	.type	f2, @object
	.size	f2, 400
f2:
	.zero	400
	.text
	.globl	calc
	.type	calc, @function
calc:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -4(%rbp)
	jmp	.L5
.L6:
	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)
.L5:
	cmpl	$9, -20(%rbp)
	jg	.L6
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	f1(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f1(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	f2(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f2(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	calc, .-calc
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	jmp	.L8
.L9:
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -8(%rbp)
	movl	%eax, %edi
	call	calc
.L8:
	cmpl	$0, -8(%rbp)
	jne	.L9
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f2(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%edx, %eax
	addl	%eax, -4(%rbp)
	addl	$1, -12(%rbp)
.L10:
	cmpl	$99, -12(%rbp)
	jle	.L11
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	in
	.type	in, @function
in:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$0, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
.L2:
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	andl	$15, %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	call	getchar_unlocked@PLT
	movl	%eax, -4(%rbp)
	cmpl	$47, -4(%rbp)
	jg	.L2
	movl	-8(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	in, .-in
	.globl	f1
	.bss
	.align 32
	.type	f1, @object
	.size	f1, 400
f1:
	.zero	400
	.globl	f2
	.align 32
	.type	f2, @object
	.size	f2, 400
f2:
	.zero	400
	.text
	.globl	calc
	.type	calc, @function
calc:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%edx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %ecx
	movl	%ecx, %eax
	sall	$2, %eax
	addl	%ecx, %eax
	addl	%eax, %eax
	subl	%eax, %edx
	movl	%edx, -4(%rbp)
	jmp	.L5
.L6:
	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)
.L5:
	cmpl	$9, -20(%rbp)
	jg	.L6
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	f1(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f1(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	f2(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f2(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	calc, .-calc
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.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	$0, %eax
	call	in
	movl	%eax, -8(%rbp)
	jmp	.L8
.L9:
	movl	-8(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -8(%rbp)
	movl	%eax, %edi
	call	calc
.L8:
	cmpl	$0, -8(%rbp)
	jne	.L9
	movl	$0, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L10
.L11:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	f1(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	f2(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%edx, %eax
	addl	%eax, -4(%rbp)
	addl	$1, -12(%rbp)
.L10:
	cmpl	$99, -12(%rbp)
	jle	.L11
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
