// File: /workspace/github_cpp_makefile_star2_O1/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 0x4a39
cmpb $0x0, 0x5c(%r12)
jne 0x4a39
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 0x9d7e
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 0x9d7e
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 0x158(%rsp), %eax
cmpl %eax, 0x58(%rsp)
jle 0x471a
movl 0x158(%rsp), %eax
cmpl %eax, 0x58(%rsp)
jle 0x476e
leaq 0x80(%rsp), %r12
incl %eax
movl %eax, 0x158(%rsp)
movb $0x30, 0x80(%rsp)
movq 0x118(%rsp), %rax
cmpq 0x120(%rsp), %rax
je 0x4700
movb $0x30, -0x1(%rax)
decq 0x118(%rsp)
jmp 0x470b
movq %r15, %rdi
movq %r12, %rsi
callq 0xb6e0
movl 0x158(%rsp), %eax
cmpl %eax, 0x58(%rsp)
jg 0x46cf
jmp 0x476e
jge 0x476e
movl 0x58(%rsp), %eax
cmpl 0x158(%rsp), %eax
jge 0x476e
leaq 0x80(%rsp), %r12
incl %eax
movl %eax, 0x58(%rsp)
movb $0x30, 0x80(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x20(%rsp), %rax
je 0x4756
movb $0x30, -0x1(%rax)
decq 0x18(%rsp)
jmp 0x4761
movq %r14, %rdi
movq %r12, %rsi
callq 0xb6e0
movl 0x58(%rsp), %eax
cmpl 0x158(%rsp), %eax
jl 0x4731
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 0x47ba
movq %rsp, %rdi
leaq 0x100(%rsp), %rsi
callq 0x2e60
cmpl $0x1, %eax
je 0x487a
testl %eax, %eax
jne 0x4897
movq %rbx, %rdi
xorl %esi, %esi
callq 0x448a
jmp 0x4a00
xorb $0x2d, %al
xorb $0x2b, %sil
movl %eax, %edi
orb %sil, %dil
jne 0x47f7
movq %rsp, %rdi
leaq 0x100(%rsp), %rsi
callq 0x2e60
cmpl $0x1, %eax
je 0x48fb
testl %eax, %eax
jne 0x4975
movq %rbx, %rdi
xorl %esi, %esi
callq 0x448a
jmp 0x4a00
orb %sil, %dl
jne 0x48b1
leaq 0x80(%rsp), %rdi
movq %rsp, %rsi
leaq 0x100(%rsp), %rdx
callq 0x34ba
leaq 0x88(%rsp), %r12
movb -0x8(%r12), %al
movb %al, (%rbx)
leaq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0xb4d4
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 0x486d
callq 0x2120
movq %r12, %rdi
callq 0x28a2
movb $0x2b, (%rbx)
jmp 0x48ef
leaq 0x80(%rsp), %rdi
movq %rsp, %rsi
leaq 0x100(%rsp), %rdx
callq 0x3736
jmp 0x498d
leaq 0x80(%rsp), %rdi
leaq 0x100(%rsp), %rsi
movq %rsp, %rdx
callq 0x3736
jmp 0x4913
orb %cl, %al
jne 0x4a00
leaq 0x80(%rsp), %rdi
movq %rsp, %rsi
leaq 0x100(%rsp), %rdx
callq 0x34ba
leaq 0x80(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x9a06
movq %r12, %rdi
callq 0x2758
movb $0x2d, (%rbx)
movl 0x58(%rsp), %eax
movl %eax, 0x58(%rbx)
jmp 0x49fc
leaq 0x80(%rsp), %rdi
movq %rsp, %rsi
leaq 0x100(%rsp), %rdx
callq 0x3736
leaq 0x88(%rsp), %r12
movb -0x8(%r12), %al
movb %al, (%rbx)
leaq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0xb4d4
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 0x4968
callq 0x2120
movq %r12, %rdi
callq 0x28a2
movb $0x2d, (%rbx)
jmp 0x49ed
leaq 0x80(%rsp), %rdi
leaq 0x100(%rsp), %rsi
movq %rsp, %rdx
callq 0x3736
leaq 0x88(%rsp), %r12
movb -0x8(%r12), %al
movb %al, (%rbx)
leaq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0xb4d4
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 0x49e2
callq 0x2120
movq %r12, %rdi
callq 0x28a2
movb $0x2b, (%rbx)
movl 0x58(%rsp), %eax
movl %eax, 0x58(%rbx)
movq %rbx, %rdi
callq 0x43c6
movb $0x0, 0x5c(%rbx)
leaq 0x170(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a16
callq 0x2120
movq %r15, %rdi
callq 0x28a2
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a31
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 0x4a6b
jmp 0x4a6b
jmp 0x4a6b
jmp 0x4a6b
jmp 0x4a6b
jmp 0x4a6b
jmp 0x4a6b
jmp 0x4a6b
movq %rax, %r14
jmp 0x4a7b
movq %rax, %r14
jmp 0x4a83
jmp 0x4a6b
jmp 0x4a6b
movq %rax, %r14
leaq 0x100(%rsp), %rdi
callq 0x2758
movq %rsp, %rdi
callq 0x2758
movq %rbx, %rdi
callq 0x2758
movq %r14, %rdi
callq 0x2200