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

Disassembly:
sub esp, 0x8c
push esi
mov esi, ecx
push edi
xor edi, edi
mov eax, dword [esi + 0x118]
mov dword [esp + 0x30], esi
cmp eax, edi
je 0x504c1a
push eax
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov dword [esi + 0x118], edi
mov eax, dword [esi + 0x114]
lea ecx, [eax*8]
sub ecx, eax
shl ecx, 2
push ecx
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
cmp eax, edi
mov dword [esi + 0x118], eax
jne 0x504c5f
mov edx, dword [0x5e062c]
push str.A3DStars::GenerateStars____Not_enough_memory_
push edx
call fcn.004c6d70
add esp, 8
xor al, al
pop edi
pop esi
add esp, 0x8c
ret
mov eax, dword [0x5ce82c]
mov ecx, dword [esi + 0x120]
mov dword [esp + 0x2c], eax
mov dword [0x5ce82c], ecx
mov eax, dword [esi + 0x114]
mov dword [esp + 0x10], edi
cmp eax, edi
jle 0x504e9e
push ebx
push ebp
mov dword [esp + 0x90], 0xff000000
mov dword [esp + 0x94], 0
mov dword [esp + 0x98], 0
mov dword [esp + 0x14], edi
mov esi, dword [0x5ce824]
mov edx, dword [0x5ce82c]
mov ebx, dword [0x5ce828]
xor edi, edi
xor ebp, ebp
push edi
push esi
push ebp
push edx
call fcn.005758c0
push ebp
push ebx
push edx
push eax
call fcn.00575800
push edi
push esi
push ebp
push eax
call fcn.005758c0
push ebp
push ebx
push edx
push eax
call fcn.00575800
push edi
push esi
push ebp
push eax
call fcn.005758c0
push ebp
push ebx
push edx
push eax
call fcn.00575800
xor ecx, ecx
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], ecx
mov dword [esp + 0x5c], eax
fild qword [esp + 0x64]
mov dword [esp + 0x60], ecx
push edi
push esi
push ecx
fstp dword [esp + 0x1c]
fild qword [esp + 0x68]
push eax
fdiv dword [esp + 0x20]
fadd st(0), st(0)
fsub dword [0x58d5d4]
fstp dword [esp + 0x38]
call fcn.005758c0
push ebp
push ebx
push edx
push eax
call fcn.00575800
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], ebp
fild qword [esp + 0x54]
push edi
push esi
push ebp
push eax
fdiv dword [esp + 0x20]
fadd st(0), st(0)
fsub dword [0x58d5d4]
fstp dword [esp + 0x3c]
call fcn.005758c0
push ebp
push ebx
push edx
push eax
call fcn.00575800
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], ebp
fild qword [esp + 0x6c]
mov dword [0x5ce82c], eax
fdiv dword [esp + 0x10]
fadd st(0), st(0)
fsub dword [0x58d5d4]
fld st(0)
fmul st(1)
fld dword [esp + 0x2c]
fmul dword [esp + 0x2c]
faddp st(1)
fld dword [esp + 0x28]
fmul dword [esp + 0x28]
faddp st(1)
fsqrt
fcom qword [0x58dc98]
fnstsw ax
test ah, 1
je 0x504dd8
fcom qword [0x58dc90]
fnstsw ax
test ah, 0x41
jne 0x504dd8
fstp st(0)
mov eax, ebp
mov ecx, ebp
fstp st(0)
mov dword [esp + 0x50], ebp
mov dword [esp + 0x4c], ebp
mov dword [esp + 0x48], ebp
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], ecx
mov edx, ebp
jmp 0x504e0a
fld dword [esp + 0x28]
fdiv st(1)
fstp dword [esp + 0x3c]
fld dword [esp + 0x2c]
fdiv st(1)
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x1c], eax
fstp dword [esp + 0x40]
fxch st(1)
fdiv st(1)
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x20], ecx
fstp dword [esp + 0x44]
mov edx, dword [esp + 0x44]
fstp st(0)
fld dword [esp + 0x1c]
fmul dword [0x58d5d0]
fld dword [esp + 0x20]
fmul dword [0x58d5d0]
mov dword [esp + 0x24], edx
lea esi, [esp + 0x80]
fstp dword [esp + 0x78]
mov eax, dword [esp + 0x78]
fld dword [esp + 0x24]
fmul dword [0x58d5d0]
mov dword [esp + 0x84], eax
mov eax, dword [esp + 0x38]
mov edx, dword [eax + 0x11c]
mov ebx, dword [eax + 0x118]
fstp dword [esp + 0x7c]
mov ecx, dword [esp + 0x7c]
mov dword [esp + 0x8c], edx
mov edx, dword [esp + 0x14]
mov dword [esp + 0x88], ecx
fstp dword [esp + 0x80]
mov edi, edx
mov ecx, 7
add edi, ebx
add edx, 0x1c
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x14], edx
mov edx, dword [eax + 0x114]
inc ecx
cmp ecx, edx
mov dword [esp + 0x18], ecx
jl 0x504cad
pop ebp
pop ebx
mov eax, dword [esp + 0x2c]
pop edi
mov dword [0x5ce82c], eax
mov al, 1
pop esi
add esp, 0x8c
ret