// File: /workspace/github_cpp_makefile_star2_O3/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 0x669d(%rip), %rdx      # 0xa3da
movq %rdx, %rsi
callq 0x5182
movq 0x8(%rbx), %rcx
movq %rcx, %rax
movq %rbx, 0x20(%rsp)
subq (%rbx), %rax
je 0x421e
movl -0x4(%rcx), %r15d
testq %r15, %r15
movq %r13, 0x28(%rsp)
je 0x3fb2
movl %r15d, %ebp
negl %ebp
cmovsl %r15d, %ebp
movl $0x1, %r12d
cmpl $0xa, %ebp
jb 0x3dc9
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x3dc0
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x3dc6
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x3dc9
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3d8d
addl $-0x3, %r12d
jmp 0x3dc9
addl $-0x2, %r12d
jmp 0x3dc9
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 0x4d69
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x3e1f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
leaq 0x6230(%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 0x3e94
movl $0x4, %r12d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x3e8b
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x3e91
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x3e94
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r12d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x3e58
addl $-0x3, %r12d
jmp 0x3e94
addl $-0x2, %r12d
jmp 0x3e94
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 0x4d69
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x3ee4
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
leaq 0x616d(%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 0x3f60
movl $0x4, %esi
movabsq $0x346dc5d63886594b, %rdi # imm = 0x346DC5D63886594B
movq %r15, %rcx
cmpq $0x63, %rcx
jbe 0x3f59
cmpq $0x3e7, %rcx            # imm = 0x3E7
jbe 0x3f5e
cmpq $0x2710, %rcx           # imm = 0x2710
jb 0x3f60
movq %rcx, %rax
mulq %rdi
shrq $0xb, %rdx
addl $0x4, %esi
cmpq $0x1869f, %rcx          # imm = 0x1869F
movq %rdx, %rcx
ja 0x3f23
addl $-0x3, %esi
jmp 0x3f60
addl $-0x2, %esi
jmp 0x3f60
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 0x4dd6
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %rbx, %rdi
je 0x3fa6
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 0x421e
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 0x420e
movq %r13, %rdi
leaq 0x6071(%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 0x4052
movl $0x4, %r13d
movl %r12d, %eax
cmpl $0x63, %eax
jbe 0x4049
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x404f
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x4052
movl %eax, %ecx
imulq %rbx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r13d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x4019
addl $-0x3, %r13d
jmp 0x4052
addl $-0x2, %r13d
jmp 0x4052
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 0x4d69
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x40a9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
movq %r12, %rdi
leaq 0x5fa3(%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 0x4118
movl $0x4, %r13d
movl %r12d, %eax
cmpl $0x63, %eax
jbe 0x410f
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x4115
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x4118
movl %eax, %ecx
imulq %rbx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r13d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x40df
addl $-0x3, %r13d
jmp 0x4118
addl $-0x2, %r13d
jmp 0x4118
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 0x4d69
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x28(%rsp), %r13
movq %r13, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x416f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
movq %r13, %rdi
leaq 0x5edf(%rip), %rsi      # 0xa058
callq 0x21d0
movl $0x1, %ebp
cmpq $0xa, %r15
jb 0x41c6
movl $0x4, %ebp
movl %r15d, %eax
cmpl $0x63, %eax
jbe 0x41bf
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x41c4
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x41c6
movl %eax, %ecx
imulq %rbx, %rcx
shrq $0x2d, %rcx
addl $0x4, %ebp
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x4191
addl $-0x3, %ebp
jmp 0x41c6
addl $-0x2, %ebp
jmp 0x41c6
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 0x4d69
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rdi
callq 0x2040
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x420e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
leaq -0x1(%r15), %rax
testq %r15, %r15
movq %rax, %r15
jg 0x3fcc
movq %r13, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4238
jmp 0x426f
jmp 0x4238
jmp 0x426f
movq %rax, %r15
movq (%rsp), %rdi
cmpq %rbx, %rdi
jne 0x4260
jmp 0x4272
jmp 0x426f
jmp 0x426f
jmp 0x4254
jmp 0x426f
jmp 0x4254
jmp 0x426f
jmp 0x426f
movq %rax, %r15
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x4272
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2110
jmp 0x4272
movq %rax, %r15
movq 0x28(%rsp), %rax
movq (%rax), %rdi
cmpq 0x30(%rsp), %rdi
je 0x4291
movq 0x30(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x2110
movq %r15, %rdi
callq 0x21b0
nop