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>

int main(void) {

  long n;
  scanf("%ld", &n);
  long answer = 0;
  int generate[9];
  long number;
  int has7,has5,has3;
  for (int digits = 3; digits <= 9; digits++) {
    if (pow(10,digits-1) > n) {
      break;
    }
    for (int i = 0; i < digits; i++) {
      generate[i] = 0;
    }
    for (int i = 0; i < pow(3,digits)-1; i++) {
      number = 0;
      has3 = 0;
      has5 = 0;
      has7 = 0;
      for (int j = 0; j < digits; j++) {
        if (generate[j] == 0) {
          has3 = 1;
          number += 3*pow(10,j);
        }
        if (generate[j] == 1) {
          has5 = 1;
          number += 5*pow(10,j);
        }
        if (generate[j] == 2) {
          has7 = 1;
          number += 7*pow(10,j);
        }
      }
      if (has3 == 1 && has5 == 1 && has7 == 1 && number <= n) {
        answer++;
      }
      generate[0]++;
      for (int j = 1; j < digits; j++) {
        generate[j] += generate[j-1]/3;
        generate[j-1] %= 3;
      }
    }
  }
  printf("%ld\n", answer);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.LC6:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -64(%rbp)
	movl	$3, -92(%rbp)
	jmp	.L2
.L18:
	movl	-92(%rbp), %eax
	subl	$1, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	-72(%rbp), %rdx
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rdx, %xmm0
	movq	%rax, %xmm2
	comisd	%xmm0, %xmm2
	ja	.L21
	movl	$0, -88(%rbp)
	jmp	.L6
.L7:
	movl	-88(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	addl	$1, -88(%rbp)
.L6:
	movl	-88(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L7
	movl	$0, -84(%rbp)
	jmp	.L8
.L17:
	movq	$0, -56(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -104(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L9
.L13:
	movl	-80(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	movl	$1, -96(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-80(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	.LC2(%rip), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-56(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -56(%rbp)
.L10:
	movl	-80(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	$1, -100(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-80(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	.LC3(%rip), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-56(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -56(%rbp)
.L11:
	movl	-80(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L12
	movl	$1, -104(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-80(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	.LC4(%rip), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-56(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -56(%rbp)
.L12:
	addl	$1, -80(%rbp)
.L9:
	movl	-80(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L13
	cmpl	$1, -96(%rbp)
	jne	.L14
	cmpl	$1, -100(%rbp)
	jne	.L14
	cmpl	$1, -104(%rbp)
	jne	.L14
	movq	-72(%rbp), %rax
	cmpq	%rax, -56(%rbp)
	jg	.L14
	addq	$1, -64(%rbp)
.L14:
	movl	-48(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
	movl	$1, -76(%rbp)
	jmp	.L15
.L16:
	movl	-76(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %ecx
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	leal	(%rcx,%rax), %edx
	movl	-76(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-76(%rbp), %eax
	leal	-1(%rax), %esi
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%esi, %rdx
	movl	%eax, -48(%rbp,%rdx,4)
	addl	$1, -76(%rbp)
.L15:
	movl	-76(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L16
	addl	$1, -84(%rbp)
.L8:
	pxor	%xmm3, %xmm3
	cvtsi2sdl	-84(%rbp), %xmm3
	movsd	%xmm3, -120(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-92(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movsd	.LC5(%rip), %xmm1
	movq	%rax, %xmm0
	subsd	%xmm1, %xmm0
	comisd	-120(%rbp), %xmm0
	ja	.L17
	addl	$1, -92(%rbp)
.L2:
	cmpl	$9, -92(%rbp)
	jle	.L18
	jmp	.L5
.L21:
	nop
.L5:
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.align 8
.LC2:
	.long	0
	.long	1074266112
	.align 8
.LC3:
	.long	0
	.long	1075052544
	.align 8
.LC4:
	.long	0
	.long	1075576832
	.align 8
.LC5:
	.long	0
	.long	1072693248
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC28:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	$3, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	$12, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$2, %ebx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rbp
	pxor	%xmm7, %xmm7
	cvtsi2sdq	%rbp, %xmm7
	movsd	%xmm7, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L42:
	pxor	%xmm1, %xmm1
	movq	.LC1(%rip), %rax
	cvtsi2sdl	%ebx, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	comisd	8(%rsp), %xmm0
	ja	.L2
	movl	%r13d, %esi
	leaq	32(%rsp), %rdx
	movl	%r13d, %r8d
	xorl	%edi, %edi
	andl	$-8, %esi
	xorl	%eax, %eax
.L3:
	movl	%eax, %ecx
	addl	$8, %eax
	movq	%rdi, (%rdx,%rcx)
	cmpl	%esi, %eax
	jb	.L3
	movl	%eax, %eax
	addq	%rax, %rdx
	testb	$4, %r8b
	je	.L5
	movl	$0, (%rdx)
	addq	$4, %rdx
.L5:
	testb	$2, %r8b
	je	.L6
	xorl	%eax, %eax
	addq	$2, %rdx
	movw	%ax, -2(%rdx)
.L6:
	andl	$1, %r8d
	je	.L7
	movb	$0, (%rdx)
.L7:
	pxor	%xmm1, %xmm1
	xorl	%r15d, %r15d
	cvtsi2sdl	%r14d, %xmm1
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L100:
	cmpl	$1, %eax
	je	.L49
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	movl	$0, %ecx
	cmpl	$2, %eax
	movl	$7, %edx
	cmove	%rdx, %rcx
	sete	%r8b
.L9:
	movl	36(%rsp), %esi
	testl	%esi, %esi
	je	.L10
.L101:
	cmpl	$1, %esi
	je	.L91
	cmpl	$2, %esi
	jne	.L12
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC3(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L12:
	movl	40(%rsp), %edx
	testl	%edx, %edx
	je	.L13
.L102:
	cmpl	$1, %edx
	je	.L92
	cmpl	$2, %edx
	jne	.L15
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC6(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L15:
	cmpl	$3, %r14d
	je	.L16
.L103:
	movl	44(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L17
	cmpl	$1, %r10d
	je	.L93
	cmpl	$2, %r10d
	jne	.L19
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC9(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L19:
	cmpl	$4, %r14d
	je	.L20
	movl	48(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L21
	cmpl	$1, %r10d
	je	.L94
	cmpl	$2, %r10d
	jne	.L23
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC12(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L23:
	cmpl	$5, %r14d
	je	.L20
	movl	52(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L24
	cmpl	$1, %r10d
	je	.L95
	cmpl	$2, %r10d
	jne	.L26
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC15(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L26:
	cmpl	$6, %r14d
	je	.L20
	movl	56(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L27
	cmpl	$1, %r10d
	je	.L96
	cmpl	$2, %r10d
	jne	.L29
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC18(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L29:
	cmpl	$7, %r14d
	je	.L20
	movl	60(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L30
	cmpl	$1, %r10d
	je	.L97
	cmpl	$2, %r10d
	jne	.L32
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC21(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L32:
	cmpl	$9, %r14d
	jne	.L20
	movl	64(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L98
	cmpl	$1, %r10d
	je	.L35
	cmpl	$2, %r10d
	jne	.L20
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC25(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	.p2align 4,,10
	.p2align 3
.L20:
	cmpq	%rcx, %rbp
	setge	%cl
	testb	%r8b, %cl
	je	.L46
	testb	%r9b, %dil
	jne	.L44
.L46:
	addl	$1, %eax
.L43:
	movslq	%eax, %rcx
	movl	%eax, %edi
	imulq	$1431655766, %rcx, %rcx
	sarl	$31, %edi
	shrq	$32, %rcx
	subl	%edi, %ecx
	addl	%ecx, %esi
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %eax
	movl	%esi, %ecx
	movd	%esi, %xmm3
	movd	%eax, %xmm0
	movslq	%esi, %rax
	sarl	$31, %ecx
	imulq	$1431655766, %rax, %rax
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, 32(%rsp)
	shrq	$32, %rax
	subl	%ecx, %eax
	addl	%eax, %edx
	leal	(%rax,%rax,2), %eax
	subl	%eax, %esi
	movl	%edx, 40(%rsp)
	movl	$3, %eax
	movl	%esi, 36(%rsp)
	cmpl	$4, %ebx
	jbe	.L39
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ecx
	shrq	$32, %rax
	subl	%ecx, %eax
	movl	44(%rsp), %ecx
	addl	%eax, %ecx
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movslq	%ecx, %rax
	movd	%ecx, %xmm4
	imulq	$1431655766, %rax, %rax
	movd	%edx, %xmm0
	movl	%ecx, %edx
	sarl	$31, %edx
	punpckldq	%xmm4, %xmm0
	movq	%xmm0, 40(%rsp)
	shrq	$32, %rax
	subl	%edx, %eax
	movl	48(%rsp), %edx
	addl	%eax, %edx
	leal	(%rax,%rax,2), %eax
	subl	%eax, %ecx
	movl	%edx, 48(%rsp)
	movl	$5, %eax
	movl	%ecx, 44(%rsp)
	cmpl	$6, %ebx
	jle	.L39
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ecx
	shrq	$32, %rax
	subl	%ecx, %eax
	movl	52(%rsp), %ecx
	addl	%eax, %ecx
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movslq	%ecx, %rax
	movd	%ecx, %xmm5
	imulq	$1431655766, %rax, %rax
	movd	%edx, %xmm0
	movl	%ecx, %edx
	sarl	$31, %edx
	punpckldq	%xmm5, %xmm0
	movq	%xmm0, 48(%rsp)
	shrq	$32, %rax
	subl	%edx, %eax
	addl	%eax, 56(%rsp)
	leal	(%rax,%rax,2), %eax
	subl	%eax, %ecx
	movl	$7, %eax
	movl	%ecx, 52(%rsp)
.L39:
	leal	-1(%rax), %ecx
	movslq	%eax, %rsi
	movslq	%ecx, %rcx
	movslq	32(%rsp,%rcx,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	shrq	$32, %rdx
	subl	%edi, %edx
	addl	%edx, 32(%rsp,%rsi,4)
	movslq	32(%rsp,%rcx,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %edi
	movl	%edi, 32(%rsp,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %r14d
	jle	.L40
	movslq	32(%rsp,%rsi,4), %rdx
	movslq	%ecx, %rcx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	shrq	$32, %rdx
	subl	%edi, %edx
	addl	%edx, 32(%rsp,%rcx,4)
	movslq	32(%rsp,%rsi,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %edi
	movl	%edi, 32(%rsp,%rsi,4)
	leal	2(%rax), %esi
	cmpl	%esi, %r14d
	jle	.L40
	movslq	32(%rsp,%rcx,4), %rdx
	movslq	%esi, %rsi
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	shrq	$32, %rdx
	subl	%edi, %edx
	addl	%edx, 32(%rsp,%rsi,4)
	movslq	32(%rsp,%rcx,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %edi
	movl	%edi, 32(%rsp,%rcx,4)
	leal	3(%rax), %ecx
	cmpl	%ecx, %r14d
	jle	.L40
	movslq	32(%rsp,%rsi,4), %rdx
	movslq	%ecx, %rcx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	shrq	$32, %rdx
	subl	%edi, %edx
	addl	%edx, 32(%rsp,%rcx,4)
	movslq	32(%rsp,%rsi,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %edi
	movl	%edi, 32(%rsp,%rsi,4)
	leal	4(%rax), %esi
	cmpl	%esi, %r14d
	jle	.L40
	movslq	32(%rsp,%rcx,4), %rdx
	movslq	%esi, %rsi
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	shrq	$32, %rdx
	subl	%edi, %edx
	addl	%edx, 32(%rsp,%rsi,4)
	movslq	32(%rsp,%rcx,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %edi
	leal	5(%rax), %edx
	movl	%edi, 32(%rsp,%rcx,4)
	cmpl	%edx, %r14d
	jle	.L40
	movslq	32(%rsp,%rsi,4), %rcx
	movslq	%edx, %rdx
	movq	%rcx, %rdi
	imulq	$1431655766, %rcx, %rcx
	sarl	$31, %edi
	shrq	$32, %rcx
	subl	%edi, %ecx
	addl	%ecx, 32(%rsp,%rdx,4)
	movslq	32(%rsp,%rsi,4), %rcx
	movq	%rcx, %rdi
	imulq	$1431655766, %rcx, %rcx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rcx
	subl	%r8d, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edi
	movl	%edi, 32(%rsp,%rsi,4)
	leal	6(%rax), %esi
	cmpl	%esi, %r14d
	jle	.L40
	movslq	32(%rsp,%rdx,4), %rcx
	movslq	%esi, %rsi
	addl	$7, %eax
	movq	%rcx, %rdi
	imulq	$1431655766, %rcx, %rcx
	sarl	$31, %edi
	shrq	$32, %rcx
	subl	%edi, %ecx
	addl	%ecx, 32(%rsp,%rsi,4)
	movslq	32(%rsp,%rdx,4), %rcx
	movq	%rcx, %rdi
	imulq	$1431655766, %rcx, %rcx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rcx
	subl	%r8d, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edi
	movl	%edi, 32(%rsp,%rdx,4)
	cmpl	%eax, %r14d
	jle	.L40
	movslq	32(%rsp,%rsi,4), %rax
	movq	%rax, %rdx
	imulq	$1431655766, %rax, %rax
	sarl	$31, %edx
	shrq	$32, %rax
	subl	%edx, %eax
	addl	%eax, 64(%rsp)
	movslq	32(%rsp,%rsi,4), %rax
	movq	%rax, %rdx
	imulq	$1431655766, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrq	$32, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movl	%edx, 32(%rsp,%rsi,4)
.L40:
	addl	$1, %r15d
.L8:
	movq	.LC26(%rip), %rax
	movsd	%xmm1, (%rsp)
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm2, %xmm2
	movsd	(%rsp), %xmm1
	subsd	.LC27(%rip), %xmm0
	cvtsi2sdl	%r15d, %xmm2
	comisd	%xmm2, %xmm0
	jbe	.L99
	movl	32(%rsp), %eax
	testl	%eax, %eax
	jne	.L100
	movl	36(%rsp), %esi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %edi
	movl	$3, %ecx
	testl	%esi, %esi
	jne	.L101
.L10:
	pxor	%xmm0, %xmm0
	movl	40(%rsp), %edx
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC4(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	testl	%edx, %edx
	jne	.L102
.L13:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC7(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	cmpl	$3, %r14d
	jne	.L103
.L16:
	cmpq	%rcx, %rbp
	setge	%cl
	testb	%r8b, %cl
	je	.L37
	testb	%dil, %r9b
	jne	.L44
.L37:
	addl	$1, %eax
	movl	%eax, 32(%rsp)
.L38:
	movslq	32(%rsp), %rax
	movq	%rax, %rdx
	imulq	$1431655766, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrq	$32, %rax
	subl	%ecx, %eax
	addl	%eax, 36(%rsp)
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movslq	36(%rsp), %rax
	movl	%edx, 32(%rsp)
	movq	%rax, %rdx
	imulq	$1431655766, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrq	$32, %rax
	subl	%ecx, %eax
	addl	%eax, 40(%rsp)
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movl	%edx, 36(%rsp)
	jmp	.L40
.L44:
	addl	$1, %eax
	addq	$1, %r12
	movl	%eax, 32(%rsp)
	cmpl	$3, %r14d
	jne	.L43
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L17:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC10(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L49:
	movl	$1, %r9d
	xorl	%edi, %edi
	xorl	%r8d, %r8d
	movl	$5, %ecx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC13(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L91:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC2(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC16(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L92:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC5(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L27:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC19(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L93:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC8(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L30:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC22(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L99:
	addl	$1, %r14d
	addl	$1, %ebx
	addq	$4, %r13
	cmpl	$10, %r14d
	jne	.L42
.L2:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC28(%rip), %rsi
	call	__printf_chk@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L104
	addq	$88, %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
	.p2align 4,,10
	.p2align 3
.L94:
	.cfi_restore_state
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC11(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L98:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC23(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L95:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC14(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L96:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC17(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L29
.L97:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC20(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L32
.L35:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC24(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L20
.L104:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.align 8
.LC2:
	.long	0
	.long	1078525952
	.align 8
.LC3:
	.long	0
	.long	1079083008
	.align 8
.LC4:
	.long	0
	.long	1077805056
	.align 8
.LC5:
	.long	0
	.long	1082081280
	.align 8
.LC6:
	.long	0
	.long	1082515456
	.align 8
.LC7:
	.long	0
	.long	1081262080
	.align 8
.LC8:
	.long	0
	.long	1085507584
	.align 8
.LC9:
	.long	0
	.long	1086019584
	.align 8
.LC10:
	.long	0
	.long	1084715008
	.align 8
.LC11:
	.long	0
	.long	1088973312
	.align 8
.LC12:
	.long	0
	.long	1089541888
	.align 8
.LC13:
	.long	0
	.long	1088244736
	.align 8
.LC14:
	.long	0
	.long	1092519040
	.align 8
.LC15:
	.long	0
	.long	1092967616
	.align 8
.LC16:
	.long	0
	.long	1091719040
	.align 8
.LC17:
	.long	0
	.long	1095963344
	.align 8
.LC18:
	.long	0
	.long	1096463344
	.align 8
.LC19:
	.long	0
	.long	1095164768
	.align 8
.LC20:
	.long	0
	.long	1099421572
	.align 8
.LC21:
	.long	0
	.long	1100001398
	.align 8
.LC22:
	.long	0
	.long	1098685496
	.align 8
.LC23:
	.long	0
	.long	1102176675
	.align 8
.LC24:
	.long	0
	.long	1102957925
	.align 8
.LC25:
	.long	-2147483648
	.long	1103420563
	.align 8
.LC26:
	.long	0
	.long	1074266112
	.align 8
.LC27:
	.long	0
	.long	1072693248
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC28:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	$3, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	$12, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	xorl	%r12d, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	$2, %ebx
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rbp
	pxor	%xmm7, %xmm7
	cvtsi2sdq	%rbp, %xmm7
	movsd	%xmm7, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L42:
	pxor	%xmm1, %xmm1
	movq	.LC1(%rip), %rax
	cvtsi2sdl	%ebx, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	comisd	8(%rsp), %xmm0
	ja	.L2
	movl	%r13d, %esi
	leaq	32(%rsp), %rdx
	movl	%r13d, %r8d
	xorl	%edi, %edi
	andl	$-8, %esi
	xorl	%eax, %eax
.L3:
	movl	%eax, %ecx
	addl	$8, %eax
	movq	%rdi, (%rdx,%rcx)
	cmpl	%esi, %eax
	jb	.L3
	movl	%eax, %eax
	addq	%rax, %rdx
	testb	$4, %r8b
	je	.L5
	movl	$0, (%rdx)
	addq	$4, %rdx
.L5:
	testb	$2, %r8b
	je	.L6
	xorl	%eax, %eax
	addq	$2, %rdx
	movw	%ax, -2(%rdx)
.L6:
	andl	$1, %r8d
	je	.L7
	movb	$0, (%rdx)
.L7:
	pxor	%xmm1, %xmm1
	xorl	%r15d, %r15d
	cvtsi2sdl	%r14d, %xmm1
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L100:
	cmpl	$1, %eax
	je	.L49
	xorl	%r8d, %r8d
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	movl	$0, %ecx
	cmpl	$2, %eax
	movl	$7, %edx
	cmove	%rdx, %rcx
	sete	%r8b
.L9:
	movl	36(%rsp), %esi
	testl	%esi, %esi
	je	.L10
.L101:
	cmpl	$1, %esi
	je	.L91
	cmpl	$2, %esi
	jne	.L12
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC3(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L12:
	movl	40(%rsp), %edx
	testl	%edx, %edx
	je	.L13
.L102:
	cmpl	$1, %edx
	je	.L92
	cmpl	$2, %edx
	jne	.L15
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC6(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L15:
	cmpl	$3, %r14d
	je	.L16
.L103:
	movl	44(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L17
	cmpl	$1, %r10d
	je	.L93
	cmpl	$2, %r10d
	jne	.L19
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC9(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L19:
	cmpl	$4, %r14d
	je	.L20
	movl	48(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L21
	cmpl	$1, %r10d
	je	.L94
	cmpl	$2, %r10d
	jne	.L23
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC12(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L23:
	cmpl	$5, %r14d
	je	.L20
	movl	52(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L24
	cmpl	$1, %r10d
	je	.L95
	cmpl	$2, %r10d
	jne	.L26
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC15(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L26:
	cmpl	$6, %r14d
	je	.L20
	movl	56(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L27
	cmpl	$1, %r10d
	je	.L96
	cmpl	$2, %r10d
	jne	.L29
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC18(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L29:
	cmpl	$7, %r14d
	je	.L20
	movl	60(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L30
	cmpl	$1, %r10d
	je	.L97
	cmpl	$2, %r10d
	jne	.L32
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC21(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
.L32:
	cmpl	$9, %r14d
	jne	.L20
	movl	64(%rsp), %r10d
	testl	%r10d, %r10d
	je	.L98
	cmpl	$1, %r10d
	je	.L35
	cmpl	$2, %r10d
	jne	.L20
	pxor	%xmm0, %xmm0
	movl	$1, %r8d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC25(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	.p2align 4,,10
	.p2align 3
.L20:
	cmpq	%rcx, %rbp
	setge	%cl
	testb	%r8b, %cl
	je	.L46
	testb	%r9b, %dil
	jne	.L44
.L46:
	addl	$1, %eax
.L43:
	movslq	%eax, %rcx
	movl	%eax, %edi
	imulq	$1431655766, %rcx, %rcx
	sarl	$31, %edi
	shrq	$32, %rcx
	subl	%edi, %ecx
	addl	%ecx, %esi
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %eax
	movl	%esi, %ecx
	movd	%esi, %xmm3
	movd	%eax, %xmm0
	movslq	%esi, %rax
	sarl	$31, %ecx
	imulq	$1431655766, %rax, %rax
	punpckldq	%xmm3, %xmm0
	movq	%xmm0, 32(%rsp)
	shrq	$32, %rax
	subl	%ecx, %eax
	addl	%eax, %edx
	leal	(%rax,%rax,2), %eax
	subl	%eax, %esi
	movl	%edx, 40(%rsp)
	movl	$3, %eax
	movl	%esi, 36(%rsp)
	cmpl	$4, %ebx
	jbe	.L39
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ecx
	shrq	$32, %rax
	subl	%ecx, %eax
	movl	44(%rsp), %ecx
	addl	%eax, %ecx
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movslq	%ecx, %rax
	movd	%ecx, %xmm4
	imulq	$1431655766, %rax, %rax
	movd	%edx, %xmm0
	movl	%ecx, %edx
	sarl	$31, %edx
	punpckldq	%xmm4, %xmm0
	movq	%xmm0, 40(%rsp)
	shrq	$32, %rax
	subl	%edx, %eax
	movl	48(%rsp), %edx
	addl	%eax, %edx
	leal	(%rax,%rax,2), %eax
	subl	%eax, %ecx
	movl	%edx, 48(%rsp)
	movl	$5, %eax
	movl	%ecx, 44(%rsp)
	cmpl	$6, %ebx
	jle	.L39
	movslq	%edx, %rax
	movl	%edx, %ecx
	imulq	$1431655766, %rax, %rax
	sarl	$31, %ecx
	shrq	$32, %rax
	subl	%ecx, %eax
	movl	52(%rsp), %ecx
	addl	%eax, %ecx
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movslq	%ecx, %rax
	movd	%ecx, %xmm5
	imulq	$1431655766, %rax, %rax
	movd	%edx, %xmm0
	movl	%ecx, %edx
	sarl	$31, %edx
	punpckldq	%xmm5, %xmm0
	movq	%xmm0, 48(%rsp)
	shrq	$32, %rax
	subl	%edx, %eax
	addl	%eax, 56(%rsp)
	leal	(%rax,%rax,2), %eax
	subl	%eax, %ecx
	movl	$7, %eax
	movl	%ecx, 52(%rsp)
.L39:
	leal	-1(%rax), %ecx
	movslq	%eax, %rsi
	movslq	%ecx, %rcx
	movslq	32(%rsp,%rcx,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	shrq	$32, %rdx
	subl	%edi, %edx
	addl	%edx, 32(%rsp,%rsi,4)
	movslq	32(%rsp,%rcx,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %edi
	movl	%edi, 32(%rsp,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %r14d
	jle	.L40
	movslq	32(%rsp,%rsi,4), %rdx
	movslq	%ecx, %rcx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	shrq	$32, %rdx
	subl	%edi, %edx
	addl	%edx, 32(%rsp,%rcx,4)
	movslq	32(%rsp,%rsi,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %edi
	movl	%edi, 32(%rsp,%rsi,4)
	leal	2(%rax), %esi
	cmpl	%esi, %r14d
	jle	.L40
	movslq	32(%rsp,%rcx,4), %rdx
	movslq	%esi, %rsi
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	shrq	$32, %rdx
	subl	%edi, %edx
	addl	%edx, 32(%rsp,%rsi,4)
	movslq	32(%rsp,%rcx,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %edi
	movl	%edi, 32(%rsp,%rcx,4)
	leal	3(%rax), %ecx
	cmpl	%ecx, %r14d
	jle	.L40
	movslq	32(%rsp,%rsi,4), %rdx
	movslq	%ecx, %rcx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	shrq	$32, %rdx
	subl	%edi, %edx
	addl	%edx, 32(%rsp,%rcx,4)
	movslq	32(%rsp,%rsi,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %edi
	movl	%edi, 32(%rsp,%rsi,4)
	leal	4(%rax), %esi
	cmpl	%esi, %r14d
	jle	.L40
	movslq	32(%rsp,%rcx,4), %rdx
	movslq	%esi, %rsi
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	sarl	$31, %edi
	shrq	$32, %rdx
	subl	%edi, %edx
	addl	%edx, 32(%rsp,%rsi,4)
	movslq	32(%rsp,%rcx,4), %rdx
	movq	%rdx, %rdi
	imulq	$1431655766, %rdx, %rdx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rdx
	subl	%r8d, %edx
	leal	(%rdx,%rdx,2), %edx
	subl	%edx, %edi
	leal	5(%rax), %edx
	movl	%edi, 32(%rsp,%rcx,4)
	cmpl	%edx, %r14d
	jle	.L40
	movslq	32(%rsp,%rsi,4), %rcx
	movslq	%edx, %rdx
	movq	%rcx, %rdi
	imulq	$1431655766, %rcx, %rcx
	sarl	$31, %edi
	shrq	$32, %rcx
	subl	%edi, %ecx
	addl	%ecx, 32(%rsp,%rdx,4)
	movslq	32(%rsp,%rsi,4), %rcx
	movq	%rcx, %rdi
	imulq	$1431655766, %rcx, %rcx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rcx
	subl	%r8d, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edi
	movl	%edi, 32(%rsp,%rsi,4)
	leal	6(%rax), %esi
	cmpl	%esi, %r14d
	jle	.L40
	movslq	32(%rsp,%rdx,4), %rcx
	movslq	%esi, %rsi
	addl	$7, %eax
	movq	%rcx, %rdi
	imulq	$1431655766, %rcx, %rcx
	sarl	$31, %edi
	shrq	$32, %rcx
	subl	%edi, %ecx
	addl	%ecx, 32(%rsp,%rsi,4)
	movslq	32(%rsp,%rdx,4), %rcx
	movq	%rcx, %rdi
	imulq	$1431655766, %rcx, %rcx
	movl	%edi, %r8d
	sarl	$31, %r8d
	shrq	$32, %rcx
	subl	%r8d, %ecx
	leal	(%rcx,%rcx,2), %ecx
	subl	%ecx, %edi
	movl	%edi, 32(%rsp,%rdx,4)
	cmpl	%eax, %r14d
	jle	.L40
	movslq	32(%rsp,%rsi,4), %rax
	movq	%rax, %rdx
	imulq	$1431655766, %rax, %rax
	sarl	$31, %edx
	shrq	$32, %rax
	subl	%edx, %eax
	addl	%eax, 64(%rsp)
	movslq	32(%rsp,%rsi,4), %rax
	movq	%rax, %rdx
	imulq	$1431655766, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrq	$32, %rax
	subl	%ecx, %eax
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movl	%edx, 32(%rsp,%rsi,4)
.L40:
	addl	$1, %r15d
.L8:
	movq	.LC26(%rip), %rax
	movsd	%xmm1, (%rsp)
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm2, %xmm2
	movsd	(%rsp), %xmm1
	subsd	.LC27(%rip), %xmm0
	cvtsi2sdl	%r15d, %xmm2
	comisd	%xmm2, %xmm0
	jbe	.L99
	movl	32(%rsp), %eax
	testl	%eax, %eax
	jne	.L100
	movl	36(%rsp), %esi
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	movl	$1, %edi
	movl	$3, %ecx
	testl	%esi, %esi
	jne	.L101
.L10:
	pxor	%xmm0, %xmm0
	movl	40(%rsp), %edx
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC4(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	testl	%edx, %edx
	jne	.L102
.L13:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC7(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	cmpl	$3, %r14d
	jne	.L103
.L16:
	cmpq	%rcx, %rbp
	setge	%cl
	testb	%r8b, %cl
	je	.L37
	testb	%dil, %r9b
	jne	.L44
.L37:
	addl	$1, %eax
	movl	%eax, 32(%rsp)
.L38:
	movslq	32(%rsp), %rax
	movq	%rax, %rdx
	imulq	$1431655766, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrq	$32, %rax
	subl	%ecx, %eax
	addl	%eax, 36(%rsp)
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movslq	36(%rsp), %rax
	movl	%edx, 32(%rsp)
	movq	%rax, %rdx
	imulq	$1431655766, %rax, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	shrq	$32, %rax
	subl	%ecx, %eax
	addl	%eax, 40(%rsp)
	leal	(%rax,%rax,2), %eax
	subl	%eax, %edx
	movl	%edx, 36(%rsp)
	jmp	.L40
.L44:
	addl	$1, %eax
	addq	$1, %r12
	movl	%eax, 32(%rsp)
	cmpl	$3, %r14d
	jne	.L43
	jmp	.L38
	.p2align 4,,10
	.p2align 3
.L17:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC10(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L49:
	movl	$1, %r9d
	xorl	%edi, %edi
	xorl	%r8d, %r8d
	movl	$5, %ecx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L21:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC13(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L91:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC2(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC16(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L92:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC5(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L27:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC19(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L93:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC8(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L30:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC22(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L99:
	addl	$1, %r14d
	addl	$1, %ebx
	addq	$4, %r13
	cmpl	$10, %r14d
	jne	.L42
.L2:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC28(%rip), %rsi
	call	__printf_chk@PLT
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L104
	addq	$88, %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
	.p2align 4,,10
	.p2align 3
.L94:
	.cfi_restore_state
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC11(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L98:
	pxor	%xmm0, %xmm0
	movl	$1, %edi
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC23(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L95:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC14(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L96:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC17(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L29
.L97:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC20(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L32
.L35:
	pxor	%xmm0, %xmm0
	movl	$1, %r9d
	cvtsi2sdq	%rcx, %xmm0
	addsd	.LC24(%rip), %xmm0
	cvttsd2siq	%xmm0, %rcx
	jmp	.L20
.L104:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.align 8
.LC2:
	.long	0
	.long	1078525952
	.align 8
.LC3:
	.long	0
	.long	1079083008
	.align 8
.LC4:
	.long	0
	.long	1077805056
	.align 8
.LC5:
	.long	0
	.long	1082081280
	.align 8
.LC6:
	.long	0
	.long	1082515456
	.align 8
.LC7:
	.long	0
	.long	1081262080
	.align 8
.LC8:
	.long	0
	.long	1085507584
	.align 8
.LC9:
	.long	0
	.long	1086019584
	.align 8
.LC10:
	.long	0
	.long	1084715008
	.align 8
.LC11:
	.long	0
	.long	1088973312
	.align 8
.LC12:
	.long	0
	.long	1089541888
	.align 8
.LC13:
	.long	0
	.long	1088244736
	.align 8
.LC14:
	.long	0
	.long	1092519040
	.align 8
.LC15:
	.long	0
	.long	1092967616
	.align 8
.LC16:
	.long	0
	.long	1091719040
	.align 8
.LC17:
	.long	0
	.long	1095963344
	.align 8
.LC18:
	.long	0
	.long	1096463344
	.align 8
.LC19:
	.long	0
	.long	1095164768
	.align 8
.LC20:
	.long	0
	.long	1099421572
	.align 8
.LC21:
	.long	0
	.long	1100001398
	.align 8
.LC22:
	.long	0
	.long	1098685496
	.align 8
.LC23:
	.long	0
	.long	1102176675
	.align 8
.LC24:
	.long	0
	.long	1102957925
	.align 8
.LC25:
	.long	-2147483648
	.long	1103420563
	.align 8
.LC26:
	.long	0
	.long	1074266112
	.align 8
.LC27:
	.long	0
	.long	1072693248
	.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>

int main(void) {

  long n;
  scanf("%ld", &n);
  long answer = 0;
  int generate[9];
  long number;
  int has7,has5,has3;
  for (int digits = 3; digits <= 9; digits++) {
    if (pow(10,digits-1) > n) {
      break;
    }
    for (int i = 0; i < digits; i++) {
      generate[i] = 0;
    }
    for (int i = 0; i < pow(3,digits)-1; i++) {
      number = 0;
      has3 = 0;
      has5 = 0;
      has7 = 0;
      for (int j = 0; j < digits; j++) {
        if (generate[j] == 0) {
          has3 = 1;
          number += 3*pow(10,j);
        }
        if (generate[j] == 1) {
          has5 = 1;
          number += 5*pow(10,j);
        }
        if (generate[j] == 2) {
          has7 = 1;
          number += 7*pow(10,j);
        }
      }
      if (has3 == 1 && has5 == 1 && has7 == 1 && number <= n) {
        answer++;
      }
      generate[0]++;
      for (int j = 1; j < digits; j++) {
        generate[j] += generate[j-1]/3;
        generate[j-1] %= 3;
      }
    }
  }
  printf("%ld\n", answer);

  return 0;
}
60
 1134
 656396080
 1260308870
 251112438
 3669
 4753
 3412
 5825
 471776498

0
 6
 20434
 26484
 8334
 13
 18
 8
 30
 14384

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>

int main(void) {

  long n;
  scanf("%ld", &n);
  long answer = 0;
  int generate[9];
  long number;
  int has7,has5,has3;
  for (int digits = 3; digits <= 9; digits++) {
    if (pow(10,digits-1) > n) {
      break;
    }
    for (int i = 0; i < digits; i++) {
      generate[i] = 0;
    }
    for (int i = 0; i < pow(3,digits)-1; i++) {
      number = 0;
      has3 = 0;
      has5 = 0;
      has7 = 0;
      for (int j = 0; j < digits; j++) {
        if (generate[j] == 0) {
          has3 = 1;
          number += 3*pow(10,j);
        }
        if (generate[j] == 1) {
          has5 = 1;
          number += 5*pow(10,j);
        }
        if (generate[j] == 2) {
          has7 = 1;
          number += 7*pow(10,j);
        }
      }
      if (has3 == 1 && has5 == 1 && has7 == 1 && number <= n) {
        answer++;
      }
      generate[0]++;
      for (int j = 1; j < digits; j++) {
        generate[j] += generate[j-1]/3;
        generate[j-1] %= 3;
      }
    }
  }
  printf("%ld\n", answer);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.LC6:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -64(%rbp)
	movl	$3, -92(%rbp)
	jmp	.L2
.L18:
	movl	-92(%rbp), %eax
	subl	$1, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	-72(%rbp), %rdx
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rdx, %xmm0
	movq	%rax, %xmm2
	comisd	%xmm0, %xmm2
	ja	.L21
	movl	$0, -88(%rbp)
	jmp	.L6
.L7:
	movl	-88(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	addl	$1, -88(%rbp)
.L6:
	movl	-88(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L7
	movl	$0, -84(%rbp)
	jmp	.L8
.L17:
	movq	$0, -56(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -104(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L9
.L13:
	movl	-80(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	movl	$1, -96(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-80(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	.LC2(%rip), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-56(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -56(%rbp)
.L10:
	movl	-80(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	$1, -100(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-80(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	.LC3(%rip), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-56(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -56(%rbp)
.L11:
	movl	-80(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L12
	movl	$1, -104(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-80(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	.LC4(%rip), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-56(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -56(%rbp)
.L12:
	addl	$1, -80(%rbp)
.L9:
	movl	-80(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L13
	cmpl	$1, -96(%rbp)
	jne	.L14
	cmpl	$1, -100(%rbp)
	jne	.L14
	cmpl	$1, -104(%rbp)
	jne	.L14
	movq	-72(%rbp), %rax
	cmpq	%rax, -56(%rbp)
	jg	.L14
	addq	$1, -64(%rbp)
.L14:
	movl	-48(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
	movl	$1, -76(%rbp)
	jmp	.L15
.L16:
	movl	-76(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %ecx
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	leal	(%rcx,%rax), %edx
	movl	-76(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-76(%rbp), %eax
	leal	-1(%rax), %esi
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%esi, %rdx
	movl	%eax, -48(%rbp,%rdx,4)
	addl	$1, -76(%rbp)
.L15:
	movl	-76(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L16
	addl	$1, -84(%rbp)
.L8:
	pxor	%xmm3, %xmm3
	cvtsi2sdl	-84(%rbp), %xmm3
	movsd	%xmm3, -120(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-92(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movsd	.LC5(%rip), %xmm1
	movq	%rax, %xmm0
	subsd	%xmm1, %xmm0
	comisd	-120(%rbp), %xmm0
	ja	.L17
	addl	$1, -92(%rbp)
.L2:
	cmpl	$9, -92(%rbp)
	jle	.L18
	jmp	.L5
.L21:
	nop
.L5:
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.align 8
.LC2:
	.long	0
	.long	1074266112
	.align 8
.LC3:
	.long	0
	.long	1075052544
	.align 8
.LC4:
	.long	0
	.long	1075576832
	.align 8
.LC5:
	.long	0
	.long	1072693248
	.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
	.section	.rodata
.LC0:
	.string	"%ld"
.LC6:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -64(%rbp)
	movl	$3, -92(%rbp)
	jmp	.L2
.L18:
	movl	-92(%rbp), %eax
	subl	$1, %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	-72(%rbp), %rdx
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rdx, %xmm0
	movq	%rax, %xmm2
	comisd	%xmm0, %xmm2
	ja	.L21
	movl	$0, -88(%rbp)
	jmp	.L6
.L7:
	movl	-88(%rbp), %eax
	cltq
	movl	$0, -48(%rbp,%rax,4)
	addl	$1, -88(%rbp)
.L6:
	movl	-88(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L7
	movl	$0, -84(%rbp)
	jmp	.L8
.L17:
	movq	$0, -56(%rbp)
	movl	$0, -96(%rbp)
	movl	$0, -100(%rbp)
	movl	$0, -104(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L9
.L13:
	movl	-80(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L10
	movl	$1, -96(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-80(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	.LC2(%rip), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-56(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -56(%rbp)
.L10:
	movl	-80(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L11
	movl	$1, -100(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-80(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	.LC3(%rip), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-56(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -56(%rbp)
.L11:
	movl	-80(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	cmpl	$2, %eax
	jne	.L12
	movl	$1, -104(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-80(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	.LC4(%rip), %xmm1
	mulsd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-56(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -56(%rbp)
.L12:
	addl	$1, -80(%rbp)
.L9:
	movl	-80(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L13
	cmpl	$1, -96(%rbp)
	jne	.L14
	cmpl	$1, -100(%rbp)
	jne	.L14
	cmpl	$1, -104(%rbp)
	jne	.L14
	movq	-72(%rbp), %rax
	cmpq	%rax, -56(%rbp)
	jg	.L14
	addq	$1, -64(%rbp)
.L14:
	movl	-48(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -48(%rbp)
	movl	$1, -76(%rbp)
	jmp	.L15
.L16:
	movl	-76(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %ecx
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %eax
	leal	(%rcx,%rax), %edx
	movl	-76(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-76(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %edx
	movl	-76(%rbp), %eax
	leal	-1(%rax), %esi
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movslq	%esi, %rdx
	movl	%eax, -48(%rbp,%rdx,4)
	addl	$1, -76(%rbp)
.L15:
	movl	-76(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L16
	addl	$1, -84(%rbp)
.L8:
	pxor	%xmm3, %xmm3
	cvtsi2sdl	-84(%rbp), %xmm3
	movsd	%xmm3, -120(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-92(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movsd	.LC5(%rip), %xmm1
	movq	%rax, %xmm0
	subsd	%xmm1, %xmm0
	comisd	-120(%rbp), %xmm0
	ja	.L17
	addl	$1, -92(%rbp)
.L2:
	cmpl	$9, -92(%rbp)
	jle	.L18
	jmp	.L5
.L21:
	nop
.L5:
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC6(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.align 8
.LC2:
	.long	0
	.long	1074266112
	.align 8
.LC3:
	.long	0
	.long	1075052544
	.align 8
.LC4:
	.long	0
	.long	1075576832
	.align 8
.LC5:
	.long	0
	.long	1072693248
	.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:
