Function at 0x140009470
Capabilities:
Check mutex on windows

Disassembly:
push rbp
push rsi
push rdi
sub rsp, 0x50
mov rax, qword [0x140101140]
xor rax, rsp
mov qword [rsp + 0x48], rax
mov rsi, rcx
mov edi, 0xffffff9d
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov r8d, eax
lea rdx, str.libusb_init_08X
lea rcx, [rsp + 0x30]
call fcn.140007960
mov edx, 1
lea r9, [rsp + 0x30]
mov r8d, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateSemaphoreA]
mov rbp, rax
test rax, rax
jne 0x1400094f3
xor ecx, ecx
call fcn.140010990
lea r9, str.could_not_create_semaphore:__s
mov qword [rsp + 0x20], rax
lea r8, str.windows_init
mov rcx, rsi
lea edx, [rdi + 0x64]
call fcn.140003000
lea eax, [rdi + 0x58]
jmp 0x1400096f6
or edx, 0xffffffff
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x14000953d
xor ecx, ecx
call fcn.140010990
lea r9, str.failure_to_access_semaphore:__s
mov qword [rsp + 0x20], rax
lea r8, str.windows_init
mov edx, 1
mov rcx, rsi
call fcn.140003000
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0xfffffff5
jmp 0x1400096f6
mov qword [rsp + 0x78], rbx
mov qword [rsp + 0x80], r14
xor r14d, r14d
add dword [0x140101ee8], 1
jne 0x140009647
call fcn.1400090b0
lea r9, str.Windows_Undefined
xor ecx, ecx
lea r8, str.windows_init
lea edx, [r14 + 4]
call fcn.140003000
cmp dword [0x140101db4], r14d
jne 0x1400095a4
lea r9, str.This_version_of_Windows_is_NOT_supported
mov rcx, rsi
lea r8, str.windows_init
lea edx, [r14 + 1]
call fcn.140003000
lea edi, [r14 - 0xc]
jmp 0x14000964a
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [0x140107f88], rax
call fcn.140006510
call fcn.140007d30
test eax, eax
je 0x1400095e3
lea r9, str.could_not_resolve_DLL_functions
mov edx, 1
lea r8, str.windows_init
mov rcx, rsi
call fcn.140003000
jmp 0x14000964a
lea rbx, fcn.14000bc40
lea rdi, str.WinUSB
mov rdx, rsi
or ecx, 0xffffffff
call qword [rbx]
add rbx, 0xa0
cmp rbx, rdi
jl 0x1400095f1
mov rcx, rsi
call fcn.140011040
test eax, eax
je 0x14000961d
mov rcx, rsi
call fcn.140010ae0
test eax, eax
jne 0x140009647
call fcn.140010be0
call fcn.140011300
mov rcx, qword [0x140107f68]
test rcx, rcx
je 0x140009640
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov qword [0x140107f68], r14
mov edi, 0xfffffff5
jmp 0x14000964a
mov edi, r14d
cmp dword [0x140101ee8], r14d
jne 0x1400096c4
test edi, edi
je 0x1400096ce
lea rbx, fcn.14000bc40
lea rsi, [0x1400dd158]
or ecx, 0xffffffff
call qword [rbx]
add rbx, 0xa0
cmp rbx, rsi
jl 0x140009665
call fcn.1400083b0
call fcn.1400066c0
call fcn.140010be0
call fcn.140011300
mov rcx, qword [0x140107f68]
test rcx, rcx
je 0x1400096a3
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov qword [0x140107f68], r14
mov rcx, qword [0x140107f88]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [0x140107f88]
test eax, eax
cmovne rcx, r14
mov qword [0x140107f88], rcx
test edi, edi
je 0x1400096ce
dec dword [0x140101ee8]
xor r8d, r8d
mov rcx, rbp
lea edx, [r8 + 1]
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov r14, qword [rsp + 0x80]
mov eax, edi
mov rbx, qword [rsp + 0x78]
mov rcx, qword [rsp + 0x48]
xor rcx, rsp
call fcn.140062030
add rsp, 0x50
pop rdi
pop rsi
pop rbp
ret