// File: /workspace/github_cpp_makefile_star2_O3/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 0xc0e7(%rip), %rbx      # 0x1bfc8
movq %rbx, %rdi
callq 0x3210
movq %rax, %r14
leaq 0x6657(%rip), %rsi      # 0x1654a
movl $0x18, %edx
movq %rax, %rdi
callq 0x3210
leaq -0x78(%rbp), %r15
movq %r15, %rdi
movsd -0x30(%rbp), %xmm0
callq 0x10200
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %r14, %rdi
callq 0x3210
movq %rax, %r14
leaq 0x6639(%rip), %rsi      # 0x16563
movl $0x5, %edx
movq %rax, %rdi
callq 0x3210
leaq -0x58(%rbp), %rdi
movsd -0x38(%rbp), %xmm0
callq 0x10200
movq -0x58(%rbp), %rsi
movq -0x50(%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 -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xff91
callq 0x31c0
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xffa3
callq 0x31c0
callq 0xfb66
movapd %xmm0, %xmm3
movsd 0x64d4(%rip), %xmm0     # 0x16488
mulsd %xmm3, %xmm0
cvttpd2dq %xmm0, %xmm1
cvtdq2pd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xffe8
jp 0xffe8
ucomisd -0x38(%rbp), %xmm3
ja 0x10023
movsd -0x30(%rbp), %xmm2
ucomisd %xmm3, %xmm2
ja 0x10023
ucomisd %xmm1, %xmm0
jne 0x10023
jnp 0x10191
jmp 0x10023
leaq 0x657a(%rip), %rsi      # 0x16569
movl $0x2b, %edx
movq %rbx, %rdi
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
leaq 0x6539(%rip), %r12      # 0x16563
leaq -0x58(%rbp), %r13
movl $0x17, %edx
movq %rbx, %rdi
leaq 0x650e(%rip), %rsi      # 0x1654b
callq 0x3210
movq %r15, %rdi
movsd -0x30(%rbp), %xmm0
callq 0x10200
movq -0x78(%rbp), %rsi
movq -0x70(%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 0x10200
movq -0x58(%rbp), %rsi
movq -0x50(%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 -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x100cb
callq 0x31c0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x100dd
callq 0x31c0
callq 0xfb66
movapd %xmm0, %xmm3
movapd %xmm0, %xmm1
mulsd 0x6396(%rip), %xmm1     # 0x16488
cvttpd2dq %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm2
ucomisd %xmm2, %xmm1
jne 0x10102
jnp 0x10167
movl $0x2b, %edx
movq %rbx, %rdi
leaq 0x6458(%rip), %rsi      # 0x16569
movsd %xmm3, -0x80(%rbp)
movapd %xmm1, -0xa0(%rbp)
movapd %xmm2, -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), %xmm2
movapd -0xa0(%rbp), %xmm1
movsd -0x80(%rbp), %xmm3
ucomisd -0x38(%rbp), %xmm3
ja 0x1002e
movsd -0x30(%rbp), %xmm0
ucomisd %xmm3, %xmm0
ja 0x1002e
ucomisd %xmm2, %xmm1
jne 0x1002e
jp 0x1002e
movapd %xmm3, %xmm0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x101a6
movq %rax, %rbx
jmp 0x101c0
movq %rax, %rbx
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x101c0
callq 0x31c0
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x101ee
jmp 0x101cc
movq %rax, %rbx
jmp 0x101e6
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x101e6
callq 0x31c0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x101f8
callq 0x31c0
movq %rbx, %rdi
callq 0x3320