Function at 0x140002040
Capabilities:
Read file on windows
Read file via mapping

Disassembly:
mov qword [rsp + 8], rbx
push rdi
sub rsp, 0x30
mov rdi, rdx
mov rbx, rcx
test rdx, rdx
je 0x140002092
mov ecx, dword [rcx]
call fcn.140007cfc
mov rcx, rax
xor r9d, r9d
xor eax, eax
xor edx, edx
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], eax
lea r8d, [rax + 2]
call qword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov qword [rbx + 0x18], rax
test rax, rax
jne 0x1400020c4
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xc1
jne 0x1400020a1
mov rcx, rbx
mov rbx, qword [rsp + 0x40]
add rsp, 0x30
pop rdi
jmp 0x1400022d0
mov rdx, qword [rbx + 8]
lea rcx, str.Unable_create_file_mapping_for__ls:_Windows_error__u
mov r8d, eax
call fcn.140002130
mov eax, 0xffffffff
mov rbx, qword [rsp + 0x40]
add rsp, 0x30
pop rdi
ret
xor r9d, r9d
mov qword [rsp + 0x20], rdi
xor r8d, r8d
mov rcx, rax
lea edx, [r9 + 4]
call qword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov qword [rbx + 0x20], rax
test rax, rax
jne 0x140002118
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rdx, qword [rbx + 8]
lea rcx, str.Unable_to_map__ls_into_memory:_Windows_error__u
mov r8d, eax
call fcn.140002130
mov rcx, qword [rbx + 0x18]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0xffffffff
mov rbx, qword [rsp + 0x40]
add rsp, 0x30
pop rdi
ret
mov qword [rbx + 0x28], rdi
xor eax, eax
mov rbx, qword [rsp + 0x40]
add rsp, 0x30
pop rdi
ret
mov qword [rsp + 0x20], rbp
push r12
push r14
push r15
sub rsp, 0x20
mov r12, rcx
mov ebp, 0x1000
mov ecx, ebp
xor r14d, r14d
call fcn.140006ae8
mov r15, rax
test rax, rax
jne 0x140002305
lea rcx, str.Out_of_memory
call fcn.140002130
test r15, r15
jne 0x14000231e
lea eax, [r15 - 1]
mov rbp, qword [rsp + 0x58]
add rsp, 0x20
pop r15
pop r14
pop r12
ret
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x50], rdi
mov qword [rsp + 0x48], rsi
nop dword [rax]
cmp r14, rbp
jne 0x140002366
cmp rbp, 0xffffffffffffffff
je 0x1400023fe
mov rax, rbp
mov rcx, r15
not rax
cmp rax, rbp
cmova rax, rbp
add rbp, rax
mov rdx, rbp
call fcn.140006af0
test rax, rax
je 0x1400023fe
mov r15, rax
mov rbx, rbp
lea rdi, [r15 + r14]
sub rbx, r14
mov rsi, rbx
je 0x1400023db
nop word [rax + rax]
mov ecx, dword [r12]
mov r8d, 0x7fffffff
cmp rbx, r8
mov rdx, rdi
cmovbe r8d, ebx
call fcn.140009cd4
movsxd rcx, eax
test eax, eax
je 0x1400023db
jns 0x1400023d0
call fcn.140004700
cmp dword [rax], 0xb
je 0x1400023d6
call fcn.140004700
cmp dword [rax], 4
je 0x1400023d6
mov rdx, qword [r12 + 8]
lea rcx, str.Error_reading_from__ls
call fcn.140002160
mov rsi, 0xffffffffffffffff
jmp 0x1400023de
add rdi, rcx
sub rbx, rcx
test rbx, rbx
jne 0x140002380
sub rsi, rbx
test esi, esi
js 0x140002414
movsxd rax, esi
add r14, rax
test esi, esi
jne 0x140002330
mov qword [r12 + 0x20], r15
xor eax, eax
mov qword [r12 + 0x28], r14
jmp 0x14000241e
mov rdx, qword [r12 + 8]
lea rcx, str.Out_of_memory____ls_is_too_large_to_be_processed_by_this_program_as_currently_implemented.
call fcn.140002130
mov esi, 0xffffffff
mov rcx, r15
call fcn.140004720
mov eax, esi
mov rsi, qword [rsp + 0x48]
mov rbx, qword [rsp + 0x40]
mov rdi, qword [rsp + 0x50]
mov rbp, qword [rsp + 0x58]
add rsp, 0x20
pop r15
pop r14
pop r12
ret