// File: Mariotti94[P]BigFloat/BigFloat.cc
// Function: BigFloat::SetPrecision(int)
void BigFloat::SetPrecision(int prec)
{
    if((error) || (prec < 0))
        return;
    if(this->decimals < prec) {
        while(this->decimals < prec) {
            this->decimals++;
            this->number.push_front('0');
        }
    }
    else if(this->decimals > prec) {
        char last;
        while(this->decimals > prec) {
            last = number[0];
            this->decimals--;
            this->number.pop_front();
        }
        if(CharToInt(last) >= 5) {
            if(prec == 0)
                (*this)++;
            else {
                std::stringstream ss;
                ss << "0.";
                for(int i = 1; i < prec; i++)
                    ss << "0";
                ss << "1";
                BigFloat aus(ss.str());
                *this = *this + aus;
            }
        }
    }
}

// Assembly:
subq $0x358, %rsp            # imm = 0x358
movq %rdi, 0x350(%rsp)
movl %esi, 0x34c(%rsp)
movq 0x350(%rsp), %rax
movq %rax, 0x8(%rsp)
testb $0x1, 0x5c(%rax)
jne 0xabb3
cmpl $0x0, 0x34c(%rsp)
jge 0xabb8
jmp 0xae26
movq 0x8(%rsp), %rax
movl 0x58(%rax), %eax
cmpl 0x34c(%rsp), %eax
jge 0xac0a
jmp 0xabcb
movq 0x8(%rsp), %rax
movl 0x58(%rax), %eax
cmpl 0x34c(%rsp), %eax
jge 0xac05
movq 0x8(%rsp), %rdi
movl 0x58(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x58(%rdi)
addq $0x8, %rdi
movb $0x30, 0x34b(%rsp)
leaq 0x34b(%rsp), %rsi
callq 0xb4e0
jmp 0xabcb
jmp 0xae26
movq 0x8(%rsp), %rax
movl 0x58(%rax), %eax
cmpl 0x34c(%rsp), %eax
jle 0xae24
jmp 0xac21
movq 0x8(%rsp), %rax
movl 0x58(%rax), %eax
cmpl 0x34c(%rsp), %eax
jle 0xac66
movq 0x8(%rsp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xb540
movq 0x8(%rsp), %rdi
movb (%rax), %al
movb %al, 0x34a(%rsp)
movl 0x58(%rdi), %eax
addl $-0x1, %eax
movl %eax, 0x58(%rdi)
addq $0x8, %rdi
callq 0xba50
jmp 0xac21
leaq 0x34a(%rsp), %rdi
callq 0xb570
cmpl $0x5, %eax
jl 0xae22
cmpl $0x0, 0x34c(%rsp)
jne 0xacac
movq 0x8(%rsp), %rsi
leaq 0x2c8(%rsp), %rdi
xorl %edx, %edx
callq 0xbac0
leaq 0x2c8(%rsp), %rdi
callq 0x2780
jmp 0xae20
leaq 0x140(%rsp), %rdi
callq 0x2120
leaq 0x150(%rsp), %rdi
leaq 0x53aa(%rip), %rsi      # 0x10072
callq 0x21d0
jmp 0xaccf
movl $0x1, 0x130(%rsp)
movl 0x130(%rsp), %eax
cmpl 0x34c(%rsp), %eax
jge 0xad2e
leaq 0x150(%rsp), %rdi
leaq 0x5348(%rip), %rsi      # 0x10041
callq 0x21d0
jmp 0xad00
jmp 0xad02
movl 0x130(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x130(%rsp)
jmp 0xacda
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
jmp 0xae11
leaq 0x150(%rsp), %rdi
leaq 0x5338(%rip), %rsi      # 0x10075
callq 0x21d0
jmp 0xad44
leaq 0x90(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x21c0
jmp 0xad5b
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0xbb90
jmp 0xad72
leaq 0x90(%rsp), %rdi
callq 0x20f0
movq 0x8(%rsp), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xb0(%rsp), %rdx
callq 0x5ee0
jmp 0xad98
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2950
leaq 0x10(%rsp), %rdi
callq 0x2780
leaq 0xb0(%rsp), %rdi
callq 0x2780
leaq 0x140(%rsp), %rdi
callq 0x2140
jmp 0xae20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x20f0
jmp 0xae11
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x2780
leaq 0x140(%rsp), %rdi
callq 0x2140
jmp 0xae2e
jmp 0xae22
jmp 0xae24
jmp 0xae26
addq $0x358, %rsp            # imm = 0x358
retq
movq 0x138(%rsp), %rdi
callq 0x2300
nopl (%rax,%rax)