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>          // printf(), scanf()

long
power(long x, long n, long M)
{
	if (n == 0)
		return 1;

	long res = power((x * x) % M, n / 2, M);
	if (n & 1)
		res = (res * x) % M;

	return res;
}

int
main(int argc, char** argv)
{
	int n, m;

	scanf("%d %d", &n, &m);
	printf("%ld\n", power(n, m, 1000000007));
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	power
	.type	power, @function
power:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rcx
	movq	-40(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	power
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L4
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, -8(%rbp)
.L4:
	movq	-8(%rbp), %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	cltq
	movl	$1000000007, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	power
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %r8d
	testq	%rsi, %rsi
	jne	.L31
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L31:
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	shrq	$63, %rcx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	addq	%rsi, %rcx
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	sarq	%rcx
	je	.L3
	movq	%rdi, %rax
	leaq	3(%rsi), %rsi
	imulq	%rdi, %rax
	cqto
	idivq	%rbp
	testq	%rbx, %rbx
	cmovns	%rbx, %rsi
	sarq	$2, %rsi
	movq	%rsi, %r13
	movq	%rdx, %r14
	jne	.L32
.L4:
	andl	$1, %ecx
	jne	.L33
.L3:
	andl	$1, %ebx
	je	.L1
	movq	%r12, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
.L1:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r8, %rax
	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
.L33:
	.cfi_restore_state
	movq	%r14, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%rdx, %rax
	leaq	7(%rbx), %rsi
	imulq	%rdx, %rax
	cqto
	idivq	%rbp
	testq	%rbx, %rbx
	cmovns	%rbx, %rsi
	sarq	$3, %rsi
	movq	%rsi, %r15
	movq	%rdx, %r9
	je	.L5
	movq	%rdx, %rax
	movq	%rdx, 8(%rsp)
	leaq	15(%rbx), %rsi
	imulq	%rdx, %rax
	movq	%rcx, 16(%rsp)
	cqto
	idivq	%rbp
	testq	%rbx, %rbx
	cmovns	%rbx, %rsi
	sarq	$4, %rsi
	movq	%rdx, %rax
	movq	%rdx, 24(%rsp)
	imulq	%rdx, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %rdi
	movq	%rbp, %rdx
	call	power
	andl	$1, %r15d
	movq	8(%rsp), %r9
	movq	16(%rsp), %rcx
	movq	%rax, %r8
	jne	.L34
.L5:
	andl	$1, %r13d
	je	.L4
	movq	%r9, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L34:
	movq	24(%rsp), %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%ld\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
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movl	(%rsp), %eax
	movl	$1, %r8d
	testq	%rsi, %rsi
	jne	.L50
.L36:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	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
.L50:
	.cfi_restore_state
	movslq	%eax, %r10
	movq	%rsi, %rax
	movl	$2, %ecx
	movq	%rsi, %r11
	cqto
	idivq	%rcx
	movq	%rax, %r12
	testq	%rax, %rax
	je	.L37
	movq	%r10, %rax
	movl	$1000000007, %ebx
	movl	$4, %ecx
	imulq	%r10, %rax
	cqto
	idivq	%rbx
	movq	%rsi, %rax
	movq	%rdx, %rbp
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	movq	%rbp, %rax
	imulq	%rbp, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rdi
	movl	$1000000007, %edx
	call	power
	andb	$1, %r12b
	movq	%rax, %r8
	jne	.L52
.L37:
	andb	$1, %r11b
	je	.L36
	movq	%r10, %rax
	movl	$1000000007, %ebx
	imulq	%r8, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %r8
	jmp	.L36
.L52:
	movq	%rbp, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %r8
	jmp	.L37
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %r8d
	testq	%rsi, %rsi
	jne	.L31
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L31:
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %rcx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	shrq	$63, %rcx
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	addq	%rsi, %rcx
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%rdx, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rsi, %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	sarq	%rcx
	je	.L3
	movq	%rdi, %rax
	leaq	3(%rsi), %rsi
	imulq	%rdi, %rax
	cqto
	idivq	%rbp
	testq	%rbx, %rbx
	cmovns	%rbx, %rsi
	sarq	$2, %rsi
	movq	%rsi, %r13
	movq	%rdx, %r14
	jne	.L32
.L4:
	andl	$1, %ecx
	jne	.L33
.L3:
	andl	$1, %ebx
	je	.L1
	movq	%r12, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
.L1:
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movq	%r8, %rax
	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
.L33:
	.cfi_restore_state
	movq	%r14, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%rdx, %rax
	leaq	7(%rbx), %rsi
	imulq	%rdx, %rax
	cqto
	idivq	%rbp
	testq	%rbx, %rbx
	cmovns	%rbx, %rsi
	sarq	$3, %rsi
	movq	%rsi, %r15
	movq	%rdx, %r9
	je	.L5
	movq	%rdx, %rax
	movq	%rdx, 8(%rsp)
	leaq	15(%rbx), %rsi
	imulq	%rdx, %rax
	movq	%rcx, 16(%rsp)
	cqto
	idivq	%rbp
	testq	%rbx, %rbx
	cmovns	%rbx, %rsi
	sarq	$4, %rsi
	movq	%rdx, %rax
	movq	%rdx, 24(%rsp)
	imulq	%rdx, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %rdi
	movq	%rbp, %rdx
	call	power
	andl	$1, %r15d
	movq	8(%rsp), %r9
	movq	16(%rsp), %rcx
	movq	%rax, %r8
	jne	.L34
.L5:
	andl	$1, %r13d
	je	.L4
	movq	%r9, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L34:
	movq	24(%rsp), %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L5
	.cfi_endproc
.LFE23:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%ld\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
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movl	(%rsp), %eax
	movl	$1, %r8d
	testq	%rsi, %rsi
	jne	.L50
.L36:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	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
.L50:
	.cfi_restore_state
	movslq	%eax, %r10
	movq	%rsi, %rax
	movl	$2, %ecx
	movq	%rsi, %r11
	cqto
	idivq	%rcx
	movq	%rax, %r12
	testq	%rax, %rax
	je	.L37
	movq	%r10, %rax
	movl	$1000000007, %ebx
	movl	$4, %ecx
	imulq	%r10, %rax
	cqto
	idivq	%rbx
	movq	%rsi, %rax
	movq	%rdx, %rbp
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	movq	%rbp, %rax
	imulq	%rbp, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rdi
	movl	$1000000007, %edx
	call	power
	andb	$1, %r12b
	movq	%rax, %r8
	jne	.L52
.L37:
	andb	$1, %r11b
	je	.L36
	movq	%r10, %rax
	movl	$1000000007, %ebx
	imulq	%r8, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %r8
	jmp	.L36
.L52:
	movq	%rbp, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %r8
	jmp	.L37
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>          // printf(), scanf()

long
power(long x, long n, long M)
{
	if (n == 0)
		return 1;

	long res = power((x * x) % M, n / 2, M);
	if (n & 1)
		res = (res * x) % M;

	return res;
}

int
main(int argc, char** argv)
{
	int n, m;

	scanf("%d %d", &n, &m);
	printf("%ld\n", power(n, m, 1000000007));
	return 0;
}
2 1
 5 9
 2 2
 7 9
 3 3
 13 9
 1 3
 13 1
 12 1
 3 1

2
 1953125
 4
 40353607
 27
 604499303
 1
 13
 12
 3

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>          // printf(), scanf()

long
power(long x, long n, long M)
{
	if (n == 0)
		return 1;

	long res = power((x * x) % M, n / 2, M);
	if (n & 1)
		res = (res * x) % M;

	return res;
}

int
main(int argc, char** argv)
{
	int n, m;

	scanf("%d %d", &n, &m);
	printf("%ld\n", power(n, m, 1000000007));
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	power
	.type	power, @function
power:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rcx
	movq	-40(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	power
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L4
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, -8(%rbp)
.L4:
	movq	-8(%rbp), %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	cltq
	movl	$1000000007, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	power
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	power
	.type	power, @function
power:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%rdx, -40(%rbp)
	cmpq	$0, -32(%rbp)
	jne	.L2
	movl	$1, %eax
	jmp	.L3
.L2:
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movq	-24(%rbp), %rax
	imulq	%rax, %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, %rcx
	movq	-40(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	power
	movq	%rax, -8(%rbp)
	movq	-32(%rbp), %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L4
	movq	-8(%rbp), %rax
	imulq	-24(%rbp), %rax
	cqto
	idivq	-40(%rbp)
	movq	%rdx, -8(%rbp)
.L4:
	movq	-8(%rbp), %rax
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	power, .-power
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movq	%rsi, -32(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-12(%rbp), %rdx
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movl	-16(%rbp), %eax
	cltq
	movl	$1000000007, %edx
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	power
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
