// File: /workspace/github_cpp_makefile_star2_O3/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 $0x28, %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, 0x20(%rsp)
testq %rsi, %rsi
je 0x3714
movq %rbx, 0x10(%rsp)
leaq 0x8(%rbx), %rax
movq %rax, 0x18(%rsp)
xorl %r13d, %r13d
xorl %r12d, %r12d
movq 0x50(%r15), %rdx
movq 0x18(%r15), %rcx
movq 0x30(%r15), %rax
movq %rdx, %rsi
subq %rax, %rsi
shrq $0x3, %rsi
cmpq $0x1, %rdx
adcq $-0x1, %rsi
shlq $0x9, %rsi
movq 0x38(%r15), %rdx
subq 0x40(%r15), %rdx
addq 0x28(%r15), %rdx
movq %rcx, %rdi
notq %rdi
addq %rdx, %rdi
addq %rsi, %rdi
movl $0x0, %ebp
cmpq %rdi, %r13
ja 0x35fe
movq %rcx, %rdx
subq 0x20(%r15), %rdx
movq %r13, %rsi
addq %rdx, %rsi
js 0x35dd
cmpq $0x1ff, %rsi            # imm = 0x1FF
ja 0x35e3
addq %r13, %rcx
movq %rcx, %rdx
jmp 0x35f8
sarq $0x9, %rsi
jmp 0x35e7
shrq $0x9, %rsi
movq %rsi, %rcx
shlq $0x9, %rcx
subq %rcx, %rdx
addq (%rax,%rsi,8), %rdx
addq %r13, %rdx
movsbl (%rdx), %ebp
addl $-0x30, %ebp
movq 0x50(%r14), %rdx
movq 0x18(%r14), %rcx
movq 0x30(%r14), %rax
movq %rdx, %rsi
subq %rax, %rsi
shrq $0x3, %rsi
cmpq $0x1, %rdx
adcq $-0x1, %rsi
shlq $0x9, %rsi
movq 0x38(%r14), %rdx
subq 0x40(%r14), %rdx
addq 0x28(%r14), %rdx
movq %rcx, %rdi
notq %rdi
addq %rdx, %rdi
addq %rsi, %rdi
xorl %edx, %edx
cmpq %rdi, %r13
ja 0x3680
movq %rcx, %rdx
subq 0x20(%r14), %rdx
movq %r13, %rsi
addq %rdx, %rsi
js 0x365f
cmpq $0x1ff, %rsi            # imm = 0x1FF
ja 0x3665
addq %r13, %rcx
movq %rcx, %rdx
jmp 0x367a
sarq $0x9, %rsi
jmp 0x3669
shrq $0x9, %rsi
movq %rsi, %rcx
shlq $0x9, %rcx
subq %rcx, %rdx
addq (%rax,%rsi,8), %rdx
addq %r13, %rdx
movsbl (%rdx), %edx
addl $-0x30, %edx
addl %r12d, %ebp
addl %edx, %ebp
leal -0xa(%rbp), %eax
xorl %r12d, %r12d
cmpl $0xa, %ebp
setge %bl
movzbl %al, %eax
cmovll %ebp, %eax
addb $0x30, %al
movb %al, 0xf(%rsp)
movq 0x10(%rsp), %rsi
movq 0x38(%rsi), %rcx
movq 0x48(%rsi), %rdx
decq %rdx
cmpq %rdx, %rcx
je 0x36ba
movb %al, (%rcx)
incq 0x38(%rsi)
jmp 0x36c9
movq 0x18(%rsp), %rdi
leaq 0xf(%rsp), %rsi
callq 0xb674
movb %bl, %r12b
incq %r13
cmpq %r13, 0x20(%rsp)
jne 0x3579
cmpl $0x9, %ebp
movq 0x10(%rsp), %rbx
jle 0x3714
setg %al
orb $0x30, %al
movb %al, 0xe(%rsp)
movq 0x38(%rbx), %rcx
movq 0x48(%rbx), %rdx
decq %rdx
cmpq %rdx, %rcx
je 0x3705
movb %al, (%rcx)
incq 0x38(%rbx)
jmp 0x3714
leaq 0xe(%rsp), %rsi
movq 0x18(%rsp), %rdi
callq 0xb674
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3728
movq %rax, %r14
movq 0x10(%rsp), %rdi
callq 0x2758
movq %r14, %rdi
callq 0x2200
nop