// File: asd00012334[P]Abstract-Algebra-2018/./prime.hpp
// Function: Polynomial<prime::Zp, prime::ZpElement> prime::powerMod<Polynomial<prime::Zp, prime::ZpElement>>(Polynomial<prime::Zp, prime::ZpElement>, long long, Polynomial<prime::Zp, prime::ZpElement> const&)
inline ringElement powerMod(ringElement base, ll expo, ringElement const& m){
    ringElement out = base.canonicalType.__unit__() % m;
    for(;expo;expo>>=1, base = base*base%m){
        if(expo&1) out = out * base % m;
    }
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rsi, -0x190(%rbp)
movq %rdi, -0x188(%rbp)
movq %rdi, %rax
movq %rax, -0x180(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xcb30
movq -0x20(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x5450
jmp 0x51af
movq -0x188(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0xcbd0
jmp 0x51c5
leaq -0x78(%rbp), %rdi
callq 0x49b0
leaq -0x50(%rbp), %rdi
callq 0x49b0
cmpq $0x0, -0x18(%rbp)
je 0x5409
movq -0x18(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x5321
movq -0x190(%rbp), %rdx
movq -0x188(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
callq 0xcef0
jmp 0x5210
movq -0x20(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x5450
jmp 0x5222
leaq -0xb0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0xcbd0
jmp 0x523e
movq -0x188(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x54c0
jmp 0x5253
leaq -0xb0(%rbp), %rdi
callq 0x49b0
leaq -0x100(%rbp), %rdi
callq 0x49b0
leaq -0xd8(%rbp), %rdi
callq 0x49b0
jmp 0x5321
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x52a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x49b0
leaq -0x50(%rbp), %rdi
callq 0x49b0
jmp 0x543b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x542f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x5310
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x5304
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x49b0
leaq -0x100(%rbp), %rdi
callq 0x49b0
leaq -0xd8(%rbp), %rdi
callq 0x49b0
jmp 0x542f
jmp 0x5323
movq -0x190(%rbp), %rdx
movq -0x18(%rbp), %rax
sarq %rax
movq %rax, -0x18(%rbp)
leaq -0x150(%rbp), %rdi
movq %rdx, %rsi
callq 0xcef0
jmp 0x5346
movq -0x20(%rbp), %rsi
leaq -0x178(%rbp), %rdi
callq 0x5450
jmp 0x5358
leaq -0x128(%rbp), %rdi
leaq -0x150(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0xcbd0
jmp 0x5374
movq -0x190(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x54c0
jmp 0x5389
leaq -0x128(%rbp), %rdi
callq 0x49b0
leaq -0x178(%rbp), %rdi
callq 0x49b0
leaq -0x150(%rbp), %rdi
callq 0x49b0
jmp 0x51d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x53fb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x53ef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x49b0
leaq -0x178(%rbp), %rdi
callq 0x49b0
leaq -0x150(%rbp), %rdi
callq 0x49b0
jmp 0x542f
movb $0x1, -0x21(%rbp)
testb $0x1, -0x21(%rbp)
jne 0x541f
movq -0x188(%rbp), %rdi
callq 0x49b0
movq -0x180(%rbp), %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
movq -0x188(%rbp), %rdi
callq 0x49b0
movq -0x80(%rbp), %rdi
callq 0x22f0
nopw %cs:(%rax,%rax)
nop