Function at 0x140050310
Capabilities:
Print debug messages
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xa8
mov rdi, rcx
call fcn.140146718
mov esi, dword [rax]
call fcn.140146718
mov dword [rax], 0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [rsp + 0x84], eax
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [rdi + 0x78]
movabs r13, 0x7ffffffffffffff8
test al, 0x10
mov dword [rsp + 0x88], esi
je 0x1400507b6
mov rax, qword [rdi + 0x48]
mov rbx, qword [rdi + 0x70]
cmp rbx, rax
jae 0x14005037d
mov qword [rdi + 0x70], rax
mov rbx, rax
mov r14, qword [rdi + 0x40]
sub rbx, r14
js 0x1400508d5
cmp rbx, r13
jae 0x140050760
cmp rbx, 0x16
ja 0x140050540
lea rcx, [rsp + 0x50]
mov byte [rcx + 0x17], bl
lea rsi, [rcx + rbx]
cmp rcx, r14
ja 0x1400503b7
cmp rsi, r14
ja 0x1400508d5
test rbx, rbx
je 0x1400503c7
mov rdx, r14
mov r8, rbx
call fcn.14014ac10
lea r14, [rdi + 0x10]
mov byte [rsi], 0
movsx rbx, byte [rsp + 0x67]
test rbx, rbx
jns 0x1400503de
mov rbx, qword [rsp + 0x58]
jns 0x1400503ea
mov rcx, qword [rsp + 0x50]
call fcn.140146640
mov rax, qword [r14]
movsxd rax, dword [rax + 4]
mov r15, qword [r14 + rax + 0x30]
lea rsi, [0x140271298]
cmp r15, rsi
jne 0x14005076a
lea rax, [0x140271400]
mov qword [rsp + 0x68], rax
mov rax, qword [0x140271400]
cmp rax, 0xffffffffffffffff
jne 0x1400508d7
movsxd rax, dword [0x140271408]
lea rdx, [rax - 1]
mov rcx, qword [r15 + 0x10]
mov r8, qword [r15 + 0x18]
sub r8, rcx
sar r8, 3
cmp r8, rdx
jbe 0x14005075b
mov rcx, qword [rcx + rax*8 - 8]
test rcx, rcx
je 0x14005075b
mov rax, qword [rcx]
mov rax, qword [rax + 0x38]
mov dl, 0xa
call qword [0x1402529a0]
mov ebp, eax
cmp r15, rsi
jne 0x140050806
mov rcx, r14
mov edx, ebp
call fcn.140050b10
mov rcx, r14
call fcn.1400509f0
movabs rax, 0xaaaaaaaaaaaaaaaa
mov qword [rsp + 0x40], rax
movaps xmm0, xmmword [0x14022cb50]
movaps xmmword [rsp + 0x30], xmm0
mov eax, dword [rdi + 0x78]
test al, 0x10
je 0x1400507d3
mov rax, qword [rdi + 0x48]
mov r14, qword [rdi + 0x70]
cmp r14, rax
jae 0x1400504ba
mov qword [rdi + 0x70], rax
mov r14, rax
mov r15, qword [rdi + 0x40]
sub r14, r15
js 0x1400508d5
cmp r14, r13
jae 0x140050774
cmp r14, 0x16
ja 0x140050580
lea rcx, [rsp + 0x30]
mov byte [rcx + 0x17], r14b
lea rsi, [rcx + r14]
cmp rcx, r15
ja 0x1400504f5
cmp rsi, r15
ja 0x1400508d5
test r14, r14
je 0x140050505
mov rdx, r15
mov r8, r14
call fcn.14014ac10
mov byte [rsi], 0
mov rbp, qword [rdi + 0x118]
movsx rax, byte [rsp + 0x47]
mov rsi, rax
test rax, rax
jns 0x140050522
mov rsi, qword [rsp + 0x38]
mov r14, rsi
sub r14, rbp
jb 0x14005077e
test al, al
js 0x1400505c0
lea r15, [rsp + 0x30]
jmp 0x1400505c5
mov rax, rbx
and rax, r13
add rax, 8
mov r15, rbx
or r15, 7
cmp r15, 0x17
cmove r15, rax
inc r15
mov rcx, r15
call fcn.140146648
mov rcx, rax
mov qword [rsp + 0x50], rax
bts r15, 0x3f
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x58], rbx
jmp 0x1400503a5
mov rax, r14
and rax, r13
add rax, 8
mov r12, r14
or r12, 7
cmp r12, 0x17
cmove r12, rax
inc r12
mov rcx, r12
call fcn.140146648
mov rcx, rax
mov qword [rsp + 0x30], rax
bts r12, 0x3f
mov qword [rsp + 0x40], r12
mov qword [rsp + 0x38], r14
jmp 0x1400504e3
mov r15, qword [rsp + 0x30]
cmp r14, r13
jae 0x140050788
add r15, rbp
cmp r14, 0x16
ja 0x1400506d5
lea rcx, [rsp + 0x68]
mov byte [rcx + 0x17], r14b
lea r12, [rcx + r14]
cmp rcx, r15
ja 0x1400505f6
cmp r12, r15
ja 0x1400508d5
cmp rsi, rbp
je 0x140050606
mov rdx, r15
mov r8, r14
call fcn.14014ac10
mov byte [r12], 0
mov eax, dword [rdi + 0x128]
mov rcx, qword [rdi + 0x120]
mov dword [rsp + 0x8c], eax
mov qword [rsp + 0x98], rcx
mov qword [rsp + 0x90], 0x57
mov al, byte [0x140272017]
test al, al
jne 0x14005094e
cmp byte [rsp + 0x7f], 0
jns 0x140050652
mov rcx, qword [rsp + 0x68]
call fcn.140146640
cmp dword [rdi + 8], 3
je 0x14005082e
mov eax, dword [0x140262650]
test al, 2
jne 0x140050792
test al, 4
jne 0x140050712
test eax, 0xfffffffa
jne 0x140050683
cmp dword [rdi + 8], 2
jge 0x140050712
test al, 1
jne 0x140050904
cmp dword [rdi + 8], 3
mov esi, dword [rsp + 0x88]
je 0x1400507f1
cmp byte [rsp + 0x47], 0
jns 0x1400506ad
mov rcx, qword [rsp + 0x30]
call fcn.140146640
mov ecx, dword [rsp + 0x84]
call qword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.140146718
mov dword [rax], esi
add rsp, 0xa8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
and r13, r14
add r13, 8
mov r12, r14
or r12, 7
cmp r12, 0x17
cmove r12, r13
inc r12
mov rcx, r12
call fcn.140146648
mov rcx, rax
mov qword [rsp + 0x68], rax
bts r12, 0x3f
mov qword [rsp + 0x78], r12
mov qword [rsp + 0x70], r14
jmp 0x1400505e4
lea rsi, [rsp + 0x30]
movsx r14, byte [rsi + 0x17]
test r14, r14
cmovs r14, qword [rsi + 8]
cmovs rsi, qword [rsi]
test r14, r14
je 0x140050683
xor r15d, r15d
mov r8d, r14d
sub r8d, r15d
lea rdx, [rsi + r15]
mov ecx, 2
call fcn.1401478a0
test eax, eax
jns 0x14005099a
mov eax, dword [0x140262650]
jmp 0x140050683
call fcn.140187c50
lea rcx, [rsp + 0x50]
call fcn.1401879d0
lock inc dword [r15 + 8]
jmp 0x140050406
lea rcx, [rsp + 0x30]
call fcn.1401879d0
lea rcx, [rsp + 0x68]
call fcn.140187a40
lea rcx, [rsp + 0x68]
call fcn.1401879d0
cmp byte [rsp + 0x47], 0
js 0x1400507a0
lea rcx, [rsp + 0x30]
jmp 0x1400507a5
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x140262650]
jmp 0x14005066a
xor r14d, r14d
mov ebx, 0
test al, 8
je 0x14005039d
mov r14, qword [rdi + 0x28]
mov rbx, qword [rdi + 0x38]
jmp 0x140050381
xor r14d, r14d
mov r15d, 0
test al, 8
je 0x1400504da
mov r15, qword [rdi + 0x28]
mov r14, qword [rdi + 0x38]
jmp 0x1400504be
lea r8, [rsp + 0x30]
mov rcx, rdi
mov rdx, rbx
call fcn.1401a54b0
jmp 0x14005069c
mov eax, 0xffffffff
lock xadd dword [r15 + 8], eax
test eax, eax
jne 0x14005046e
mov rax, qword [r15]
mov rax, qword [rax + 8]
mov rcx, r15
call qword [0x1402529a0]
jmp 0x14005046e
cmp byte [0x14027232c], 0
jne 0x14005065c
mov byte [0x14027232c], 1
mov eax, dword [0x140272338]
mov ecx, dword [0x14026ee18]
mov rdx, qword gs:[0x58]
mov rcx, qword [rdx + rcx*8]
cmp eax, dword [rcx + 4]
jg 0x1400509ad
lea r14, [rsp + 0x50]
mov rcx, rdi
mov rdx, r14
call fcn.1401a53e0
movsx rax, byte [r14 + 0x17]
test rax, rax
jns 0x14005088b
mov rax, qword [rsp + 0x58]
mov r14, qword [rsp + 0x50]
mov qword [rsp + 0x68], r14
mov qword [rsp + 0x70], rax
test rax, rax
js 0x1400508d5
sete al
test r14, r14
setne cl
or cl, al
je 0x1400508d5
mov rcx, qword [0x140272330]
lea rdx, [rsp + 0x68]
call fcn.140010c70
cmp byte [rsp + 0x67], 0
jns 0x1400508c9
mov rcx, qword [rsp + 0x50]
call fcn.140146640
mov byte [0x14027232c], 0
jmp 0x14005065c
ud2
lea rax, [rsp + 0x68]
lea rcx, [rsp + 0x50]
mov qword [rcx], rax
lea rdx, [rsp + 0x30]
mov qword [rdx], rcx
lea rcx, [0x140271400]
lea r8, [0x1400a7820]
call fcn.140035600
jmp 0x140050423
call fcn.1401a50f0
test al, al
je 0x14005068b
lea r9, [rsp + 0x50]
mov dword [r9], 0xaaaaaaaa
lea rdx, [rsp + 0x30]
movzx r8d, byte [rdx + 0x17]
test r8b, r8b
cmovs r8d, dword [rdx + 8]
cmovs rdx, qword [rdx]
mov rcx, qword [0x1402722e8]
mov qword [rsp + 0x20], 0
call qword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x14005068b
movzx ecx, al
lea rax, [rsp + 0x98]
lea r9, [rsp + 0x50]
mov qword [r9], rax
lea rax, [rsp + 0x8c]
mov qword [r9 + 8], rax
lea rax, [rsp + 0x68]
mov qword [r9 + 0x10], rax
lea rax, str.LogMessage
lea r8, [rsp + 0xa0]
mov qword [r8], rax
lea rdx, [rsp + 0x90]
call fcn.1401a5af0
jmp 0x140050641
mov eax, eax
add r15, rax
cmp r15, r14
jb 0x140050734
jmp 0x140050750
lea rcx, [0x140272338]
call fcn.1401467a0
cmp dword [0x140272338], 0xffffffff
jne 0x140050867
lea rcx, str.LOG_FATAL
mov edx, 0x400
call fcn.140050b00
mov qword [0x140272330], rax
lea rcx, [0x140272338]
call fcn.140146740
jmp 0x140050867