Given the following C code and 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)
{
	long res = 1;
	if (n > 0)
	{
		res = power(x, n / 2, M);
		if (n % 2 == 0)
			res = (res * res) % M;
		else
			res = (((res * res) % M) * 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;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.type	power.part.0, @function
power.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$1, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdx, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	sarq	%r13
	jne	.L21
.L2:
	cqto
	idivq	%rbx
	andl	$1, %ebp
	je	.L1
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rbx
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%rdx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	movq	%rsi, %r14
	sarq	$2, %r14
	jne	.L22
.L3:
	cqto
	idivq	%rbx
	andl	$1, %r13d
	movq	%rdx, %rax
	je	.L19
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rax
.L19:
	imulq	%rdx, %rax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	sarq	$3, %rsi
	je	.L4
	movq	%rdi, 8(%rsp)
	call	power.part.0
	movq	8(%rsp), %rdi
	imulq	%rax, %rax
.L4:
	cqto
	idivq	%rbx
	andl	$1, %r14d
	movq	%rdx, %rax
	je	.L18
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rax
.L18:
	imulq	%rdx, %rax
	jmp	.L3
	.cfi_endproc
.LFE25:
	.size	power.part.0, .-power.part.0
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %r9d
	testq	%rsi, %rsi
	jg	.L43
.L37:
	movq	%r9, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rsi, %r9
	movq	%rsi, %rcx
	movq	%rdx, %r8
	movl	$1, %eax
	sarq	%r9
	jne	.L44
	cqto
	idivq	%r8
	andl	$1, %ecx
	movq	%rdx, %r9
	je	.L37
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
	movq	%r9, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	sarq	$2, %rsi
	je	.L26
	movq	%rdi, 8(%rsp)
	call	power.part.0
	movq	8(%rsp), %rdi
	imulq	%rax, %rax
.L26:
	cqto
	idivq	%r8
	andl	$1, %r9d
	movq	%rdx, %rax
	je	.L42
	imulq	%rdi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rax
.L42:
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	andl	$1, %ecx
	movq	%rdx, %r9
	je	.L23
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L23:
	movq	%r9, %rax
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movslq	(%rsp), %rdi
	movl	$1, %edx
	testq	%rsi, %rsi
	jle	.L46
	movl	$1000000007, %edx
	call	power.part.0
	movq	%rax, %rdx
.L46:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L51:
	.cfi_restore_state
	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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.type	power.part.0, @function
power.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$1, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdx, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	sarq	%r13
	jne	.L21
.L2:
	cqto
	idivq	%rbx
	andl	$1, %ebp
	je	.L1
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rbx
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%rdx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	movq	%rsi, %r14
	sarq	$2, %r14
	jne	.L22
.L3:
	cqto
	idivq	%rbx
	andl	$1, %r13d
	movq	%rdx, %rax
	je	.L19
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rax
.L19:
	imulq	%rdx, %rax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	sarq	$3, %rsi
	je	.L4
	movq	%rdi, 8(%rsp)
	call	power.part.0
	movq	8(%rsp), %rdi
	imulq	%rax, %rax
.L4:
	cqto
	idivq	%rbx
	andl	$1, %r14d
	movq	%rdx, %rax
	je	.L18
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rax
.L18:
	imulq	%rdx, %rax
	jmp	.L3
	.cfi_endproc
.LFE25:
	.size	power.part.0, .-power.part.0
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %r9d
	testq	%rsi, %rsi
	jg	.L43
.L37:
	movq	%r9, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rsi, %r9
	movq	%rsi, %rcx
	movq	%rdx, %r8
	movl	$1, %eax
	sarq	%r9
	jne	.L44
	cqto
	idivq	%r8
	andl	$1, %ecx
	movq	%rdx, %r9
	je	.L37
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
	movq	%r9, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	sarq	$2, %rsi
	je	.L26
	movq	%rdi, 8(%rsp)
	call	power.part.0
	movq	8(%rsp), %rdi
	imulq	%rax, %rax
.L26:
	cqto
	idivq	%r8
	andl	$1, %r9d
	movq	%rdx, %rax
	je	.L42
	imulq	%rdi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rax
.L42:
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	andl	$1, %ecx
	movq	%rdx, %r9
	je	.L23
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L23:
	movq	%r9, %rax
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movslq	(%rsp), %rdi
	movl	$1, %edx
	testq	%rsi, %rsi
	jle	.L46
	movl	$1000000007, %edx
	call	power.part.0
	movq	%rax, %rdx
.L46:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L51:
	.cfi_restore_state
	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
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.type	power.part.0, @function
power.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$1, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdx, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	sarq	%r13
	jne	.L21
.L2:
	cqto
	idivq	%rbx
	andl	$1, %ebp
	je	.L1
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rbx
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%rdx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	movq	%rsi, %r14
	sarq	$2, %r14
	jne	.L22
.L3:
	cqto
	idivq	%rbx
	andl	$1, %r13d
	movq	%rdx, %rax
	je	.L19
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rax
.L19:
	imulq	%rdx, %rax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	sarq	$3, %rsi
	je	.L4
	movq	%rdi, 8(%rsp)
	call	power.part.0
	movq	8(%rsp), %rdi
	imulq	%rax, %rax
.L4:
	cqto
	idivq	%rbx
	andl	$1, %r14d
	movq	%rdx, %rax
	je	.L18
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rax
.L18:
	imulq	%rdx, %rax
	jmp	.L3
	.cfi_endproc
.LFE25:
	.size	power.part.0, .-power.part.0
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %r9d
	testq	%rsi, %rsi
	jg	.L43
.L37:
	movq	%r9, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rsi, %r9
	movq	%rsi, %rcx
	movq	%rdx, %r8
	movl	$1, %eax
	sarq	%r9
	jne	.L44
	cqto
	idivq	%r8
	andl	$1, %ecx
	movq	%rdx, %r9
	je	.L37
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
	movq	%r9, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	sarq	$2, %rsi
	je	.L26
	movq	%rdi, 8(%rsp)
	call	power.part.0
	movq	8(%rsp), %rdi
	imulq	%rax, %rax
.L26:
	cqto
	idivq	%r8
	andl	$1, %r9d
	movq	%rdx, %rax
	je	.L42
	imulq	%rdi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rax
.L42:
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	andl	$1, %ecx
	movq	%rdx, %r9
	je	.L23
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L23:
	movq	%r9, %rax
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movslq	(%rsp), %rdi
	movl	$1, %edx
	testq	%rsi, %rsi
	jle	.L46
	movl	$1000000007, %edx
	call	power.part.0
	movq	%rax, %rdx
.L46:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L51:
	.cfi_restore_state
	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:
```
```c
#include <stdio.h>          // printf(), scanf()

long
power(long x, long n, long M)
{
	long res = 1;
	if (n > 0)
	{
		res = power(x, n / 2, M);
		if (n % 2 == 0)
			res = (res * res) % M;
		else
			res = (((res * res) % M) * 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;
}```
Given the following C 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)
{
	long res = 1;
	if (n > 0)
	{
		res = power(x, n / 2, M);
		if (n % 2 == 0)
			res = (res * res) % M;
		else
			res = (((res * res) % M) * 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;
}```

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.
Optimized Assembly Code:

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 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)
{
	long res = 1;
	if (n > 0)
	{
		res = power(x, n / 2, M);
		if (n % 2 == 0)
			res = (res * res) % M;
		else
			res = (((res * res) % M) * 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;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.type	power.part.0, @function
power.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$1, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdx, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	sarq	%r13
	jne	.L21
.L2:
	cqto
	idivq	%rbx
	andl	$1, %ebp
	je	.L1
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rbx
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%rdx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	movq	%rsi, %r14
	sarq	$2, %r14
	jne	.L22
.L3:
	cqto
	idivq	%rbx
	andl	$1, %r13d
	movq	%rdx, %rax
	je	.L19
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rax
.L19:
	imulq	%rdx, %rax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	sarq	$3, %rsi
	je	.L4
	movq	%rdi, 8(%rsp)
	call	power.part.0
	movq	8(%rsp), %rdi
	imulq	%rax, %rax
.L4:
	cqto
	idivq	%rbx
	andl	$1, %r14d
	movq	%rdx, %rax
	je	.L18
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rax
.L18:
	imulq	%rdx, %rax
	jmp	.L3
	.cfi_endproc
.LFE25:
	.size	power.part.0, .-power.part.0
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %r9d
	testq	%rsi, %rsi
	jg	.L43
.L37:
	movq	%r9, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rsi, %r9
	movq	%rsi, %rcx
	movq	%rdx, %r8
	movl	$1, %eax
	sarq	%r9
	jne	.L44
	cqto
	idivq	%r8
	andl	$1, %ecx
	movq	%rdx, %r9
	je	.L37
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
	movq	%r9, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	sarq	$2, %rsi
	je	.L26
	movq	%rdi, 8(%rsp)
	call	power.part.0
	movq	8(%rsp), %rdi
	imulq	%rax, %rax
.L26:
	cqto
	idivq	%r8
	andl	$1, %r9d
	movq	%rdx, %rax
	je	.L42
	imulq	%rdi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rax
.L42:
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	andl	$1, %ecx
	movq	%rdx, %r9
	je	.L23
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L23:
	movq	%r9, %rax
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movslq	(%rsp), %rdi
	movl	$1, %edx
	testq	%rsi, %rsi
	jle	.L46
	movl	$1000000007, %edx
	call	power.part.0
	movq	%rax, %rdx
.L46:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L51:
	.cfi_restore_state
	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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.type	power.part.0, @function
power.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movl	$1, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movq	%rsi, %r13
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rsi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movq	%rdx, %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	sarq	%r13
	jne	.L21
.L2:
	cqto
	idivq	%rbx
	andl	$1, %ebp
	je	.L1
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%rbx
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movq	%rdx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	movq	%rsi, %r14
	sarq	$2, %r14
	jne	.L22
.L3:
	cqto
	idivq	%rbx
	andl	$1, %r13d
	movq	%rdx, %rax
	je	.L19
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rax
.L19:
	imulq	%rdx, %rax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	sarq	$3, %rsi
	je	.L4
	movq	%rdi, 8(%rsp)
	call	power.part.0
	movq	8(%rsp), %rdi
	imulq	%rax, %rax
.L4:
	cqto
	idivq	%rbx
	andl	$1, %r14d
	movq	%rdx, %rax
	je	.L18
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rax
.L18:
	imulq	%rdx, %rax
	jmp	.L3
	.cfi_endproc
.LFE25:
	.size	power.part.0, .-power.part.0
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %r9d
	testq	%rsi, %rsi
	jg	.L43
.L37:
	movq	%r9, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rsi, %r9
	movq	%rsi, %rcx
	movq	%rdx, %r8
	movl	$1, %eax
	sarq	%r9
	jne	.L44
	cqto
	idivq	%r8
	andl	$1, %ecx
	movq	%rdx, %r9
	je	.L37
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
	movq	%r9, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L44:
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	sarq	$2, %rsi
	je	.L26
	movq	%rdi, 8(%rsp)
	call	power.part.0
	movq	8(%rsp), %rdi
	imulq	%rax, %rax
.L26:
	cqto
	idivq	%r8
	andl	$1, %r9d
	movq	%rdx, %rax
	je	.L42
	imulq	%rdi, %rax
	cqto
	idivq	%r8
	movq	%rdx, %rax
.L42:
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	andl	$1, %ecx
	movq	%rdx, %r9
	je	.L23
	movq	%rdi, %rax
	imulq	%rdx, %rax
	cqto
	idivq	%r8
	movq	%rdx, %r9
.L23:
	movq	%r9, %rax
	addq	$24, %rsp
	.cfi_def_cfa_offset 8
	ret
	.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
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rsi
	movslq	(%rsp), %rdi
	movl	$1, %edx
	testq	%rsi, %rsi
	jle	.L46
	movl	$1000000007, %edx
	call	power.part.0
	movq	%rax, %rdx
.L46:
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L51
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L51:
	.cfi_restore_state
	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:
```