Function at 0x4f0010
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
mov rax, qword [rcx + 0x18]
sub rax, qword [rcx + 0x10]
mov r15, rcx
mov rcx, rdx
mov r12, rdx
mov dword [rsp + 0xa0], r8d
sar rax, 3
mov ebx, eax
sub ebx, r8d
call sub.msvcrt.dll_clearerr
test ebx, ebx
jne 0x4f00a0
mov r8d, 1
mov rdx, r12
mov rcx, r15
call fcn.004efbd0
mov r14d, eax
mov eax, dword [rsp + 0xa0]
lea edi, [rax + 1]
mov rcx, r12
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x4f02cf
test r14d, r14d
je 0x4f0320
mov eax, edi
sub eax, dword [rsp + 0xa0]
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
lea edx, [rbx + 0x14]
mov rcx, r15
mov r14d, 1
lea r8, str.too_many_arguments
call sym.a.out.exe_luaL_checkstack
mov edi, dword [rsp + 0xa0]
lea rsi, [rsp + 0x38]
lea eax, [rbx - 1]
mov qword [rsp + 0x28], rsi
nop dword [rax]
movsxd rbx, edi
mov r13d, eax
shl rbx, 3
nop word [rax + rax]
mov rdx, rbx
add rdx, qword [r15 + 0x10]
mov eax, dword [rdx + 4]
cmp eax, 0xfffffffb
je 0x4f01e0
cmp eax, 0xfffeffff
ja 0x4f036f
add edi, 1
mov rcx, r15
mov edx, edi
call sym.a.out.exe_lj_lib_checkint
test eax, eax
mov ebx, eax
je 0x4f01a0
mov edx, dword [r15 + 8]
mov r8d, eax
mov rcx, r15
add rdx, 0x58
call sym.a.out.exe_lj_str_needbuf
mov r8d, ebx
mov r9, r12
mov edx, 1
mov rcx, rax
mov rsi, rax
call sub.msvcrt.dll_fread
mov rdx, rsi
mov rcx, r15
mov r8d, eax
mov rbx, rax
call sym.a.out.exe_lj_str_new
mov rdx, qword [r15 + 0x18]
lea rcx, [rdx + 8]
mov qword [r15 + 0x18], rcx
mov dword [rdx], eax
mov dword [rdx + 4], 0xfffffffb
mov eax, dword [r15 + 8]
mov esi, dword [rax + 0x24]
cmp dword [rax + 0x20], esi
jae 0x4f0330
xor r14d, r14d
test ebx, ebx
setne r14b
lea eax, [r13 - 1]
test r13d, r13d
je 0x4f0069
test r14d, r14d
jne 0x4f00d0
jmp 0x4f0314
mov rcx, r12
xor r14d, r14d
call sub.msvcrt.dll_getc
mov rdx, r12
mov ecx, eax
mov ebx, eax
call sub.msvcrt.dll_ungetc
mov rax, qword [r15 + 0x18]
mov edx, dword [r15 + 8]
lea rcx, [rax + 8]
sub rdx, 0xffffffffffffff80
cmp ebx, 0xffffffff
mov qword [r15 + 0x18], rcx
setne r14b
mov dword [rax], edx
mov dword [rax + 4], 0xfffffffb
jmp 0x4f017d
mov eax, dword [rdx]
cmp byte [rax + 0x10], 0x2a
jne 0x4f036f
movzx eax, byte [rax + 0x11]
cmp al, 0x6e
je 0x4f02e1
mov edx, eax
and edx, 0xffffffdf
cmp dl, 0x4c
je 0x4f0340
cmp al, 0x61
jne 0x4f0380
xor ebx, ebx
mov esi, 0x200
jmp 0x4f0222
add esi, esi
mov edx, dword [r15 + 8]
mov r8d, esi
mov rcx, r15
add rdx, 0x58
call sym.a.out.exe_lj_str_needbuf
mov ecx, ebx
mov r8d, esi
mov r9, r12
sub r8d, ebx
add rcx, rax
mov edx, 1
mov rbp, rax
call sub.msvcrt.dll_fread
add ebx, eax
cmp esi, ebx
je 0x4f0220
mov rdx, rbp
mov rcx, r15
mov r8d, ebx
call sym.a.out.exe_lj_str_new
mov rdx, qword [r15 + 0x18]
lea rcx, [rdx + 8]
mov qword [r15 + 0x18], rcx
mov dword [rdx], eax
mov dword [rdx + 4], 0xfffffffb
mov eax, dword [r15 + 8]
mov esi, dword [rax + 0x24]
cmp dword [rax + 0x20], esi
jae 0x4f035f
add edi, 1
lea eax, [r13 - 1]
test r13d, r13d
jne 0x4f00d0
jmp 0x4f0069
movsd xmm0, qword [rsp + 0x38]
sub r13d, 1
add edi, 1
add rbx, 8
cmp r13d, 0xffffffff
movsd qword [rax], xmm0
jne 0x4f00e0
mov rcx, r12
call sub.msvcrt.dll_ferror
test eax, eax
je 0x4f0082
xor r8d, r8d
xor edx, edx
mov rcx, r15
call sym.a.out.exe_luaL_fileresult
jmp 0x4f008b
mov r8, qword [rsp + 0x28]
lea rdx, [0x005c9913]
mov rcx, r12
call sub.msvcrt.dll_fscanf
mov r14d, eax
mov rax, qword [r15 + 0x18]
cmp r14d, 1
lea rdx, [rax + 8]
mov qword [r15 + 0x18], rdx
je 0x4f02a0
mov dword [rax + 4], 0xffffffff
add edi, 1
mov rcx, r12
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x4f02cf
mov rax, qword [r15 + 0x18]
mov dword [rax - 4], 0xffffffff
jmp 0x4f0082
mov rcx, r15
call sym.a.out.exe_lj_gc_step
jmp 0x4f0174
xor r8d, r8d
cmp al, 0x6c
mov rdx, r12
sete r8b
mov rcx, r15
add edi, 1
call fcn.004efbd0
mov r14d, eax
jmp 0x4f017d
mov rcx, r15
add edi, 1
call sym.a.out.exe_lj_gc_step
jmp 0x4f028c
lea edx, [rdi + 1]
mov r8d, 0x4c8
mov rcx, r15
call sym.a.out.exe_lj_err_arg
lea edx, [rdi + 1]
mov r8d, 0x4eb
mov rcx, r15
call sym.a.out.exe_lj_err_arg
nop
nop dword [rax]
nop word cs:[rax + rax]
sub rsp, 0x28
mov eax, dword [rcx + 8]
mov eax, dword [rax + 0x190]
mov rdx, qword [rax + 0x18]
test rdx, rdx
je 0x4f03c2
xor r8d, r8d
add rsp, 0x28
jmp fcn.004f0010
mov edx, 0x62c
call sym.a.out.exe_lj_err_caller
nop
nop dword [rax]