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<stdlib.h>
#include<math.h>
#include<string.h>
#include <time.h>
typedef long long llint;

int main(void){
    llint n,i,k,ans=0,a,b,c,judge=0,many=0,rest;
    scanf("%lld%lld",&n,&k);

    // if(n/k>100){
    //     many=n/1000;
    //     rest = n;
    //     n=1000;
    // }
    if(n>k){
        many=n/k;
        rest = n;
        n=k;
    }


    for(a=n;a>=1;a--){
        for(i= (2*a%k==0)? 2*a/k: 2*a/k-1 ;i>0;i--){
            judge=0;
            b = k*i-a;
            if(a<b) break;
            if(b<1) break;
            c=b;
            if((c+b)%k==0){
                llint div;
                if(a==b){
                    if(a==c) ans++;
                    if(b!=c) ans+=3;
                    div = c%k==0?c/k-1:c/k;
                    if(div<1) continue;
                    ans+=3*div;
                }else{
                    if(b!=c) ans+=6;
                    if(b==c ) ans+=3;
                    div = c%k==0?c/k-1:c/k;
                    if(div<1) continue;
                    ans+=6*div;
                }
                judge++;
                // printf("%lld %lld %lld %lld %lld\n",a,b,c,ans,div);
            }
        }
        if(k!=2 && judge==1) a-=k-1;
    }

    if(many!=0){
        ans*=pow(many,3);
        for(a=rest;a>=rest-rest%k+1;a--){
            for(i= (2*a%k==0)? 2*a/k: 2*a/k-1 ;i>0;i--){
                judge=0;
                b = k*i-a;
                if(a<b) break;
                if(b<1) break;
                c=b;
                if((c+b)%k==0){
                    llint div;
                    if(a==b){
                        if(a==c) ans++;
                        if(b!=c) ans+=3;
                        div = c%k==0?c/k-1:c/k;
                        if(div<1) continue;
                        ans+=3*div;
                    }else{
                        if(b!=c) ans+=6;
                        if(b==c ) ans+=3;
                        div = c%k==0?c/k-1:c/k;
                        if(div<1) continue;
                        ans+=6*div;
                    }
                    judge++;
                    // printf("%lld %lld %lld %lld %lld\n",a,b,c,ans,div);
                }
            }
            if(k!=2 && judge==1) a-=k-1;
        }

    }


    printf("%lld\n",ans);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -80(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	leaq	-96(%rbp), %rdx
	leaq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-104(%rbp), %rdx
	movq	-96(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movq	-104(%rbp), %rax
	movq	-96(%rbp), %rsi
	cqto
	idivq	%rsi
	movq	%rax, -56(%rbp)
	movq	-104(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-96(%rbp), %rax
	movq	%rax, -104(%rbp)
.L2:
	movq	-104(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L3
.L25:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L4
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rdi
	cqto
	idivq	%rdi
	jmp	.L5
.L4:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rsi
	cqto
	idivq	%rsi
	subq	$1, %rax
.L5:
	movq	%rax, -88(%rbp)
	jmp	.L6
.L23:
	movq	$0, -64(%rbp)
	movq	-96(%rbp), %rax
	imulq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jl	.L52
	cmpq	$0, -40(%rbp)
	jle	.L53
	movq	-40(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L10
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jne	.L11
	movq	-72(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L12
	addq	$1, -80(%rbp)
.L12:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L13
	addq	$3, -80(%rbp)
.L13:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L14
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L15
.L14:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L15:
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L54
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, -80(%rbp)
	jmp	.L17
.L11:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L18
	addq	$6, -80(%rbp)
.L18:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L19
	addq	$3, -80(%rbp)
.L19:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L20
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L21
.L20:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L21:
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L55
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, -80(%rbp)
.L17:
	addq	$1, -64(%rbp)
	jmp	.L10
.L54:
	nop
	jmp	.L10
.L55:
	nop
.L10:
	subq	$1, -88(%rbp)
.L6:
	cmpq	$0, -88(%rbp)
	jg	.L23
	jmp	.L8
.L52:
	nop
	jmp	.L8
.L53:
	nop
.L8:
	movq	-96(%rbp), %rax
	cmpq	$2, %rax
	je	.L24
	cmpq	$1, -64(%rbp)
	jne	.L24
	movq	-96(%rbp), %rax
	subq	$1, %rax
	subq	%rax, -72(%rbp)
.L24:
	subq	$1, -72(%rbp)
.L3:
	cmpq	$0, -72(%rbp)
	jg	.L25
	cmpq	$0, -56(%rbp)
	je	.L26
	pxor	%xmm2, %xmm2
	cvtsi2sdq	-56(%rbp), %xmm2
	movq	%xmm2, %rax
	movsd	.LC1(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-80(%rbp), %xmm1
	mulsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -80(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L27
.L49:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L28
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rdi
	cqto
	idivq	%rdi
	jmp	.L29
.L28:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rsi
	cqto
	idivq	%rsi
	subq	$1, %rax
.L29:
	movq	%rax, -88(%rbp)
	jmp	.L30
.L47:
	movq	$0, -64(%rbp)
	movq	-96(%rbp), %rax
	imulq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jl	.L56
	cmpq	$0, -40(%rbp)
	jle	.L57
	movq	-40(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L34
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jne	.L35
	movq	-72(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L36
	addq	$1, -80(%rbp)
.L36:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L37
	addq	$3, -80(%rbp)
.L37:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L38
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L39
.L38:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L39:
	movq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L58
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, -80(%rbp)
	jmp	.L41
.L35:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L42
	addq	$6, -80(%rbp)
.L42:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L43
	addq	$3, -80(%rbp)
.L43:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L44
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L45
.L44:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L45:
	movq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L59
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, -80(%rbp)
.L41:
	addq	$1, -64(%rbp)
	jmp	.L34
.L58:
	nop
	jmp	.L34
.L59:
	nop
.L34:
	subq	$1, -88(%rbp)
.L30:
	cmpq	$0, -88(%rbp)
	jg	.L47
	jmp	.L32
.L56:
	nop
	jmp	.L32
.L57:
	nop
.L32:
	movq	-96(%rbp), %rax
	cmpq	$2, %rax
	je	.L48
	cmpq	$1, -64(%rbp)
	jne	.L48
	movq	-96(%rbp), %rax
	subq	$1, %rax
	subq	%rax, -72(%rbp)
.L48:
	subq	$1, -72(%rbp)
.L27:
	movq	-96(%rbp), %rcx
	movq	-48(%rbp), %rax
	cqto
	idivq	%rcx
	movq	-48(%rbp), %rax
	subq	%rdx, %rax
	cmpq	%rax, -72(%rbp)
	jg	.L49
.L26:
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L51
	call	__stack_chk_fail@PLT
.L51:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.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	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %r13
	movq	16(%rsp), %rbx
	cmpq	%rbx, %r13
	jg	.L2
	movq	%r13, %r8
	xorl	%r10d, %r10d
	xorl	%r12d, %r12d
	testq	%r13, %r13
	jle	.L4
.L3:
	xorl	%ebp, %ebp
	xorl	%r12d, %r12d
	leaq	-1(%rbx), %r9
	.p2align 4,,10
	.p2align 3
.L17:
	leaq	(%r8,%r8), %rax
	cqto
	idivq	%rbx
	cmpq	$1, %rdx
	adcq	$-1, %rax
	movq	%rax, %rsi
	testq	%rax, %rax
	jle	.L7
	movq	%rbx, %rdi
	imulq	%rax, %rdi
	movq	%rdi, %rcx
	subq	%r8, %rcx
	testq	%rcx, %rcx
	jle	.L8
	cmpq	%rcx, %r8
	jl	.L8
	subq	%rbx, %rdi
	subq	%r8, %rdi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L50:
	movq	%rcx, %rax
	cqto
	idivq	%rbx
	cmpq	%rcx, %r8
	je	.L49
	addq	$3, %r12
	cmpq	$1, %rdx
	sbbq	$0, %rax
	testq	%rax, %rax
	jle	.L11
	leaq	(%rax,%rax,2), %rax
	movl	$1, %ebp
	leaq	(%r12,%rax,2), %r12
.L11:
	subq	$1, %rsi
	je	.L7
.L15:
	movq	%rdi, %rcx
	subq	%rbx, %rdi
	cmpq	%r8, %rcx
	jg	.L8
	testq	%rcx, %rcx
	jle	.L8
.L9:
	leaq	(%rcx,%rcx), %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rbp
	testq	%rdx, %rdx
	je	.L50
	xorl	%ebp, %ebp
	subq	$1, %rsi
	jne	.L15
.L7:
	cmpq	$2, %rbx
	je	.L16
	cmpq	$1, %rbp
	jne	.L16
	subq	%r9, %r8
	subq	$1, %r8
	testq	%r8, %r8
	jg	.L17
.L5:
	testq	%r10, %r10
	jne	.L51
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L49:
	.cfi_restore_state
	addq	$1, %r12
	cmpq	$1, %rdx
	sbbq	$0, %rax
	testq	%rax, %rax
	jle	.L11
	leaq	(%rax,%rax,2), %rax
	movl	$1, %ebp
	addq	%rax, %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L8:
	xorl	%ebp, %ebp
.L16:
	subq	$1, %r8
	testq	%r8, %r8
	jg	.L17
	testq	%r10, %r10
	je	.L4
	jmp	.L51
.L2:
	movq	%r13, %rax
	movq	%rbx, 8(%rsp)
	cqto
	idivq	%rbx
	movq	%rax, %r10
	testq	%rbx, %rbx
	jle	.L32
	movq	%rbx, %r8
	jmp	.L3
.L51:
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	cvtsi2sdq	%r10, %xmm0
	call	pow@PLT
	movq	%r13, %rax
	movq	%r13, %r8
	cqto
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	idivq	%rbx
	cvtsi2sdq	%r12, %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %r12
	subq	%rdx, %r8
	cmpq	%r8, %r13
	jle	.L4
	leaq	-1(%rbx), %r9
	.p2align 4,,10
	.p2align 3
.L29:
	leaq	(%r13,%r13), %rax
	cqto
	idivq	%rbx
	cmpq	$1, %rdx
	adcq	$-1, %rax
	movq	%rax, %rsi
	testq	%rax, %rax
	jle	.L19
	movq	%rbx, %rdi
	imulq	%rax, %rdi
	movq	%rdi, %rcx
	subq	%r13, %rcx
	testq	%rcx, %rcx
	jle	.L20
	cmpq	%rcx, %r13
	jl	.L20
	subq	%rbx, %rdi
	subq	%r13, %rdi
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L54:
	movq	%rcx, %rax
	cqto
	idivq	%rbx
	cmpq	%rcx, %r13
	je	.L53
	addq	$3, %r12
	cmpq	$1, %rdx
	sbbq	$0, %rax
	testq	%rax, %rax
	jle	.L23
	leaq	(%rax,%rax,2), %rax
	movl	$1, %ebp
	leaq	(%r12,%rax,2), %r12
.L23:
	subq	$1, %rsi
	je	.L19
.L27:
	movq	%rdi, %rcx
	subq	%rbx, %rdi
	testq	%rcx, %rcx
	jle	.L20
	cmpq	%r13, %rcx
	jg	.L20
.L21:
	leaq	(%rcx,%rcx), %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rbp
	testq	%rdx, %rdx
	je	.L54
	xorl	%ebp, %ebp
	subq	$1, %rsi
	jne	.L27
.L19:
	cmpq	$2, %rbx
	je	.L28
	cmpq	$1, %rbp
	jne	.L28
	subq	%r9, %r13
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L53:
	addq	$1, %r12
	cmpq	$1, %rdx
	sbbq	$0, %rax
	testq	%rax, %rax
	jle	.L23
	leaq	(%rax,%rax,2), %rax
	movl	$1, %ebp
	addq	%rax, %r12
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%ebp, %ebp
.L28:
	subq	$1, %r13
	cmpq	%r13, %r8
	jl	.L29
	jmp	.L4
.L32:
	xorl	%ebp, %ebp
	xorl	%r12d, %r12d
	jmp	.L5
.L52:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.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	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %r13
	movq	16(%rsp), %rbx
	cmpq	%rbx, %r13
	jg	.L2
	movq	%r13, %r8
	xorl	%r10d, %r10d
	xorl	%r12d, %r12d
	testq	%r13, %r13
	jle	.L4
.L3:
	xorl	%ebp, %ebp
	xorl	%r12d, %r12d
	leaq	-1(%rbx), %r9
	.p2align 4,,10
	.p2align 3
.L17:
	leaq	(%r8,%r8), %rax
	cqto
	idivq	%rbx
	cmpq	$1, %rdx
	adcq	$-1, %rax
	movq	%rax, %rsi
	testq	%rax, %rax
	jle	.L7
	movq	%rbx, %rdi
	imulq	%rax, %rdi
	movq	%rdi, %rcx
	subq	%r8, %rcx
	testq	%rcx, %rcx
	jle	.L8
	cmpq	%rcx, %r8
	jl	.L8
	subq	%rbx, %rdi
	subq	%r8, %rdi
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L50:
	movq	%rcx, %rax
	cqto
	idivq	%rbx
	cmpq	%rcx, %r8
	je	.L49
	addq	$3, %r12
	cmpq	$1, %rdx
	sbbq	$0, %rax
	testq	%rax, %rax
	jle	.L11
	leaq	(%rax,%rax,2), %rax
	movl	$1, %ebp
	leaq	(%r12,%rax,2), %r12
.L11:
	subq	$1, %rsi
	je	.L7
.L15:
	movq	%rdi, %rcx
	subq	%rbx, %rdi
	cmpq	%r8, %rcx
	jg	.L8
	testq	%rcx, %rcx
	jle	.L8
.L9:
	leaq	(%rcx,%rcx), %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rbp
	testq	%rdx, %rdx
	je	.L50
	xorl	%ebp, %ebp
	subq	$1, %rsi
	jne	.L15
.L7:
	cmpq	$2, %rbx
	je	.L16
	cmpq	$1, %rbp
	jne	.L16
	subq	%r9, %r8
	subq	$1, %r8
	testq	%r8, %r8
	jg	.L17
.L5:
	testq	%r10, %r10
	jne	.L51
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L52
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L49:
	.cfi_restore_state
	addq	$1, %r12
	cmpq	$1, %rdx
	sbbq	$0, %rax
	testq	%rax, %rax
	jle	.L11
	leaq	(%rax,%rax,2), %rax
	movl	$1, %ebp
	addq	%rax, %r12
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L8:
	xorl	%ebp, %ebp
.L16:
	subq	$1, %r8
	testq	%r8, %r8
	jg	.L17
	testq	%r10, %r10
	je	.L4
	jmp	.L51
.L2:
	movq	%r13, %rax
	movq	%rbx, 8(%rsp)
	cqto
	idivq	%rbx
	movq	%rax, %r10
	testq	%rbx, %rbx
	jle	.L32
	movq	%rbx, %r8
	jmp	.L3
.L51:
	pxor	%xmm0, %xmm0
	movsd	.LC1(%rip), %xmm1
	cvtsi2sdq	%r10, %xmm0
	call	pow@PLT
	movq	%r13, %rax
	movq	%r13, %r8
	cqto
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	idivq	%rbx
	cvtsi2sdq	%r12, %xmm0
	mulsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %r12
	subq	%rdx, %r8
	cmpq	%r8, %r13
	jle	.L4
	leaq	-1(%rbx), %r9
	.p2align 4,,10
	.p2align 3
.L29:
	leaq	(%r13,%r13), %rax
	cqto
	idivq	%rbx
	cmpq	$1, %rdx
	adcq	$-1, %rax
	movq	%rax, %rsi
	testq	%rax, %rax
	jle	.L19
	movq	%rbx, %rdi
	imulq	%rax, %rdi
	movq	%rdi, %rcx
	subq	%r13, %rcx
	testq	%rcx, %rcx
	jle	.L20
	cmpq	%rcx, %r13
	jl	.L20
	subq	%rbx, %rdi
	subq	%r13, %rdi
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L54:
	movq	%rcx, %rax
	cqto
	idivq	%rbx
	cmpq	%rcx, %r13
	je	.L53
	addq	$3, %r12
	cmpq	$1, %rdx
	sbbq	$0, %rax
	testq	%rax, %rax
	jle	.L23
	leaq	(%rax,%rax,2), %rax
	movl	$1, %ebp
	leaq	(%r12,%rax,2), %r12
.L23:
	subq	$1, %rsi
	je	.L19
.L27:
	movq	%rdi, %rcx
	subq	%rbx, %rdi
	testq	%rcx, %rcx
	jle	.L20
	cmpq	%r13, %rcx
	jg	.L20
.L21:
	leaq	(%rcx,%rcx), %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rbp
	testq	%rdx, %rdx
	je	.L54
	xorl	%ebp, %ebp
	subq	$1, %rsi
	jne	.L27
.L19:
	cmpq	$2, %rbx
	je	.L28
	cmpq	$1, %rbp
	jne	.L28
	subq	%r9, %r13
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L53:
	addq	$1, %r12
	cmpq	$1, %rdx
	sbbq	$0, %rax
	testq	%rax, %rax
	jle	.L23
	leaq	(%rax,%rax,2), %rax
	movl	$1, %ebp
	addq	%rax, %r12
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%ebp, %ebp
.L28:
	subq	$1, %r13
	cmpq	%r13, %r8
	jl	.L29
	jmp	.L4
.L32:
	xorl	%ebp, %ebp
	xorl	%r12d, %r12d
	jmp	.L5
.L52:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.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<stdlib.h>
#include<math.h>
#include<string.h>
#include <time.h>
typedef long long llint;

int main(void){
    llint n,i,k,ans=0,a,b,c,judge=0,many=0,rest;
    scanf("%lld%lld",&n,&k);

    // if(n/k>100){
    //     many=n/1000;
    //     rest = n;
    //     n=1000;
    // }
    if(n>k){
        many=n/k;
        rest = n;
        n=k;
    }


    for(a=n;a>=1;a--){
        for(i= (2*a%k==0)? 2*a/k: 2*a/k-1 ;i>0;i--){
            judge=0;
            b = k*i-a;
            if(a<b) break;
            if(b<1) break;
            c=b;
            if((c+b)%k==0){
                llint div;
                if(a==b){
                    if(a==c) ans++;
                    if(b!=c) ans+=3;
                    div = c%k==0?c/k-1:c/k;
                    if(div<1) continue;
                    ans+=3*div;
                }else{
                    if(b!=c) ans+=6;
                    if(b==c ) ans+=3;
                    div = c%k==0?c/k-1:c/k;
                    if(div<1) continue;
                    ans+=6*div;
                }
                judge++;
                // printf("%lld %lld %lld %lld %lld\n",a,b,c,ans,div);
            }
        }
        if(k!=2 && judge==1) a-=k-1;
    }

    if(many!=0){
        ans*=pow(many,3);
        for(a=rest;a>=rest-rest%k+1;a--){
            for(i= (2*a%k==0)? 2*a/k: 2*a/k-1 ;i>0;i--){
                judge=0;
                b = k*i-a;
                if(a<b) break;
                if(b<1) break;
                c=b;
                if((c+b)%k==0){
                    llint div;
                    if(a==b){
                        if(a==c) ans++;
                        if(b!=c) ans+=3;
                        div = c%k==0?c/k-1:c/k;
                        if(div<1) continue;
                        ans+=3*div;
                    }else{
                        if(b!=c) ans+=6;
                        if(b==c ) ans+=3;
                        div = c%k==0?c/k-1:c/k;
                        if(div<1) continue;
                        ans+=6*div;
                    }
                    judge++;
                    // printf("%lld %lld %lld %lld %lld\n",a,b,c,ans,div);
                }
            }
            if(k!=2 && judge==1) a-=k-1;
        }

    }


    printf("%lld\n",ans);
    return 0;
}

3 2

9

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<stdlib.h>
#include<math.h>
#include<string.h>
#include <time.h>
typedef long long llint;

int main(void){
    llint n,i,k,ans=0,a,b,c,judge=0,many=0,rest;
    scanf("%lld%lld",&n,&k);

    // if(n/k>100){
    //     many=n/1000;
    //     rest = n;
    //     n=1000;
    // }
    if(n>k){
        many=n/k;
        rest = n;
        n=k;
    }


    for(a=n;a>=1;a--){
        for(i= (2*a%k==0)? 2*a/k: 2*a/k-1 ;i>0;i--){
            judge=0;
            b = k*i-a;
            if(a<b) break;
            if(b<1) break;
            c=b;
            if((c+b)%k==0){
                llint div;
                if(a==b){
                    if(a==c) ans++;
                    if(b!=c) ans+=3;
                    div = c%k==0?c/k-1:c/k;
                    if(div<1) continue;
                    ans+=3*div;
                }else{
                    if(b!=c) ans+=6;
                    if(b==c ) ans+=3;
                    div = c%k==0?c/k-1:c/k;
                    if(div<1) continue;
                    ans+=6*div;
                }
                judge++;
                // printf("%lld %lld %lld %lld %lld\n",a,b,c,ans,div);
            }
        }
        if(k!=2 && judge==1) a-=k-1;
    }

    if(many!=0){
        ans*=pow(many,3);
        for(a=rest;a>=rest-rest%k+1;a--){
            for(i= (2*a%k==0)? 2*a/k: 2*a/k-1 ;i>0;i--){
                judge=0;
                b = k*i-a;
                if(a<b) break;
                if(b<1) break;
                c=b;
                if((c+b)%k==0){
                    llint div;
                    if(a==b){
                        if(a==c) ans++;
                        if(b!=c) ans+=3;
                        div = c%k==0?c/k-1:c/k;
                        if(div<1) continue;
                        ans+=3*div;
                    }else{
                        if(b!=c) ans+=6;
                        if(b==c ) ans+=3;
                        div = c%k==0?c/k-1:c/k;
                        if(div<1) continue;
                        ans+=6*div;
                    }
                    judge++;
                    // printf("%lld %lld %lld %lld %lld\n",a,b,c,ans,div);
                }
            }
            if(k!=2 && judge==1) a-=k-1;
        }

    }


    printf("%lld\n",ans);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -80(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	leaq	-96(%rbp), %rdx
	leaq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-104(%rbp), %rdx
	movq	-96(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movq	-104(%rbp), %rax
	movq	-96(%rbp), %rsi
	cqto
	idivq	%rsi
	movq	%rax, -56(%rbp)
	movq	-104(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-96(%rbp), %rax
	movq	%rax, -104(%rbp)
.L2:
	movq	-104(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L3
.L25:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L4
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rdi
	cqto
	idivq	%rdi
	jmp	.L5
.L4:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rsi
	cqto
	idivq	%rsi
	subq	$1, %rax
.L5:
	movq	%rax, -88(%rbp)
	jmp	.L6
.L23:
	movq	$0, -64(%rbp)
	movq	-96(%rbp), %rax
	imulq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jl	.L52
	cmpq	$0, -40(%rbp)
	jle	.L53
	movq	-40(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L10
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jne	.L11
	movq	-72(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L12
	addq	$1, -80(%rbp)
.L12:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L13
	addq	$3, -80(%rbp)
.L13:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L14
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L15
.L14:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L15:
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L54
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, -80(%rbp)
	jmp	.L17
.L11:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L18
	addq	$6, -80(%rbp)
.L18:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L19
	addq	$3, -80(%rbp)
.L19:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L20
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L21
.L20:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L21:
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L55
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, -80(%rbp)
.L17:
	addq	$1, -64(%rbp)
	jmp	.L10
.L54:
	nop
	jmp	.L10
.L55:
	nop
.L10:
	subq	$1, -88(%rbp)
.L6:
	cmpq	$0, -88(%rbp)
	jg	.L23
	jmp	.L8
.L52:
	nop
	jmp	.L8
.L53:
	nop
.L8:
	movq	-96(%rbp), %rax
	cmpq	$2, %rax
	je	.L24
	cmpq	$1, -64(%rbp)
	jne	.L24
	movq	-96(%rbp), %rax
	subq	$1, %rax
	subq	%rax, -72(%rbp)
.L24:
	subq	$1, -72(%rbp)
.L3:
	cmpq	$0, -72(%rbp)
	jg	.L25
	cmpq	$0, -56(%rbp)
	je	.L26
	pxor	%xmm2, %xmm2
	cvtsi2sdq	-56(%rbp), %xmm2
	movq	%xmm2, %rax
	movsd	.LC1(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-80(%rbp), %xmm1
	mulsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -80(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L27
.L49:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L28
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rdi
	cqto
	idivq	%rdi
	jmp	.L29
.L28:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rsi
	cqto
	idivq	%rsi
	subq	$1, %rax
.L29:
	movq	%rax, -88(%rbp)
	jmp	.L30
.L47:
	movq	$0, -64(%rbp)
	movq	-96(%rbp), %rax
	imulq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jl	.L56
	cmpq	$0, -40(%rbp)
	jle	.L57
	movq	-40(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L34
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jne	.L35
	movq	-72(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L36
	addq	$1, -80(%rbp)
.L36:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L37
	addq	$3, -80(%rbp)
.L37:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L38
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L39
.L38:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L39:
	movq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L58
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, -80(%rbp)
	jmp	.L41
.L35:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L42
	addq	$6, -80(%rbp)
.L42:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L43
	addq	$3, -80(%rbp)
.L43:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L44
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L45
.L44:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L45:
	movq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L59
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, -80(%rbp)
.L41:
	addq	$1, -64(%rbp)
	jmp	.L34
.L58:
	nop
	jmp	.L34
.L59:
	nop
.L34:
	subq	$1, -88(%rbp)
.L30:
	cmpq	$0, -88(%rbp)
	jg	.L47
	jmp	.L32
.L56:
	nop
	jmp	.L32
.L57:
	nop
.L32:
	movq	-96(%rbp), %rax
	cmpq	$2, %rax
	je	.L48
	cmpq	$1, -64(%rbp)
	jne	.L48
	movq	-96(%rbp), %rax
	subq	$1, %rax
	subq	%rax, -72(%rbp)
.L48:
	subq	$1, -72(%rbp)
.L27:
	movq	-96(%rbp), %rcx
	movq	-48(%rbp), %rax
	cqto
	idivq	%rcx
	movq	-48(%rbp), %rax
	subq	%rdx, %rax
	cmpq	%rax, -72(%rbp)
	jg	.L49
.L26:
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L51
	call	__stack_chk_fail@PLT
.L51:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.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	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$112, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -80(%rbp)
	movq	$0, -64(%rbp)
	movq	$0, -56(%rbp)
	leaq	-96(%rbp), %rdx
	leaq	-104(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-104(%rbp), %rdx
	movq	-96(%rbp), %rax
	cmpq	%rax, %rdx
	jle	.L2
	movq	-104(%rbp), %rax
	movq	-96(%rbp), %rsi
	cqto
	idivq	%rsi
	movq	%rax, -56(%rbp)
	movq	-104(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-96(%rbp), %rax
	movq	%rax, -104(%rbp)
.L2:
	movq	-104(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L3
.L25:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L4
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rdi
	cqto
	idivq	%rdi
	jmp	.L5
.L4:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rsi
	cqto
	idivq	%rsi
	subq	$1, %rax
.L5:
	movq	%rax, -88(%rbp)
	jmp	.L6
.L23:
	movq	$0, -64(%rbp)
	movq	-96(%rbp), %rax
	imulq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jl	.L52
	cmpq	$0, -40(%rbp)
	jle	.L53
	movq	-40(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L10
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jne	.L11
	movq	-72(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L12
	addq	$1, -80(%rbp)
.L12:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L13
	addq	$3, -80(%rbp)
.L13:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L14
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L15
.L14:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L15:
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L54
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, -80(%rbp)
	jmp	.L17
.L11:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L18
	addq	$6, -80(%rbp)
.L18:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L19
	addq	$3, -80(%rbp)
.L19:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L20
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L21
.L20:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L21:
	movq	%rax, -16(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L55
	movq	-16(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, -80(%rbp)
.L17:
	addq	$1, -64(%rbp)
	jmp	.L10
.L54:
	nop
	jmp	.L10
.L55:
	nop
.L10:
	subq	$1, -88(%rbp)
.L6:
	cmpq	$0, -88(%rbp)
	jg	.L23
	jmp	.L8
.L52:
	nop
	jmp	.L8
.L53:
	nop
.L8:
	movq	-96(%rbp), %rax
	cmpq	$2, %rax
	je	.L24
	cmpq	$1, -64(%rbp)
	jne	.L24
	movq	-96(%rbp), %rax
	subq	$1, %rax
	subq	%rax, -72(%rbp)
.L24:
	subq	$1, -72(%rbp)
.L3:
	cmpq	$0, -72(%rbp)
	jg	.L25
	cmpq	$0, -56(%rbp)
	je	.L26
	pxor	%xmm2, %xmm2
	cvtsi2sdq	-56(%rbp), %xmm2
	movq	%xmm2, %rax
	movsd	.LC1(%rip), %xmm0
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-80(%rbp), %xmm1
	mulsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -80(%rbp)
	movq	-48(%rbp), %rax
	movq	%rax, -72(%rbp)
	jmp	.L27
.L49:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L28
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rdi
	cqto
	idivq	%rdi
	jmp	.L29
.L28:
	movq	-72(%rbp), %rax
	addq	%rax, %rax
	movq	-96(%rbp), %rsi
	cqto
	idivq	%rsi
	subq	$1, %rax
.L29:
	movq	%rax, -88(%rbp)
	jmp	.L30
.L47:
	movq	$0, -64(%rbp)
	movq	-96(%rbp), %rax
	imulq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, -40(%rbp)
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jl	.L56
	cmpq	$0, -40(%rbp)
	jle	.L57
	movq	-40(%rbp), %rax
	movq	%rax, -32(%rbp)
	movq	-32(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	-96(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L34
	movq	-72(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jne	.L35
	movq	-72(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L36
	addq	$1, -80(%rbp)
.L36:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L37
	addq	$3, -80(%rbp)
.L37:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L38
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L39
.L38:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L39:
	movq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L58
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, -80(%rbp)
	jmp	.L41
.L35:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	je	.L42
	addq	$6, -80(%rbp)
.L42:
	movq	-40(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jne	.L43
	addq	$3, -80(%rbp)
.L43:
	movq	-96(%rbp), %rcx
	movq	-32(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L44
	movq	-96(%rbp), %rdi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rdi
	subq	$1, %rax
	jmp	.L45
.L44:
	movq	-96(%rbp), %rsi
	movq	-32(%rbp), %rax
	cqto
	idivq	%rsi
.L45:
	movq	%rax, -24(%rbp)
	cmpq	$0, -24(%rbp)
	jle	.L59
	movq	-24(%rbp), %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	addq	%rax, -80(%rbp)
.L41:
	addq	$1, -64(%rbp)
	jmp	.L34
.L58:
	nop
	jmp	.L34
.L59:
	nop
.L34:
	subq	$1, -88(%rbp)
.L30:
	cmpq	$0, -88(%rbp)
	jg	.L47
	jmp	.L32
.L56:
	nop
	jmp	.L32
.L57:
	nop
.L32:
	movq	-96(%rbp), %rax
	cmpq	$2, %rax
	je	.L48
	cmpq	$1, -64(%rbp)
	jne	.L48
	movq	-96(%rbp), %rax
	subq	$1, %rax
	subq	%rax, -72(%rbp)
.L48:
	subq	$1, -72(%rbp)
.L27:
	movq	-96(%rbp), %rcx
	movq	-48(%rbp), %rax
	cqto
	idivq	%rcx
	movq	-48(%rbp), %rax
	subq	%rdx, %rax
	cmpq	%rax, -72(%rbp)
	jg	.L49
.L26:
	movq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L51
	call	__stack_chk_fail@PLT
.L51:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.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:
