Function at 0x140021dc8
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rbp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x30
movsxd r14, ecx
lea r11, [0x140000000]
mov rax, r14
mov rbp, r14
and eax, 0x3f
sar rbp, 6
mov r15, r9
mov rsi, rdx
lea rdi, [rax + rax*8]
mov rax, qword [r11 + rbp*8 + 0x46490]
mov r10, qword [rax + rdi*8 + 0x28]
test r8, r8
je 0x140021e1d
cmp byte [rdx], 0xa
jne 0x140021e1d
or byte [rax + rdi*8 + 0x38], 4
jmp 0x140021e22
and byte [rax + rdi*8 + 0x38], 0xfb
lea r9, [rdx + r8]
mov rax, rsi
mov rbx, rsi
mov r12d, 1
cmp rsi, r9
jae 0x140021f33
mov cl, byte [rax]
cmp cl, 0x1a
je 0x140021f16
lea rdx, [rax + 1]
cmp cl, 0xd
je 0x140021e56
mov rax, rdx
mov byte [rbx], cl
jmp 0x140021e73
cmp rdx, r9
jae 0x140021e80
cmp byte [rdx], 0xa
jne 0x140021e6a
mov byte [rbx], 0xa
mov ecx, 2
jmp 0x140021e70
mov byte [rbx], 0xd
mov rcx, r12
add rax, rcx
inc rbx
cmp rax, r9
jb 0x140021e3b
jmp 0x140021f33
and qword [rsp + 0x20], 0
lea r9, [rsp + 0x68]
mov r8d, r12d
lea rdx, [rsp + 0x60]
mov rcx, r10
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x140021f0a
cmp dword [rsp + 0x68], 0
je 0x140021f0a
lea r11, [0x140000000]
mov rax, qword [r11 + rbp*8 + 0x46490]
test byte [rax + rdi*8 + 0x38], 0x48
je 0x140021edc
mov cl, byte [rsp + 0x60]
cmp cl, 0xa
jne 0x140021ecb
mov byte [rbx], 0xa
jmp 0x140021f30
mov byte [rbx], 0xd
mov rax, qword [r11 + rbp*8 + 0x46490]
mov byte [rax + rdi*8 + 0x3a], cl
jmp 0x140021f30
cmp byte [rsp + 0x60], 0xa
jne 0x140021ee8
cmp rbx, rsi
je 0x140021ec6
mov r8d, r12d
or rdx, 0xffffffffffffffff
mov ecx, r14d
call fcn.140022870
cmp byte [rsp + 0x60], 0xa
lea r11, [0x140000000]
je 0x140021f33
mov byte [rbx], 0xd
jmp 0x140021f30
mov byte [rbx], 0xd
lea r11, [0x140000000]
jmp 0x140021f30
mov rdx, qword [r11 + rbp*8 + 0x46490]
mov al, byte [rdx + rdi*8 + 0x38]
test al, 0x40
jne 0x140021f2e
or al, 2
mov byte [rdx + rdi*8 + 0x38], al
jmp 0x140021f33
mov byte [rbx], cl
add rbx, r12
sub ebx, esi
jne 0x140021f3e
xor eax, eax
jmp 0x140022077
mov r8, qword [r11 + rbp*8 + 0x46490]
cmp byte [r8 + rdi*8 + 0x39], 0
jne 0x140021f55
mov eax, ebx
jmp 0x140022077
movsxd rcx, ebx
add rcx, rsi
lea rbx, [rcx - 1]
cmp byte [rbx], 0
jl 0x140021f6c
mov rbx, rcx
jmp 0x140022012
mov edx, r12d
jmp 0x140021f81
cmp edx, 4
ja 0x140021f8f
cmp rbx, rsi
jb 0x140021f8f
sub rbx, r12
add edx, r12d
movzx eax, byte [rbx]
cmp byte [rax + r11 + 0x444d0], 0
je 0x140021f71
movzx ecx, byte [rbx]
movsx eax, byte [rcx + r11 + 0x444d0]
test eax, eax
jne 0x140021fb2
call fcn.140017c00
mov dword [rax], 0x2a
or eax, 0xffffffff
jmp 0x140022077
inc eax
cmp eax, edx
jne 0x140021fbf
mov eax, edx
add rbx, rax
jmp 0x140022012
test byte [r8 + rdi*8 + 0x38], 0x48
je 0x140022002
add rbx, r12
mov byte [r8 + rdi*8 + 0x3a], cl
cmp edx, 2
jb 0x140021fe5
mov cl, byte [rbx]
add rbx, r12
mov rax, qword [r11 + rbp*8 + 0x46490]
mov byte [rax + rdi*8 + 0x3b], cl
cmp edx, 3
jne 0x140021ffb
mov cl, byte [rbx]
add rbx, r12
mov rax, qword [r11 + rbp*8 + 0x46490]
mov byte [rax + rdi*8 + 0x3c], cl
mov eax, edx
sub rbx, rax
jmp 0x140022012
neg edx
mov r8d, r12d
movsxd rdx, edx
mov ecx, r14d
call fcn.140022870
mov eax, dword [rsp + 0x80]
sub ebx, esi
mov dword [rsp + 0x28], eax
mov r9d, ebx
mov r8, rsi
mov qword [rsp + 0x20], r15
xor edx, edx
mov ecx, 0xfde9
call fcn.14001dc24
mov r8d, eax
test eax, eax
jne 0x14002204f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.140017b74
jmp 0x140021faa
sub eax, ebx
lea rdx, [0x140000000]
mov rdx, qword [rdx + rbp*8 + 0x46490]
neg eax
sbb cl, cl
and cl, 2
mov al, byte [rdx + rdi*8 + 0x3d]
and al, 0xfd
or cl, al
lea eax, [r8 + r8]
mov byte [rdx + rdi*8 + 0x3d], cl
mov rbx, qword [rsp + 0x70]
mov rbp, qword [rsp + 0x78]
add rsp, 0x30
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret