// File: /workspace/github_cpp_makefile_star2_O2/Mariotti94[P]BigFloat/BigFloat.cc
// Function: operator/(BigFloat const&, BigFloat const&)
BigFloat operator/(const BigFloat& left, const BigFloat& right)
{
    BigFloat tmp;

    if((left.error) || (right.error)) {
        return tmp;
    }

    BigFloat Q, R, D, N, zero;
    zero = 0;

    if(right == zero) {
        tmp.error_code = "Division For 0";
        return tmp;
    }

    N = (left > zero) ? (left) : (left * (-1));
    D = (right > zero) ? (right) : (right * (-1));
    R.sign = '+';
    R.error = 0;

    while((N.decimals != 0) || (D.decimals != 0)) {
        if(N.decimals == 0)
            N.number.push_front('0');
        else
            N.decimals--;

        if(D.decimals == 0)
            D.number.push_front('0');
        else
            D.decimals--;
    }
    N.LeadTrim();
    D.LeadTrim();

    //Increase Precision to highest decimal quote
    int div_precision = (left.decimals > right.decimals) ? (left.decimals) : (right.decimals);
    for(int i = 0; i < div_precision; i++)
        N.number.push_front('0');

    int check = BigFloat::CompareNum(N, D);

    if(check == 0) {
        tmp.number.push_front('1');
    }
    if(check == 2) {
        return zero;
    }
    else {
        while(!N.number.empty()) {
            R.number.push_front(*(N.number.rbegin()));
            N.number.pop_back();

            bool is_zero = true;
            std::deque<char>::const_iterator zero_iter = R.number.begin();
            for(; zero_iter != R.number.end(); ++zero_iter)
                if(*zero_iter != '0')
                    is_zero = false;

            if((R >= D) && (!is_zero)) {
                int Q_sub = 0;
                int min = 0;
                int max = 9;

                while(R >= D) {
                    int avg = max - min;
                    int mod_avg = avg / 2;
                    avg = (avg - mod_avg * 2) ? (mod_avg + 1) : (mod_avg);

                    int div_check = BigFloat::CompareNum(R, D * avg);

                    if(div_check == 2) {
                        max = avg;
                    }
                    else {
                        Q_sub = Q_sub + avg;
                        R = R - D * avg;

                        max = 9;
                    }
                }

                Q.number.push_front(BigFloat::IntToChar(Q_sub));

                bool is_zero = true;
                std::deque<char>::const_iterator zero_iter = R.number.begin();
                for(; zero_iter != R.number.end(); ++zero_iter)
                    if(*zero_iter != '0')
                        is_zero = false;
                if(is_zero)
                    R.number.clear();

            }
            else {
                Q.number.push_front('0');
            }
        }
        tmp = Q;
    }

    if(((left.sign == '-') && (right.sign == '-')) || ((left.sign == '+') && (right.sign == '+')))
        tmp.sign = '+';
    else
        tmp.sign = '-';

    tmp.decimals = div_precision;
    tmp.error = 0;
    tmp.LeadTrim();

    return tmp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x228(%rsp), %rdi
callq 0x2610
cmpb $0x0, 0x5c(%rbx)
jne 0x476a
cmpb $0x1, 0x5c(%r15)
jne 0x477f
leaq 0x228(%rsp), %rsi
movq %r14, %rdi
callq 0x6d18
jmp 0x4cbc
leaq 0x328(%rsp), %rdi
callq 0x2610
leaq 0xa8(%rsp), %rdi
callq 0x2610
leaq 0x1a8(%rsp), %rdi
callq 0x2610
leaq 0x128(%rsp), %rdi
callq 0x2610
movq %rbx, 0x8(%rsp)
leaq 0x2a8(%rsp), %rdi
callq 0x2610
leaq 0x2a8(%rsp), %rdi
xorl %esi, %esi
callq 0x3b82
leaq 0x2a8(%rsp), %rsi
movq %r15, %rdi
callq 0x4d92
testb %al, %al
je 0x4811
leaq 0x288(%rsp), %rdi
leaq 0x4851(%rip), %rsi      # 0x9048
callq 0x2220
leaq 0x228(%rsp), %rsi
movq %r14, %rdi
callq 0x6d18
jmp 0x4c7b
leaq 0x2a8(%rsp), %rsi
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x4dca
testb %al, %al
je 0x4839
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x25b4
jmp 0x4851
leaq 0x3a8(%rsp), %rdx
orl $-0x1, (%rdx)
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
callq 0x4588
leaq 0x128(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x6c40
leaq 0x28(%rsp), %rdi
callq 0x253c
leaq 0x2a8(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4dca
testb %al, %al
je 0x4893
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x25b4
jmp 0x48ab
leaq 0x3a8(%rsp), %rdx
orl $-0x1, (%rdx)
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
callq 0x4588
movq %r15, 0x20(%rsp)
movq %r14, 0x18(%rsp)
leaq 0x1a8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x6c40
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x253c
movb $0x2b, 0xa8(%rsp)
movb $0x0, 0x104(%rsp)
leaq 0x130(%rsp), %r12
leaq 0x1b0(%rsp), %r15
movl 0x180(%rsp), %ecx
movl 0x200(%rsp), %eax
movl %ecx, %edx
orl %eax, %edx
je 0x494f
testl %ecx, %ecx
je 0x4917
decl %ecx
movl %ecx, 0x180(%rsp)
jmp 0x492e
movb $0x30, 0x28(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x88c4
movl 0x200(%rsp), %eax
testl %eax, %eax
je 0x493d
decl %eax
movl %eax, 0x200(%rsp)
jmp 0x48f4
movb $0x30, 0x28(%rsp)
movq %r15, %rdi
movq %r14, %rsi
callq 0x88c4
jmp 0x48f4
leaq 0x128(%rsp), %rdi
callq 0x3b2c
leaq 0x1a8(%rsp), %rdi
callq 0x3b2c
movq 0x8(%rsp), %rax
movl 0x58(%rax), %eax
movq 0x20(%rsp), %rcx
movl 0x58(%rcx), %r15d
cmpl %r15d, %eax
cmovgl %eax, %r15d
xorl %ebp, %ebp
testl %r15d, %r15d
cmovgl %r15d, %ebp
leaq 0x28(%rsp), %r14
subl $0x1, %ebp
jb 0x49a6
movb $0x30, 0x28(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x88c4
jmp 0x498f
leaq 0x128(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x2edc
movq 0x18(%rsp), %r14
cmpl $0x2, %eax
je 0x4c70
testl %eax, %eax
jne 0x49e2
leaq 0x230(%rsp), %rdi
leaq 0x28(%rsp), %rsi
movb $0x31, (%rsi)
callq 0x88c4
movl %r15d, 0x14(%rsp)
leaq 0xb0(%rsp), %r13
leaq 0xa8(%rsp), %r14
leaq 0x1a8(%rsp), %r15
leaq 0x28(%rsp), %rbx
movq 0x160(%rsp), %rsi
cmpq 0x140(%rsp), %rsi
je 0x4c00
cmpq 0x168(%rsp), %rsi
jne 0x4a38
movq 0x178(%rsp), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
decq %rsi
movq %r13, %rdi
callq 0x6c84
movq %r12, %rdi
callq 0x6d5c
movq 0xc0(%rsp), %rax
movq 0xd0(%rsp), %rsi
movq 0xd8(%rsp), %rcx
movb $0x1, %bpl
movq 0xe0(%rsp), %rdx
cmpq %rdx, %rax
je 0x4a96
cmpb $0x30, (%rax)
sete %dil
andb %dil, %bpl
incq %rax
cmpq %rsi, %rax
jne 0x4a6e
movq 0x8(%rcx), %rax
addq $0x8, %rcx
leaq 0x200(%rax), %rsi
jmp 0x4a6e
movq %r14, %rdi
movq %r15, %rsi
callq 0x4e14
notb %al
orb %bpl, %al
testb $0x1, %al
je 0x4ac4
movb $0x30, 0x28(%rsp)
leaq 0x330(%rsp), %rdi
movq %rbx, %rsi
callq 0x88c4
jmp 0x4a04
xorl %ebp, %ebp
pushq $0x9
popq %r13
movq %r14, %rdi
movq %r15, %rsi
callq 0x4e14
testb %al, %al
je 0x4b77
movl %r13d, %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
leal (%rax,%rax), %ecx
xorl %r12d, %r12d
cmpl %ecx, %r13d
setne %r12b
addl %eax, %r12d
movl %r12d, 0x4(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x4(%rsp), %rdx
callq 0x4588
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2edc
movl %eax, %r13d
movq %rbx, %rdi
callq 0x253c
cmpl $0x2, %r13d
je 0x4b6f
leaq 0x3a8(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
leaq 0x4(%rsp), %rdx
callq 0x4588
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x40de
addl %r12d, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2678
movq %rbx, %rdi
callq 0x253c
movq %r13, %rdi
callq 0x253c
pushq $0x9
popq %r12
movl %r12d, %r13d
jmp 0x4aca
addb $0x30, %bpl
movb %bpl, 0x28(%rsp)
leaq 0x330(%rsp), %rdi
movq %rbx, %rsi
callq 0x88c4
movq 0xc0(%rsp), %rax
movq 0xd0(%rsp), %rdi
movq 0xd8(%rsp), %rdx
movb $0x1, %cl
movq 0xe0(%rsp), %rsi
leaq 0x130(%rsp), %r12
leaq 0xb0(%rsp), %r13
cmpq %rsi, %rax
je 0x4bea
cmpb $0x30, (%rax)
sete %r8b
andb %r8b, %cl
incq %rax
cmpq %rdi, %rax
jne 0x4bc2
movq 0x8(%rdx), %rax
addq $0x8, %rdx
leaq 0x200(%rax), %rdi
jmp 0x4bc2
testb $0x1, %cl
je 0x4a04
movq %r13, %rdi
callq 0x2df6
jmp 0x4a04
leaq 0x228(%rsp), %rbx
leaq 0x328(%rsp), %rsi
movq %rbx, %rdi
callq 0x6c40
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %rdx
movl 0x14(%rsp), %edi
movq 0x8(%rsp), %rax
movb (%rax), %al
movl %eax, %ecx
xorb $0x2d, %cl
movb (%rdx), %dl
movl %edx, %esi
xorb $0x2d, %sil
orb %cl, %sil
sete %cl
xorb $0x2b, %al
xorb $0x2b, %dl
orb %al, %dl
sete %al
orb %cl, %al
xorb $0x1, %al
addb %al, %al
addb $0x2b, %al
movb %al, 0x228(%rsp)
movl %edi, 0x280(%rsp)
movb $0x0, 0x284(%rsp)
movq %rbx, %rdi
callq 0x3b2c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6d18
leaq 0x2a8(%rsp), %rdi
callq 0x253c
leaq 0x128(%rsp), %rdi
callq 0x253c
leaq 0x1a8(%rsp), %rdi
callq 0x253c
leaq 0xa8(%rsp), %rdi
callq 0x253c
leaq 0x328(%rsp), %rdi
callq 0x253c
leaq 0x228(%rsp), %rdi
callq 0x253c
movq %r14, %rax
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4d39
jmp 0x4d39
jmp 0x4d39
jmp 0x4d2a
jmp 0x4d2a
jmp 0x4d39
jmp 0x4d39
movq %rax, %rbx
jmp 0x4d49
movq %rax, %rbx
jmp 0x4d56
movq %rax, %rbx
jmp 0x4d63
movq %rax, %rbx
jmp 0x4d70
jmp 0x4d06
jmp 0x4d39
jmp 0x4d39
movq %rax, %rbx
jmp 0x4d7d
jmp 0x4d39
jmp 0x4d39
jmp 0x4d39
jmp 0x4d39
jmp 0x4d39
jmp 0x4d39
jmp 0x4d39
jmp 0x4d39
movq %rax, %rbx
leaq 0x3a8(%rsp), %rdi
jmp 0x4d32
jmp 0x4d39
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x253c
jmp 0x4d3c
movq %rax, %rbx
leaq 0x2a8(%rsp), %rdi
callq 0x253c
leaq 0x128(%rsp), %rdi
callq 0x253c
leaq 0x1a8(%rsp), %rdi
callq 0x253c
leaq 0xa8(%rsp), %rdi
callq 0x253c
leaq 0x328(%rsp), %rdi
callq 0x253c
leaq 0x228(%rsp), %rdi
callq 0x253c
movq %rbx, %rdi
callq 0x2200