Function at 0x140056ee0
Capabilities:
Query environment variable

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x68
movaps xmmword [rsp + 0x50], xmm6
mov rdi, rcx
mov eax, 1
xchg dword [0x14014a654], eax
cmp eax, 1
jne 0x140056f29
mov rsi, qword [sym.imp.KERNEL32.dll_SleepEx]
nop
xor ecx, ecx
mov edx, 1
call rsi
mov eax, 1
xchg dword [0x14014a654], eax
cmp eax, 1
je 0x140056f10
cmp qword [0x14014a658], 0
jne 0x140056f3f
lea rcx, [0x14014a658]
call fcn.14006f400
mov r14, qword [0x14014a668]
test rdi, rdi
jne 0x140056f78
test r14, r14
je 0x140056f78
lea r8, str.libusb_init
lea r9, str.reusing_default_context
xor r13d, r13d
xor ecx, ecx
mov edx, 4
call fcn.140055400
inc dword [0x14014a670]
jmp 0x1400572a1
mov rdx, qword [0x140123c68]
add rdx, 0x1f8
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
test rax, rax
je 0x1400570fc
mov rbx, rax
mov rsi, rax
lea rcx, str.LIBUSB_DEBUG
call qword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
test rax, rax
je 0x14005718d
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_atoi]
cmp eax, 4
mov ecx, 4
cmovl ecx, eax
xor eax, eax
test ecx, ecx
cmovg eax, ecx
mov dword [rsi], eax
jle 0x140056fdc
mov dword [rsi + 4], 1
test r14, r14
jne 0x140057008
mov qword [0x14014a668], rsi
inc dword [0x14014a670]
lea r8, str.libusb_init
lea r9, str.created_default_context
xor ecx, ecx
mov edx, 4
call fcn.140055400
lea rax, [0x140100477]
mov qword [rsp + 0x40], rax
mov dword [rsp + 0x38], 0x2d40
mov dword [rsp + 0x30], 0x18
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 1
lea r8, str.libusb_init
lea r9, str.libusb_v_u._u._u._u_s
xor ecx, ecx
mov edx, 4
call fcn.140055400
lea r14, [rbx + 0x30]
mov r13, qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov rcx, r14
call r13
lea r12, [rbx + 0x68]
mov rcx, r12
call r13
lea r15, [rbx + 0xa8]
mov rcx, r15
call r13
lea rbp, [rbx + 0x20]
mov qword [rsi + 0x28], rbp
mov qword [rsi + 0x20], rbp
lea rax, [rbx + 0x58]
mov qword [rsi + 0x60], rax
mov qword [rsi + 0x58], rax
lea rax, [rbx + 0x90]
mov qword [rsi + 0x98], rax
mov qword [rsi + 0x90], rax
mov dword [rsi + 0xa0], 1
mov eax, 1
xchg dword [0x14014a640], eax
cmp eax, 1
jne 0x1400570ea
mov r13, qword [sym.imp.KERNEL32.dll_SleepEx]
nop word cs:[rax + rax]
xor ecx, ecx
mov edx, 1
call r13
mov eax, 1
xchg dword [0x14014a640], eax
cmp eax, 1
je 0x1400570d0
cmp byte [0x14014a650], 1
jne 0x140057107
mov rax, qword [0x14014a680]
jmp 0x14005711c
mov r13d, 0xfffffff5
jmp 0x1400572a1
mov byte [0x14014a650], 1
lea rax, [0x14014a678]
mov qword [0x14014a678], rax
add rbx, 0x1e8
mov qword [rsi + 0x1f0], rax
lea rcx, [0x14014a678]
mov qword [rsi + 0x1e8], rcx
mov qword [rax], rbx
mov qword [0x14014a680], rbx
xor eax, eax
xchg dword [0x14014a640], eax
mov rax, qword [0x140123b70]
test rax, rax
je 0x140057162
mov rcx, rsi
call rax
mov r13d, eax
test eax, eax
jne 0x1400571b5
mov rcx, rsi
call fcn.140070dc0
test eax, eax
js 0x1400571a1
xor r13d, r13d
mov eax, 0
xchg dword [0x14014a654], eax
test rdi, rdi
je 0x1400572a9
mov qword [rdi], rsi
jmp 0x1400572a9
mov dword [rsi], 0
test r14, r14
jne 0x140057008
jmp 0x140056fe1
mov r13d, eax
mov rax, qword [0x140123b78]
test rax, rax
je 0x1400571b5
mov rcx, rsi
call rax
cmp rsi, qword [0x14014a668]
jne 0x1400571cf
mov qword [0x14014a668], 0
dec dword [0x14014a670]
mov eax, 1
xchg dword [0x14014a640], eax
cmp eax, 1
jne 0x140057209
mov rdi, qword [sym.imp.KERNEL32.dll_SleepEx]
nop word cs:[rax + rax]
xor ecx, ecx
mov edx, 1
call rdi
mov eax, 1
xchg dword [0x14014a640], eax
cmp eax, 1
je 0x1400571f0
mov rax, qword [rsi + 0x1e8]
mov rcx, qword [rsi + 0x1f0]
mov qword [rcx], rax
mov rax, qword [rsi + 0x1e8]
mov rcx, qword [rsi + 0x1f0]
mov qword [rax + 8], rcx
xorps xmm6, xmm6
movups xmmword [rbx], xmm6
xor eax, eax
xchg dword [0x14014a640], eax
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rax, qword [rsi + 0x28]
cmp rax, rbp
je 0x140057279
lea rcx, [rax - 0x48]
mov rdi, qword [rcx + 0x50]
mov rdx, qword [rax]
mov qword [rdi], rdx
mov rdx, qword [rcx + 0x50]
mov r8, qword [rax]
mov qword [r8 + 8], rdx
movups xmmword [rax], xmm6
call fcn.140055ca0
lea rcx, [rdi - 0x48]
mov rax, rdi
cmp rdi, rbp
jne 0x140057250
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rdi, qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, r12
call rdi
mov rcx, r14
call rdi
mov rcx, r15
call rdi
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor eax, eax
xchg dword [0x14014a654], eax
mov eax, r13d
movaps xmm6, xmmword [rsp + 0x50]
add rsp, 0x68
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret