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>

typedef long long ll;

ll keta(ll a){
  int count = 0;
  while(a > 0){
    a/= 10;
    count ++;
  }

  return count-1;
}

int main(void){
  
  ll n;
  scanf("%lld",&n);

  int count = 0 , k = 0;
  ll a = n;
  while(a > 0){
    k += a%10; 
    a/= 10;
    count ++;
  }


  ll ans = 9*keta(n) + (n/(long long)pow(10,keta(n)))-1;
  if(k > ans){
    ans = k;
  }

  printf("%lld\n",ans);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	keta
	.type	keta, @function
keta:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -4(%rbp)
.L2:
	cmpq	$0, -24(%rbp)
	jg	.L3
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	keta, .-keta
	.section	.rodata
.LC0:
	.string	"%lld"
.LC2:
	.string	"%lld\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
	pushq	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -56(%rbp)
	movl	$0, -52(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -40(%rbp)
	jmp	.L6
.L7:
	movq	-40(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -52(%rbp)
	movq	-40(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -40(%rbp)
	addl	$1, -56(%rbp)
.L6:
	cmpq	$0, -40(%rbp)
	jg	.L7
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	keta
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	leaq	(%rax,%rdx), %r12
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	keta
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2siq	%xmm0, %rdi
	movq	%rbx, %rax
	cqto
	idivq	%rdi
	addq	%r12, %rax
	subq	$1, %rax
	movq	%rax, -32(%rbp)
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jge	.L8
	movl	-52(%rbp), %eax
	cltq
	movq	%rax, -32(%rbp)
.L8:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	keta
	.type	keta, @function
keta:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rdx
	testq	%rdi, %rdi
	jle	.L4
	movabsq	$-3689348814741910323, %rdi
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rdx, %rax
	movq	%rdx, %rsi
	mulq	%rdi
	movslq	%ecx, %rax
	addl	$1, %ecx
	shrq	$3, %rdx
	cmpq	$9, %rsi
	jg	.L3
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movq	$-1, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	keta, .-keta
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rbp
	testq	%rbp, %rbp
	jle	.L14
	movabsq	$-3689348814741910323, %rdi
	movq	%rbp, %rcx
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rcx, %rax
	mulq	%rdi
	movq	%rcx, %rax
	shrq	$3, %rdx
	leaq	(%rdx,%rdx,4), %rsi
	addq	%rsi, %rsi
	subq	%rsi, %rax
	addl	%eax, %ebx
	movq	%rcx, %rax
	movq	%rdx, %rcx
	cmpq	$9, %rax
	jg	.L9
	movabsq	$-3689348814741910323, %rdi
	movq	%rbp, %rdx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdx, %rax
	movq	%rdx, %rsi
	mulq	%rdi
	movslq	%ecx, %rax
	addl	$1, %ecx
	shrq	$3, %rdx
	cmpq	$9, %rsi
	jg	.L10
	leaq	(%rax,%rax,8), %r12
	movq	%rbp, %rdx
	xorl	%ecx, %ecx
	movabsq	$-3689348814741910323, %rdi
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rdx, %rax
	movq	%rdx, %rsi
	mulq	%rdi
	movl	%ecx, %eax
	addl	$1, %ecx
	shrq	$3, %rdx
	cmpq	$9, %rsi
	jg	.L12
.L8:
	pxor	%xmm1, %xmm1
	movsd	.LC1(%rip), %xmm0
	movslq	%ebx, %rbx
	cvtsi2sdl	%eax, %xmm1
	call	pow@PLT
	movq	%rbp, %rax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	cvttsd2siq	%xmm0, %rcx
	cqto
	idivq	%rcx
	leaq	-1(%r12,%rax), %rdx
	cmpq	%rbx, %rdx
	cmovl	%rbx, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	orl	$-1, %eax
	xorl	%ebx, %ebx
	movq	$-9, %r12
	jmp	.L8
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	keta
	.type	keta, @function
keta:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rdx
	testq	%rdi, %rdi
	jle	.L4
	movabsq	$-3689348814741910323, %rdi
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rdx, %rax
	movq	%rdx, %rsi
	mulq	%rdi
	movslq	%ecx, %rax
	addl	$1, %ecx
	shrq	$3, %rdx
	cmpq	$9, %rsi
	jg	.L3
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movq	$-1, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	keta, .-keta
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rbp
	testq	%rbp, %rbp
	jle	.L14
	movabsq	$-3689348814741910323, %rdi
	movq	%rbp, %rcx
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rcx, %rax
	mulq	%rdi
	movq	%rcx, %rax
	shrq	$3, %rdx
	leaq	(%rdx,%rdx,4), %rsi
	addq	%rsi, %rsi
	subq	%rsi, %rax
	addl	%eax, %ebx
	movq	%rcx, %rax
	movq	%rdx, %rcx
	cmpq	$9, %rax
	jg	.L9
	movabsq	$-3689348814741910323, %rdi
	movq	%rbp, %rdx
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rdx, %rax
	movq	%rdx, %rsi
	mulq	%rdi
	movslq	%ecx, %rax
	addl	$1, %ecx
	shrq	$3, %rdx
	cmpq	$9, %rsi
	jg	.L10
	leaq	(%rax,%rax,8), %r12
	movq	%rbp, %rdx
	xorl	%ecx, %ecx
	movabsq	$-3689348814741910323, %rdi
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%rdx, %rax
	movq	%rdx, %rsi
	mulq	%rdi
	movl	%ecx, %eax
	addl	$1, %ecx
	shrq	$3, %rdx
	cmpq	$9, %rsi
	jg	.L12
.L8:
	pxor	%xmm1, %xmm1
	movsd	.LC1(%rip), %xmm0
	movslq	%ebx, %rbx
	cvtsi2sdl	%eax, %xmm1
	call	pow@PLT
	movq	%rbp, %rax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	cvttsd2siq	%xmm0, %rcx
	cqto
	idivq	%rcx
	leaq	-1(%r12,%rax), %rdx
	cmpq	%rbx, %rdx
	cmovl	%rbx, %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L21
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	orl	$-1, %eax
	xorl	%ebx, %ebx
	movq	$-9, %r12
	jmp	.L8
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.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>

typedef long long ll;

ll keta(ll a){
  int count = 0;
  while(a > 0){
    a/= 10;
    count ++;
  }

  return count-1;
}

int main(void){
  
  ll n;
  scanf("%lld",&n);

  int count = 0 , k = 0;
  ll a = n;
  while(a > 0){
    k += a%10; 
    a/= 10;
    count ++;
  }


  ll ans = 9*keta(n) + (n/(long long)pow(10,keta(n)))-1;
  if(k > ans){
    ans = k;
  }

  printf("%lld\n",ans);

  return 0;
}
1265641936938969
 101
 613
 1180
 2005985506723837
 78
 813322357948504
 127248513971408
 46390584841058
 51

135
 18
 23
 27
 136
 15
 133
 126
 120
 13

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>

typedef long long ll;

ll keta(ll a){
  int count = 0;
  while(a > 0){
    a/= 10;
    count ++;
  }

  return count-1;
}

int main(void){
  
  ll n;
  scanf("%lld",&n);

  int count = 0 , k = 0;
  ll a = n;
  while(a > 0){
    k += a%10; 
    a/= 10;
    count ++;
  }


  ll ans = 9*keta(n) + (n/(long long)pow(10,keta(n)))-1;
  if(k > ans){
    ans = k;
  }

  printf("%lld\n",ans);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	keta
	.type	keta, @function
keta:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -4(%rbp)
.L2:
	cmpq	$0, -24(%rbp)
	jg	.L3
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	keta, .-keta
	.section	.rodata
.LC0:
	.string	"%lld"
.LC2:
	.string	"%lld\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
	pushq	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -56(%rbp)
	movl	$0, -52(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -40(%rbp)
	jmp	.L6
.L7:
	movq	-40(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -52(%rbp)
	movq	-40(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -40(%rbp)
	addl	$1, -56(%rbp)
.L6:
	cmpq	$0, -40(%rbp)
	jg	.L7
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	keta
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	leaq	(%rax,%rdx), %r12
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	keta
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2siq	%xmm0, %rdi
	movq	%rbx, %rax
	cqto
	idivq	%rdi
	addq	%r12, %rax
	subq	$1, %rax
	movq	%rax, -32(%rbp)
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jge	.L8
	movl	-52(%rbp), %eax
	cltq
	movq	%rax, -32(%rbp)
.L8:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	keta
	.type	keta, @function
keta:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L2
.L3:
	movq	-24(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -4(%rbp)
.L2:
	cmpq	$0, -24(%rbp)
	jg	.L3
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	keta, .-keta
	.section	.rodata
.LC0:
	.string	"%lld"
.LC2:
	.string	"%lld\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
	pushq	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -56(%rbp)
	movl	$0, -52(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -40(%rbp)
	jmp	.L6
.L7:
	movq	-40(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	movq	%rcx, %rsi
	sarq	$63, %rsi
	subq	%rsi, %rax
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -52(%rbp)
	movq	-40(%rbp), %rcx
	movabsq	$7378697629483820647, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$2, %rax
	sarq	$63, %rcx
	movq	%rcx, %rdx
	subq	%rdx, %rax
	movq	%rax, -40(%rbp)
	addl	$1, -56(%rbp)
.L6:
	cmpq	$0, -40(%rbp)
	jg	.L7
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	keta
	movq	%rax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	leaq	(%rax,%rdx), %r12
	movq	-48(%rbp), %rbx
	movq	-48(%rbp), %rax
	movq	%rax, %rdi
	call	keta
	pxor	%xmm0, %xmm0
	cvtsi2sdq	%rax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2siq	%xmm0, %rdi
	movq	%rbx, %rax
	cqto
	idivq	%rdi
	addq	%r12, %rax
	subq	$1, %rax
	movq	%rax, -32(%rbp)
	movl	-52(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jge	.L8
	movl	-52(%rbp), %eax
	cltq
	movq	%rax, -32(%rbp)
.L8:
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.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:
