// File: /workspace/github_cpp_makefile_star2_O2/Mariotti94[P]BigFloat/BigFloat.cc
// Function: BigFloat::CompareNum(BigFloat const&, BigFloat const&)
int BigFloat::CompareNum(const BigFloat& left, const BigFloat& right)
{
    if((left.number.size() - left.decimals) > (right.number.size() - right.decimals))
        return 1;
    else if((left.number.size() - left.decimals) < (right.number.size() - right.decimals))
        return 2;

    if(left.decimals > right.decimals) {
        BigFloat tmp;
        tmp = right;
        while(left.decimals > tmp.decimals) {
            tmp.decimals++;
            tmp.number.push_front('0');
        }

        for(int i = left.number.size() - 1; i >= 0; i--) {
            if(left.number[i] > tmp.number[i])
                return 1;
            else if(left.number[i] < tmp.number[i])
                return 2;
        }
        return 0;
    }
    else if(left.decimals < right.decimals) {
        BigFloat tmp;
        tmp = left;
        while(tmp.decimals < right.decimals) {
            tmp.decimals++;
            tmp.number.push_front('0');
        }

        for(int i = tmp.number.size() - 1; i >= 0; i--) {
            if(tmp.number[i] > right.number[i])
                return 1;
            else if(tmp.number[i] < right.number[i])
                return 2;
        }
        return 0;
    }
    else {
        for(int i = left.number.size() - 1; i >= 0; i--) {
            if(left.number[i] > right.number[i])
                return 1;
            else if(left.number[i] < right.number[i])
                return 2;
        }
        return 0;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rdi), %r12
movq %r12, %rdi
callq 0x298e
movq %rax, %rbp
movslq 0x58(%r15), %rax
subq %rax, %rbp
leaq 0x8(%r14), %r13
movq %r13, %rdi
callq 0x298e
movslq 0x58(%r14), %rcx
subq %rcx, %rax
pushq $0x1
popq %rbx
cmpq %rax, %rbp
ja 0x314d
movq %r12, %rdi
callq 0x298e
movq %rax, %rbp
movslq 0x58(%r15), %rax
subq %rax, %rbp
movq %r13, %rdi
callq 0x298e
movslq 0x58(%r14), %rcx
subq %rcx, %rax
pushq $0x2
popq %rdx
cmpq %rax, %rbp
jae 0x2f58
movl %edx, %ebx
jmp 0x314d
cmpl %ecx, 0x58(%r15)
jle 0x2fa2
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x2610
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6c40
leaq 0x10(%rsp), %rbx
leaq 0x7(%rsp), %r14
movl 0x60(%rsp), %eax
cmpl %eax, 0x58(%r15)
jle 0x2ff0
incl %eax
movl %eax, 0x60(%rsp)
movb $0x30, 0x7(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x88c4
jmp 0x2f80
jge 0x3065
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x2610
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6c40
leaq 0x10(%rsp), %rbx
leaq 0x7(%rsp), %r15
movl 0x60(%rsp), %eax
cmpl 0x58(%r14), %eax
jge 0x30d4
incl %eax
movl %eax, 0x60(%rsp)
movb $0x30, 0x7(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x88c4
jmp 0x2fca
movq %r12, %rdi
callq 0x298e
addq $0x18, %r15
leaq 0x20(%rsp), %r14
movl %eax, %r13d
decq %r13
pushq $0x1
popq %rbx
testl %r13d, %r13d
js 0x3141
movl %r13d, %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq %r15, %rdi
movq %r12, %rsi
callq 0x895c
movb (%rax), %bpl
movq %r14, %rdi
movq %r12, %rsi
callq 0x895c
cmpb (%rax), %bpl
jg 0x3143
movq %r15, %rdi
movq %r12, %rsi
callq 0x895c
movb (%rax), %bpl
movq %r14, %rdi
movq %r12, %rsi
callq 0x895c
decq %r13
cmpb (%rax), %bpl
jge 0x300a
jmp 0x313c
movq %r12, %rdi
callq 0x298e
addq $0x18, %r15
addq $0x18, %r14
movl %eax, %ebp
decq %rbp
testl %ebp, %ebp
js 0x3161
movl %ebp, %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq %r15, %rdi
movq %r12, %rsi
callq 0x895c
movb (%rax), %r13b
movq %r14, %rdi
movq %r12, %rsi
callq 0x895c
cmpb (%rax), %r13b
jg 0x314d
movq %r15, %rdi
movq %r12, %rsi
callq 0x895c
movb (%rax), %r13b
movq %r14, %rdi
movq %r12, %rsi
callq 0x895c
decq %rbp
cmpb (%rax), %r13b
jge 0x307a
pushq $0x2
popq %rbx
jmp 0x314d
movq %rbx, %rdi
callq 0x298e
leaq 0x20(%rsp), %r15
addq $0x18, %r14
movl %eax, %r13d
decq %r13
pushq $0x1
popq %rbx
testl %r13d, %r13d
js 0x3141
movl %r13d, %r12d
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
movq %r15, %rdi
movq %r12, %rsi
callq 0x895c
movb (%rax), %bpl
movq %r14, %rdi
movq %r12, %rsi
callq 0x895c
cmpb (%rax), %bpl
jg 0x3143
movq %r15, %rdi
movq %r12, %rsi
callq 0x895c
movb (%rax), %bpl
movq %r14, %rdi
movq %r12, %rsi
callq 0x895c
decq %r13
cmpb (%rax), %bpl
jge 0x30ee
pushq $0x2
popq %rbx
jmp 0x3143
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdi
callq 0x253c
movl %ebx, %eax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x314d
jmp 0x316b
jmp 0x316b
jmp 0x316b
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x253c
movq %rbx, %rdi
callq 0x2200