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

```c
// AOJ 0384: Dudeney Number
// 2019.2.20 bal4u
 
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int tbl[11] = { 0,0,10000,464,100,39,21,13,10,7,6 };

int sb(int a)
{
	int s = 0;
	while (a) {
		s += a % 10;
		a /= 10;
	}
	return s;
}

int main()
{
	int a, n, m;
	int x, y, lim, ans;

	scanf("%d%d%d", &a, &n, &m);
	lim = tbl[n] - a, ans = 0;
	for (y = 1; y <= lim; y++) {
		x = (int)pow(y + a, n);
		if (x > m) break;
		if (sb(x) == y) ans++;
	}
	printf("%d\n", ans);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	sb
	.type	sb, @function
sb:
.LFB39:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testl	%edi, %edi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	addl	%edi, %r8d
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	sb, .-sb
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rcx
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rcx
	leaq	tbl(%rip), %rdx
	movl	28(%rsp), %ebp
	movl	(%rdx,%rcx,4), %ebx
	subl	%ebp, %ebx
	testl	%ebx, %ebx
	jle	.L13
	pxor	%xmm1, %xmm1
	movl	36(%rsp), %r13d
	xorl	%r12d, %r12d
	movl	$1, %r14d
	cvtsi2sdl	%ecx, %xmm1
	.p2align 4,,10
	.p2align 3
.L11:
	leal	(%r14,%rbp), %eax
	pxor	%xmm0, %xmm0
	movsd	%xmm1, 8(%rsp)
	cvtsi2sdl	%eax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %edx
	cmpl	%r13d, %edx
	jg	.L8
	testl	%edx, %edx
	movsd	8(%rsp), %xmm1
	je	.L9
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	addl	%edx, %esi
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L10
	xorl	%eax, %eax
	cmpl	%r14d, %esi
	sete	%al
	addl	%eax, %r12d
.L9:
	addl	$1, %r14d
	cmpl	%r14d, %ebx
	jge	.L11
.L8:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L8
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	tbl
	.data
	.align 32
	.type	tbl, @object
	.size	tbl, 44
tbl:
	.long	0
	.long	0
	.long	10000
	.long	464
	.long	100
	.long	39
	.long	21
	.long	13
	.long	10
	.long	7
	.long	6
	.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
	.p2align 4
	.globl	sb
	.type	sb, @function
sb:
.LFB39:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testl	%edi, %edi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	addl	%edi, %r8d
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	sb, .-sb
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rcx
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rcx
	leaq	tbl(%rip), %rdx
	movl	28(%rsp), %ebp
	movl	(%rdx,%rcx,4), %ebx
	subl	%ebp, %ebx
	testl	%ebx, %ebx
	jle	.L13
	pxor	%xmm1, %xmm1
	movl	36(%rsp), %r13d
	xorl	%r12d, %r12d
	movl	$1, %r14d
	cvtsi2sdl	%ecx, %xmm1
	.p2align 4,,10
	.p2align 3
.L11:
	leal	(%r14,%rbp), %eax
	pxor	%xmm0, %xmm0
	movsd	%xmm1, 8(%rsp)
	cvtsi2sdl	%eax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %edx
	cmpl	%r13d, %edx
	jg	.L8
	testl	%edx, %edx
	movsd	8(%rsp), %xmm1
	je	.L9
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	addl	%edx, %esi
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L10
	xorl	%eax, %eax
	cmpl	%r14d, %esi
	sete	%al
	addl	%eax, %r12d
.L9:
	addl	$1, %r14d
	cmpl	%r14d, %ebx
	jge	.L11
.L8:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L8
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	tbl
	.data
	.align 32
	.type	tbl, @object
	.size	tbl, 44
tbl:
	.long	0
	.long	0
	.long	10000
	.long	464
	.long	100
	.long	39
	.long	21
	.long	13
	.long	10
	.long	7
	.long	6
	.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
	.p2align 4
	.globl	sb
	.type	sb, @function
sb:
.LFB39:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testl	%edi, %edi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	addl	%edi, %r8d
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	sb, .-sb
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rcx
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rcx
	leaq	tbl(%rip), %rdx
	movl	28(%rsp), %ebp
	movl	(%rdx,%rcx,4), %ebx
	subl	%ebp, %ebx
	testl	%ebx, %ebx
	jle	.L13
	pxor	%xmm1, %xmm1
	movl	36(%rsp), %r13d
	xorl	%r12d, %r12d
	movl	$1, %r14d
	cvtsi2sdl	%ecx, %xmm1
	.p2align 4,,10
	.p2align 3
.L11:
	leal	(%r14,%rbp), %eax
	pxor	%xmm0, %xmm0
	movsd	%xmm1, 8(%rsp)
	cvtsi2sdl	%eax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %edx
	cmpl	%r13d, %edx
	jg	.L8
	testl	%edx, %edx
	movsd	8(%rsp), %xmm1
	je	.L9
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	addl	%edx, %esi
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L10
	xorl	%eax, %eax
	cmpl	%r14d, %esi
	sete	%al
	addl	%eax, %r12d
.L9:
	addl	$1, %r14d
	cmpl	%r14d, %ebx
	jge	.L11
.L8:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L8
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	tbl
	.data
	.align 32
	.type	tbl, @object
	.size	tbl, 44
tbl:
	.long	0
	.long	0
	.long	10000
	.long	464
	.long	100
	.long	39
	.long	21
	.long	13
	.long	10
	.long	7
	.long	6
	.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
// AOJ 0384: Dudeney Number
// 2019.2.20 bal4u
 
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int tbl[11] = { 0,0,10000,464,100,39,21,13,10,7,6 };

int sb(int a)
{
	int s = 0;
	while (a) {
		s += a % 10;
		a /= 10;
	}
	return s;
}

int main()
{
	int a, n, m;
	int x, y, lim, ans;

	scanf("%d%d%d", &a, &n, &m);
	lim = tbl[n] - a, ans = 0;
	for (y = 1; y <= lim; y++) {
		x = (int)pow(y + a, n);
		if (x > m) break;
		if (sb(x) == y) ans++;
	}
	printf("%d\n", ans);
	return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// AOJ 0384: Dudeney Number
// 2019.2.20 bal4u
 
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int tbl[11] = { 0,0,10000,464,100,39,21,13,10,7,6 };

int sb(int a)
{
	int s = 0;
	while (a) {
		s += a % 10;
		a /= 10;
	}
	return s;
}

int main()
{
	int a, n, m;
	int x, y, lim, ans;

	scanf("%d%d%d", &a, &n, &m);
	lim = tbl[n] - a, ans = 0;
	for (y = 1; y <= lim; y++) {
		x = (int)pow(y + a, n);
		if (x > m) break;
		if (sb(x) == y) ans++;
	}
	printf("%d\n", ans);
	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:

16 2 1000

2

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

```c
// AOJ 0384: Dudeney Number
// 2019.2.20 bal4u
 
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int tbl[11] = { 0,0,10000,464,100,39,21,13,10,7,6 };

