Function at 0x140013680
Capabilities:
Read file on windows

Disassembly:
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
push rbp
sub rsp, 0x38
mov rax, rcx
xor ecx, ecx
mov r12, rax
mov rsi, rcx
mov rcx, r12
lea rdx, [rsp + 0x20]
call fcn.1400139a0
movzx r9d, byte [rsp + 0x20]
mov byte [r12 + 0x4e5], r9b
mov byte [r12 + 0x4e4], r9b
test r9d, r9d
je 0x140013942
lea edx, [r9 - 5]
cmp edx, 0xa
ja 0x14001372d
cmp edx, 2
ja 0x1400136e8
mov edx, 7
mov ebx, 0xf
cmp r9d, 5
cmove ebx, edx
jmp 0x1400136f5
mov ebx, 1
lea ecx, [r9 + 0x15]
shl ebx, cl
dec ebx
mov byte [r12 + 0x80], bl
mov byte [r12 + 0x81], bl
mov byte [r12 + 0x83], bl
mov byte [r12 + 0x88], bl
mov byte [r12 + 0x89], bl
mov byte [r12 + 0x8a], bl
mov byte [r12 + 0x8b], bl
mov r8d, dword [r12 + 0xc0]
mov edi, r8d
cmp r9d, 0x3f
je 0x140013869
mov r9, qword [r12 + 0x528]
mov rbx, qword [r12 + 0x4f8]
mov r13d, dword [rsp + 0x28]
cmp dword [r9], 0
je 0x14001384d
mov r14, qword [r9 + 8]
cmp rbx, qword [r14 + 0x30]
jne 0x1400137f8
mov rbx, qword [r14 + 0x28]
mov dword [rbx], 1
mov dword [rbx + 4], r13d
mov rcx, qword [r14]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, qword [r14 + 8]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r15d, dword [rbx + 8]
test r15d, r15d
jl 0x14001395a
mov rcx, r12
mov edx, dword [rsp + 0x24]
call fcn.140014600
test eax, eax
jl 0x140013949
mov r8d, dword [r12 + 0xc0]
mov edx, r8d
sub rdx, rdi
je 0x1400137d0
add rsi, rdx
sub r8d, dword [r12 + 0x78]
jns 0x1400137ee
mov rdx, qword [r12 + 0x528]
cmp dword [rdx], 0
jne 0x14001369b
mov rcx, rsi
call fcn.14001e7f0
jmp 0x14001369b
mov dword [r12 + 0xc0], r8d
jmp 0x1400137d0
test r13, r13
je 0x140013845
mov r15, qword [r14 + 0x28]
mov dword [r15], 1
mov dword [r15 + 4], r13d
mov rcx, qword [r14]
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, qword [r14 + 8]
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r15d, dword [r15 + 8]
test r15d, r15d
jle 0x140013799
mov rcx, rbx
mov r8, r13
mov rdx, qword [r14 + 0x30]
call fcn.140023e60
jmp 0x140013799
xor r15d, r15d
jmp 0x140013799
mov rcx, rbx
xor edx, edx
inc rdx
mov r8, r13
mov r9, qword [r9 + 0x10]
call fcn.140027a34
mov r15d, eax
jmp 0x140013799
mov ebx, dword [rsp + 0x28]
test rbx, rbx
je 0x14001390e
mov r13d, r8d
and r13, 0xffffff
mov rbp, r13
neg rbp
add rbp, 0x1000000
cmp rbp, rbx
cmovae rbp, rbx
shr r8d, 0x18
mov rdx, rbp
mov r9, qword [r12 + r8*8 + 0xd8]
add r13, r9
mov rcx, r13
mov r8, qword [r12 + 0x528]
call fcn.14000f660
mov r14d, eax
test r14d, r14d
jl 0x140013983
movsxd r15, r14d
cmp r15, rbp
jne 0x14001396e
mov rcx, r13
mov rdx, r15
mov r8, qword [r12 + 0x528]
call fcn.14001c310
test eax, eax
jl 0x140013949
mov r8d, dword [r12 + 0xc0]
add dword [r12 + 0x504], r14d
add r8d, r14d
mov dword [r12 + 0xc0], r8d
sub rbx, r15
jne 0x140013876
jmp 0x1400137be
mov rax, r12
mov rcx, rsi
mov rax, qword [rax + 0x528]
cmp dword [rax], 0
jne 0x14001392f
mov dword [0x1400371a0], 0
call fcn.14001e7f0
xor eax, eax
add rsp, 0x38
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
xor ebx, ebx
jmp 0x1400136f5
add rsp, 0x38
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
mov eax, r15d
add rsp, 0x38
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
xor eax, eax
dec eax
add rsp, 0x38
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
mov eax, r14d
add rsp, 0x38
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret