// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x180, %rsp            # imm = 0x180
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
callq 0x27f8
cmpb $0x0, 0x5c(%r15)
jne 0x49d3
cmpb $0x0, 0x5c(%r12)
jne 0x49d3
movq %rsp, %rdi
callq 0x27f8
leaq 0x100(%rsp), %rdi
callq 0x27f8
movb (%r15), %al
leaq 0x8(%rsp), %r14
movb %al, -0x8(%r14)
leaq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x9c0c
movb 0x5c(%r15), %al
leaq 0x60(%rsp), %rdi
movb %al, -0x4(%rdi)
movl 0x58(%r15), %eax
movl %eax, -0x8(%rdi)
addq $0x60, %r15
movq %r15, %rsi
callq 0x20a0
movb (%r12), %al
leaq 0x108(%rsp), %r15
movb %al, -0x8(%r15)
leaq 0x8(%r12), %rsi
movq %r15, %rdi
callq 0x9c0c
movb 0x5c(%r12), %al
leaq 0x160(%rsp), %rdi
movb %al, -0x4(%rdi)
movl 0x58(%r12), %eax
movl %eax, -0x8(%rdi)
addq $0x60, %r12
movq %r12, %rsi
callq 0x20a0
movl 0x58(%rsp), %eax
movl 0x158(%rsp), %ecx
cmpl %ecx, %eax
jle 0x46c1
leaq 0x80(%rsp), %r12
incl %ecx
movl %ecx, 0x158(%rsp)
movb $0x30, 0x80(%rsp)
movq 0x118(%rsp), %rax
cmpq 0x120(%rsp), %rax
je 0x46a7
movb $0x30, -0x1(%rax)
decq 0x118(%rsp)
jmp 0x46b2
movq %r15, %rdi
movq %r12, %rsi
callq 0xb5ba
movl 0x158(%rsp), %ecx
cmpl %ecx, 0x58(%rsp)
jg 0x4676
jmp 0x4708
jge 0x4708
leaq 0x80(%rsp), %r12
incl %eax
movl %eax, 0x58(%rsp)
movb $0x30, 0x80(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x46f0
movb $0x30, -0x1(%rax)
decq 0x18(%rsp)
jmp 0x46fb
movq %r14, %rdi
movq %r12, %rsi
callq 0xb5ba
movl 0x58(%rsp), %eax
cmpl 0x158(%rsp), %eax
jl 0x46cb
movb (%rsp), %al
movl %eax, %edx
xorb $0x2b, %dl
movb 0x100(%rsp), %sil
movl %esi, %ecx
xorb $0x2d, %cl
movl %edx, %edi
orb %cl, %dil
jne 0x4754
movq %rsp, %rdi
leaq 0x100(%rsp), %rsi
callq 0x2e64
cmpl $0x1, %eax
je 0x4814
testl %eax, %eax
jne 0x4831
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4440
jmp 0x499a
xorb $0x2d, %al
xorb $0x2b, %sil
movl %eax, %edi
orb %sil, %dil
jne 0x4791
movq %rsp, %rdi
leaq 0x100(%rsp), %rsi
callq 0x2e64
cmpl $0x1, %eax
je 0x4895
testl %eax, %eax
jne 0x490f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4440
jmp 0x499a
orb %sil, %dl
jne 0x484b
leaq 0x80(%rsp), %rdi
movq %rsp, %rsi
leaq 0x100(%rsp), %rdx
callq 0x34d8
leaq 0x88(%rsp), %r12
movb -0x8(%r12), %al
movb %al, (%rbx)
leaq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0xb3ae
movb 0x54(%r12), %al
movb %al, 0x5c(%rbx)
movl 0x50(%r12), %eax
movl %eax, 0x58(%rbx)
leaq 0x60(%rbx), %rdi
leaq 0xe0(%rsp), %r13
movq %r13, %rsi
callq 0x2170
movq (%r13), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x4807
callq 0x2120
movq %r12, %rdi
callq 0x28a2
movb $0x2b, (%rbx)
jmp 0x4889
leaq 0x80(%rsp), %rdi
movq %rsp, %rsi
leaq 0x100(%rsp), %rdx
callq 0x373e
jmp 0x4927
leaq 0x80(%rsp), %rdi
leaq 0x100(%rsp), %rsi
movq %rsp, %rdx
callq 0x373e
jmp 0x48ad
orb %cl, %al
jne 0x499a
leaq 0x80(%rsp), %rdi
movq %rsp, %rsi
leaq 0x100(%rsp), %rdx
callq 0x34d8
leaq 0x80(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9894
movq %r12, %rdi
callq 0x2758
movb $0x2d, (%rbx)
movl 0x58(%rsp), %eax
movl %eax, 0x58(%rbx)
jmp 0x4996
leaq 0x80(%rsp), %rdi
movq %rsp, %rsi
leaq 0x100(%rsp), %rdx
callq 0x373e
leaq 0x88(%rsp), %r12
movb -0x8(%r12), %al
movb %al, (%rbx)
leaq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0xb3ae
movb 0x54(%r12), %al
movb %al, 0x5c(%rbx)
movl 0x50(%r12), %eax
movl %eax, 0x58(%rbx)
leaq 0x60(%rbx), %rdi
leaq 0xe0(%rsp), %r13
movq %r13, %rsi
callq 0x2170
movq (%r13), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x4902
callq 0x2120
movq %r12, %rdi
callq 0x28a2
movb $0x2d, (%rbx)
jmp 0x4987
leaq 0x80(%rsp), %rdi
leaq 0x100(%rsp), %rsi
movq %rsp, %rdx
callq 0x373e
leaq 0x88(%rsp), %r12
movb -0x8(%r12), %al
movb %al, (%rbx)
leaq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0xb3ae
movb 0x54(%r12), %al
movb %al, 0x5c(%rbx)
movl 0x50(%r12), %eax
movl %eax, 0x58(%rbx)
leaq 0x60(%rbx), %rdi
leaq 0xe0(%rsp), %r13
movq %r13, %rsi
callq 0x2170
movq (%r13), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x497c
callq 0x2120
movq %r12, %rdi
callq 0x28a2
movb $0x2b, (%rbx)
movl 0x58(%rsp), %eax
movl %eax, 0x58(%rbx)
movq %rbx, %rdi
callq 0x4398
movb $0x0, 0x5c(%rbx)
leaq 0x170(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x49b0
callq 0x2120
movq %r15, %rdi
callq 0x28a2
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x49cb
callq 0x2120
movq %r14, %rdi
callq 0x28a2
movq %rbx, %rax
addq $0x180, %rsp            # imm = 0x180
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x4a05
jmp 0x4a05
jmp 0x4a05
jmp 0x4a05
jmp 0x4a05
jmp 0x4a05
jmp 0x4a05
jmp 0x4a05
movq %rax, %r14
jmp 0x4a15
movq %rax, %r14
jmp 0x4a1d
jmp 0x4a05
jmp 0x4a05
movq %rax, %r14
leaq 0x100(%rsp), %rdi
callq 0x2758
movq %rsp, %rdi
callq 0x2758
movq %rbx, %rdi
callq 0x2758
movq %r14, %rdi
callq 0x2200