// File: /workspace/github_cpp_makefile_star2_O1/permutationlock[P]aes_math/lib/galois_field.cpp
// Function: Polynomial::toPoly[abi:cxx11]() const
string Polynomial::toPoly() const{
    
    string s = "";
    if(_a.size()==0) return s;
    if(_a[_a.size()-1].value()!=0){
        s += to_string(_a[_a.size()-1].value());
        s += "*";
        s += to_string(_p);
        s += "^";
        s += to_string(_a.size()-1);
    }
    for(int i=_a.size()-2; i>=0; i--){
        if(_a[i].value()!=0){
            s += "+";
            s += to_string(_a[i].value());
            s += "*";
            s += to_string(_p);
            s += "^";
            s += to_string(i);
        }
    }

    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r13
leaq 0x10(%rdi), %rax
movq %rax, 0x30(%rsp)
movq %rax, (%rdi)
leaq 0x6533(%rip), %rdx      # 0xa3da
movq %rdx, %rsi
callq 0x52e6
movq (%rbx), %rax
movq %rbx, 0x20(%rsp)
movq 0x8(%rbx), %rdx
movq %rdx, %rcx
subq %rax, %rcx
je 0x438d
cmpl $0x0, -0x4(%rdx)
movq %r13, 0x28(%rsp)
je 0x4115
movl -0x4(%rax,%rcx), %r15d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x3f38
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x3f2f
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x3f35
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x3f38
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3efc
addl $-0x3, %r12d
jmp 0x3f38
addl $-0x2, %r12d
jmp 0x3f38
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
leaq 0x10(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq %rsp, %rdi
movl $0x2d, %edx
callq 0x2140
addq (%rsp), %r15
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x4ed1
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x3f8e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
leaq 0x60c1(%rip), %rsi      # 0xa056
movq %r13, %rdi
callq 0x21d0
movq 0x20(%rsp), %rax
movl 0x18(%rax), %r15d
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x4003
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x3ffa
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x4000
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x4003
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3fc7
addl $-0x3, %r12d
jmp 0x4003
addl $-0x2, %r12d
jmp 0x4003
decl %r12d
shrl $0x1f, %r15d
leal (%r12,%r15), %esi
movq %rsp, %rdi
movq %rbx, (%rdi)
movl $0x2d, %edx
callq 0x2140
addq (%rsp), %r15
movq %r15, %rdi
movl %r12d, %esi
movl %ebp, %edx
callq 0x4ed1
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x4053
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
leaq 0x5ffe(%rip), %rsi      # 0xa058
movq %r13, %rdi
callq 0x21d0
movq 0x20(%rsp), %rax
movq 0x8(%rax), %r15
subq (%rax), %r15
sarq $0x2, %r15
decq %r15
movl $0x1, %esi
cmpq $0xa, %r15
jb 0x40cf
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r15, %rcx
cmpq $0x63, %rcx
jbe 0x40c8
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x40cd
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x40cf
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x4092
addl $-0x3, %esi
jmp 0x40cf
addl $-0x2, %esi
jmp 0x40cf
decl %esi
movl %esi, %esi
movq %rsp, %rdi
movq %rbx, (%rdi)
xorl %edx, %edx
callq 0x2140
movq (%rsp), %rdi
movl 0x8(%rsp), %esi
movq %r15, %rdx
callq 0x4f3e
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x4115
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rax
subq (%rcx), %rax
shrq $0x2, %rax
addl $-0x2, %eax
js 0x438d
leaq 0x10(%rsp), %r14
movl %eax, %r15d
movl $0xd1b71759, %ebx       # imm = 0xD1B71759
movq 0x20(%rsp), %rax
movq (%rax), %rax
cmpl $0x0, (%rax,%r15,4)
je 0x437d
movq %r13, %rdi
leaq 0x5f02(%rip), %rsi      # 0xa05a
callq 0x21d0
movq 0x20(%rsp), %rax
movq (%rax), %rax
movl (%rax,%r15,4), %ebp
movl %ebp, %r12d
negl %r12d
cmovsl %ebp, %r12d
movl $0x1, %r13d
cmpl $0xa, %r12d
jb 0x41c1
movl $0x4, %r13d
movl %r12d, %eax
cmpl $0x63, %eax
jbe 0x41b8
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x41be
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x41c1
movl %eax, %ecx
imulq %rbx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r13d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x4188
addl $-0x3, %r13d
jmp 0x41c1
addl $-0x2, %r13d
jmp 0x41c1
decl %r13d
shrl $0x1f, %ebp
leal (%r13,%rbp), %esi
movq %r14, (%rsp)
movq %rsp, %rdi
movl $0x2d, %edx
callq 0x2140
addq (%rsp), %rbp
movq %rbp, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x4ed1
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4218
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
movq %r12, %rdi
leaq 0x5e34(%rip), %rsi      # 0xa056
callq 0x21d0
movq 0x20(%rsp), %rax
movl 0x18(%rax), %ebp
movl %ebp, %r12d
negl %r12d
cmovsl %ebp, %r12d
movl $0x1, %r13d
cmpl $0xa, %r12d
jb 0x4287
movl $0x4, %r13d
movl %r12d, %eax
cmpl $0x63, %eax
jbe 0x427e
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x4284
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x4287
movl %eax, %ecx
imulq %rbx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r13d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x424e
addl $-0x3, %r13d
jmp 0x4287
addl $-0x2, %r13d
jmp 0x4287
decl %r13d
shrl $0x1f, %ebp
leal (%r13,%rbp), %esi
movq %r14, (%rsp)
movq %rsp, %rdi
movl $0x2d, %edx
callq 0x2140
addq (%rsp), %rbp
movq %rbp, %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x4ed1
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x42de
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
movq %r13, %rdi
leaq 0x5d70(%rip), %rsi      # 0xa058
callq 0x21d0
movl $0x1, %ebp
cmpq $0xa, %r15
jb 0x4335
movl $0x4, %ebp
movl %r15d, %eax
cmpl $0x63, %eax
jbe 0x432e
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x4333
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x4335
movl %eax, %ecx
imulq %rbx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebp
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x4300
addl $-0x3, %ebp
jmp 0x4335
addl $-0x2, %ebp
jmp 0x4335
decl %ebp
movl %ebp, %esi
movq %r14, (%rsp)
movq %rsp, %rdi
movl $0x2d, %edx
callq 0x2140
movq (%rsp), %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x4ed1
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x437d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
leaq -0x1(%r15), %rax
testq %r15, %r15
movq %rax, %r15
jg 0x413b
movq %r13, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x43a7
jmp 0x43de
jmp 0x43a7
jmp 0x43de
movq %rax, %r15
movq (%rsp), %rdi
cmpq %rbx, %rdi
jne 0x43cf
jmp 0x43e1
jmp 0x43de
jmp 0x43de
jmp 0x43c3
jmp 0x43de
jmp 0x43c3
jmp 0x43de
jmp 0x43de
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x43e1
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
jmp 0x43e1
movq %rax, %r15
movq 0x28(%rsp), %rax
movq (%rax), %rdi
cmpq 0x30(%rsp), %rdi
je 0x4400
movq 0x30(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2110
movq %r15, %rdi
callq 0x21b0