int sb(int a)
{
	int s = 0;
	while (a) {
		s += a % 10;
		a /= 10;
	}
	return s;
}

int main()
{
	int a, n, m;
	int x, y, lim, ans;

	scanf("%d%d%d", &a, &n, &m);
	lim = tbl[n] - a, ans = 0;
	for (y = 1; y <= lim; y++) {
		x = (int)pow(y + a, n);
		if (x > m) break;
		if (sb(x) == y) ans++;
	}
	printf("%d\n", ans);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	sb
	.type	sb, @function
sb:
.LFB39:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testl	%edi, %edi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	addl	%edi, %r8d
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	sb, .-sb
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rcx
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rcx
	leaq	tbl(%rip), %rdx
	movl	28(%rsp), %ebp
	movl	(%rdx,%rcx,4), %ebx
	subl	%ebp, %ebx
	testl	%ebx, %ebx
	jle	.L13
	pxor	%xmm1, %xmm1
	movl	36(%rsp), %r13d
	xorl	%r12d, %r12d
	movl	$1, %r14d
	cvtsi2sdl	%ecx, %xmm1
	.p2align 4,,10
	.p2align 3
.L11:
	leal	(%r14,%rbp), %eax
	pxor	%xmm0, %xmm0
	movsd	%xmm1, 8(%rsp)
	cvtsi2sdl	%eax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %edx
	cmpl	%r13d, %edx
	jg	.L8
	testl	%edx, %edx
	movsd	8(%rsp), %xmm1
	je	.L9
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	addl	%edx, %esi
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L10
	xorl	%eax, %eax
	cmpl	%r14d, %esi
	sete	%al
	addl	%eax, %r12d
.L9:
	addl	$1, %r14d
	cmpl	%r14d, %ebx
	jge	.L11
.L8:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L8
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	tbl
	.data
	.align 32
	.type	tbl, @object
	.size	tbl, 44
tbl:
	.long	0
	.long	0
	.long	10000
	.long	464
	.long	100
	.long	39
	.long	21
	.long	13
	.long	10
	.long	7
	.long	6
	.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
	.p2align 4
	.globl	sb
	.type	sb, @function
sb:
.LFB39:
	.cfi_startproc
	endbr64
	xorl	%r8d, %r8d
	testl	%edi, %edi
	je	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	%edi, %rax
	movl	%edi, %edx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %edx
	sarq	$34, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	addl	%edx, %edx
	subl	%edx, %edi
	addl	%edi, %r8d
	movl	%eax, %edi
	testl	%eax, %eax
	jne	.L3
.L1:
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	sb, .-sb
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$48, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rcx
	leaq	32(%rsp), %rdx
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	32(%rsp), %rcx
	leaq	tbl(%rip), %rdx
	movl	28(%rsp), %ebp
	movl	(%rdx,%rcx,4), %ebx
	subl	%ebp, %ebx
	testl	%ebx, %ebx
	jle	.L13
	pxor	%xmm1, %xmm1
	movl	36(%rsp), %r13d
	xorl	%r12d, %r12d
	movl	$1, %r14d
	cvtsi2sdl	%ecx, %xmm1
	.p2align 4,,10
	.p2align 3
.L11:
	leal	(%r14,%rbp), %eax
	pxor	%xmm0, %xmm0
	movsd	%xmm1, 8(%rsp)
	cvtsi2sdl	%eax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %edx
	cmpl	%r13d, %edx
	jg	.L8
	testl	%edx, %edx
	movsd	8(%rsp), %xmm1
	je	.L9
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1717986919, %rax, %rax
	sarl	$31, %ecx
	sarq	$34, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,4), %ecx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	addl	%edx, %esi
	movl	%eax, %edx
	testl	%eax, %eax
	jne	.L10
	xorl	%eax, %eax
	cmpl	%r14d, %esi
	sete	%al
	addl	%eax, %r12d
.L9:
	addl	$1, %r14d
	cmpl	%r14d, %ebx
	jge	.L11
.L8:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%r12d, %r12d
	jmp	.L8
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.globl	tbl
	.data
	.align 32
	.type	tbl, @object
	.size	tbl, 44
tbl:
	.long	0
	.long	0
	.long	10000
	.long	464
	.long	100
	.long	39
	.long	21
	.long	13
	.long	10
	.long	7
	.long	6
	.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:
```