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

Disassembly:
push 0xffffffffffffffff
push 0x640033
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x30
push ebx
push ebp
push esi
push edi
mov esi, ecx
xor edi, edi
mov dword [esp + 0x18], esi
mov dword [esp + 0x10], edi
cmp dword [esp + 0x68], edi
mov ebp, 1
mov dword [esp + 0x48], ebp
mov bl, 2
je 0x512101
lea ecx, [esi + 0x1b0]
mov dword [esi + 4], 0x6612bc
mov dword [esi + 0x20], 0x6612b4
mov dword [esi + 0x40], 0x6612ac
call fcn.0040b080
mov byte [esp + 0x48], bl
mov dword [esp + 0x10], ebp
mov eax, dword [esp + 0x5c]
push edi
sub esp, 0xc
mov ecx, esp
mov dword [ecx], 0x6580c8
mov edx, dword [eax + 4]
lea eax, [esp + edx + 0x6c]
mov dword [esp + 0x78], esp
push eax
call fcn.00420750
mov edx, dword [esp + 0x60]
sub esp, 0xc
mov ecx, esp
mov dword [ecx], 0x6580c8
mov eax, dword [edx + 4]
lea edx, [esp + eax + 0x6c]
mov dword [esp + 0x30], esp
push edx
mov dword [esp + 0x68], 3
call fcn.00420750
mov ecx, esi
mov byte [esp + 0x64], bl
call fcn.0050c5a0
mov ecx, dword [esi + 4]
mov dword [esi], vtable.SunlightControl.3.0
mov dword [esi + 0x1c], vtable.SunlightControl.2.0
mov dword [esi + 0x3c], vtable.SunlightControl.1.0
mov edx, dword [ecx + 4]
mov dword [edx + esi + 4], vtable.SunlightControl.0
mov eax, 4
mov dword [esi + 0x134], eax
mov dword [esi + 0x138], 0x40200000
mov dword [esi + 0x13c], 0x3f800000
mov dword [esi + 0x140], 0x3f400000
mov dword [esp + 0x48], eax
lea eax, [esi + 0x164]
xor ecx, ecx
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov dword [eax], eax
mov dword [eax + 4], eax
mov dword [esi + 0x16c], edi
mov dword [esi + 0x170], edi
lea ebp, [esi + 0x174]
mov dword [ebp], 0x6580c8
mov dword [ebp + 4], edi
mov eax, dword [ebp]
mov ecx, dword [eax + 4]
mov dword [ecx + ebp + 4], edi
lea ebx, [esi + 0x180]
mov dword [ebx], 0x6580c8
mov dword [ebx + 4], edi
mov edx, dword [ebx]
mov eax, dword [edx + 4]
mov dword [eax + ebx + 4], edi
lea edi, [esi + 0x198]
xor eax, eax
mov dword [edi], eax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
mov dword [esi + 0x1a4], 0x6580c8
mov dword [esi + 0x1a8], eax
mov ecx, dword [esi + 0x1a4]
mov edx, dword [ecx + 4]
mov dword [edx + esi + 0x1a8], eax
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea eax, [esp + 0x80]
push eax
push str.rays
mov byte [esp + 0x68], 0x11
call fcn.00403db0
mov edx, dword [esp + 0x74]
lea ecx, [esp + 0x34]
push ecx
mov ecx, dword [edx + 4]
lea ecx, [esp + ecx + 0x78]
mov byte [esp + 0x64], 0x11
call fcn.004304e0
mov ecx, eax
call fcn.00428b50
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea eax, [esp + 0x80]
push eax
push str.minAngle
mov byte [esp + 0x68], 0x13
call fcn.00403db0
mov ecx, dword [esp + 0x34]
mov ecx, dword [ecx + 4]
lea ecx, [esp + ecx + 0x34]
mov byte [esp + 0x60], 0x13
call fcn.004304e0
mov ecx, eax
call fcn.0045c590
fstp dword [esi + 0x144]
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push str.maxAngle
call fcn.00403db0
mov eax, dword [esp + 0x34]
mov ecx, dword [eax + 4]
lea ecx, [esp + ecx + 0x34]
mov byte [esp + 0x60], 0x13
call fcn.004304e0
mov ecx, eax
call fcn.0045c590
fstp dword [esi + 0x148]
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push str.minX
call fcn.00403db0
mov eax, dword [esp + 0x34]
mov ecx, dword [eax + 4]
lea ecx, [esp + ecx + 0x34]
mov byte [esp + 0x60], 0x13
call fcn.004304e0
mov ecx, eax
call fcn.0045c590
fstp dword [esi + 0x14c]
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push str.maxX
call fcn.00403db0
mov eax, dword [esp + 0x34]
mov ecx, dword [eax + 4]
lea ecx, [esp + ecx + 0x34]
mov byte [esp + 0x60], 0x13
call fcn.004304e0
mov ecx, eax
call fcn.0045c590
fstp dword [esi + 0x150]
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push str.minY
call fcn.00403db0
mov eax, dword [esp + 0x34]
mov ecx, dword [eax + 4]
lea ecx, [esp + ecx + 0x34]
mov byte [esp + 0x60], 0x13
call fcn.004304e0
mov ecx, eax
call fcn.0045c590
fstp dword [esi + 0x154]
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push str.usual
call fcn.00403db0
mov ecx, dword [esp + 0x34]
mov ecx, dword [ecx + 4]
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + ecx + 0x38]
mov byte [esp + 0x64], 0x13
call fcn.004304e0
mov ecx, eax
call fcn.00428b50
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push str.maxCount
mov byte [esp + 0x68], 0x1a
call fcn.00403db0
mov eax, dword [esp + 0x40]
mov ecx, dword [eax + 4]
lea ecx, [esp + ecx + 0x40]
mov byte [esp + 0x60], 0x1a
call fcn.004304e0
mov ecx, eax
call fcn.0042b350
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push str.maxY
mov dword [esi + 0x18c], eax
call fcn.00403db0
mov eax, dword [esp + 0x40]
mov ecx, dword [eax + 4]
lea ecx, [esp + ecx + 0x40]
mov byte [esp + 0x60], 0x1a
call fcn.004304e0
mov ecx, eax
call fcn.0045c590
fstp dword [esi + 0x158]
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push str.upgraded
call fcn.00403db0
mov ecx, dword [esp + 0x34]
mov ecx, dword [ecx + 4]
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + ecx + 0x38]
mov byte [esp + 0x64], 0x1a
call fcn.004304e0
mov ecx, eax
call fcn.00428b50
mov byte [esp + 0x48], 0x1e
push eax
lea ecx, [esp + 0x2c]
call fcn.00422700
lea ecx, [esp + 0x34]
mov byte [esp + 0x48], 0x1a
call fcn.0042ce80
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push str.maxCount
call fcn.00403db0
mov eax, dword [esp + 0x40]
mov ecx, dword [eax + 4]
lea ecx, [esp + ecx + 0x40]
mov byte [esp + 0x60], 0x1a
call fcn.004304e0
mov ecx, eax
call fcn.0042b350
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push str.maxY
mov dword [esi + 0x194], eax
mov dword [esi + 0x190], 0
call fcn.00403db0
mov eax, dword [esp + 0x40]
mov ecx, dword [eax + 4]
lea ecx, [esp + ecx + 0x40]
mov byte [esp + 0x60], 0x1a
call fcn.004304e0
mov ecx, eax
call fcn.0045c590
fstp dword [esi + 0x160]
mov ecx, dword [esi + 0x158]
sub esp, 0x18
mov dword [esi + 0x15c], ecx
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push 0x661244
call fcn.00403db0
lea eax, [esp + 0x4c]
push eax
mov ecx, 0x6bfa98
call fcn.004a1c40
push eax
mov ecx, ebp
mov byte [esp + 0x4c], 0x21
call fcn.0049ab80
lea ecx, [esp + 0x34]
mov byte [esp + 0x48], 0x1a
call fcn.0049ac10
sub esp, 0x18
mov ecx, esp
mov dword [esp + 0x80], esp
lea edx, [esp + 0x80]
push edx
push 0x66123c
call fcn.00403db0
lea eax, [esp + 0x4c]
push eax
mov ecx, 0x6bfa98
call fcn.004a1c40
push eax
mov ecx, ebx
mov byte [esp + 0x4c], 0x22
call fcn.0049ab80
lea ecx, [esp + 0x34]
mov byte [esp + 0x48], 0x1a
call fcn.0049ac10
mov eax, dword [edi + 4]
mov ecx, dword [edi]
cmp ecx, eax
je 0x512616
mov ebx, eax
sub ebx, eax
je 0x512611
push ebx
push eax
push ecx
call fcn.00611870
add esp, 0xc
add eax, ebx
jmp 0x512613
mov eax, ecx
mov dword [edi + 4], eax
mov eax, dword [esi + 0x134]
xor ebx, ebx
test eax, eax
mov dword [esp + 0x68], ebx
jle 0x51268f
fild dword [esp + 0x68]
mov eax, dword [edi + 4]
cmp eax, dword [edi + 8]
fmul dword [0x661238]
fidiv dword [esi + 0x134]
fsin
fld dword [esi + 0x150]
fsub dword [esi + 0x14c]
fmul st(1)
fadd dword [esi + 0x14c]
fstp dword [esp + 0x68]
fstp st(0)
je 0x51266a
test eax, eax
je 0x512664
mov ecx, dword [esp + 0x68]
mov dword [eax], ecx
add dword [edi + 4], 4
jmp 0x512680
push 1
push 1
lea edx, [esp + 0x70]
push edx
lea ecx, [esp + 0x74]
push ecx
push eax
mov ecx, edi
call fcn.0041cb60
mov eax, dword [esi + 0x134]
inc ebx
cmp ebx, eax
mov dword [esp + 0x68], ebx
jl 0x512626
fld dword [esi + 0x148]
fadd dword [0x661234]
fmul dword [0x663214]
fmul dword [0x65ab44]
fptan
fstp st(0)
fld dword [0x661234]
fsub dword [esi + 0x144]
fst dword [esp + 0x68]
fmul dword [0x663214]
fmul dword [0x65ab44]
fptan
fstp st(0)
fld dword [esi + 0x14c]
fadd dword [esi + 0x150]
fxch st(1)
fadd st(2)
fdivp st(1)
fchs
call fcn.00611c14
fstp st(0)
fld dword [esp + 0x68]
mov dword [esi + 0x16c], eax
fmul dword [0x663214]
mov dword [esp + 0x14], eax
fmul dword [0x65ab44]
fptan
fstp st(0)
fild dword [esp + 0x14]
fsub dword [esi + 0x14c]
fmul st(1)
fsubr dword [0x65c598]
call fcn.00611c14
fstp st(0)
lea ecx, [esi + 0x3c]
mov dword [esi + 0x170], eax
call fcn.004e3ce0
lea ecx, [esp + 0x28]
mov byte [esp + 0x48], 0x13
call fcn.0042ce80
lea ecx, [esp + 0x1c]
mov byte [esp + 0x48], 0x11
call fcn.0042ce80
lea ecx, [esp + 0x50]
mov byte [esp + 0x48], 0
call fcn.0042ce80
lea ecx, [esp + 0x5c]
mov dword [esp + 0x48], 0xffffffff
call fcn.0042ce80
mov ecx, dword [esp + 0x40]
pop edi
mov eax, esi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x3c
ret 0x1c