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

Disassembly:
sub esp, 0x44
push ebx
push ebp
push esi
mov esi, dword [esp + 0x54]
push edi
mov dword [esi], 0
call fcn.004bae60
test eax, eax
mov dword [esi + 0x14], eax
je 0x512fb5
mov edi, dword [esi + 0x124]
mov dword [esp + 0x20], 0
test edi, edi
mov dword [esp + 0x18], edi
jne 0x512ad3
mov dword [esp + 0x18], 0x100
mov edi, dword [esp + 0x18]
mov ecx, dword [esi + 0x128]
mov eax, dword [0x838f6c]
push edi
push ecx
mov dword [esp + 0x24], eax
call fcn.00578400
mov edx, dword [esi + 0x128]
push edx
call fcn.005784c0
mov ecx, edi
mov ebx, eax
shl ecx, 5
mov edx, ecx
xor eax, eax
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x70]
mov edi, dword [esp + 0x74]
mov ecx, dword [esp + 0x68]
push eax
push 0xa00
push edi
call dword [ecx + 0x14]
mov ebp, dword [esp + 0x78]
mov edx, dword [0x69fdfc]
push 0x838f1c
push ebp
push str._s__s_n
push edi
call dword [edx + 0x130]
add esp, 0x28
cmp eax, 1
mov dword [esp + 0x38], eax
je 0x512b55
cmp eax, 2
jne 0x512fa2
push 0x8386ac
call fcn.004bfc20
push ebp
call fcn.004bfce0
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x512fb5
cmp dword [esp + 0x38], 1
jne 0x512b97
mov eax, dword [esp + 0x60]
mov ecx, dword [0x69fdfc]
push eax
push 0x5f8d88
push 0x838f1c
call dword [ecx + 0xf0]
add esp, 0xc
push 0x838f1c
call fcn.004bfce0
add esp, 4
mov dword [esp + 0x60], eax
test eax, eax
je 0x512bca
push eax
call fcn.004bf7a0
mov edx, dword [esp + 0x64]
push edx
push ebp
call fcn.004bf870
mov eax, dword [esp + 0x6c]
push eax
call fcn.004bf4c0
add esp, 0x10
mov ecx, dword [ebp + 4]
mov edx, dword [ebp + 8]
mov dword [esp + 0x60], ecx
lea eax, [esp + 0x30]
mov dword [esp + 0x2c], edx
lea ecx, [esp + 0x34]
push eax
lea edx, [esp + 0x18]
push ecx
lea eax, [esp + 0x18]
push edx
push eax
push 4
push ebp
call fcn.004c8420
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x78]
mov edx, dword [esp + 0x44]
add esp, 0x18
cmp ecx, eax
mov ecx, dword [esp + 0x14]
jne 0x512c13
cmp edx, ecx
je 0x512ce9
cmp eax, dword [esp + 0x60]
jl 0x512c35
cmp ecx, edx
jl 0x512c35
push ecx
push eax
push ebp
call fcn.004bf610
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
add esp, 0xc
jmp 0x512ce9
mov edi, dword [esp + 0x60]
cmp edi, edx
jg 0x512c3f
mov edi, edx
test edi, 0xffff0000
je 0x512c72
mov eax, edi
sar eax, 0x10
test ah, 0xff
je 0x512c65
mov ecx, edi
sar ecx, 0x18
movsx eax, byte [ecx + 0x5f5660]
add eax, 7
lea ecx, [eax + 0x10]
jmp 0x512c93
movsx eax, byte [eax + 0x5f5660]
dec eax
lea ecx, [eax + 0x10]
jmp 0x512c93
test edi, 0xff00
je 0x512c8b
mov edx, edi
sar edx, 8
movsx ecx, byte [edx + 0x5f5660]
add ecx, 7
jmp 0x512c93
movsx ecx, byte [edi + 0x5f5660]
dec ecx
mov eax, 1
shl eax, cl
cmp edi, eax
je 0x512ca6
inc ecx
mov edi, 1
shl edi, cl
push edi
push edi
push ebp
call fcn.004bf610
lea ecx, [esp + 0x3c]
lea edx, [esp + 0x40]
push ecx
lea eax, [esp + 0x24]
push edx
lea ecx, [esp + 0x24]
push eax
push ecx
push 4
push ebp
call fcn.004c8420
mov eax, dword [esp + 0x34]
add esp, 0x24
cmp edi, eax
jne 0x512fac
mov ecx, dword [esp + 0x14]
cmp edi, ecx
jne 0x512fac
mov edi, dword [esp + 0x68]
mov edx, dword [esp + 0x30]
or dh, 0x90
push edx
mov edx, dword [esp + 0x38]
push edx
push ecx
push eax
call fcn.004beea0
push ebp
push eax
mov dword [esp + 0x50], eax
call fcn.004c83f0
push ebp
call fcn.004bf4c0
mov eax, dword [esp + 0x54]
push eax
call fcn.004bafd0
mov ebp, eax
push 0x5f8d84
push ebp
call fcn.004bb0b0
mov ecx, dword [esi + 0x14]
push ebp
push ecx
call fcn.004bb190
mov edx, dword [esp + 0x94]
mov ebp, dword [esp + 0x8c]
push edx
push 0xa00
push edi
call dword [ebp + 0x14]
mov ecx, dword [0x69fdfc]
lea eax, [esp + 0x8c]
push eax
push 0x5f8d80
push edi
call dword [ecx + 0x130]
fild dword [esp + 0x58]
mov edx, dword [esp + 0xac]
add esp, 0x48
fdivr dword [0x58b454]
push edx
push 0xa00
push edi
fstp dword [esp + 0x6c]
fild dword [esp + 0x20]
fdivr dword [0x58b454]
fstp dword [esp + 0x38]
call dword [ebp + 0x14]
add esp, 0xc
test eax, eax
je 0x512f53
xor ebp, ebp
lea eax, [esp + 0x24]
lea ecx, [esp + 0x3c]
push eax
lea edx, [esp + 0x2c]
push ecx
lea eax, [esp + 0x48]
push edx
mov edx, dword [0x69fdfc]
lea ecx, [esp + 0x58]
push eax
push ecx
push str._i__i__i__i__i_n
push edi
call dword [edx + 0x130]
add esp, 0x1c
cmp eax, 5
jne 0x512f36
mov ecx, dword [0x838f70]
mov eax, dword [esp + 0x20]
cmp eax, ecx
jl 0x512e62
lea eax, [ecx + 0x20]
mov ecx, dword [0x69fdfc]
mov dword [esp + 0x44], eax
shl eax, 2
push eax
call dword [ecx + 0x134]
mov ecx, dword [0x838f70]
mov esi, dword [esp + 0x20]
mov edx, eax
add esp, 4
mov edi, edx
mov dword [esp + 0x48], edx
rep movsd dword es:[edi], dword [esi]
mov eax, dword [0x838f70]
mov esi, dword [esp + 0x44]
cmp eax, esi
jge 0x512e2a
mov ecx, esi
lea edi, [edx + eax*4]
sub ecx, eax
or eax, 0xffffffff
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x512e46
mov edx, dword [0x69fdfc]
push eax
call dword [edx + 0x138]
mov edx, dword [esp + 0x4c]
add esp, 4
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x68]
mov dword [0x838f70], esi
mov esi, dword [esp + 0x58]
mov dword [esp + 0x1c], edx
mov dword [0x838f6c], edx
mov ecx, dword [esp + 0x4c]
cmp ecx, 0x80
jl 0x512e80
mov edx, dword [esi + 0x10]
or edx, 2
mov dword [esi + 0x10], edx
mov edx, dword [esp + 0x1c]
mov dword [edx + eax*4], ecx
jmp 0x512e85
mov word [esi + ecx*2 + 0x18], ax
fild dword [esp + 0x40]
mov ecx, dword [esp + 0x38]
add ebp, 0x20
fmul dword [esp + 0x60]
fstp dword [ebx + ebp - 0x18]
fild dword [esp + 0x28]
fmul dword [esp + 0x2c]
fstp dword [ebx + ebp - 0x14]
fild dword [esp + 0x3c]
fmul dword [esp + 0x60]
fstp dword [ebx + ebp - 0x10]
fild dword [esp + 0x24]
mov dword [ebx + ebp - 0x1c], ecx
fmul dword [esp + 0x2c]
fstp dword [ebx + ebp - 0xc]
mov edx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
sub edx, ecx
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x48], edx
mov edx, dword [esp + 0x28]
fild dword [esp + 0x48]
sub ecx, edx
mov byte [ebx + ebp - 4], 0x61
mov dword [esp + 0x48], ecx
mov ecx, dword [esp + 0x18]
fild dword [esp + 0x48]
inc eax
fdivp st(1)
cmp eax, ecx
mov dword [esp + 0x20], eax
fstp dword [ebx + ebp - 0x20]
jl 0x512f36
mov edx, dword [esi + 0x128]
push 0x20
push edx
call fcn.00578400
mov eax, dword [esi + 0x128]
push eax
call fcn.005784c0
mov ebx, eax
mov eax, dword [esp + 0x24]
add eax, 0x20
add esp, 0xc
mov dword [esp + 0x18], eax
mov ecx, 0x100
xor eax, eax
lea edi, [ebx + ebp]
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x68]
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x5c]
push ecx
push 0xa00
push edi
call dword [edx + 0x14]
add esp, 0xc
test eax, eax
jne 0x512d9e
mov eax, dword [esp + 0x20]
push esi
mov dword [esi + 0x124], eax
call fcn.00512fc0
mov edi, dword [0x838f6c]
add esp, 4
test edi, edi
je 0x512f7b
mov ecx, dword [0x838f70]
or eax, 0xffffffff
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
sub ecx, eax
mov dword [esi + 0xc], 0
mov dword [esp + 0x68], ecx
fild dword [esp + 0x68]
fst dword [esi + 4]
fild dword [esp + 0x50]
fdiv st(1)
fstp dword [esi + 8]
fstp st(0)
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x44
ret
push ebp
call fcn.004bf4c0
add esp, 4
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x44
ret