Function at 0x1400025d0
Capabilities:
Check mutex on windows

Disassembly:
mov qword [rsp + 8], rcx
push rbx
push rsi
sub rsp, 0x78
mov rbx, rcx
lea rcx, str.LIBUSB_DEBUG
call fcn.14009ce1c
mov edx, 1
mov rsi, rax
xchg dword [0x140107dd0], edx
cmp edx, 1
jne 0x14000261d
nop dword [rax]
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SleepEx]
mov ecx, 1
xchg dword [0x140107dd0], ecx
cmp ecx, 1
je 0x140002600
cmp dword [0x140107dd8], 0
jne 0x140002698
lea rcx, [rsp + 0x98]
call qword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
movabs rax, 0xcccccccccccccccd
mul qword [rsp + 0x98]
movabs rax, 0x431bde82d7b634db
mov r8, rdx
shr r8, 3
mul r8
shr rdx, 0x12
imul rax, rdx, 0xf4240
movabs rdx, 0xfe624e212ac18000
add rdx, qword [rsp + 0x98]
sub r8, rax
movabs rax, 0xd6bf94d5e57a42bd
mov dword [0x140107ddc], r8d
mul rdx
shr rdx, 0x17
mov dword [0x140107dd8], edx
test rbx, rbx
jne 0x1400026d3
cmp qword [0x140107de8], rbx
je 0x1400026d3
lea r9, str.reusing_default_context
xor ecx, ecx
lea r8, str.libusb_init
lea edx, [rbx + 4]
call fcn.140003000
inc dword [0x140107de4]
xchg dword [0x140107dd0], ebx
xor eax, eax
add rsp, 0x78
pop rsi
pop rbx
ret
mov qword [rsp + 0xa0], rbp
mov edx, 0x120
mov qword [rsp + 0x70], rdi
mov ecx, 1
mov qword [rsp + 0x68], r12
mov qword [rsp + 0x60], r13
mov qword [rsp + 0x58], r14
mov qword [rsp + 0x50], r15
call fcn.14008f864
xor ebx, ebx
mov rdi, rax
test rax, rax
jne 0x14000271f
xchg dword [0x140107dd0], ebx
mov ebp, 0xfffffff5
mov eax, ebp
jmp 0x140002a30
test rsi, rsi
je 0x140002739
mov rcx, rsi
call fcn.14009d150
mov dword [rdi], eax
test eax, eax
je 0x140002739
mov dword [rdi + 4], 1
cmp qword [0x140107de8], rbx
jne 0x140002769
inc dword [0x140107de4]
lea r9, str.created_default_context
lea r8, str.libusb_init
mov qword [0x140107de8], rdi
mov edx, 4
xor ecx, ecx
call fcn.140003000
lea rax, [0x1400dc280]
mov edx, 4
mov qword [rsp + 0x40], rax
lea r9, str.libusb_v_u._u._u._u_s
mov dword [rsp + 0x38], 0x2b6b
lea r8, str.libusb_init
mov dword [rsp + 0x30], 0x14
xor ecx, ecx
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x20], 1
call fcn.140003000
lea r14, [rdi + 0x20]
test r14, r14
je 0x1400027c4
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [r14], rax
lea r13, [rdi + 0x38]
test r13, r13
je 0x1400027de
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [r13], rax
lea r12, [rdi + 0x50]
test r12, r12
je 0x1400027f8
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [r12], rax
lea rax, [rdi + 0x28]
lea r15, [rdi + 0x10]
mov qword [r15 + 8], r15
mov qword [r15], r15
mov qword [rax + 8], rax
mov qword [rax], rax
lea rax, [rdi + 0x40]
mov qword [rax + 8], rax
mov qword [rax], rax
mov eax, 1
xchg dword [0x140107de0], eax
cmp eax, 1
jne 0x14000284d
nop dword [rax]
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SleepEx]
mov eax, 1
xchg dword [0x140107de0], eax
cmp eax, 1
je 0x140002830
cmp dword [0x140101db0], ebx
lea rcx, [0x14010eb00]
je 0x140002875
mov dword [0x140101db0], ebx
mov rax, rcx
mov qword [0x14010eb08], rcx
mov qword [0x14010eb00], rcx
jmp 0x14000287c
mov rax, qword [0x14010eb08]
lea rsi, [rdi + 0x110]
mov qword [rsi + 8], rax
mov qword [rsi], rcx
lea rcx, [fcn.140009470]
mov rax, qword [0x14010eb08]
mov qword [rax], rsi
mov eax, ebx
mov qword [0x14010eb08], rsi
xchg dword [0x140107de0], eax
test rcx, rcx
je 0x1400028bd
mov rcx, rdi
call fcn.140009470
mov ebp, eax
test eax, eax
jne 0x1400028e0
mov rcx, rdi
call fcn.1400044f0
mov ebp, eax
test eax, eax
jns 0x140002a18
lea rax, [fcn.14000b480]
test rax, rax
je 0x1400028e0
call fcn.14000b480
cmp rdi, qword [0x140107de8]
jne 0x1400028f6
dec dword [0x140107de4]
mov qword [0x140107de8], rbx
mov eax, 1
xchg dword [0x140107de0], eax
cmp eax, 1
jne 0x14000292d
nop word [rax + rax]
mov edx, 1
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SleepEx]
mov eax, 1
xchg dword [0x140107de0], eax
cmp eax, 1
je 0x140002910
mov rcx, qword [rsi + 8]
mov rax, qword [rsi]
mov qword [rcx], rax
mov rax, qword [rsi + 8]
mov rcx, qword [rsi]
mov qword [rcx + 8], rax
mov eax, ebx
mov qword [rsi], rbx
mov qword [rsi + 8], rbx
xchg dword [0x140107de0], eax
test r14, r14
je 0x140002962
mov rcx, qword [r14]
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rdi + 0x18]
sub rcx, 0x30
mov rsi, qword [rcx + 0x38]
lea r8, [rcx + 0x30]
sub rsi, 0x30
cmp r8, r15
je 0x1400029b5
nop dword [rax + rax]
mov rdx, qword [r8 + 8]
mov rax, qword [r8]
mov qword [rdx], rax
mov rdx, qword [r8]
mov rax, qword [r8 + 8]
mov qword [rdx + 8], rax
mov qword [r8], rbx
mov qword [r8 + 8], rbx
call fcn.140001d90
mov rcx, rsi
mov rsi, qword [rsi + 0x38]
sub rsi, 0x30
lea r8, [rcx + 0x30]
cmp r8, r15
jne 0x140002980
test r14, r14
je 0x1400029c3
mov rcx, qword [r14]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
test r13, r13
je 0x1400029da
mov rcx, qword [r13]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x1400029da
mov qword [r13], rbx
test r14, r14
je 0x1400029ef
mov rcx, qword [r14]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x1400029ef
mov qword [r14], rbx
test r12, r12
je 0x140002a06
mov rcx, qword [r12]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x140002a06
mov qword [r12], rbx
mov rcx, rdi
call fcn.14008f86c
xchg dword [0x140107dd0], ebx
mov eax, ebp
jmp 0x140002a30
mov rax, qword [rsp + 0x90]
xchg dword [0x140107dd0], ebx
test rax, rax
je 0x140002a2e
mov qword [rax], rdi
xor eax, eax
mov r14, qword [rsp + 0x58]
mov r13, qword [rsp + 0x60]
mov r12, qword [rsp + 0x68]
mov rdi, qword [rsp + 0x70]
mov rbp, qword [rsp + 0xa0]
mov r15, qword [rsp + 0x50]
add rsp, 0x78
pop rsi
pop rbx
ret