Function at 0x100497100
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x478
movabs rax, 0x7fffffffffffffff
mov r10d, dword [rcx + 0x10]
mov qword [rsp + 0x40], rax
mov r12, rcx
mov r15, rdx
mov ebx, r8d
mov dword [rsp + 0x54], 0
test r10d, r10d
jne 0x100497168
test ebx, ebx
jne 0x1004971ce
mov rcx, r15
call sym.vim.exe_rettv_list_alloc
test eax, eax
jne 0x1004971e3
add rsp, 0x478
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea r13, [rcx + 0x10]
mov rcx, r13
call sym.vim.exe_tv_get_string
movzx edx, byte [rax]
sub edx, 0x62
jne 0x100497180
movzx edx, byte [rax + 1]
xor eax, eax
test edx, edx
mov rcx, r13
sete al
mov dword [rsp + 0x54], eax
call sym.vim.exe_tv_get_string
cmp byte [rax], 0x42
jne 0x100497641
cmp byte [rax + 1], 0
jne 0x100497641
movabs rax, 0x7fffffffffffffff
mov r9d, dword [r12 + 0x20]
mov qword [rsp + 0x40], rax
test r9d, r9d
je 0x1004971ce
lea rcx, [r12 + 0x20]
call sym.vim.exe_tv_get_number
mov qword [rsp + 0x40], rax
mov rcx, r15
mov ebx, 1
call sym.vim.exe_rettv_blob_alloc
test eax, eax
je 0x100497154
mov rcx, r12
call sym.vim.exe_tv_get_string
mov rcx, rax
mov r12, rax
call sym.vim.exe_mch_isdir
test eax, eax
jne 0x10067674d
cmp byte [r12], 0
je 0x10067677e
lea rdx, [0x1006c0c2b]
mov rcx, r12
call sub.msys_2.0.dll_fopen
mov qword [rsp + 0x60], rax
test rax, rax
je 0x100676777
test ebx, ebx
jne 0x1004976be
mov rax, qword [rsp + 0x40]
xor r13d, r13d
mov rdi, rax
shr rdi, 0x3f
mov qword [rsp + 0x68], rdi
test rax, rax
je 0x100497405
lea rax, [rsp + 0x70]
xor r14d, r14d
xor edi, edi
xor r10d, r10d
mov qword [rsp + 0x30], rax
mov rax, qword [rsp + 0x40]
xor r13d, r13d
mov r12, r14
not rax
shr rax, 0x3f
mov qword [rsp + 0x58], rax
nop dword [rax]
mov rsi, qword [rsp + 0x30]
mov r9, qword [rsp + 0x60]
mov r8d, 0x400
mov edx, 1
mov qword [rsp + 0x28], r10
mov rcx, rsi
call sub.msys_2.0.dll_fread
mov r14, qword [rsp + 0x28]
mov r9, rsi
mov ebp, eax
cdqe
mov qword [rsp + 0x38], rax
nop dword [rax + rax]
mov rax, qword [rsp + 0x30]
add rax, qword [rsp + 0x38]
cmp rsi, rax
jb 0x1004973a3
test ebp, ebp
jg 0x10049757f
test r14, r14
jg 0x1004972dc
mov eax, dword [rsp + 0x54]
test eax, eax
je 0x100497678
mov rbx, rsi
sub rbx, r9
test r14, r14
je 0x1004973d0
mov qword [rsp + 0x28], r14
lea r12, [rbx + r14]
lea rdx, [r12 + 1]
mov rcx, r13
mov qword [rsp + 0x48], r9
call sub.msys_2.0.dll_realloc
test rax, rax
je 0x1004976f9
mov rdx, qword [rsp + 0x48]
lea rcx, [rax + r14]
mov r8, rbx
xor r13d, r13d
mov qword [rsp + 0x28], rax
call sub.msys_2.0.dll_memcpy
mov r10, qword [rsp + 0x28]
mov byte [r10 + r12], 0
xor r12d, r12d
mov qword [rsp + 0x28], r10
call sym.vim.exe_listitem_alloc
mov r10, qword [rsp + 0x28]
test rax, rax
mov rdx, rax
je 0x100497626
mov byte [rax + 0x14], 0
add rdi, 1
mov qword [rax + 0x18], r10
mov rcx, qword [r15 + 8]
mov dword [rax + 0x10], 7
call sym.vim.exe_list_append
lea r9, [rsi + 1]
cmp rdi, qword [rsp + 0x40]
jl 0x100497382
cmp byte [rsp + 0x58], 0
jne 0x100497678
test ebp, ebp
jle 0x100497678
mov rax, qword [rsp + 0x30]
mov rsi, r9
add rax, qword [rsp + 0x38]
xor r14d, r14d
cmp rsi, rax
jae 0x1004972c3
test ebp, ebp
jle 0x1004972dc
movzx eax, byte [rsi]
cmp al, 0xa
je 0x100497420
test al, al
jne 0x100497480
mov byte [rsi], 0xa
add rsi, 1
jmp 0x1004972b0
mov rdx, rbx
mov rcx, r9
call sym.vim.exe_vim_strnsave
mov r10, rax
test rax, rax
jne 0x100497335
xor r8d, r8d
lea rcx, [r8 + rbx + 1]
call sym.vim.exe_do_outofmem_msg
mov rcx, qword [r15 + 8]
call sym.vim.exe_list_free
mov rcx, r15
call sym.vim.exe_rettv_list_alloc
mov rcx, r13
call sym.vim.exe_vim_free
mov rcx, qword [rsp + 0x60]
call fcn.100672bf0
jmp 0x100497154
mov rbx, rsi
sub rbx, r9
cmp dword [rsp + 0x54], 1
jne 0x10049744b
jmp 0x1004972e2
cmp byte [r9 + rbx - 1], 0xd
lea rax, [rbx - 1]
jne 0x1004972e2
mov rbx, rax
test rbx, rbx
jne 0x100497438
test r14, r14
jg 0x10049746a
jmp 0x1004972e2
sub r14, 1
je 0x1004973d0
cmp byte [r13 + r14 - 1], 0xd
je 0x100497460
mov qword [rsp + 0x28], r14
mov r12, r14
jmp 0x1004972f4
cmp al, 0xbf
je 0x100497490
add rsi, 1
jmp 0x1004972b0
mov rax, qword [sym.vim.exe_enc_utf8]
mov ecx, dword [rax]
test ecx, ecx
je 0x100497484
mov edx, dword [rsp + 0x54]
test edx, edx
jne 0x100497484
lea rax, [rsp + 0x71]
cmp rsi, rax
jb 0x1004974d7
lea rcx, [rsp + 0x72]
movzx edx, byte [rsi - 1]
cmp rsi, rcx
jae 0x100497633
cmp rsi, rax
jne 0x1004974f2
test r14, r14
jle 0x1004976f1
movzx eax, byte [r13 + r14 - 1]
jmp 0x1004974fe
xor edx, edx
test r14, r14
jle 0x1004974e4
movzx edx, byte [r13 + r14 - 1]
lea rax, [rsp + 0x72]
cmp rsi, rax
jae 0x100497633
cmp r14, 1
jle 0x100497484
movzx eax, byte [r13 + r14 - 2]
cmp al, 0xef
jne 0x100497484
cmp dl, 0xbb
jne 0x100497484
lea rcx, [rsi - 2]
cmp r9, rcx
je 0x1004976b2
mov rdx, qword [rsp + 0x30]
mov ebx, 3
cmp rcx, rdx
jae 0x100497537
mov rax, rdx
sub rax, rcx
mov rcx, rdx
sub ebx, eax
cdqe
sub r14, rax
mov rax, rsi
mov r11, qword [rsp + 0x38]
sub rax, qword [rsp + 0x30]
lea rdx, [rax + 1]
cmp r11, rdx
jle 0x10049756d
sub r11, rax
lea rdx, [rsi + 1]
mov qword [rsp + 0x28], r9
mov r8, r11
sub r8, 1
call sub.msys_2.0.dll_memmove
mov r9, qword [rsp + 0x28]
mov rcx, rax
sub ebp, ebx
mov rsi, rcx
movsxd rax, ebp
mov qword [rsp + 0x38], rax
jmp 0x1004972b0
mov r10, r14
cmp rdi, qword [rsp + 0x40]
jl 0x100497594
cmp byte [rsp + 0x58], 0
jne 0x100497678
cmp rsi, r9
jbe 0x10049760b
sub rsi, r9
lea rbx, [rsi + r10]
cmp rbx, r12
jl 0x1004975f8
test r12, r12
je 0x10049763c
lea rdx, [r12 + r12*2]
mov rax, rdx
shr rax, 0x3f
add rax, rdx
lea rdx, [rsi + rbx]
sar rax, 1
cmp rdx, rax
cmovge rax, rdx
mov r12, rax
mov rdx, r12
mov rcx, r13
mov qword [rsp + 0x38], r10
mov qword [rsp + 0x28], r9
call sub.msys_2.0.dll_realloc
mov r9, qword [rsp + 0x28]
mov r10, qword [rsp + 0x38]
test rax, rax
je 0x100497703
mov r13, rax
lea rcx, [r13 + r10]
mov r8, rsi
mov rdx, r9
call sub.msys_2.0.dll_memcpy
mov r10, rbx
cmp rdi, qword [rsp + 0x40]
jl 0x100497278
cmp byte [rsp + 0x68], 0
jne 0x100497278
jmp 0x100497405
mov rcx, r10
call sym.vim.exe_vim_free
jmp 0x1004973f4
movzx eax, byte [rsi - 2]
jmp 0x1004974fe
mov r12, rsi
jmp 0x1004975cd
movabs rax, 0x7fffffffffffffff
mov r8d, dword [r12 + 0x20]
mov qword [rsp + 0x40], rax
test r8d, r8d
je 0x10049713c
lea rcx, [r12 + 0x20]
call sym.vim.exe_tv_get_number
mov qword [rsp + 0x40], rax
jmp 0x10049713c
mov rax, qword [rsp + 0x40]
test rax, rax
jns 0x100497405
neg rax
mov rbx, rax
cmp rax, rdi
jge 0x100497405
nop dword [rax]
mov rcx, qword [r15 + 8]
sub rdi, 1
mov rdx, qword [rcx]
call sym.vim.exe_listitem_remove
cmp rbx, rdi
jne 0x100497698
jmp 0x100497405
lea r9, [rsi + 1]
mov rsi, r9
jmp 0x1004972b0
mov rdx, qword [r15 + 8]
mov rcx, qword [rsp + 0x60]
call sym.vim.exe_read_blob
test eax, eax
je 0x100676720
mov rcx, qword [rsp + 0x60]
add rsp, 0x478
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp fcn.100672bf0
mov rsi, rcx
jmp 0x1004972b0
mov r8, qword [rsp + 0x28]
jmp 0x1004973ea
mov rcx, r12
call sym.vim.exe_do_outofmem_msg
jmp 0x1004973f4
push r13
push r12
sub rsp, 0x28
mov r12, rcx
mov r13, rdx
call sym.vim.exe_in_vim9script
test eax, eax
je 0x100498c45
xor edx, edx
mov rcx, r12
call sym.vim.exe_check_for_string_arg
test eax, eax
je 0x100498c60
mov r8d, 1
mov rdx, r13
mov rcx, r12
add rsp, 0x28
pop r12
pop r13
jmp 0x100497100
add rsp, 0x28
pop r12
pop r13
ret
mov rcx, qword [sym.vim.exe_e_cant_read_file_str]
call sub.msys_intl_8.dll_libintl_gettext
mov rdx, r12
mov rcx, rax
call sym.vim.exe_semsg
mov rcx, qword [r15 + 8]
call sym.vim.exe_blob_free
mov qword [r15 + 8], 0
jmp 0x1004976d4
mov rcx, qword [sym.vim.exe_e_str_is_directory]
call sub.msys_intl_8.dll_libintl_gettext
mov rdx, r12
mov rcx, rax
add rsp, 0x478
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sym.vim.exe_semsg
cmp byte [r12], 0
jne 0x10067678d
lea rcx, [0x1006c0c23]
call sub.msys_intl_8.dll_libintl_gettext
mov r12, rax
mov rcx, qword [sym.vim.exe_e_cant_open_file_str]
call sub.msys_intl_8.dll_libintl_gettext
mov rdx, r12
mov rcx, rax
add rsp, 0x478
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sym.vim.exe_semsg