Function at 0x10011680
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x34
push ebx
mov ebx, ecx
mov dword [esp + 0x24], edx
push esi
push edi
mov edi, dword [ebp + 8]
mov esi, 1
mov eax, dword [ebx + 0x14]
mov ecx, dword [ebx + 0xc]
sub ecx, dword [eax]
sub ecx, 0x10
sar ecx, 4
sub ecx, edi
je 0x100118cc
mov eax, dword [ebx + 0x14]
dec ecx
mov dword [esp + 0x34], ecx
test edi, edi
jle 0x10011712
mov ecx, edi
shl ecx, 4
add ecx, dword [eax]
cmp ecx, dword [ebx + 0xc]
jb 0x1001174c
lea eax, [esp + 0x30]
push eax
push edi
push ebx
call sym.lua53.dll_lua_tolstring
add esp, 0xc
test eax, eax
je 0x100118d8
test esi, esi
je 0x10011840
push dword [esp + 0x2c]
mov esi, dword [esp + 0x34]
push esi
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp eax, esi
jne 0x10011840
mov esi, 1
jmp 0x10011842
cmp edi, 0xfff0b9d8
jle 0x10011724
mov ecx, edi
shl ecx, 4
add ecx, dword [ebx + 0xc]
jmp 0x1001174c
jne 0x1001172e
mov ecx, dword [ebx + 0x10]
add ecx, 0x28
jmp 0x1001174c
mov eax, dword [eax]
mov ecx, 0xfff0b9d8
sub ecx, edi
cmp dword [eax + 8], 0x16
je 0x100116cc
mov edx, dword [eax]
movzx eax, byte [edx + 6]
cmp ecx, eax
jg 0x100116cc
shl ecx, 4
add ecx, edx
cmp ecx, 0x1002b870
je 0x100116cc
mov eax, dword [ecx + 8]
and eax, 0xf
cmp al, 3
jne 0x100116cc
push edi
push ebx
call sym.lua53.dll_lua_isinteger
add esp, 8
test eax, eax
je 0x1001178c
push 0
push edi
push ebx
call sym.lua53.dll_lua_tointegerx
add esp, 0xc
push edx
push eax
push str._lld
jmp 0x10011828
test edi, edi
jle 0x100117a7
mov edx, dword [ebx + 0x14]
mov eax, edi
shl eax, 4
mov ecx, 0x1002b870
add eax, dword [edx]
cmp eax, dword [ebx + 0xc]
cmovb ecx, eax
jmp 0x100117eb
cmp edi, 0xfff0b9d8
jle 0x100117b9
mov ecx, edi
shl ecx, 4
add ecx, dword [ebx + 0xc]
jmp 0x100117eb
jne 0x100117c3
mov ecx, dword [ebx + 0x10]
add ecx, 0x28
jmp 0x100117eb
mov edx, dword [ebx + 0x14]
mov ecx, 0xfff0b9d8
sub ecx, edi
mov edx, dword [edx]
cmp dword [edx + 8], 0x16
je 0x100117e6
mov edx, dword [edx]
movzx eax, byte [edx + 6]
cmp ecx, eax
jg 0x100117e6
shl ecx, 4
add ecx, edx
jmp 0x100117eb
mov ecx, 0x1002b870
cmp dword [ecx + 8], 3
jne 0x100117fd
movsd xmm0, qword [ecx]
movsd qword [esp + 0x38], xmm0
jmp 0x1001181b
lea edx, [esp + 0x38]
call fcn.10026290
test eax, eax
jne 0x10011815
xorps xmm0, xmm0
movsd qword [esp + 0x38], xmm0
jmp 0x1001181b
movsd xmm0, qword [esp + 0x38]
sub esp, 8
movsd qword [esp], xmm0
push str._.14g
push dword [esp + 0x38]
call fcn.10004080
add esp, 0x10
test esi, esi
je 0x10011840
test eax, eax
jg 0x10011708
xor esi, esi
mov ecx, dword [esp + 0x34]
inc edi
test ecx, ecx
jne 0x100116b0
test esi, esi
jne 0x100118cc
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov edi, dword [eax]
mov eax, dword [ebx + 0xc]
push edi
mov dword [eax + 8], esi
add dword [ebx + 0xc], 0x10
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
test eax, eax
jne 0x1001187b
mov eax, dword [ebx + 0xc]
mov dword [eax + 8], esi
jmp 0x10011893
mov edx, eax
mov ecx, ebx
call fcn.1001de30
mov ecx, dword [ebx + 0xc]
mov dword [ecx], eax
movzx eax, byte [eax + 4]
or eax, 0x40
mov dword [ecx + 8], eax
mov ecx, dword [ebx + 0x10]
add dword [ebx + 0xc], 0x10
mov esi, dword [ebx + 0xc]
cmp dword [ecx + 0xc], 0
jle 0x100118ad
mov ecx, ebx
call fcn.1000fd40
mov esi, dword [ebx + 0xc]
mov eax, edi
mov dword [esi + 8], 0x13
cdq
mov dword [esi], eax
mov eax, 3
mov dword [esi + 4], edx
add dword [ebx + 0xc], 0x10
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
push 4
mov edx, edi
mov ecx, ebx
call fcn.100049c0
int3