// 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 left, right;
    left = left_;
    right = right_;

    if(left.decimals > right.decimals)
        while(left.decimals > right.decimals) {
            right.decimals++;
            right.number.push_front('0');
        }
    else if(left.decimals < right.decimals)
        while(left.decimals < right.decimals) {
            left.decimals++;
            left.number.push_front('0');
        }

    if((left.sign == '+') && (right.sign == '-')) {
        int check = BigFloat::CompareNum(left, right);
        if(check == 0) {
            tmp = 0;
            return tmp;
        }
        if(check == 1) {
            tmp = BigFloat::Subtract(left, right);
            tmp.sign = '+';
            tmp.decimals = left.decimals;
            tmp.LeadTrim();
            tmp.error = 0;
            return tmp;
        }
        if(check == 2) {
            tmp = BigFloat::Subtract(right, left);
            tmp.sign = '-';
            tmp.decimals = left.decimals;
            tmp.LeadTrim();
            tmp.error = 0;
            return tmp;
        }
    }
    if((left.sign == '-') && (right.sign == '+')) {
        int check = BigFloat::CompareNum(left, right);
        if(check == 0) {
            tmp = 0;
            return tmp;
        }
        if(check == 1) {
            tmp = BigFloat::Subtract(left, right);
            tmp.sign = '-';
            tmp.decimals = left.decimals;
            tmp.LeadTrim();
            tmp.error = 0;
            return tmp;
        }
        if(check == 2) {
            tmp = BigFloat::Subtract(right, left);
            tmp.sign = '+';
            tmp.decimals = left.decimals;
            tmp.LeadTrim();
            tmp.error = 0;
            return tmp;
        }
    }

    if((left.sign == '+') && (right.sign == '+')) {
        tmp = BigFloat::Sum(left, right);
        tmp.sign = '+';
        tmp.decimals = left.decimals;
        tmp.error = 0;
        return tmp;
    }
    if((left.sign == '-') && (right.sign == '-')) {
        tmp = BigFloat::Sum(left, right);
        tmp.sign = '-';
        tmp.decimals = left.decimals;
        tmp.error = 0;
        return tmp;
    }

    return tmp; //all cases are covered above, this is only to prevent compiler warnings
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x2610
cmpb $0x0, 0x5c(%r15)
jne 0x3ed9
cmpb $0x0, 0x5c(%r14)
jne 0x3ed9
movq %rsp, %rdi
callq 0x2610
leaq 0x80(%rsp), %rdi
callq 0x2610
movq %rsp, %rdi
movq %r15, %rsi
callq 0x6c40
leaq 0x80(%rsp), %rdi
movq %r14, %rsi
callq 0x6c40
movl 0x58(%rsp), %eax
movl 0xd8(%rsp), %ecx
cmpl %ecx, %eax
jle 0x3cc6
leaq 0x88(%rsp), %r14
leaq 0x100(%rsp), %r15
cmpl %ecx, %eax
jle 0x3cff
incl %ecx
movl %ecx, 0xd8(%rsp)
movb $0x30, 0x100(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x88c4
movl 0x58(%rsp), %eax
movl 0xd8(%rsp), %ecx
jmp 0x3c99
jge 0x3cff
leaq 0x8(%rsp), %r14
leaq 0x100(%rsp), %r15
cmpl %ecx, %eax
jge 0x3cff
incl %eax
movl %eax, 0x58(%rsp)
movb $0x30, 0x100(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x88c4
movl 0x58(%rsp), %eax
movl 0xd8(%rsp), %ecx
jmp 0x3cd5
movb (%rsp), %al
movl %eax, %edx
xorb $0x2b, %dl
movb 0x80(%rsp), %sil
movl %esi, %ecx
xorb $0x2d, %cl
movl %edx, %edi
orb %cl, %dil
jne 0x3d4b
movq %rsp, %rdi
leaq 0x80(%rsp), %rsi
callq 0x2edc
cmpl $0x1, %eax
je 0x3dc5
testl %eax, %eax
jne 0x3de2
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3b82
jmp 0x3ec4
xorb $0x2d, %al
xorb $0x2b, %sil
movl %eax, %edi
orb %sil, %dil
jne 0x3d88
movq %rsp, %rdi
leaq 0x80(%rsp), %rsi
callq 0x2edc
cmpl $0x1, %eax
je 0x3e43
testl %eax, %eax
jne 0x3e7b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3b82
jmp 0x3ec4
orb %sil, %dl
jne 0x3dfc
leaq 0x100(%rsp), %rdi
movq %rsp, %rsi
leaq 0x80(%rsp), %rdx
callq 0x3180
leaq 0x100(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2678
movq %r14, %rdi
callq 0x253c
movb $0x2b, (%rbx)
jmp 0x3e3a
leaq 0x100(%rsp), %rdi
movq %rsp, %rsi
leaq 0x80(%rsp), %rdx
callq 0x32d6
jmp 0x3e93
leaq 0x100(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movq %rsp, %rdx
callq 0x32d6
jmp 0x3e5b
orb %cl, %al
jne 0x3ec4
leaq 0x100(%rsp), %rdi
movq %rsp, %rsi
leaq 0x80(%rsp), %rdx
callq 0x3180
leaq 0x100(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2678
movq %r14, %rdi
callq 0x253c
movb $0x2d, (%rbx)
movl 0x58(%rsp), %eax
movl %eax, 0x58(%rbx)
jmp 0x3ec0
leaq 0x100(%rsp), %rdi
movq %rsp, %rsi
leaq 0x80(%rsp), %rdx
callq 0x32d6
leaq 0x100(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2678
movq %r14, %rdi
callq 0x253c
movb $0x2d, (%rbx)
jmp 0x3eb1
leaq 0x100(%rsp), %rdi
leaq 0x80(%rsp), %rsi
movq %rsp, %rdx
callq 0x32d6
leaq 0x100(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2678
movq %r14, %rdi
callq 0x253c
movb $0x2b, (%rbx)
movl 0x58(%rsp), %eax
movl %eax, 0x58(%rbx)
movq %rbx, %rdi
callq 0x3b2c
movb $0x0, 0x5c(%rbx)
leaq 0x80(%rsp), %rdi
callq 0x253c
movq %rsp, %rdi
callq 0x253c
movq %rbx, %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r14
popq %r15
retq
jmp 0x3f07
jmp 0x3f07
jmp 0x3f07
jmp 0x3f07
jmp 0x3f07
jmp 0x3f07
jmp 0x3f07
jmp 0x3f07
movq %rax, %r14
jmp 0x3f17
movq %rax, %r14
jmp 0x3f1f
jmp 0x3f07
jmp 0x3f07
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x253c
movq %rsp, %rdi
callq 0x253c
movq %rbx, %rdi
callq 0x253c
movq %r14, %rdi
callq 0x2200