Function at 0x140003980
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r12
push r13
push r14
sub rsp, 0x20
mov r12, r8
mov r13, rdx
mov rdi, rcx
test rcx, rcx
je 0x140003adf
movzx eax, byte [rcx]
cmp al, byte [0x14000642c]
jne 0x1400039c3
movzx eax, byte [rcx + 1]
cmp al, byte [0x14000642d]
je 0x140003adf
test r13, r13
je 0x140003a05
test r12, r12
je 0x140003a05
xor ebx, ebx
mov qword [rdx], rbx
lea rdx, [0x140006eec]
mov qword [r8], rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov rsi, rax
test rax, rax
jne 0x140003a0c
lea ecx, [rbx + 2]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov r8, rdi
lea rdx, str.cannot_open_input_file__s_n
mov rcx, rax
call fcn.1400034a0
xor eax, eax
jmp 0x140003c2b
xor edx, edx
mov rcx, rsi
lea r8d, [rdx + 2]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
xor r8d, r8d
xor edx, edx
mov rcx, rsi
movsxd rbp, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
lea rcx, [rbp + 1]
call sub.libwebp.dll_WebPMalloc
mov r14, rax
test rax, rax
jne 0x140003a72
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
lea ecx, [r14 + 2]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov r8, rdi
lea rdx, str.memory_allocation_failure_when_reading_file__s_n
mov rcx, rax
call fcn.1400034a0
xor eax, eax
jmp 0x140003c2b
mov r9, rsi
mov r8d, 1
mov rdx, rbp
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov rcx, rsi
mov rbx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
cmp rbx, 1
je 0x140003ac8
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov r9, rdi
lea rdx, str.Could_not_read__d_bytes_of_data_from_file__s_n
mov rcx, rax
mov r8d, ebp
call fcn.1400034a0
mov rcx, r14
call sub.libwebp.dll_WebPFree
xor eax, eax
jmp 0x140003c2b
mov byte [r14 + rbp], 0
mov eax, 1
mov qword [r13], r14
mov qword [r12], rbp
jmp 0x140003c2b
xor ebx, ebx
mov qword [rsp + 0x50], r15
mov edi, ebx
mov ebp, ebx
mov r14d, ebx
test r13, r13
je 0x140003c24
test r12, r12
je 0x140003c24
mov qword [rdx], rbx
xor ecx, ecx
mov qword [r8], rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
mov rsi, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__fileno]
mov ecx, eax
mov edx, 0x8000
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__setmode]
cmp eax, 0xffffffff
jne 0x140003b48
lea ecx, [rbx + 2]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.Failed_to_reopen_file_in_O_BINARY_mode._n
call fcn.1400034a0
jmp 0x140003c24
test rsi, rsi
je 0x140003c24
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_feof]
test eax, eax
jne 0x140003bd4
mov eax, 0x4000
nop dword [rax + rax]
test rdi, rdi
mov rsi, rdi
mov rcx, r14
cmove rsi, rax
add rdi, rsi
lea rdx, [rdi + 1]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_realloc]
mov r15, rax
test rax, rax
je 0x140003be9
xor ecx, ecx
mov r14, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
lea rcx, [r14 + rbp]
mov r8, rsi
mov r9, rax
mov edx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add rbp, rax
cmp rbp, rdi
jb 0x140003bd4
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_feof]
test eax, eax
mov eax, 0x4000
je 0x140003b70
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ferror]
test eax, eax
je 0x140003c0e
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.Could_not_read_from_stdin_n
call fcn.1400034a0
jmp 0x140003c24
test r14, r14
je 0x140003c17
mov byte [r14 + rbp], bl
mov qword [r13], r14
mov ebx, 1
mov qword [r12], rbp
mov r15, qword [rsp + 0x50]
mov eax, ebx
mov rbx, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x60]
add rsp, 0x20
pop r14
pop r13
pop r12
pop rdi
pop rsi
ret