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>

#define L 10

static int ans[ 11 ][ 331 ] = { { 0 } };

static void
solve (
  int   n,
  int   s,
  int * d
  )
{
  int i;

  if ( n > 10 ) return ;

  for ( i = 0; i < L; ++i )
  {
    const int tmp = d[ i ]
            , sum = s + n * tmp;

    if ( tmp < 0 ) continue ;

    ++ans[ n ][ sum ];
    d[ i ] = -1;
    solve ( n + 1, sum, d );
    d[ i ] = tmp;
  }

  return ;
}

/** Application main entry point. */
int
main (
  int     argc,
  char  * argv[ ]
  )
{
  int d[ ] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  solve ( 1, 0, d );

  for ( ; ; )
  {
    int n, s;

    if ( scanf ( "%d%d", &n, &s ) != 2 ) break ;

    if ( n > 10 || s > 330 )
    {
      puts ( "0" );
    }
    else
    {
      printf ( "%d\n", ans[ n ][ s ] );
    }
  }

  return ( 0 );
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	ans
	.comm	ans,14564,32
	.type	solve, @function
solve:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	cmpl	$10, -20(%rbp)
	jg	.L8
	movl	$0, -12(%rbp)
	jmp	.L4
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	imull	-8(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -8(%rbp)
	js	.L9
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$331, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$331, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	movl	-20(%rbp), %eax
	leal	1(%rax), %ecx
	movq	-32(%rbp), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	solve
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L6
.L9:
	nop
.L6:
	addl	$1, -12(%rbp)
.L4:
	cmpl	$9, -12(%rbp)
	jle	.L7
	jmp	.L1
.L8:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -68(%rbp)
	movq	%rsi, -80(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -48(%rbp)
	movl	$1, -44(%rbp)
	movl	$2, -40(%rbp)
	movl	$3, -36(%rbp)
	movl	$4, -32(%rbp)
	movl	$5, -28(%rbp)
	movl	$6, -24(%rbp)
	movl	$7, -20(%rbp)
	movl	$8, -16(%rbp)
	movl	$9, -12(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rdx
	movl	$0, %esi
	movl	$1, %edi
	call	solve
.L16:
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L11
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	jmp	.L18
.L11:
	movl	-56(%rbp), %eax
	cmpl	$10, %eax
	jg	.L13
	movl	-52(%rbp), %eax
	cmpl	$330, %eax
	jle	.L14
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	movl	-56(%rbp), %eax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$331, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	jmp	.L16
.L18:
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.type	solve, @function
solve:
.LFB23:
	.cfi_startproc
	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
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movl	%esi, 184(%rsp)
	cmpl	$11, %edi
	je	.L1
	movl	%edi, %r10d
	leal	1(%rdi), %edi
	leaq	ans(%rip), %r11
	movq	%rdx, %rcx
	movslq	%r10d, %rax
	leal	2(%r10), %ebx
	leal	3(%r10), %esi
	movl	%edi, 36(%rsp)
	imulq	$331, %rax, %rax
	leal	4(%r10), %edx
	movl	%ebx, 40(%rsp)
	leal	5(%r10), %r15d
	leal	6(%r10), %r14d
	movl	%esi, 44(%rsp)
	leal	7(%r10), %r9d
	leal	8(%r10), %ebp
	movl	%edx, 16(%rsp)
	movq	%rax, 112(%rsp)
	movslq	%edi, %rax
	leaq	40(%rcx), %r8
	imulq	$331, %rax, %rax
	movl	%r15d, 20(%rsp)
	movl	%r14d, 72(%rsp)
	movl	%ebp, 28(%rsp)
	movq	%rax, 120(%rsp)
	movslq	%ebx, %rax
	imulq	$331, %rax, %rax
	movq	%rcx, (%rsp)
	movl	%r9d, 24(%rsp)
	movl	%r10d, 32(%rsp)
	movq	%rcx, %r10
	movq	%rax, 128(%rsp)
	movslq	%esi, %rax
	imulq	$331, %rax, %rax
	movq	%rax, 136(%rsp)
	movslq	%edx, %rax
	imulq	$331, %rax, %rax
	movq	%rax, 56(%rsp)
	movslq	%r15d, %rax
	imulq	$331, %rax, %rax
	movq	%rax, 144(%rsp)
	movslq	%r14d, %rax
	imulq	$331, %rax, %rax
	movq	%rax, 152(%rsp)
	movslq	%r9d, %rax
	movq	%r8, %r9
	imulq	$331, %rax, %rax
	movq	%rax, 64(%rsp)
	movslq	%ebp, %rax
	imulq	$331, %rax, %rax
	movq	%rax, 160(%rsp)
.L28:
	movq	(%rsp), %rdi
	movl	(%rdi), %esi
	movl	%esi, 76(%rsp)
	testl	%esi, %esi
	js	.L3
	movl	32(%rsp), %eax
	movl	$-1, (%rdi)
	movq	%r10, 8(%rsp)
	imull	%esi, %eax
	addl	184(%rsp), %eax
	movl	%eax, 80(%rsp)
	cltq
	addq	112(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 36(%rsp)
	je	.L27
	movq	%r10, %r8
	movq	%r9, %r10
.L4:
	movq	8(%rsp), %rcx
	movl	(%rcx), %edi
	movl	%edi, 84(%rsp)
	testl	%edi, %edi
	js	.L5
	movl	36(%rsp), %eax
	movl	$-1, (%rcx)
	imull	%edi, %eax
	addl	80(%rsp), %eax
	movl	%eax, 88(%rsp)
	cltq
	addq	120(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 40(%rsp)
	je	.L26
	movq	%r10, %r9
	movq	%r8, %rcx
	movq	%r8, %r10
.L6:
	movl	(%r10), %ebx
	movl	%ebx, 92(%rsp)
	testl	%ebx, %ebx
	js	.L7
	movl	40(%rsp), %eax
	movl	$-1, (%r10)
	imull	%ebx, %eax
	addl	88(%rsp), %eax
	movl	%eax, 96(%rsp)
	cltq
	addq	128(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 44(%rsp)
	je	.L25
	movq	%r10, 168(%rsp)
	movq	%r9, %r8
	movq	%rcx, %r10
	movq	%rcx, %r9
.L8:
	movl	(%r9), %edx
	movl	%edx, 100(%rsp)
	testl	%edx, %edx
	js	.L9
	movl	44(%rsp), %eax
	movl	$-1, (%r9)
	imull	%edx, %eax
	addl	96(%rsp), %eax
	movl	%eax, 48(%rsp)
	cltq
	addq	136(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 16(%rsp)
	je	.L24
	movq	%r9, 176(%rsp)
	movq	%r10, %r12
	movq	%r10, %r9
.L10:
	movl	(%r12), %r10d
	testl	%r10d, %r10d
	js	.L11
	movl	16(%rsp), %eax
	movl	$-1, (%r12)
	imull	%r10d, %eax
	addl	48(%rsp), %eax
	movl	%eax, 52(%rsp)
	cltq
	addq	56(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 20(%rsp)
	je	.L23
	movl	%r10d, 188(%rsp)
	movq	%r9, %r14
	movq	%r12, 192(%rsp)
.L12:
	movl	(%r14), %ecx
	movl	%ecx, 104(%rsp)
	testl	%ecx, %ecx
	js	.L13
	movl	20(%rsp), %eax
	movl	$-1, (%r14)
	movq	%r9, %r13
	movq	%r14, %r10
	imull	%ecx, %eax
	addl	52(%rsp), %eax
	movl	%eax, 108(%rsp)
	cltq
	addq	144(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 72(%rsp)
	je	.L22
.L14:
	movl	0(%r13), %eax
	testl	%eax, %eax
	js	.L15
	movl	72(%rsp), %r15d
	movl	$-1, 0(%r13)
	movq	%r9, %rbx
	movq	%r13, %rcx
	imull	%eax, %r15d
	addl	108(%rsp), %r15d
	movslq	%r15d, %rdx
	addq	152(%rsp), %rdx
	addl	$1, (%r11,%rdx,4)
	cmpl	$11, 24(%rsp)
	je	.L21
.L16:
	movl	(%rbx), %r14d
	testl	%r14d, %r14d
	js	.L17
	movl	24(%rsp), %ebp
	movl	32(%rsp), %esi
	movl	$-1, (%rbx)
	movq	%r9, %r12
	imull	%r14d, %ebp
	leal	9(%rsi), %edi
	addl	%r15d, %ebp
	movslq	%ebp, %rdx
	addq	64(%rsp), %rdx
	addl	$1, (%r11,%rdx,4)
	cmpl	$11, 28(%rsp)
	je	.L20
	movl	%r14d, 208(%rsp)
	movl	%eax, %r14d
	movq	%rbx, 200(%rsp)
	movq	%r8, %rbx
.L18:
	movl	(%r12), %r13d
	testl	%r13d, %r13d
	js	.L19
	movl	28(%rsp), %esi
	movl	$-1, (%r12)
	movq	%rcx, 232(%rsp)
	imull	%r13d, %esi
	movq	%r10, 224(%rsp)
	movq	%r9, 216(%rsp)
	movl	%edi, 212(%rsp)
	addl	%ebp, %esi
	movslq	%esi, %rdx
	addq	160(%rsp), %rdx
	addl	$1, (%r11,%rdx,4)
	movq	%r9, %rdx
	call	solve
	movl	%r13d, (%r12)
	movq	232(%rsp), %rcx
	leaq	ans(%rip), %r11
	movq	224(%rsp), %r10
	movq	216(%rsp), %r9
	movl	212(%rsp), %edi
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$4, %r12
	cmpq	%r12, %rbx
	jne	.L18
	movl	%r14d, %eax
	movq	%rbx, %r8
	movl	208(%rsp), %r14d
	movq	200(%rsp), %rbx
.L20:
	movl	%r14d, (%rbx)
.L17:
	addq	$4, %rbx
	cmpq	%rbx, %r8
	jne	.L16
	movq	%rcx, %r13
.L21:
	movl	%eax, 0(%r13)
.L15:
	addq	$4, %r13
	cmpq	%r13, %r8
	jne	.L14
	movq	%r10, %r14
.L22:
	movl	104(%rsp), %eax
	movl	%eax, (%r14)
.L13:
	addq	$4, %r14
	cmpq	%r14, %r8
	jne	.L12
	movl	188(%rsp), %r10d
	movq	192(%rsp), %r12
.L23:
	movl	%r10d, (%r12)
.L11:
	addq	$4, %r12
	cmpq	%r12, %r8
	jne	.L10
	movq	%r9, %r10
	movq	176(%rsp), %r9
.L24:
	movl	100(%rsp), %eax
	movl	%eax, (%r9)
.L9:
	addq	$4, %r9
	cmpq	%r9, %r8
	jne	.L8
	movq	%r10, %rcx
	movq	168(%rsp), %r10
	movq	%r8, %r9
.L25:
	movl	92(%rsp), %eax
	movl	%eax, (%r10)
.L7:
	addq	$4, %r10
	cmpq	%r10, %r9
	jne	.L6
	movq	%r9, %r10
	movq	%rcx, %r8
.L26:
	movq	8(%rsp), %rax
	movl	84(%rsp), %ebx
	movl	%ebx, (%rax)
.L5:
	addq	$4, 8(%rsp)
	movq	8(%rsp), %rax
	cmpq	%rax, %r10
	jne	.L4
	movq	%r10, %r9
	movq	%r8, %r10
.L27:
	movq	(%rsp), %rax
	movl	76(%rsp), %ebx
	movl	%ebx, (%rax)
.L3:
	addq	$4, (%rsp)
	movq	(%rsp), %rax
	cmpq	%rax, %r9
	jne	.L28
.L1:
	addq	$248, %rsp
	.cfi_def_cfa_offset 56
	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
	.cfi_endproc
.LFE23:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%d%d"
.LC4:
	.string	"0"
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%esi, %esi
	movl	$1, %edi
	leaq	ans(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC5(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC4(%rip), %r13
	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	.LC3(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %r12
	movq	.LC2(%rip), %rax
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC1(%rip), %xmm0
	leaq	8(%rsp), %rbp
	movq	%rax, 48(%rsp)
	movaps	%xmm0, 32(%rsp)
	call	solve
	.p2align 4,,10
	.p2align 3
.L75:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L71
	movslq	8(%rsp), %rax
	cmpl	$10, %eax
	jg	.L72
	movslq	12(%rsp), %rdx
	cmpl	$330, %edx
	jle	.L73
.L72:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L73:
	imulq	$331, %rax, %rax
	movq	%r14, %rsi
	movl	$1, %edi
	addq	%rdx, %rax
	movl	(%r15,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L71:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L78
	addq	$72, %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
.L78:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.local	ans
	.comm	ans,14564,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	5
	.long	6
	.long	7
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	8
	.long	9
	.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
	.type	solve, @function
solve:
.LFB23:
	.cfi_startproc
	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
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movl	%esi, 184(%rsp)
	cmpl	$11, %edi
	je	.L1
	movl	%edi, %r10d
	leal	1(%rdi), %edi
	leaq	ans(%rip), %r11
	movq	%rdx, %rcx
	movslq	%r10d, %rax
	leal	2(%r10), %ebx
	leal	3(%r10), %esi
	movl	%edi, 36(%rsp)
	imulq	$331, %rax, %rax
	leal	4(%r10), %edx
	movl	%ebx, 40(%rsp)
	leal	5(%r10), %r15d
	leal	6(%r10), %r14d
	movl	%esi, 44(%rsp)
	leal	7(%r10), %r9d
	leal	8(%r10), %ebp
	movl	%edx, 16(%rsp)
	movq	%rax, 112(%rsp)
	movslq	%edi, %rax
	leaq	40(%rcx), %r8
	imulq	$331, %rax, %rax
	movl	%r15d, 20(%rsp)
	movl	%r14d, 72(%rsp)
	movl	%ebp, 28(%rsp)
	movq	%rax, 120(%rsp)
	movslq	%ebx, %rax
	imulq	$331, %rax, %rax
	movq	%rcx, (%rsp)
	movl	%r9d, 24(%rsp)
	movl	%r10d, 32(%rsp)
	movq	%rcx, %r10
	movq	%rax, 128(%rsp)
	movslq	%esi, %rax
	imulq	$331, %rax, %rax
	movq	%rax, 136(%rsp)
	movslq	%edx, %rax
	imulq	$331, %rax, %rax
	movq	%rax, 56(%rsp)
	movslq	%r15d, %rax
	imulq	$331, %rax, %rax
	movq	%rax, 144(%rsp)
	movslq	%r14d, %rax
	imulq	$331, %rax, %rax
	movq	%rax, 152(%rsp)
	movslq	%r9d, %rax
	movq	%r8, %r9
	imulq	$331, %rax, %rax
	movq	%rax, 64(%rsp)
	movslq	%ebp, %rax
	imulq	$331, %rax, %rax
	movq	%rax, 160(%rsp)
.L28:
	movq	(%rsp), %rdi
	movl	(%rdi), %esi
	movl	%esi, 76(%rsp)
	testl	%esi, %esi
	js	.L3
	movl	32(%rsp), %eax
	movl	$-1, (%rdi)
	movq	%r10, 8(%rsp)
	imull	%esi, %eax
	addl	184(%rsp), %eax
	movl	%eax, 80(%rsp)
	cltq
	addq	112(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 36(%rsp)
	je	.L27
	movq	%r10, %r8
	movq	%r9, %r10
.L4:
	movq	8(%rsp), %rcx
	movl	(%rcx), %edi
	movl	%edi, 84(%rsp)
	testl	%edi, %edi
	js	.L5
	movl	36(%rsp), %eax
	movl	$-1, (%rcx)
	imull	%edi, %eax
	addl	80(%rsp), %eax
	movl	%eax, 88(%rsp)
	cltq
	addq	120(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 40(%rsp)
	je	.L26
	movq	%r10, %r9
	movq	%r8, %rcx
	movq	%r8, %r10
.L6:
	movl	(%r10), %ebx
	movl	%ebx, 92(%rsp)
	testl	%ebx, %ebx
	js	.L7
	movl	40(%rsp), %eax
	movl	$-1, (%r10)
	imull	%ebx, %eax
	addl	88(%rsp), %eax
	movl	%eax, 96(%rsp)
	cltq
	addq	128(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 44(%rsp)
	je	.L25
	movq	%r10, 168(%rsp)
	movq	%r9, %r8
	movq	%rcx, %r10
	movq	%rcx, %r9
.L8:
	movl	(%r9), %edx
	movl	%edx, 100(%rsp)
	testl	%edx, %edx
	js	.L9
	movl	44(%rsp), %eax
	movl	$-1, (%r9)
	imull	%edx, %eax
	addl	96(%rsp), %eax
	movl	%eax, 48(%rsp)
	cltq
	addq	136(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 16(%rsp)
	je	.L24
	movq	%r9, 176(%rsp)
	movq	%r10, %r12
	movq	%r10, %r9
.L10:
	movl	(%r12), %r10d
	testl	%r10d, %r10d
	js	.L11
	movl	16(%rsp), %eax
	movl	$-1, (%r12)
	imull	%r10d, %eax
	addl	48(%rsp), %eax
	movl	%eax, 52(%rsp)
	cltq
	addq	56(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 20(%rsp)
	je	.L23
	movl	%r10d, 188(%rsp)
	movq	%r9, %r14
	movq	%r12, 192(%rsp)
.L12:
	movl	(%r14), %ecx
	movl	%ecx, 104(%rsp)
	testl	%ecx, %ecx
	js	.L13
	movl	20(%rsp), %eax
	movl	$-1, (%r14)
	movq	%r9, %r13
	movq	%r14, %r10
	imull	%ecx, %eax
	addl	52(%rsp), %eax
	movl	%eax, 108(%rsp)
	cltq
	addq	144(%rsp), %rax
	addl	$1, (%r11,%rax,4)
	cmpl	$11, 72(%rsp)
	je	.L22
.L14:
	movl	0(%r13), %eax
	testl	%eax, %eax
	js	.L15
	movl	72(%rsp), %r15d
	movl	$-1, 0(%r13)
	movq	%r9, %rbx
	movq	%r13, %rcx
	imull	%eax, %r15d
	addl	108(%rsp), %r15d
	movslq	%r15d, %rdx
	addq	152(%rsp), %rdx
	addl	$1, (%r11,%rdx,4)
	cmpl	$11, 24(%rsp)
	je	.L21
.L16:
	movl	(%rbx), %r14d
	testl	%r14d, %r14d
	js	.L17
	movl	24(%rsp), %ebp
	movl	32(%rsp), %esi
	movl	$-1, (%rbx)
	movq	%r9, %r12
	imull	%r14d, %ebp
	leal	9(%rsi), %edi
	addl	%r15d, %ebp
	movslq	%ebp, %rdx
	addq	64(%rsp), %rdx
	addl	$1, (%r11,%rdx,4)
	cmpl	$11, 28(%rsp)
	je	.L20
	movl	%r14d, 208(%rsp)
	movl	%eax, %r14d
	movq	%rbx, 200(%rsp)
	movq	%r8, %rbx
.L18:
	movl	(%r12), %r13d
	testl	%r13d, %r13d
	js	.L19
	movl	28(%rsp), %esi
	movl	$-1, (%r12)
	movq	%rcx, 232(%rsp)
	imull	%r13d, %esi
	movq	%r10, 224(%rsp)
	movq	%r9, 216(%rsp)
	movl	%edi, 212(%rsp)
	addl	%ebp, %esi
	movslq	%esi, %rdx
	addq	160(%rsp), %rdx
	addl	$1, (%r11,%rdx,4)
	movq	%r9, %rdx
	call	solve
	movl	%r13d, (%r12)
	movq	232(%rsp), %rcx
	leaq	ans(%rip), %r11
	movq	224(%rsp), %r10
	movq	216(%rsp), %r9
	movl	212(%rsp), %edi
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$4, %r12
	cmpq	%r12, %rbx
	jne	.L18
	movl	%r14d, %eax
	movq	%rbx, %r8
	movl	208(%rsp), %r14d
	movq	200(%rsp), %rbx
.L20:
	movl	%r14d, (%rbx)
.L17:
	addq	$4, %rbx
	cmpq	%rbx, %r8
	jne	.L16
	movq	%rcx, %r13
.L21:
	movl	%eax, 0(%r13)
.L15:
	addq	$4, %r13
	cmpq	%r13, %r8
	jne	.L14
	movq	%r10, %r14
.L22:
	movl	104(%rsp), %eax
	movl	%eax, (%r14)
.L13:
	addq	$4, %r14
	cmpq	%r14, %r8
	jne	.L12
	movl	188(%rsp), %r10d
	movq	192(%rsp), %r12
.L23:
	movl	%r10d, (%r12)
.L11:
	addq	$4, %r12
	cmpq	%r12, %r8
	jne	.L10
	movq	%r9, %r10
	movq	176(%rsp), %r9
.L24:
	movl	100(%rsp), %eax
	movl	%eax, (%r9)
.L9:
	addq	$4, %r9
	cmpq	%r9, %r8
	jne	.L8
	movq	%r10, %rcx
	movq	168(%rsp), %r10
	movq	%r8, %r9
.L25:
	movl	92(%rsp), %eax
	movl	%eax, (%r10)
.L7:
	addq	$4, %r10
	cmpq	%r10, %r9
	jne	.L6
	movq	%r9, %r10
	movq	%rcx, %r8
.L26:
	movq	8(%rsp), %rax
	movl	84(%rsp), %ebx
	movl	%ebx, (%rax)
.L5:
	addq	$4, 8(%rsp)
	movq	8(%rsp), %rax
	cmpq	%rax, %r10
	jne	.L4
	movq	%r10, %r9
	movq	%r8, %r10
.L27:
	movq	(%rsp), %rax
	movl	76(%rsp), %ebx
	movl	%ebx, (%rax)
.L3:
	addq	$4, (%rsp)
	movq	(%rsp), %rax
	cmpq	%rax, %r9
	jne	.L28
.L1:
	addq	$248, %rsp
	.cfi_def_cfa_offset 56
	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
	.cfi_endproc
.LFE23:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC3:
	.string	"%d%d"
.LC4:
	.string	"0"
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xorl	%esi, %esi
	movl	$1, %edi
	leaq	ans(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	.LC5(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC4(%rip), %r13
	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	.LC3(%rip), %rbx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movdqa	.LC0(%rip), %xmm0
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %r12
	movq	.LC2(%rip), %rax
	movaps	%xmm0, 16(%rsp)
	movdqa	.LC1(%rip), %xmm0
	leaq	8(%rsp), %rbp
	movq	%rax, 48(%rsp)
	movaps	%xmm0, 32(%rsp)
	call	solve
	.p2align 4,,10
	.p2align 3
.L75:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	jne	.L71
	movslq	8(%rsp), %rax
	cmpl	$10, %eax
	jg	.L72
	movslq	12(%rsp), %rdx
	cmpl	$330, %edx
	jle	.L73
.L72:
	movq	%r13, %rdi
	call	puts@PLT
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L73:
	imulq	$331, %rax, %rax
	movq	%r14, %rsi
	movl	$1, %edi
	addq	%rdx, %rax
	movl	(%r15,%rax,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L75
	.p2align 4,,10
	.p2align 3
.L71:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L78
	addq	$72, %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
.L78:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.local	ans
	.comm	ans,14564,32
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC1:
	.long	4
	.long	5
	.long	6
	.long	7
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	8
	.long	9
	.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>

#define L 10

static int ans[ 11 ][ 331 ] = { { 0 } };

static void
solve (
  int   n,
  int   s,
  int * d
  )
{
  int i;

  if ( n > 10 ) return ;

  for ( i = 0; i < L; ++i )
  {
    const int tmp = d[ i ]
            , sum = s + n * tmp;

    if ( tmp < 0 ) continue ;

    ++ans[ n ][ sum ];
    d[ i ] = -1;
    solve ( n + 1, sum, d );
    d[ i ] = tmp;
  }

  return ;
}

/** Application main entry point. */
int
main (
  int     argc,
  char  * argv[ ]
  )
{
  int d[ ] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  solve ( 1, 0, d );

  for ( ; ; )
  {
    int n, s;

    if ( scanf ( "%d%d", &n, &s ) != 2 ) break ;

    if ( n > 10 || s > 330 )
    {
      puts ( "0" );
    }
    else
    {
      printf ( "%d\n", ans[ n ][ s ] );
    }
  }

  return ( 0 );
}
4 10
3 1
 6 10
3 1
 2 14
3 1
 2 25
10 0
 2 4
10 0
 3 10
0 1
 3 14
10 3
 3 10
2 1
 2 9
3 1
 2 14
2 1

1
0
 0
0
 5
0
 2
0
 3
0
 8
0
 14
0
 8
1
 4
0
 5
1

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>

#define L 10

static int ans[ 11 ][ 331 ] = { { 0 } };

static void
solve (
  int   n,
  int   s,
  int * d
  )
{
  int i;

  if ( n > 10 ) return ;

  for ( i = 0; i < L; ++i )
  {
    const int tmp = d[ i ]
            , sum = s + n * tmp;

    if ( tmp < 0 ) continue ;

    ++ans[ n ][ sum ];
    d[ i ] = -1;
    solve ( n + 1, sum, d );
    d[ i ] = tmp;
  }

  return ;
}

/** Application main entry point. */
int
main (
  int     argc,
  char  * argv[ ]
  )
{
  int d[ ] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  solve ( 1, 0, d );

  for ( ; ; )
  {
    int n, s;

    if ( scanf ( "%d%d", &n, &s ) != 2 ) break ;

    if ( n > 10 || s > 330 )
    {
      puts ( "0" );
    }
    else
    {
      printf ( "%d\n", ans[ n ][ s ] );
    }
  }

  return ( 0 );
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.local	ans
	.comm	ans,14564,32
	.type	solve, @function
solve:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	cmpl	$10, -20(%rbp)
	jg	.L8
	movl	$0, -12(%rbp)
	jmp	.L4
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	imull	-8(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -8(%rbp)
	js	.L9
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$331, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$331, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	movl	-20(%rbp), %eax
	leal	1(%rax), %ecx
	movq	-32(%rbp), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	solve
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L6
.L9:
	nop
.L6:
	addl	$1, -12(%rbp)
.L4:
	cmpl	$9, -12(%rbp)
	jle	.L7
	jmp	.L1
.L8:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -68(%rbp)
	movq	%rsi, -80(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -48(%rbp)
	movl	$1, -44(%rbp)
	movl	$2, -40(%rbp)
	movl	$3, -36(%rbp)
	movl	$4, -32(%rbp)
	movl	$5, -28(%rbp)
	movl	$6, -24(%rbp)
	movl	$7, -20(%rbp)
	movl	$8, -16(%rbp)
	movl	$9, -12(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rdx
	movl	$0, %esi
	movl	$1, %edi
	call	solve
.L16:
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L11
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	jmp	.L18
.L11:
	movl	-56(%rbp), %eax
	cmpl	$10, %eax
	jg	.L13
	movl	-52(%rbp), %eax
	cmpl	$330, %eax
	jle	.L14
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	movl	-56(%rbp), %eax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$331, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	jmp	.L16
.L18:
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.local	ans
	.comm	ans,14564,32
	.type	solve, @function
solve:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movq	%rdx, -32(%rbp)
	cmpl	$10, -20(%rbp)
	jg	.L8
	movl	$0, -12(%rbp)
	jmp	.L4
.L7:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	imull	-8(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -8(%rbp)
	js	.L9
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$331, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	1(%rax), %ecx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$331, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	$-1, (%rax)
	movl	-20(%rbp), %eax
	leal	1(%rax), %ecx
	movq	-32(%rbp), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, %esi
	movl	%ecx, %edi
	call	solve
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movl	-8(%rbp), %eax
	movl	%eax, (%rdx)
	jmp	.L6
.L9:
	nop
.L6:
	addl	$1, -12(%rbp)
.L4:
	cmpl	$9, -12(%rbp)
	jle	.L7
	jmp	.L1
.L8:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -68(%rbp)
	movq	%rsi, -80(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -48(%rbp)
	movl	$1, -44(%rbp)
	movl	$2, -40(%rbp)
	movl	$3, -36(%rbp)
	movl	$4, -32(%rbp)
	movl	$5, -28(%rbp)
	movl	$6, -24(%rbp)
	movl	$7, -20(%rbp)
	movl	$8, -16(%rbp)
	movl	$9, -12(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rdx
	movl	$0, %esi
	movl	$1, %edi
	call	solve
.L16:
	leaq	-52(%rbp), %rdx
	leaq	-56(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$2, %eax
	je	.L11
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	jmp	.L18
.L11:
	movl	-56(%rbp), %eax
	cmpl	$10, %eax
	jg	.L13
	movl	-52(%rbp), %eax
	cmpl	$330, %eax
	jle	.L14
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	movl	-56(%rbp), %eax
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$331, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	ans(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	jmp	.L16
.L18:
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
