// File: aisthesis[P]realnumber/src/real_number.cpp
// Function: RealNumber::assign_value(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void RealNumber::assign_value(const std::string& str) {
    std::size_t dot_position = str.find('.');
		std::size_t i;
    int integer_part = 0;
    if (dot_position > MAX_DECIMAL_INTEGER_DIGITS) {
        throw std::invalid_argument("Too many digits before decimal!");
    }
    for (i = 0; i < dot_position; ++i) {
        if (0 <= str[i] - '0' && str[i] - '0' <= 9) {
            integer_part = 10 * integer_part + (str[i] - '0');
        }
        else {
            throw std::invalid_argument("Input can contain only decimal digits!");
        }   
    }
    set_integer_part(integer_part);
		std::size_t fractional_digits_len = str.size() - dot_position - 1;
    unsigned char* decimal_digits = array_arithmetic::convert::helpers::to_digit_array(str.substr(dot_position + 1));
    for (i = INTEGER_DIGITS; i < ARRAY_SIZE; ++i) {
        value[i] = array_arithmetic::convert::helpers::times_radix(decimal_digits, fractional_digits_len);
    }
    delete[] decimal_digits;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movl $0x2e, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x2210
movq %rax, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
cmpq $0x9, -0x18(%rbp)
jbe 0x3402
movl $0x10, %edi
callq 0x2090
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x78(%rbp)
leaq 0x2cec(%rip), %rsi      # 0x60b6
callq 0x22c0
jmp 0x33d1
movq -0x78(%rbp), %rdi
movq 0x4c04(%rip), %rsi      # 0x7fe0
movq 0x4bed(%rip), %rdx      # 0x7fd0
callq 0x2270
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x20f0
jmp 0x35c8
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x34df
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x21c0
movsbl (%rax), %ecx
subl $0x30, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x3470
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x21c0
movsbl (%rax), %eax
subl $0x30, %eax
cmpl $0x9, %eax
jg 0x3470
imull $0xa, -0x24(%rbp), %eax
movl %eax, -0x7c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x21c0
movq %rax, %rcx
movl -0x7c(%rbp), %eax
movsbl (%rcx), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x24(%rbp)
jmp 0x34cc
movl $0x10, %edi
callq 0x2090
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x88(%rbp)
leaq 0x2c48(%rip), %rsi      # 0x60d6
callq 0x22c0
jmp 0x3495
movq -0x88(%rbp), %rdi
movq 0x4b3d(%rip), %rsi      # 0x7fe0
movq 0x4b26(%rip), %rdx      # 0x7fd0
callq 0x2270
movq -0x88(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
callq 0x20f0
jmp 0x35c8
jmp 0x34ce
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x340a
movq -0x70(%rbp), %rdi
leaq -0x24(%rbp), %rsi
callq 0x4090
movq -0x10(%rbp), %rdi
callq 0x20c0
movq %rax, %rcx
movq -0x18(%rbp), %rax
notq %rax
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
incq %rdx
leaq -0x68(%rbp), %rdi
movq %rdi, -0x98(%rbp)
movq $-0x1, %rcx
callq 0x2170
movq -0x98(%rbp), %rdi
callq 0x4e50
movq %rax, -0x90(%rbp)
jmp 0x353d
leaq -0x68(%rbp), %rdi
callq 0x20a0
movq -0x90(%rbp), %rax
movq %rax, -0x48(%rbp)
movq $0x4, -0x20(%rbp)
cmpq $0x36, -0x20(%rbp)
jae 0x35a2
movq -0x48(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4f70
movb %al, %dl
movq -0x70(%rbp), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x3559
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x20a0
jmp 0x35c8
movq -0x48(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, %rax
je 0x35bf
movq -0xa0(%rbp), %rdi
callq 0x2200
addq $0xa0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x2290
nopw %cs:(%rax,%rax)