Function at 0x14001fec0
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x978
mov r15, r8
cmp qword [rdx + 8], 0
je 0x14002027d
mov rsi, rdx
mov r13, rcx
mov dword [rsp + 0x44], 0
lea rdx, [rsp + 0x44]
call sub.KERNEL32.dll_GetConsoleMode
mov r14, qword [rsi + 8]
cmp r14, 0x40000000
mov ebx, 0x40000000
cmovl rbx, r14
test eax, eax
je 0x140020281
test r14, r14
js 0x1400203e2
mov qword [rsp + 0x48], r15
test rbx, rbx
js 0x140020406
je 0x1400202c7
mov rsi, qword [rsi]
xor edi, edi
lea r15, [rsp + 0x6c]
mov r8d, 0x304
mov rcx, r15
xor edx, edx
call fcn.140073060
lea rcx, [rsp + 0x370]
mov r8d, 0x608
xor edx, edx
call fcn.140073060
xor eax, eax
test r14, r14
setne al
mov ecx, ebx
shr ecx, 2
cmp rcx, rax
cmovg rax, rcx
cmp rax, 0x182
mov r8d, 0x182
cmovb r8, rax
lea rbp, [rsp + 0x38]
mov qword [rsp + 0x50], r13
mov qword [rsp + 0x58], rsi
mov qword [rsp + 0x60], r8
test r8d, r8d
je 0x1400202c7
mov dword [rsp + 0x3c], 0
mov qword [rsp + 0x20], 0
mov rcx, r13
mov rdx, r15
lea r9, [rsp + 0x3c]
call sub.KERNEL32.dll_ReadConsoleW
test eax, eax
je 0x14001ffd0
xor r12d, r12d
jmp 0x14001ffd8
call sub.KERNEL32.dll_GetLastError
mov r12d, eax
mov r13d, dword [rsp + 0x3c]
cmp r13, 0x183
jae 0x140020392
test r13, r13
je 0x140020210
xor r15d, r15d
xor esi, esi
nop dword [rax + rax]
cmp r15, 0x607
jg 0x14002019e
cmp rsi, r13
jae 0x140020306
movzx eax, word [rsp + rsi*2 + 0x6c]
lea ecx, [rax + 0x2000]
movzx ecx, cx
cmp ecx, 0xf800
jae 0x140020050
cmp ax, 0x7f
ja 0x1400200f0
mov r10d, 1
xor edx, edx
xor ecx, ecx
jmp 0x14002014c
mov ecx, 0xfffd
cmp eax, 0xdbff
ja 0x14002012e
lea r9, [rsi + 1]
cmp r9, r13
jge 0x14002012e
movzx edx, word [rsp + rsi*2 + 0x6e]
mov r8d, edx
and r8d, 0xfc00
cmp r8d, 0xdc00
jne 0x14002012e
shl eax, 0xa
add eax, 0xfca00000
add edx, 0xffff2400
or edx, eax
add edx, 0x10000
mov eax, edx
and eax, 0xfffff800
mov r8d, 0xfffd
cmp eax, 0xd800
je 0x1400200b6
mov r8d, edx
mov eax, r8d
shr eax, 0x12
or al, 0xf0
mov edx, r8d
shr edx, 0xc
and dl, 0x3f
or dl, 0x80
mov ecx, r8d
shr ecx, 6
and cl, 0x3f
or cl, 0x80
and r8b, 0x3f
or r8b, 0x80
mov r10d, 4
mov rsi, r9
jmp 0x14002014f
cmp eax, 0x800
jae 0x140020116
mov r8d, eax
shr r8d, 6
or r8b, 0xc0
and al, 0x3f
mov edx, eax
or dl, 0x80
mov r10d, 2
xor ecx, ecx
mov eax, r8d
jmp 0x14002014c
mov ecx, eax
and ecx, 0xf800
cmp ecx, 0xd800
mov ecx, 0xfffd
cmove eax, ecx
mov ecx, eax
mov eax, ecx
shr eax, 0xc
or al, 0xe0
mov edx, ecx
shr edx, 6
and dl, 0x3f
or dl, 0x80
and cl, 0x3f
or cl, 0x80
mov r10d, 3
xor r8d, r8d
mov byte [rsp + 0x38], al
mov byte [rsp + 0x39], dl
mov byte [rsp + 0x3a], cl
mov byte [rsp + 0x3b], r8b
test r15, r15
js 0x140020325
mov r14d, 0x608
sub r14, r15
cmp r14, r10
cmovge r14, r10
lea rcx, [rsp + r15]
add rcx, 0x370
mov rdx, rbp
mov r8, r14
call fcn.1400729c0
add r15, r14
inc rsi
cmp rsi, r13
jl 0x140020000
cmp r15, 0x608
ja 0x1400203ba
lea rcx, [rdi - 2]
mov rsi, qword [rsp + 0x58]
lea rdx, [rsi + rdi]
xor eax, eax
mov r13, qword [rsp + 0x50]
nop
lea r8, [rdi + rax]
add rcx, 2
cmp rcx, rbx
jge 0x140020219
cmp r15, rax
je 0x140020351
movzx r9d, byte [rsp + rax + 0x370]
cmp r9b, 0x1a
je 0x1400202d0
cmp r8, rbx
jae 0x140020370
mov byte [rdx + rax], r9b
inc rax
cmp r15, rax
jne 0x1400201c0
add rdi, rax
jmp 0x14002021c
xor eax, eax
mov r13, qword [rsp + 0x50]
jmp 0x140020225
mov rdi, r8
mov eax, dword [rsp + 0x3c]
lea r15, [rsp + 0x6c]
mov r8, qword [rsp + 0x60]
cmp eax, r8d
jb 0x1400202d3
jne 0x14002026d
cmp rdi, 2
jl 0x14002026d
lea r9, [rdi - 2]
cmp rdi, rbx
jg 0x14002042a
cmp r9, rbx
jg 0x14002042a
add r9, rsi
lea rax, [0x14008b91a]
cmp r9, rax
je 0x1400202d3
cmp byte [r9], 0xd
jne 0x14002026d
cmp byte [r9 + 1], 0xa
je 0x1400202d3
cmp rdi, rbx
jge 0x1400202d3
test r12, r12
je 0x14001ff99
jmp 0x1400202d3
xor edi, edi
jmp 0x1400202dd
mov dword [rsp + 0x40], 0
test r14, r14
je 0x14002044b
mov rdx, qword [rsi]
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x40]
mov rcx, r13
mov r8d, ebx
call sub.KERNEL32.dll_ReadFile
test eax, eax
je 0x1400202fa
mov edi, dword [rsp + 0x40]
xor eax, eax
test rdi, rdi
mov r12d, 0x26
cmovne r12, rax
jmp 0x1400202e0
xor edi, edi
mov r15, qword [rsp + 0x48]
jmp 0x1400202dd
add rdi, rax
test r12, r12
mov r15, qword [rsp + 0x48]
jne 0x1400202e0
xor r12d, r12d
mov qword [r15], rdi
mov rax, r12
add rsp, 0x978
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
call sub.KERNEL32.dll_GetLastError
mov r12d, eax
xor edi, edi
jmp 0x1400202e0
mov qword [rsp + 0x20], r13
lea rcx, str.c:_odin_core_unicode_utf16_utf16.odin
mov edx, 0x75
mov r8d, 0x11
mov r9, rsi
call fcn.1400525f0
mov qword [rsp + 0x28], 0x608
mov qword [rsp + 0x20], 0x608
lea rcx, str.c:_odin_core_unicode_utf16_utf16.odin
mov edx, 0x7f
mov r8d, 0xe
mov r9, r15
call fcn.140004310
mov qword [rsp + 0x20], r15
lea rcx, str.c:_odin_core_os_file_windows.odin
mov edx, 0x81
mov r8d, 0xd
mov r9, r15
call fcn.1400525f0
add rdi, rax
mov qword [rsp + 0x20], rbx
lea rcx, str.c:_odin_core_os_file_windows.odin
mov edx, 0x86
mov r8d, 6
mov r9, rdi
call fcn.1400525f0
mov qword [rsp + 0x20], r13
mov qword [rsp + 0x28], 0x182
lea rcx, str.c:_odin_core_os_file_windows.odin
mov edx, 0x7c
mov r8d, 0x32
xor r9d, r9d
call fcn.140004310
mov qword [rsp + 0x20], r15
mov qword [rsp + 0x28], 0x608
lea rcx, str.c:_odin_core_os_file_windows.odin
mov edx, 0x7d
mov r8d, 0xe
xor r9d, r9d
call fcn.140004310
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], r14
lea rcx, str.c:_odin_core_os_file_windows.odin
mov edx, 0xa7
mov r8d, 0x2e
xor r9d, r9d
call fcn.140004310
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], rbx
lea rcx, str.c:_odin_core_os_file_windows.odin
mov edx, 0xa7
mov r8d, 0x3b
xor r9d, r9d
call fcn.140004310
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], rdi
lea rcx, str.c:_odin_core_os_file_windows.odin
mov edx, 0x8f
mov r8d, 0x3a
call fcn.140004310
mov qword [rsp + 0x20], 0
lea rcx, str.c:_odin_core_os_file_windows.odin
mov edx, 0xae
mov r8d, 0x28
xor r9d, r9d
call fcn.1400525f0
int3