// File: /workspace/github_cpp_makefile_star2_O1/permutationlock[P]aes_math/lib/galois_field.cpp
// Function: Polynomial::operator/=(Polynomial const&)
Polynomial & Polynomial::operator/=(const Polynomial & other){
    if(_p != other._p) throw runtime_error("Mismatched prime.");
    
    Polynomial quot(0,_p,1);
    
    Modular<int>::globalSetModulus(_p);
    while(this->size() >= other.size()){
        Modular<int> c =  other._a.back() / _a.back();
        int diff = this->size()-other.size();
        vector<Modular<int>> v;
        for(int i=0; i< diff; i++)
            v.push_back(0);
        v.push_back(c);
        Polynomial p(v,_p);
        quot += p;
        (*this) -= (other * p);
    }
    
    swap(_a,quot._a);
    
    return *this;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl 0x18(%rdi), %edx
cmpl 0x18(%rsi), %edx
jne 0x3b76
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rsp), %rdi
xorl %esi, %esi
movl $0x1, %ecx
callq 0x2f9c
movl 0x18(%rbx), %eax
movl %eax, 0xb787(%rip)      # 0xf138
movq (%rbx), %rax
movq 0x8(%rbx), %rdi
movq %rdi, %rdx
subq %rax, %rdx
shrq $0x2, %rdx
movq 0x8(%r14), %rcx
movq %rcx, %rsi
subq (%r14), %rsi
shrq $0x2, %rsi
cmpl %esi, %edx
jl 0x3b2d
leaq 0x10(%rsp), %r15
leaq 0x58(%rsp), %r12
leaq 0x78(%rsp), %r13
addq $-0x4, %rdi
movl -0x4(%rcx), %ebp
callq 0x4daa
imull %ebp, %eax
cltd
idivl 0xb73b(%rip)            # 0xf138
movl %edx, 0xc(%rsp)
movq 0x8(%rbx), %rbp
subq (%rbx), %rbp
shrq $0x2, %rbp
movq 0x8(%r14), %rax
subq (%r14), %rax
shrq $0x2, %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movq $0x0, 0x20(%rsp)
subl %eax, %ebp
jle 0x3a60
movl $0x0, 0x58(%rsp)
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x3a51
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x3a5c
movq %r15, %rdi
movq %r12, %rdx
callq 0x50de
decl %ebp
jne 0x3a2c
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x3a7d
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x3a8a
movq %r15, %rdi
leaq 0xc(%rsp), %rdx
callq 0x5204
movl 0x18(%rbx), %edx
movq %r12, %rdi
movq %r15, %rsi
callq 0x30c0
leaq 0x30(%rsp), %rdi
movq %r12, %rsi
callq 0x325e
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3900
movq %rbx, %rdi
movq %r13, %rsi
callq 0x33a6
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x3ad8
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3aef
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3b06
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq (%rbx), %rax
movq 0x8(%rbx), %rdi
movq %rdi, %rdx
subq %rax, %rdx
shrq $0x2, %rdx
movq 0x8(%r14), %rcx
movq %rcx, %rsi
subq (%r14), %rsi
shrq $0x2, %rsi
cmpl %esi, %edx
jge 0x39e7
movq 0x10(%rbx), %rsi
movaps 0x30(%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x40(%rsp), %rcx
movq %rcx, 0x10(%rbx)
movq %rax, 0x30(%rsp)
movq %rdi, 0x38(%rsp)
movq %rsi, 0x40(%rsp)
testq %rax, %rax
je 0x3b61
subq %rax, %rsi
movq %rax, %rdi
callq 0x2110
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x2080
movq %rax, %r14
leaq 0x64ba(%rip), %rsi      # 0xa044
movq %rax, %rdi
callq 0x2060
movq 0xb457(%rip), %rsi      # 0xeff0
movq 0xb428(%rip), %rdx      # 0xefc8
movq %r14, %rdi
callq 0x2190
movq %rax, %rbx
movq %r14, %rdi
callq 0x20c0
jmp 0x3c2c
jmp 0x3bfb
movq %rax, %rbx
jmp 0x3c15
jmp 0x3bfb
jmp 0x3bc0
movq %rax, %rbx
jmp 0x3be2
movq %rax, %rbx
movq 0x78(%rsp), %rdi
testq %rdi, %rdi
je 0x3be2
movq 0x88(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x3bfe
movq 0x68(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
jmp 0x3bfe
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3c15
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x3c2c
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2110
movq %rbx, %rdi
callq 0x21b0