// File: /workspace/github_cpp_makefile_star2_O1/m0Mh42[P]mash/./src/main.cpp
// Function: difficulty_set(char*)
void difficulty_set(char* difficulty_num){
    try {
        difficulty = stoi(difficulty_num);
    } catch(...) {
        // Not Numeric Difficulty
        cout << "Invalid difficulty. Please insert number as difficulty." << endl;
        exit(USAGEERR);
    }
    if (difficulty > 63){
        // Difficulty can't be 64, so we cant find a result with all the characters '0'
        cout << "Invalid difficulty. Difficulty can\'t be more than 63." << endl;
        exit(INVALIDDIFF);
    }
    cout << "Difficulty set to " << difficulty << endl;
    double probability;
    double x = 64.00 - difficulty;
    // The probability to find the mash we look for.
    probability = pow(16.00, x) / pow(16.00, 64.00);
    cout << "Finding Probability: " << probability << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rsi
leaq 0x10(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x2ff8
movq 0x10(%rsp), %r14
callq 0x2050
movq %rax, %rbx
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x30(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x2260
cmpq %r14, (%r15)
je 0x2801
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x280d
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x280d
testl %ecx, %ecx
jne 0x26eb
movl %ebp, (%rbx)
movb %al, 0x3ac1(%rip)       # 0x61b2
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x270c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21e0
cmpb $0x3f, 0x3a9f(%rip)     # 0x61b2
ja 0x2819
movq 0x38b8(%rip), %rbx      # 0x5fd8
leaq 0x1977(%rip), %rsi      # 0x409e
movl $0x12, %edx
movq %rbx, %rdi
callq 0x2200
movb 0x3a78(%rip), %al       # 0x61b2
leaq 0x10(%rsp), %rsi
movb %al, (%rsi)
movl $0x1, %edx
movq %rbx, %rdi
callq 0x2200
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
movzbl 0x3a33(%rip), %eax      # 0x61b2
cvtsi2sd %eax, %xmm1
movsd 0x187d(%rip), %xmm0     # 0x4008
subsd %xmm1, %xmm0
mulsd 0x1879(%rip), %xmm0     # 0x4010
callq 0x2180
mulsd 0x1874(%rip), %xmm0     # 0x4018
movsd %xmm0, 0x8(%rsp)
leaq 0x1900(%rip), %rsi      # 0x40b1
movl $0x15, %edx
movq %rbx, %rdi
callq 0x2200
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x22c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2120
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x190a(%rip), %rdi      # 0x4112
callq 0x2100
leaq 0x18fe(%rip), %rdi      # 0x4112
callq 0x2280
movq 0x37b8(%rip), %rdi      # 0x5fd8
leaq 0x1841(%rip), %rsi      # 0x4068
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
movl $0x3, %edi
callq 0x2220
movq %rax, %r14
jmp 0x2868
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x284d
movl %ebp, (%rbx)
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2868
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x20c0
movq 0x3761(%rip), %rdi      # 0x5fd8
leaq 0x17b2(%rip), %rsi      # 0x4030
movl $0x37, %edx
callq 0x2200
movq 0x3749(%rip), %rdi      # 0x5fd8
callq 0x20e0
movl $0x2, %edi
callq 0x2220
movq %rax, %rbx
callq 0x22d0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0x3035