Function at 0x4faf10
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x58a846
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x78
push ebx
push ebp
mov ebp, ecx
push esi
push edi
mov eax, dword [ebp + 0x114]
shl eax, 2
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [ebp + 0x164]
mov esi, eax
imul ecx, dword [ebp + 0x168]
imul ecx, dword [ebp + 0x16c]
add esp, 4
xor ebx, ebx
xor eax, eax
mov dword [esp + 0x10], esi
test ecx, ecx
jle 0x4faf90
xor ecx, ecx
mov edx, 0xffff
mov edi, dword [ebp + 0x124]
inc eax
mov word [ecx + edi + 2], dx
mov edi, dword [ebp + 0x164]
imul edi, dword [ebp + 0x168]
imul edi, dword [ebp + 0x16c]
add ecx, 0xc
cmp eax, edi
jl 0x4faf69
mov ecx, dword [ebp + 0x114]
xor eax, eax
cmp ecx, ebx
mov dword [ebp + 0x11c], ebx
jle 0x4fafd5
xor ecx, ecx
mov edx, dword [ebp + 0x118]
cmp dword [ecx + edx + 0x2c], 0xffffffff
je 0x4fafc7
mov edx, dword [ebp + 0x11c]
mov dword [esi + edx*4], eax
mov edx, dword [ebp + 0x11c]
inc edx
mov dword [ebp + 0x11c], edx
mov edx, dword [ebp + 0x114]
inc eax
add ecx, 0x3c
cmp eax, edx
jl 0x4fafa4
mov eax, dword [ebp + 0x11c]
shl eax, 2
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
mov edi, eax
add esp, 4
cmp edi, ebx
mov dword [ebp + 0x120], edi
jne 0x4faffb
xor al, al
jmp 0x4fb3e1
mov ecx, dword [ebp + 0x11c]
xor eax, eax
shl ecx, 2
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
cmp dword [ebp + 0x11c], ebx
jle 0x4fb3d6
mov eax, dword [esi + ebx*4]
mov ecx, dword [ebp + 0x118]
lea edi, [esp + 0x4c]
lea eax, [eax + eax*2]
lea eax, [eax + eax*4]
lea esi, [ecx + eax*4]
mov ecx, 0xf
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x78]
cmp eax, 6
je 0x4fb238
cmp eax, 0x303
je 0x4fb063
mov edx, dword [ebp + 0x120]
mov dword [edx + ebx*4], 0
jmp 0x4fb3c3
push 0x704
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
mov dword [esp + 0x90], 0
je 0x4fb08e
mov ecx, eax
call fcn.00503bc0
mov esi, eax
jmp 0x4fb090
xor esi, esi
mov eax, dword [ebp + 0x110]
push 0x303
push str.Shine.bmp
push eax
mov ecx, esi
mov dword [esp + 0x9c], 0xffffffff
call fcn.00503cc0
test al, al
jne 0x4fb0e0
mov ecx, dword [0x5e062c]
push str.A3DIBLLightGrid::PrepareFirstRender____create_a_sun_lamp_fail_
push ecx
call fcn.004c6d70
add esp, 8
test esi, esi
je 0x4fb3c3
mov edx, dword [esi]
push 1
mov ecx, esi
call dword [edx]
jmp 0x4fb3c3
fld dword [esp + 0x68]
fmul dword [esp + 0x84]
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x6c]
mov dword [esp + 0x3c], eax
mov edx, dword [esp + 0x70]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x44], edx
fstp dword [esp + 0x3c]
fld dword [esp + 0x40]
fmul dword [esp + 0x84]
mov edx, dword [esp + 0x3c]
sub esp, 0x10
mov ecx, esp
mov eax, dword [esp + 0x84]
mov dword [esp + 0x3c], 0
mov dword [esp + 0x38], 0
fstp dword [esp + 0x50]
fld dword [esp + 0x54]
fmul dword [esp + 0x94]
mov dword [ecx], edx
mov edx, dword [esp + 0x50]
mov dword [esp + 0x34], 0
mov dword [ecx + 4], edx
fstp dword [esp + 0x54]
fld dword [esp + 0x6c]
fchs
fld dword [esp + 0x70]
fchs
fstp dword [esp + 0x44]
fld dword [esp + 0x74]
fchs
fstp dword [esp + 0x48]
mov edx, dword [esp + 0x54]
fmul dword [0x58d5d0]
mov dword [ecx + 8], edx
fstp dword [esp + 0x28]
fld dword [esp + 0x44]
fmul dword [0x58d5d0]
mov dword [ecx + 0xc], eax
fstp dword [esp + 0x2c]
fld dword [esp + 0x48]
fmul dword [0x58d5d0]
fstp dword [esp + 0x30]
call fcn.004abe60
fld qword [0x5944f0]
fcos
mov edx, dword [esp + 0x28]
mov ecx, 0x43480000
mov dword [esi + 0x6ac], ecx
mov dword [esi + 0x6b0], ecx
lea ecx, [esi + 0x6b4]
add esp, 0x10
mov dword [esi + 0x6cc], eax
mov dword [esi + 0x6d0], 0x42480000
mov dword [ecx], edx
mov edx, dword [esp + 0x1c]
push str.Flare.bmp
mov dword [esi + 0x6d4], 0x42f00000
mov dword [ecx + 4], edx
mov edx, dword [esp + 0x24]
mov dword [ecx + 8], edx
mov edx, dword [esp + 0x28]
lea ecx, [esi + 0x6c0]
mov dword [esi + 0x6c0], edx
mov edx, dword [esp + 0x2c]
mov dword [ecx + 4], edx
mov edx, dword [esp + 0x30]
mov dword [ecx + 8], edx
mov ecx, esi
fstp dword [esi + 0x6d8]
fld qword [0x5944e8]
fcos
fstp dword [esi + 0x6dc]
call fcn.00503dd0
jmp 0x4fb3ba
push 0x704
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
mov dword [esp + 0x90], 1
je 0x4fb263
mov ecx, eax
call fcn.00503bc0
mov esi, eax
jmp 0x4fb265
xor esi, esi
mov ecx, dword [ebp + 0x110]
push 6
push str.Lamp.bmp
push ecx
mov ecx, esi
mov dword [esp + 0x9c], 0xffffffff
call fcn.00503cc0
test al, al
jne 0x4fb2b2
mov edx, dword [0x5e062c]
push str.A3DIBLLightGrid::AddLightSource____create_a_unreal_lamp_fail_
push edx
call fcn.004c6d70
add esp, 8
test esi, esi
je 0x4fb3c3
mov eax, dword [esi]
push 1
mov ecx, esi
call dword [eax]
jmp 0x4fb3c3
fld dword [esp + 0x68]
fmul dword [esp + 0x84]
mov ecx, dword [esp + 0x68]
mov edx, dword [esp + 0x6c]
mov dword [esp + 0x3c], ecx
mov eax, dword [esp + 0x70]
mov dword [esp + 0x40], edx
mov dword [esp + 0x44], eax
fstp dword [esp + 0x3c]
fld dword [esp + 0x40]
fmul dword [esp + 0x84]
mov edx, dword [esp + 0x3c]
sub esp, 0x10
mov ecx, esp
mov eax, dword [esp + 0x84]
fstp dword [esp + 0x50]
fld dword [esp + 0x54]
fmul dword [esp + 0x94]
mov dword [ecx], edx
mov edx, dword [esp + 0x50]
mov dword [ecx + 4], edx
fstp dword [esp + 0x54]
mov edx, dword [esp + 0x54]
mov dword [ecx + 8], edx
mov dword [ecx + 0xc], eax
call fcn.004abe60
fild dword [esp + 0x8c]
mov edx, dword [esp + 0x60]
lea ecx, [esi + 0x6b4]
add esp, 0x10
mov dword [esi + 0x6cc], eax
fst dword [esi + 0x6ac]
fstp dword [esi + 0x6b0]
fld dword [esp + 0x80]
fstp dword [esi + 0x6f4]
fld qword [0x5944f0]
fcos
mov dword [ecx], edx
mov edx, dword [esp + 0x54]
mov dword [esi + 0x6f0], 0
mov dword [esi + 0x6d0], 0x42480000
mov dword [ecx + 4], edx
mov edx, dword [esp + 0x58]
mov dword [esi + 0x6d4], 0x42f00000
mov dword [ecx + 8], edx
mov edx, dword [esp + 0x5c]
lea ecx, [esi + 0x6c0]
mov dword [esi + 0x6c0], edx
mov edx, dword [esp + 0x60]
mov dword [ecx + 4], edx
mov edx, dword [esp + 0x64]
mov dword [ecx + 8], edx
fstp dword [esi + 0x6d8]
fld qword [0x5944e8]
fcos
fstp dword [esi + 0x6dc]
mov eax, dword [ebp + 0x120]
mov dword [eax + ebx*4], esi
mov eax, dword [ebp + 0x11c]
mov esi, dword [esp + 0x10]
inc ebx
cmp ebx, eax
jl 0x4fb020
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x88]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x84
ret