// File: /workspace/github_cpp_makefile_star2_O3/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 0x2fce
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 0x27ec
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x27f8
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x27f8
testl %ecx, %ecx
jne 0x26d5
movl %ebp, (%rbx)
movb %al, 0x3ad7(%rip)       # 0x61b2
leaq 0x20(%rsp), %rcx
movq -0x10(%rcx), %rdi
cmpq %rcx, %rdi
je 0x26fc
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21e0
movb 0x3ab6(%rip), %al       # 0x61b2
cmpb $0x3f, %al
ja 0x2804
movq 0x38cd(%rip), %rbx      # 0x5fd8
leaq 0x198c(%rip), %rsi      # 0x409e
movl $0x12, %edx
movq %rbx, %rdi
callq 0x2200
movb 0x3a8d(%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 0x3a48(%rip), %eax      # 0x61b2
cvtsi2sd %eax, %xmm1
movsd 0x1892(%rip), %xmm0     # 0x4008
subsd %xmm1, %xmm0
mulsd 0x188e(%rip), %xmm0     # 0x4010
callq 0x2180
mulsd 0x1889(%rip), %xmm0     # 0x4018
movsd %xmm0, 0x8(%rsp)
leaq 0x1915(%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 0x191f(%rip), %rdi      # 0x4112
callq 0x2100
leaq 0x1913(%rip), %rdi      # 0x4112
callq 0x2280
movq 0x37cd(%rip), %rdi      # 0x5fd8
leaq 0x1856(%rip), %rsi      # 0x4068
callq 0x21c0
movq %rax, %rdi
callq 0x20e0
movl $0x3, %edi
callq 0x2220
movq %rax, %r14
jmp 0x2853
movq %rax, %r14
cmpl $0x0, (%rbx)
jne 0x2838
movl %ebp, (%rbx)
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2853
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21e0
movq %r14, %rdi
callq 0x20c0
movq 0x3776(%rip), %rdi      # 0x5fd8
leaq 0x17c7(%rip), %rsi      # 0x4030
movl $0x37, %edx
callq 0x2200
movq 0x375e(%rip), %rdi      # 0x5fd8
callq 0x20e0
movl $0x2, %edi
callq 0x2220
movq %rax, %rbx
callq 0x22d0
movq %rbx, %rdi
callq 0x2300
movq %rax, %rdi
callq 0x300b