// File: /workspace/github_cpp_makefile_star2_O1/Mariotti94[P]BigFloat/BigFloat.cc
// Function: BigFloat::Sum(BigFloat const&, BigFloat const&)
BigFloat BigFloat::Sum(const BigFloat& left, const BigFloat& right)
{
    BigFloat tmp;
    int carry = 0;
    size_t loopsize = (left.number.size() > right.number.size()) ? left.number.size() : right.number.size();

    for(size_t i = 0; i < loopsize; ++i) {
        int val1, val2;
        val1 = (i > left.number.size() - 1) ? 0 : CharToInt(left.number[i]);
        val2 = (i > right.number.size() - 1) ? 0 : CharToInt(right.number[i]);

        int aus = val1 + val2 + carry;

        carry = 0;
        if(aus > 9) {
            carry = 1;
            aus = aus - 10;
        }

        tmp.number.push_back(IntToChar(aus));
    }
    if(carry != 0)
        tmp.number.push_back(IntToChar(carry));

    return tmp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x27f8
movq 0x38(%r15), %rax
movq 0x50(%r15), %rcx
movq %rcx, %rdx
subq 0x30(%r15), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rcx
adcq $-0x1, %rdx
subq 0x40(%r15), %rax
shlq $0x9, %rdx
addq 0x28(%r15), %rax
addq %rdx, %rax
subq 0x18(%r15), %rax
movq 0x38(%r14), %rsi
movq 0x50(%r14), %rcx
movq %rcx, %rdx
subq 0x30(%r14), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rcx
adcq $-0x1, %rdx
shlq $0x9, %rdx
subq 0x40(%r14), %rsi
addq 0x28(%r14), %rsi
addq %rdx, %rsi
subq 0x18(%r14), %rsi
cmpq %rsi, %rax
cmovaq %rax, %rsi
movq %rsi, 0x10(%rsp)
testq %rsi, %rsi
je 0x36d6
leaq 0x8(%rbx), %rax
movq %rax, 0x8(%rsp)
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x50(%r15), %rax
movq 0x18(%r15), %rdx
movq 0x30(%r15), %rcx
movq %rax, %rsi
subq %rcx, %rsi
shrq $0x3, %rsi
cmpq $0x1, %rax
adcq $-0x1, %rsi
shlq $0x9, %rsi
movq 0x38(%r15), %rax
subq 0x40(%r15), %rax
addq 0x28(%r15), %rax
movq %rdx, %rdi
notq %rdi
addq %rax, %rdi
addq %rsi, %rdi
movl $0x0, %eax
cmpq %rdi, %r12
ja 0x35eb
movq %rdx, %rax
subq 0x20(%r15), %rax
leaq (%r12,%rax), %rsi
cmpq $0x1ff, %rsi            # imm = 0x1FF
ja 0x35b3
addq %r12, %rdx
jmp 0x35e5
movq %rsi, %rdx
shrq $0x9, %rdx
movq %rdx, %rdi
movabsq $-0x80000000000000, %r8 # imm = 0xFF80000000000000
orq %r8, %rdi
testq %rsi, %rsi
cmovgq %rdx, %rdi
movq %rdi, %rdx
shlq $0x9, %rdx
subq %rdx, %rax
addq (%rcx,%rdi,8), %rax
addq %r12, %rax
movq %rax, %rdx
movsbl (%rdx), %eax
addl $-0x30, %eax
movq 0x50(%r14), %rsi
movq 0x18(%r14), %rdx
movq 0x30(%r14), %rcx
movq %rsi, %rdi
subq %rcx, %rdi
shrq $0x3, %rdi
cmpq $0x1, %rsi
adcq $-0x1, %rdi
shlq $0x9, %rdi
movq 0x38(%r14), %rsi
subq 0x40(%r14), %rsi
addq 0x28(%r14), %rsi
movq %rdx, %r8
notq %r8
addq %rsi, %r8
addq %rdi, %r8
xorl %esi, %esi
cmpq %r8, %r12
ja 0x367d
movq %rdx, %rsi
subq 0x20(%r14), %rsi
leaq (%r12,%rsi), %rdi
cmpq $0x1ff, %rdi            # imm = 0x1FF
ja 0x3645
addq %r12, %rdx
jmp 0x3677
movq %rdi, %rdx
shrq $0x9, %rdx
movq %rdx, %r8
movabsq $-0x80000000000000, %r9 # imm = 0xFF80000000000000
orq %r9, %r8
testq %rdi, %rdi
cmovgq %rdx, %r8
movq %r8, %rdx
shlq $0x9, %rdx
subq %rdx, %rsi
addq (%rcx,%r8,8), %rsi
addq %r12, %rsi
movq %rsi, %rdx
movsbl (%rdx), %esi
addl $-0x30, %esi
addl %r13d, %eax
addl %esi, %eax
leal -0xa(%rax), %ecx
xorl %r13d, %r13d
cmpl $0xa, %eax
setge %bpl
movzbl %cl, %ecx
cmovll %eax, %ecx
addb $0x30, %cl
movb %cl, 0x7(%rsp)
movq 0x38(%rbx), %rax
movq 0x48(%rbx), %rdx
decq %rdx
cmpq %rdx, %rax
je 0x36b4
movb %cl, (%rax)
incq 0x38(%rbx)
jmp 0x36c3
movq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rsi
callq 0xb79a
movb %bpl, %r13b
incq %r12
cmpq %r12, 0x10(%rsp)
jne 0x3556
jmp 0x36d9
xorl %r13d, %r13d
testl %r13d, %r13d
je 0x370e
orb $0x30, %r13b
movb %r13b, 0x6(%rsp)
movq 0x38(%rbx), %rax
movq 0x48(%rbx), %rcx
decq %rcx
cmpq %rcx, %rax
je 0x3700
movb %r13b, (%rax)
incq 0x38(%rbx)
jmp 0x370e
leaq 0x8(%rbx), %rdi
leaq 0x6(%rsp), %rsi
callq 0xb79a
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3722
movq %rax, %r14
movq %rbx, %rdi
callq 0x2758
movq %r14, %rdi
callq 0x2200
nop