Function at 0x140055400
Capabilities:
Query environment variable
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x468
mov rbx, r9
mov r14, r8
mov esi, edx
mov rdi, rcx
lea r13, [rsp + 0x4d0]
mov qword [rsp + 0x58], r13
test rcx, rcx
jne 0x140055437
mov rdi, qword [0x14014a668]
test rdi, rdi
je 0x140055447
mov eax, dword [rdi]
cmp eax, esi
jge 0x140055487
jmp case.0x1400554a3.0
lea rcx, str.LIBUSB_DEBUG
call qword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
test rax, rax
je 0x14005547d
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
cmp eax, esi
jge 0x140055487
jmp case.0x1400554a3.0
xor eax, eax
cmp eax, esi
jl case.0x1400554a3.0
cmp esi, 4
ja case.default.0x1400554a3
lea r15, str.error
mov ecx, esi
lea rdx, [0x140055714]
movsxd rcx, dword [rdx + rcx*4]
add rcx, rdx
jmp rcx
lea r15, str.warning
cmp eax, 4
je 0x1400554cd
jmp 0x14005550b
lea r15, str.unknown
cmp eax, 4
je 0x1400554cd
jmp 0x14005550b
lea r15, str.info
cmp eax, 4
jne 0x14005550b
cmp byte [0x14014a690], 0
jne 0x140055596
mov byte [0x14014a690], 1
mov rax, qword [0x14014a648]
test rax, rax
je 0x14005552e
lea r8, str._timestamp___threadID__facility_level__function_call___message__n
xor ecx, ecx
mov edx, 4
call rax
jmp 0x140055553
lea r15, str.debug
cmp eax, 4
je 0x1400554cd
mov qword [rsp + 0x20], r14
lea r8, str.libusb:__s___s_
lea rcx, [rsp + 0x60]
mov edx, 0x400
mov r9, r15
call fcn.140004c10
jmp 0x14005561f
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea rcx, str._timestamp___threadID__facility_level__function_call___message__n
mov edx, 0x40
mov r8d, 1
mov r9, rax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fwrite
mov rax, qword [0x14014a648]
test rax, rax
je 0x140055571
lea r8, str._________________________________________________________________________________n
xor ecx, ecx
mov edx, 4
call rax
jmp 0x140055596
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea rcx, str._________________________________________________________________________________n
mov edx, 0x51
mov r8d, 1
mov r9, rax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fwrite
lea rcx, [rsp + 0x48]
call fcn.14006f400
mov rax, qword [rsp + 0x48]
sub rax, qword [0x14014a658]
mov qword [rsp + 0x48], rax
mov ecx, dword [rsp + 0x50]
sub ecx, dword [0x14014a660]
mov dword [rsp + 0x50], ecx
jns 0x1400555d3
dec rax
mov qword [rsp + 0x48], rax
add ecx, 0x3b9aca00
mov dword [rsp + 0x50], ecx
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
movsxd rcx, dword [rsp + 0x50]
imul rcx, rcx, 0x10624dd3
mov rdx, rcx
shr rdx, 0x3f
sar rcx, 0x26
add ecx, edx
mov r9d, dword [rsp + 0x48]
mov qword [rsp + 0x38], r14
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], ecx
lea r8, str.__2ld._06ld____08x__libusb:__s___s_
lea rcx, [rsp + 0x60]
mov edx, 0x400
call fcn.140004c10
mov r14d, eax
xor ebp, ebp
cmp eax, 0x400
cmovae r14d, ebp
mov r12d, 0x400
sub r12, r14
lea r15, [rsp + r14]
add r15, 0x60
call fcn.1400067f0
mov rcx, qword [rax]
or rcx, 2
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], 0
mov rdx, r15
mov r8, r12
mov r9, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___stdio_common_vsprintf]
test eax, eax
mov ecx, 0xffffffff
cmovns ecx, eax
lea eax, [rcx + r14]
mov edx, 0x400
sub edx, r14d
cmp eax, 0x400
mov eax, ecx
cmovge eax, edx
test ecx, ecx
cmovs eax, edx
lea ecx, [rax + r14]
cmp ecx, 0x3fe
lea ecx, [rax + r14 - 0x3fe]
cmovb ecx, ebp
sub eax, ecx
cdqe
mov word [rax + r15], 0xa
mov rax, qword [0x14014a648]
test rax, rax
je 0x1400556ca
lea r8, [rsp + 0x60]
xor ecx, ecx
mov edx, esi
call rax
test rdi, rdi
jne 0x1400556e8
jmp case.0x1400554a3.0
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea rcx, [rsp + 0x60]
mov rdx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
test rdi, rdi
je case.0x1400554a3.0
mov rax, qword [rdi + 8]
test rax, rax
je case.0x1400554a3.0
lea r8, [rsp + 0x60]
mov rcx, rdi
mov edx, esi
call rax
nop
add rsp, 0x468
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret