// File: Mariotti94[P]BigFloat/BigFloat.cc
// Function: BigFloat::Multiply(BigFloat const&, BigFloat const&)
BigFloat BigFloat::Multiply(const BigFloat& left, const BigFloat& right)
{
    BigFloat ris;
    BigFloat tmp;
    ris.number.push_back('0');
    int carry = 0;

    for(size_t i = 0; i < right.number.size(); ++i) {
        for(size_t k = 0; k < i; ++k) {
            tmp.number.push_front('0');
        }

        for(size_t j = 0; j < left.number.size(); ++j) {
            int aus = CharToInt(right.number[i]) * CharToInt(left.number[j]) + carry;
            carry = 0;
            if(aus > 9) {
                while(aus > 9) {
                    carry++;
                    aus -= 10;
                }
            }
            tmp.number.push_back(IntToChar(aus));
        }

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

        ris = Sum(ris, tmp);
        tmp.number.clear();
    }

    return ris;
}

// Assembly:
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, 0x38(%rsp)
movq %rdi, %rax
movq %rax, 0x40(%rsp)
movq %rdi, 0x1a0(%rsp)
movq %rsi, 0x198(%rsp)
movq %rdx, 0x190(%rsp)
movb $0x0, 0x18f(%rsp)
callq 0x28c0
leaq 0x108(%rsp), %rdi
callq 0x28c0
jmp 0x4ff8
movq 0x38(%rsp), %rdi
addq $0x8, %rdi
movb $0x30, 0xfb(%rsp)
leaq 0xfb(%rsp), %rsi
callq 0xb590
jmp 0x5018
movl $0x0, 0xf4(%rsp)
movq $0x0, 0xe8(%rsp)
movq 0xe8(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x190(%rsp), %rdi
addq $0x8, %rdi
callq 0x35c0
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0x52e5
movq $0x0, 0xe0(%rsp)
movq 0xe0(%rsp), %rax
cmpq 0xe8(%rsp), %rax
jae 0x50f2
leaq 0x110(%rsp), %rdi
movb $0x30, 0xdf(%rsp)
leaq 0xdf(%rsp), %rsi
callq 0xb4e0
jmp 0x509b
jmp 0x509d
movq 0xe0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xe0(%rsp)
jmp 0x506a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
jmp 0x531b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x100(%rsp)
movl %eax, 0xfc(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x2780
jmp 0x531b
movq $0x0, 0xd0(%rsp)
movq 0xd0(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x198(%rsp), %rdi
addq $0x8, %rdi
callq 0x35c0
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0x5235
movq 0x190(%rsp), %rdi
addq $0x8, %rdi
movq 0xe8(%rsp), %rsi
callq 0xb510
movq %rax, %rdi
callq 0xb570
movl %eax, 0x24(%rsp)
jmp 0x5154
movq 0x198(%rsp), %rdi
addq $0x8, %rdi
movq 0xd0(%rsp), %rsi
callq 0xb510
movq %rax, %rdi
callq 0xb570
movl %eax, 0x20(%rsp)
jmp 0x517b
movl 0x20(%rsp), %ecx
movl 0x24(%rsp), %eax
imull %ecx, %eax
addl 0xf4(%rsp), %eax
movl %eax, 0xcc(%rsp)
movl $0x0, 0xf4(%rsp)
cmpl $0x9, 0xcc(%rsp)
jle 0x51db
jmp 0x51ab
cmpl $0x9, 0xcc(%rsp)
jle 0x51d9
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xf4(%rsp)
movl 0xcc(%rsp), %eax
subl $0xa, %eax
movl %eax, 0xcc(%rsp)
jmp 0x51ab
jmp 0x51db
leaq 0x110(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0xcc(%rsp), %rdi
callq 0xb5c0
movb %al, 0x1f(%rsp)
jmp 0x51fb
movq 0x10(%rsp), %rdi
movb 0x1f(%rsp), %al
movb %al, 0xcb(%rsp)
leaq 0xcb(%rsp), %rsi
callq 0xb590
jmp 0x521a
jmp 0x521c
movq 0xd0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xd0(%rsp)
jmp 0x50fe
cmpl $0x0, 0xf4(%rsp)
je 0x527e
leaq 0x110(%rsp), %rax
movq %rax, (%rsp)
leaq 0xf4(%rsp), %rdi
callq 0xb5c0
movb %al, 0xf(%rsp)
jmp 0x525e
movq (%rsp), %rdi
movb 0xf(%rsp), %al
movb %al, 0xca(%rsp)
leaq 0xca(%rsp), %rsi
callq 0xb590
jmp 0x527c
jmp 0x527e
movq 0x38(%rsp), %rsi
movl $0x0, 0xf4(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x108(%rsp), %rdx
callq 0x4af0
jmp 0x52a2
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x2950
leaq 0x48(%rsp), %rdi
callq 0x2780
leaq 0x108(%rsp), %rdi
addq $0x8, %rdi
callq 0x4330
movq 0xe8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xe8(%rsp)
jmp 0x502f
movb $0x1, 0x18f(%rsp)
leaq 0x108(%rsp), %rdi
callq 0x2780
testb $0x1, 0x18f(%rsp)
jne 0x530e
movq 0x38(%rsp), %rdi
callq 0x2780
movq 0x40(%rsp), %rax
addq $0x1a8, %rsp            # imm = 0x1A8
retq
movq 0x38(%rsp), %rdi
callq 0x2780
movq 0x100(%rsp), %rdi
callq 0x2300
nopw %cs:(%rax,%rax)