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>
long powmod(long a,long b,long m){
    if(b==0){return 1;}
    long c;
    c = powmod((a*a)%m,b/2,m);
    if(b%2){
        c=(c*a)%m;
    }
    return c;
}
int main(void){
  long n,m,k;
  long i;
  scanf("%ld %ld %ld", &n, &m, &k);
  long mod = 998244353;
  long sum = (m*powmod(m-1,n-1,mod))%mod;
  long c=1;
  for(i=1;i<=k;i++){
    c = (c *(((n-i)*powmod(i,mod-2,mod))%mod))%mod;
    sum = (sum + ((m*c)%mod)*powmod(m-1,n-1-i,mod))%mod;
  }
  printf("%ld",sum);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	powmod
	.type	powmod, @function
powmod:
.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	powmod
	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	powmod, .-powmod
	.section	.rodata
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld"
	.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	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-64(%rbp), %rcx
	leaq	-72(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$998244353, -32(%rbp)
	movq	-80(%rbp), %rax
	leaq	-1(%rax), %rsi
	movq	-72(%rbp), %rax
	leaq	-1(%rax), %rcx
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	powmod
	movq	-72(%rbp), %rdx
	imulq	%rdx, %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -48(%rbp)
	movq	$1, -40(%rbp)
	movq	$1, -56(%rbp)
	jmp	.L6
.L7:
	movq	-80(%rbp), %rax
	subq	-56(%rbp), %rax
	movq	%rax, %rbx
	movq	-32(%rbp), %rax
	leaq	-2(%rax), %rcx
	movq	-32(%rbp), %rdx
	movq	-56(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	powmod
	imulq	%rbx, %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rax
	imulq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-72(%rbp), %rax
	imulq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rbx
	movq	-80(%rbp), %rax
	subq	$1, %rax
	subq	-56(%rbp), %rax
	movq	-72(%rbp), %rdx
	leaq	-1(%rdx), %rcx
	movq	-32(%rbp), %rdx
	movq	%rax, %rsi
	movq	%rcx, %rdi
	call	powmod
	imulq	%rax, %rbx
	movq	%rbx, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -48(%rbp)
	addq	$1, -56(%rbp)
.L6:
	movq	-64(%rbp), %rax
	cmpq	%rax, -56(%rbp)
	jle	.L7
	movq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	movq	-8(%rbp), %rbx
	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
	.type	powmod.part.0, @function
powmod.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %rcx
	movl	$1, %r8d
	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
	jne	.L29
.L2:
	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
.L29:
	.cfi_restore_state
	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
	je	.L3
	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
	jne	.L30
.L4:
	andl	$1, %r13d
	jne	.L31
.L3:
	andl	$1, %ecx
	je	.L2
	movq	%r14, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r9, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L30:
	movq	%rdx, %rax
	leaq	15(%rbx), %rsi
	imulq	%rdx, %rax
	cqto
	idivq	%rbp
	testq	%rbx, %rbx
	cmovns	%rbx, %rsi
	sarq	$4, %rsi
	movq	%rdx, %r10
	je	.L5
	movq	%rdx, %rax
	movq	%rdx, 8(%rsp)
	imulq	%rdx, %rax
	movq	%r9, 24(%rsp)
	movq	%rcx, 16(%rsp)
	cqto
	idivq	%rbp
	movq	%rdx, %rdi
	movq	%rbp, %rdx
	call	powmod.part.0
	movq	24(%rsp), %r9
	movq	16(%rsp), %rcx
	movq	8(%rsp), %r10
	movq	%rax, %r8
.L5:
	andl	$1, %r15d
	je	.L4
	movq	%r10, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L4
	.cfi_endproc
.LFE25:
	.size	powmod.part.0, .-powmod.part.0
	.p2align 4
	.globl	powmod
	.type	powmod, @function
powmod:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %r8d
	testq	%rsi, %rsi
	jne	.L58
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L58:
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rsi, %rcx
	movq	%rsi, %r11
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	shrq	$63, %rcx
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	addq	%rsi, %rcx
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdx, %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	sarq	%rcx
	je	.L34
	movq	%rdi, %rax
	leaq	3(%rsi), %rsi
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	testq	%r11, %r11
	cmovns	%r11, %rsi
	sarq	$2, %rsi
	movq	%rsi, %r12
	movq	%rdx, %r13
	jne	.L59
.L35:
	andl	$1, %ecx
	jne	.L60
.L34:
	andl	$1, %r11d
	je	.L32
	movq	%rbp, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %r8
.L32:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movq	%r8, %rax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.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
.L60:
	.cfi_restore_state
	movq	%r13, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %r8
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L59:
	movq	%rdx, %rax
	leaq	7(%r11), %rsi
	imulq	%rdx, %rax
	cqto
	idivq	%rbx
	testq	%r11, %r11
	cmovns	%r11, %rsi
	sarq	$3, %rsi
	movq	%rdx, %r14
	je	.L36
	movq	%rdx, %rax
	movq	%rcx, 8(%rsp)
	imulq	%rdx, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rdi
	movq	%rbx, %rdx
	call	powmod.part.0
	movq	8(%rsp), %rcx
	movq	%rax, %r8
.L36:
	andl	$1, %r12d
	je	.L35
	movq	%r14, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %r8
	jmp	.L35
	.cfi_endproc
.LFE23:
	.size	powmod, .-powmod
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	112(%rsp), %rcx
	leaq	96(%rsp), %rsi
	leaq	104(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movq	96(%rsp), %rbx
	movq	104(%rsp), %rax
	movl	$1, %ecx
	movq	%rbx, %rsi
	leaq	-1(%rax), %rdi
	movq	%rax, 32(%rsp)
	subq	$1, %rsi
	movq	%rdi, 48(%rsp)
	je	.L62
	movl	$998244353, %edx
	call	powmod.part.0
	movq	%rax, %rcx
.L62:
	movabsq	$155014655926305585, %r11
	imulq	32(%rsp), %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	112(%rsp), %rax
	movq	%rcx, (%rsp)
	movq	%rax, 40(%rsp)
	testq	%rax, %rax
	jle	.L63
	movq	48(%rsp), %rax
	leaq	-2(%rbx), %r8
	movl	$1, %r10d
	movl	$1, %ebx
	movabsq	$-8525806094425994177, %r9
	movq	%rax, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, 56(%rsp)
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, 64(%rsp)
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, 72(%rsp)
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, 80(%rsp)
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, 88(%rsp)
	.p2align 4,,10
	.p2align 3
.L71:
	movq	%r10, %rcx
	movq	%r8, 24(%rsp)
	imulq	%r10, %rcx
	movq	%r10, 16(%rsp)
	movq	%rcx, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rbp
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r12
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r13
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r14
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rsi
	movq	%rcx, %r15
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	mulq	%r9
	movq	%rdx, %rcx
	shrq	$29, %rcx
	imulq	$998244353, %rcx, %rax
	subq	%rax, %rsi
	movq	%rsi, %rdi
	movq	%rsi, 8(%rsp)
	imulq	%rsi, %rdi
	movl	$7798783, %esi
	movq	%rdi, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rdi
	movl	$998244353, %edx
	call	powmod.part.0
	movq	8(%rsp), %rcx
	movq	16(%rsp), %r10
	movabsq	$-8525806094425994177, %r9
	movq	24(%rsp), %r8
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r15, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r14, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r13, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r12, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbp, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r10, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	leaq	1(%r8), %rax
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	movq	%rdx, %rbx
	subq	%rax, %rbx
	imulq	$998244353, %rbx, %rax
	movq	%rcx, %rbx
	movq	32(%rsp), %rcx
	subq	%rax, %rbx
	imulq	%rbx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	testq	%r8, %r8
	movq	%rcx, %rbp
	je	.L64
	movq	%r8, %r12
	movl	$1, %ecx
	shrq	$63, %r12
	addq	%r8, %r12
	sarq	%r12
	je	.L65
	testq	%r8, %r8
	leaq	3(%r8), %r13
	cmovns	%r8, %r13
	sarq	$2, %r13
	je	.L66
	testq	%r8, %r8
	leaq	7(%r8), %r14
	cmovns	%r8, %r14
	sarq	$3, %r14
	jne	.L104
.L67:
	andl	$1, %r13d
	jne	.L105
.L66:
	andl	$1, %r12d
	je	.L65
	movq	56(%rsp), %rsi
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	imulq	%r11
	movq	%rsi, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rsi
	movq	%rsi, %rcx
.L65:
	testb	$1, %r8b
	je	.L103
	imulq	48(%rsp), %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
.L103:
	imulq	%rcx, %rbp
.L64:
	addq	(%rsp), %rbp
	addq	$1, %r10
	subq	$1, %r8
	movq	%rbp, %rax
	imulq	%r11
	movq	%rbp, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rbp
	movq	%rbp, (%rsp)
	cmpq	40(%rsp), %r10
	jle	.L71
.L63:
	movq	(%rsp), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L106
	addq	$136, %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
.L105:
	.cfi_restore_state
	movq	64(%rsp), %rax
	movl	$998244353, %edi
	imulq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	jmp	.L66
.L104:
	movq	%r8, %rax
	movl	$16, %edi
	cqto
	idivq	%rdi
	movq	%rax, %r15
	testq	%rax, %rax
	je	.L68
	movq	%r8, %rax
	movl	$32, %esi
	cqto
	idivq	%rsi
	testq	%rax, %rax
	jne	.L107
.L69:
	andb	$1, %r15b
	jne	.L108
.L68:
	andb	$1, %r14b
	je	.L67
	movq	72(%rsp), %rax
	movl	$998244353, %edi
	imulq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	jmp	.L67
.L108:
	movq	80(%rsp), %rax
	movl	$998244353, %edi
	imulq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	jmp	.L68
.L107:
	movq	88(%rsp), %rdi
	movl	$998244353, %edx
	movq	%rax, %rsi
	movq	%r8, 16(%rsp)
	movq	%r10, 8(%rsp)
	call	powmod.part.0
	movq	16(%rsp), %r8
	movq	8(%rsp), %r10
	movabsq	$-8525806094425994177, %r9
	movq	%rax, %rcx
	jmp	.L69
.L106:
	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
	.type	powmod.part.0, @function
powmod.part.0:
.LFB25:
	.cfi_startproc
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rsi, %rcx
	movl	$1, %r8d
	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
	jne	.L29
.L2:
	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
.L29:
	.cfi_restore_state
	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
	je	.L3
	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
	jne	.L30
.L4:
	andl	$1, %r13d
	jne	.L31
.L3:
	andl	$1, %ecx
	je	.L2
	movq	%r14, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r9, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L30:
	movq	%rdx, %rax
	leaq	15(%rbx), %rsi
	imulq	%rdx, %rax
	cqto
	idivq	%rbp
	testq	%rbx, %rbx
	cmovns	%rbx, %rsi
	sarq	$4, %rsi
	movq	%rdx, %r10
	je	.L5
	movq	%rdx, %rax
	movq	%rdx, 8(%rsp)
	imulq	%rdx, %rax
	movq	%r9, 24(%rsp)
	movq	%rcx, 16(%rsp)
	cqto
	idivq	%rbp
	movq	%rdx, %rdi
	movq	%rbp, %rdx
	call	powmod.part.0
	movq	24(%rsp), %r9
	movq	16(%rsp), %rcx
	movq	8(%rsp), %r10
	movq	%rax, %r8
.L5:
	andl	$1, %r15d
	je	.L4
	movq	%r10, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbp
	movq	%rdx, %r8
	jmp	.L4
	.cfi_endproc
.LFE25:
	.size	powmod.part.0, .-powmod.part.0
	.p2align 4
	.globl	powmod
	.type	powmod, @function
powmod:
.LFB23:
	.cfi_startproc
	endbr64
	movl	$1, %r8d
	testq	%rsi, %rsi
	jne	.L58
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L58:
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movq	%rsi, %rcx
	movq	%rsi, %r11
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	shrq	$63, %rcx
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	addq	%rsi, %rcx
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	movq	%rdx, %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	sarq	%rcx
	je	.L34
	movq	%rdi, %rax
	leaq	3(%rsi), %rsi
	imulq	%rdi, %rax
	cqto
	idivq	%rbx
	testq	%r11, %r11
	cmovns	%r11, %rsi
	sarq	$2, %rsi
	movq	%rsi, %r12
	movq	%rdx, %r13
	jne	.L59
.L35:
	andl	$1, %ecx
	jne	.L60
.L34:
	andl	$1, %r11d
	je	.L32
	movq	%rbp, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %r8
.L32:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	movq	%r8, %rax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.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
.L60:
	.cfi_restore_state
	movq	%r13, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %r8
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L59:
	movq	%rdx, %rax
	leaq	7(%r11), %rsi
	imulq	%rdx, %rax
	cqto
	idivq	%rbx
	testq	%r11, %r11
	cmovns	%r11, %rsi
	sarq	$3, %rsi
	movq	%rdx, %r14
	je	.L36
	movq	%rdx, %rax
	movq	%rcx, 8(%rsp)
	imulq	%rdx, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %rdi
	movq	%rbx, %rdx
	call	powmod.part.0
	movq	8(%rsp), %rcx
	movq	%rax, %r8
.L36:
	andl	$1, %r12d
	je	.L35
	movq	%r14, %rax
	imulq	%r8, %rax
	cqto
	idivq	%rbx
	movq	%rdx, %r8
	jmp	.L35
	.cfi_endproc
.LFE23:
	.size	powmod, .-powmod
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$136, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 120(%rsp)
	xorl	%eax, %eax
	leaq	112(%rsp), %rcx
	leaq	96(%rsp), %rsi
	leaq	104(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movq	96(%rsp), %rbx
	movq	104(%rsp), %rax
	movl	$1, %ecx
	movq	%rbx, %rsi
	leaq	-1(%rax), %rdi
	movq	%rax, 32(%rsp)
	subq	$1, %rsi
	movq	%rdi, 48(%rsp)
	je	.L62
	movl	$998244353, %edx
	call	powmod.part.0
	movq	%rax, %rcx
.L62:
	movabsq	$155014655926305585, %r11
	imulq	32(%rsp), %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	112(%rsp), %rax
	movq	%rcx, (%rsp)
	movq	%rax, 40(%rsp)
	testq	%rax, %rax
	jle	.L63
	movq	48(%rsp), %rax
	leaq	-2(%rbx), %r8
	movl	$1, %r10d
	movl	$1, %ebx
	movabsq	$-8525806094425994177, %r9
	movq	%rax, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, 56(%rsp)
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, 64(%rsp)
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, 72(%rsp)
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, 80(%rsp)
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, 88(%rsp)
	.p2align 4,,10
	.p2align 3
.L71:
	movq	%r10, %rcx
	movq	%r8, 24(%rsp)
	imulq	%r10, %rcx
	movq	%r10, 16(%rsp)
	movq	%rcx, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rbp
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r12
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r13
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %r14
	imulq	%rcx, %rcx
	movq	%rcx, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rsi
	movq	%rcx, %r15
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	mulq	%r9
	movq	%rdx, %rcx
	shrq	$29, %rcx
	imulq	$998244353, %rcx, %rax
	subq	%rax, %rsi
	movq	%rsi, %rdi
	movq	%rsi, 8(%rsp)
	imulq	%rsi, %rdi
	movl	$7798783, %esi
	movq	%rdi, %rax
	mulq	%r9
	shrq	$29, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rdi
	movl	$998244353, %edx
	call	powmod.part.0
	movq	8(%rsp), %rcx
	movq	16(%rsp), %r10
	movabsq	$-8525806094425994177, %r9
	movq	24(%rsp), %r8
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r15, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r14, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r13, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r12, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbp, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%r10, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	leaq	1(%r8), %rax
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rax, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
	imulq	%rbx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	movq	%rdx, %rbx
	subq	%rax, %rbx
	imulq	$998244353, %rbx, %rax
	movq	%rcx, %rbx
	movq	32(%rsp), %rcx
	subq	%rax, %rbx
	imulq	%rbx, %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	testq	%r8, %r8
	movq	%rcx, %rbp
	je	.L64
	movq	%r8, %r12
	movl	$1, %ecx
	shrq	$63, %r12
	addq	%r8, %r12
	sarq	%r12
	je	.L65
	testq	%r8, %r8
	leaq	3(%r8), %r13
	cmovns	%r8, %r13
	sarq	$2, %r13
	je	.L66
	testq	%r8, %r8
	leaq	7(%r8), %r14
	cmovns	%r8, %r14
	sarq	$3, %r14
	jne	.L104
.L67:
	andl	$1, %r13d
	jne	.L105
.L66:
	andl	$1, %r12d
	je	.L65
	movq	56(%rsp), %rsi
	imulq	%rcx, %rsi
	movq	%rsi, %rax
	imulq	%r11
	movq	%rsi, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rsi
	movq	%rsi, %rcx
.L65:
	testb	$1, %r8b
	je	.L103
	imulq	48(%rsp), %rcx
	movq	%rcx, %rax
	imulq	%r11
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rdx
	subq	%rdx, %rcx
.L103:
	imulq	%rcx, %rbp
.L64:
	addq	(%rsp), %rbp
	addq	$1, %r10
	subq	$1, %r8
	movq	%rbp, %rax
	imulq	%r11
	movq	%rbp, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rbp
	movq	%rbp, (%rsp)
	cmpq	40(%rsp), %r10
	jle	.L71
.L63:
	movq	(%rsp), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L106
	addq	$136, %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
.L105:
	.cfi_restore_state
	movq	64(%rsp), %rax
	movl	$998244353, %edi
	imulq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	jmp	.L66
.L104:
	movq	%r8, %rax
	movl	$16, %edi
	cqto
	idivq	%rdi
	movq	%rax, %r15
	testq	%rax, %rax
	je	.L68
	movq	%r8, %rax
	movl	$32, %esi
	cqto
	idivq	%rsi
	testq	%rax, %rax
	jne	.L107
.L69:
	andb	$1, %r15b
	jne	.L108
.L68:
	andb	$1, %r14b
	je	.L67
	movq	72(%rsp), %rax
	movl	$998244353, %edi
	imulq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	jmp	.L67
.L108:
	movq	80(%rsp), %rax
	movl	$998244353, %edi
	imulq	%rcx, %rax
	cqto
	idivq	%rdi
	movq	%rdx, %rcx
	jmp	.L68
.L107:
	movq	88(%rsp), %rdi
	movl	$998244353, %edx
	movq	%rax, %rsi
	movq	%r8, 16(%rsp)
	movq	%r10, 8(%rsp)
	call	powmod.part.0
	movq	16(%rsp), %r8
	movq	8(%rsp), %r10
	movabsq	$-8525806094425994177, %r9
	movq	%rax, %rcx
	jmp	.L69
.L106:
	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>
long powmod(long a,long b,long m){
    if(b==0){return 1;}
    long c;
    c = powmod((a*a)%m,b/2,m);
    if(b%2){
        c=(c*a)%m;
    }
    return c;
}
int main(void){
  long n,m,k;
  long i;
  scanf("%ld %ld %ld", &n, &m, &k);
  long mod = 998244353;
  long sum = (m*powmod(m-1,n-1,mod))%mod;
  long c=1;
  for(i=1;i<=k;i++){
    c = (c *(((n-i)*powmod(i,mod-2,mod))%mod))%mod;
    sum = (sum + ((m*c)%mod)*powmod(m-1,n-1-i,mod))%mod;
  }
  printf("%ld",sum);
}

100 110 0
 6 2 1
 119754 114575 7559
 100 010 0
 12 2 1
 119754 114575 8988
 100 010 -1
 11 2 1
 145188 114575 8988
 11 3 1

701524751 12 612524154 113759282 24 536128558 113759282 22 964030371 18432
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>
long powmod(long a,long b,long m){
    if(b==0){return 1;}
    long c;
    c = powmod((a*a)%m,b/2,m);
    if(b%2){
        c=(c*a)%m;
    }
    return c;
}
int main(void){
  long n,m,k;
  long i;
  scanf("%ld %ld %ld", &n, &m, &k);
  long mod = 998244353;
  long sum = (m*powmod(m-1,n-1,mod))%mod;
  long c=1;
  for(i=1;i<=k;i++){
    c = (c *(((n-i)*powmod(i,mod-2,mod))%mod))%mod;
    sum = (sum + ((m*c)%mod)*powmod(m-1,n-1-i,mod))%mod;
  }
  printf("%ld",sum);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	powmod
	.type	powmod, @function
powmod:
.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	powmod
	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	powmod, .-powmod
	.section	.rodata
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld"
	.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	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-64(%rbp), %rcx
	leaq	-72(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$998244353, -32(%rbp)
	movq	-80(%rbp), %rax
	leaq	-1(%rax), %rsi
	movq	-72(%rbp), %rax
	leaq	-1(%rax), %rcx
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	powmod
	movq	-72(%rbp), %rdx
	imulq	%rdx, %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -48(%rbp)
	movq	$1, -40(%rbp)
	movq	$1, -56(%rbp)
	jmp	.L6
.L7:
	movq	-80(%rbp), %rax
	subq	-56(%rbp), %rax
	movq	%rax, %rbx
	movq	-32(%rbp), %rax
	leaq	-2(%rax), %rcx
	movq	-32(%rbp), %rdx
	movq	-56(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	powmod
	imulq	%rbx, %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rax
	imulq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-72(%rbp), %rax
	imulq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rbx
	movq	-80(%rbp), %rax
	subq	$1, %rax
	subq	-56(%rbp), %rax
	movq	-72(%rbp), %rdx
	leaq	-1(%rdx), %rcx
	movq	-32(%rbp), %rdx
	movq	%rax, %rsi
	movq	%rcx, %rdi
	call	powmod
	imulq	%rax, %rbx
	movq	%rbx, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -48(%rbp)
	addq	$1, -56(%rbp)
.L6:
	movq	-64(%rbp), %rax
	cmpq	%rax, -56(%rbp)
	jle	.L7
	movq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	movq	-8(%rbp), %rbx
	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	powmod
	.type	powmod, @function
powmod:
.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	powmod
	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	powmod, .-powmod
	.section	.rodata
.LC0:
	.string	"%ld %ld %ld"
.LC1:
	.string	"%ld"
	.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	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-64(%rbp), %rcx
	leaq	-72(%rbp), %rdx
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$998244353, -32(%rbp)
	movq	-80(%rbp), %rax
	leaq	-1(%rax), %rsi
	movq	-72(%rbp), %rax
	leaq	-1(%rax), %rcx
	movq	-32(%rbp), %rax
	movq	%rax, %rdx
	movq	%rcx, %rdi
	call	powmod
	movq	-72(%rbp), %rdx
	imulq	%rdx, %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -48(%rbp)
	movq	$1, -40(%rbp)
	movq	$1, -56(%rbp)
	jmp	.L6
.L7:
	movq	-80(%rbp), %rax
	subq	-56(%rbp), %rax
	movq	%rax, %rbx
	movq	-32(%rbp), %rax
	leaq	-2(%rax), %rcx
	movq	-32(%rbp), %rdx
	movq	-56(%rbp), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	powmod
	imulq	%rbx, %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rax
	imulq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -40(%rbp)
	movq	-72(%rbp), %rax
	imulq	-40(%rbp), %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, %rbx
	movq	-80(%rbp), %rax
	subq	$1, %rax
	subq	-56(%rbp), %rax
	movq	-72(%rbp), %rdx
	leaq	-1(%rdx), %rcx
	movq	-32(%rbp), %rdx
	movq	%rax, %rsi
	movq	%rcx, %rdi
	call	powmod
	imulq	%rax, %rbx
	movq	%rbx, %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	cqto
	idivq	-32(%rbp)
	movq	%rdx, -48(%rbp)
	addq	$1, -56(%rbp)
.L6:
	movq	-64(%rbp), %rax
	cmpq	%rax, -56(%rbp)
	jle	.L7
	movq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	movq	-8(%rbp), %rbx
	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:
