// File: /workspace/github_cpp_makefile_star2_O1/dnegovan[P]Intruder-On-Donnar-V/dansLibrary.cpp
// Function: getMoneyWithinRange(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, double, double)
double getMoneyWithinRange(std::string prompt, double min, double max)
{
    bool isMoney = true;

    std::cout << prompt << " Choose an amount from $" << makeTwoDecimals(min)
              << " to $" << makeTwoDecimals(max) << std::endl;
    double input = getDouble();

    //check that they only entered 2 numbers after decimal
    double check1 = input * 100;
    int check2 = check1;
    if (check1 != check2)
    {
        isMoney = false;
        std::cout << "Please enter a valid monetary value in USD."
                  << std::endl;
    }

    //validate range
    while(input < min || input > max || !isMoney)
    {
        std::cout << "Choose an amount from $" << makeTwoDecimals(min)
                  << " to $" << makeTwoDecimals(max) << std::endl;

        input = getDouble();

        //check that they only entered 2 numbers after decimal
        double check1 = input * 100;
        int check2 = check1;
        if (check1 != check2)
        {
            isMoney = false;
            std::cout << "Please enter a valid monetary value in USD."
                      << std::endl;
        }
        else
        {
            isMoney = true;
        }
    }

    return input;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movsd %xmm1, -0x38(%rbp)
movsd %xmm0, -0x30(%rbp)
movq (%rdi), %rsi
movq 0x8(%rdi), %rdx
movq 0xbedc(%rip), %rbx      # 0x1bfc8
movq %rbx, %rdi
callq 0x3210
movq %rax, %r14
leaq 0x644c(%rip), %rsi      # 0x1654a
movl $0x18, %edx
movq %rax, %rdi
callq 0x3210
leaq -0x80(%rbp), %r15
movq %r15, %rdi
movsd -0x30(%rbp), %xmm0
callq 0x10433
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x3210
movq %rax, %r14
leaq 0x642e(%rip), %rsi      # 0x16563
movl $0x5, %edx
movq %rax, %rdi
callq 0x3210
leaq -0x60(%rbp), %rdi
movsd -0x38(%rbp), %xmm0
callq 0x10433
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %r14, %rdi
callq 0x3210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1019c
callq 0x31c0
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x101ae
callq 0x31c0
callq 0xfd71
movapd %xmm0, %xmm1
movsd 0x62c9(%rip), %xmm2     # 0x16488
mulsd %xmm0, %xmm2
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm3
ucomisd %xmm3, %xmm2
jne 0x101d3
jnp 0x10238
leaq 0x638f(%rip), %rsi      # 0x16569
movl $0x2b, %edx
movq %rbx, %rdi
movsd %xmm1, -0x40(%rbp)
movapd %xmm2, -0xa0(%rbp)
movapd %xmm3, -0x90(%rbp)
callq 0x3210
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
movapd -0x90(%rbp), %xmm3
movapd -0xa0(%rbp), %xmm2
movsd -0x40(%rbp), %xmm1
ucomisd -0x38(%rbp), %xmm1
ja 0x10256
movsd -0x30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x10256
ucomisd %xmm3, %xmm2
jne 0x10256
jnp 0x103c4
leaq 0x6306(%rip), %r12      # 0x16563
leaq -0x60(%rbp), %r13
movl $0x17, %edx
movq %rbx, %rdi
leaq 0x62db(%rip), %rsi      # 0x1654b
callq 0x3210
movq %r15, %rdi
movsd -0x30(%rbp), %xmm0
callq 0x10433
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq %rbx, %rdi
callq 0x3210
movq %rax, %r14
movl $0x5, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x3210
movq %r13, %rdi
movsd -0x38(%rbp), %xmm0
callq 0x10433
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq %r14, %rdi
callq 0x3210
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x102fe
callq 0x31c0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x10310
callq 0x31c0
callq 0xfd71
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
mulsd 0x6163(%rip), %xmm2     # 0x16488
cvttpd2dq %xmm2, %xmm0
cvtdq2pd %xmm0, %xmm3
ucomisd %xmm3, %xmm2
jne 0x10335
jnp 0x1039a
movl $0x2b, %edx
movq %rbx, %rdi
leaq 0x6225(%rip), %rsi      # 0x16569
movsd %xmm1, -0x40(%rbp)
movapd %xmm2, -0xa0(%rbp)
movapd %xmm3, -0x90(%rbp)
callq 0x3210
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x31d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3140
movapd -0x90(%rbp), %xmm3
movapd -0xa0(%rbp), %xmm2
movsd -0x40(%rbp), %xmm1
ucomisd -0x38(%rbp), %xmm1
ja 0x10261
movsd -0x30(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x10261
ucomisd %xmm3, %xmm2
jne 0x10261
jp 0x10261
movapd %xmm1, %xmm0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x103d9
movq %rax, %rbx
jmp 0x103f3
movq %rax, %rbx
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x103f3
callq 0x31c0
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x10421
jmp 0x103ff
movq %rax, %rbx
jmp 0x10419
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x10419
callq 0x31c0
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x1042b
callq 0x31c0
movq %rbx, %rdi
callq 0x3320