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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x74
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
fld qword [0x70b3e0]
fcomp qword [0x6c3b40]
mov ecx, dword [eax]
mov eax, dword [edx]
mov dword [esp + 0x20], eax
push ebx
xor ebx, ebx
push esi
fnstsw ax
push edi
mov dword [esp + 0x18], ebx
test ah, 1
mov dword [esp + 0xc], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x10], ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x14], ecx
je 0x5216b4
call fcn.0051f2e0
mov edi, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov eax, dword [edi - 4]
mov esi, dword [ecx - 4]
cmp eax, esi
jle 0x5216c6
mov esi, eax
lea edx, [esp + 0x18]
push esi
push edx
call fcn.0051f250
lea eax, [esp + 0x14]
push esi
push eax
call fcn.0051f250
lea ecx, [esp + 0x30]
push esi
push ecx
call fcn.0051f250
lea edx, [esp + 0x28]
push esi
push edx
call fcn.0051f250
lea eax, [esp + 0x3c]
push esi
push eax
call fcn.0051f250
lea ecx, [esp + 0x4c]
push esi
push ecx
call fcn.0051f250
lea edx, [esp + 0x58]
push esi
push edx
call fcn.0051f250
mov edx, dword [edi]
mov eax, dword [esp + 0x50]
add esp, 0x38
cmp edx, ebx
mov ecx, edi
jl 0x521730
inc edx
mov edi, dword [ecx]
add ecx, 4
mov dword [eax], edi
add eax, 4
dec edx
jne 0x521723
lea eax, [esp + 0x14]
push esi
push eax
call fcn.0051f250
mov edx, dword [ebp + 0x10]
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x34]
push esi
push eax
mov dword [edx], ecx
call fcn.0051f250
mov edx, dword [ebp + 0x14]
mov ecx, dword [esp + 0x3c]
mov eax, dword [esp + 0x1c]
add esp, 0x10
mov dword [edx], ecx
mov ecx, dword [ebp + 0xc]
fld qword [0x748d80]
fadd qword [0x6c3b38]
mov edx, dword [ecx]
cmp edx, ebx
fstp qword [esp + 0x70]
fld qword [0x6c3b38]
fsub qword [0x748d80]
fstp qword [esp + 0x68]
jl 0x521796
inc edx
mov esi, dword [ecx]
add ecx, 4
mov dword [eax], esi
add eax, 4
dec edx
jne 0x521789
mov eax, dword [esp + 0x14]
mov dword [eax], 1
mov ecx, dword [esp + 0x14]
mov dword [ecx + 4], 1
mov edx, dword [esp + 0x10]
mov dword [edx], 1
mov eax, dword [esp + 0x10]
mov dword [eax + 4], ebx
mov edi, dword [esp + 0xc]
mov edx, dword [edi]
cmp edx, 1
jg 0x5217d0
cmp dword [edi + 4], ebx
jle 0x521b67
mov esi, dword [esp + 0x18]
mov dword [esp + 0x40], ebx
mov eax, dword [esi]
mov ecx, eax
sub ecx, edx
je 0x5217e9
cmp ecx, 1
jne 0x521a94
fild dword [esi + eax*4]
cmp eax, 1
fmul qword [0x70b3d8]
fst qword [esp + 0x60]
jle 0x521803
fiadd dword [esi + eax*4 - 4]
fst qword [esp + 0x60]
fild dword [edi + edx*4]
cmp edx, 1
fmul qword [0x70b3d8]
fst qword [esp + 0x48]
jle 0x52181d
fiadd dword [edi + edx*4 - 4]
fst qword [esp + 0x48]
fxch st(1)
fadd qword [0x6c3b38]
cmp ecx, ebx
fmul qword [esp + 0x70]
fdiv st(1)
fxch st(1)
fstp st(0)
fld qword [esp + 0x60]
fmul qword [esp + 0x68]
fld qword [esp + 0x48]
fadd qword [0x6c3b38]
fdivp st(1)
fstp qword [esp + 0x60]
jle 0x52185f
fmul qword [0x70b3d8]
fld qword [0x70b3d8]
fmul qword [esp + 0x60]
fstp qword [esp + 0x60]
mov edi, 1
mov dword [esp + 0x34], 1
mov eax, edi
mov dword [esp + 0x38], ebx
mov dword [esp + 0x30], eax
mov dword [esp + 0x3c], eax
fcom qword [0x70b3d8]
mov eax, dword [esp + 0x30]
mov ecx, 1
sub ecx, eax
mov dword [esp + 0x30], ecx
fnstsw ax
test ah, 1
je 0x52198b
fld qword [esp + 0x60]
call fcn.0061e258
mov esi, eax
mov dword [esp + 0x48], esi
fild dword [esp + 0x48]
fst qword [esp + 0x48]
fld st(1)
fsubrp st(1)
fst qword [esp + 0x78]
fcomp qword [0x6c3b40]
fnstsw ax
test ah, 0x40
jne 0x52198b
test esi, esi
je 0x52198b
call fcn.0061e258
cmp esi, eax
jl 0x52198d
fld qword [esp + 0x60]
fld qword [esp + 0x68]
fdiv qword [esp + 0x78]
fstp qword [esp + 0x60]
fcom qword [esp + 0x48]
fnstsw ax
test ah, 0x41
jne 0x521904
fsub qword [esp + 0x48]
fdivr qword [esp + 0x70]
jmp 0x52190c
fstp st(0)
fld qword [0x70b3d8]
mov ecx, dword [esp + 0x34]
mov eax, 0x40000000
sub eax, ecx
mov dword [esp + 0x34], ebx
cdq
idiv esi
cmp eax, ebx
jge 0x52192c
mov dword [esp + 0x3c], 0
jmp 0x521935
mov edx, esi
imul edx, ebx
add edx, ecx
mov ebx, edx
mov ecx, dword [esp + 0x38]
mov eax, 0x40000000
sub eax, ecx
mov dword [esp + 0x38], edi
cdq
idiv esi
cmp eax, edi
jl 0x52198b
imul esi, edi
mov eax, dword [esp + 0x3c]
add esi, ecx
test eax, eax
mov edi, esi
jle 0x52198b
mov eax, dword [esp + 0x30]
test eax, eax
jle 0x52187a
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x40], 1
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], ecx
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x44], edi
jmp 0x52187a
fstp st(0)
mov eax, dword [esp + 0x40]
test eax, eax
je 0x521a8a
mov esi, dword [esp + 0x54]
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x1c]
push edx
push esi
push eax
call fcn.0051fd30
mov edi, dword [esp + 0x64]
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x30]
push ecx
push edi
push edx
call fcn.0051fd30
mov ebx, dword [esp + 0x74]
mov ecx, dword [esp + 0x2c]
lea eax, [esp + 0x40]
push eax
push ebx
push ecx
call fcn.0051fd30
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x34]
lea edx, [esp + 0x34]
push edx
push eax
push ecx
call fcn.0051fd30
mov eax, dword [esp + 0x54]
mov ecx, dword [esp + 0x4c]
lea edx, [esp + 0x44]
push edx
push eax
push ecx
call fcn.0051f840
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x64]
lea edx, [esp + 0x4c]
push edx
push eax
push ecx
call fcn.0051f840
mov eax, dword [esp + 0x60]
add esp, 0x48
lea edx, [esp + 0x1c]
push edx
push esi
push eax
call fcn.0051fd30
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x30]
push ecx
push edi
push edx
call fcn.0051fd30
mov ecx, dword [esp + 0x30]
lea eax, [esp + 0x40]
push eax
push ebx
push ecx
call fcn.0051fd30
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x30]
lea edx, [esp + 0x30]
push edx
push eax
push ecx
call fcn.0051fd30
mov eax, dword [esp + 0x54]
mov ecx, dword [esp + 0x4c]
lea edx, [esp + 0x48]
push edx
push eax
push ecx
call fcn.0051fb30
mov eax, dword [esp + 0x64]
mov ecx, dword [esp + 0x48]
lea edx, [esp + 0x48]
push edx
push eax
push ecx
call fcn.0051fb30
add esp, 0x48
xor ebx, ebx
jmp 0x5217bc
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0xc]
xor ebx, ebx
lea edx, [esp + 0x18]
lea eax, [esp + 0x20]
push edx
push eax
push edi
push esi
call fcn.00520cb0
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x2c]
push ecx
push edx
push eax
call fcn.0051ff30
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x30]
lea ecx, [esp + 0x30]
push ecx
push edx
push eax
call fcn.0051f840
mov eax, dword [esp + 0x40]
add esp, 0x28
cmp dword [eax], 1
jg 0x521b22
cmp dword [eax + 4], ebx
jg 0x521b22
mov ecx, dword [esp + 0xc]
mov edx, dword [ecx]
cmp edx, ebx
jl 0x521afa
inc edx
mov esi, dword [ecx]
add ecx, 4
mov dword [eax], esi
add eax, 4
dec edx
jne 0x521ae9
mov ecx, dword [esp + 0xc]
mov dword [ecx], 1
mov ecx, dword [esp + 0xc]
lea edx, [esp + 0x14]
mov dword [ecx + 4], ebx
mov eax, dword [esp + 0x10]
mov ecx, dword [ebp + 0xc]
push edx
push eax
push ecx
call fcn.0051fb30
add esp, 0xc
jmp 0x5217bc
lea edx, [esp + 0xc]
lea ecx, [esp + 0x20]
push edx
mov edx, dword [esp + 0x10]
push ecx
push eax
push edx
call fcn.00520cb0
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x30]
lea eax, [esp + 0x2c]
push eax
push ecx
push edx
call fcn.0051ff30
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x2c]
lea eax, [esp + 0x2c]
push eax
push ecx
push edx
call fcn.0051f840
add esp, 0x28
jmp 0x5217bc
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx]
cmp edx, 1
jne 0x521b7b
cmp dword [ecx + 4], edx
jne 0x521b7b
xor esi, esi
jmp 0x521b80
mov esi, 1
mov eax, dword [esp + 0x2c]
cmp edx, ebx
jl 0x521b96
inc edx
mov edi, dword [ecx]
add ecx, 4
mov dword [eax], edi
add eax, 4
dec edx
jne 0x521b89
mov ecx, dword [ebp + 0x10]
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x2c]
mov dword [ecx], eax
mov eax, dword [ebp + 0x14]
lea ecx, [esp + 0x18]
push ecx
mov dword [eax], edx
call fcn.0051f2c0
lea edx, [esp + 0x10]
push edx
call fcn.0051f2c0
lea eax, [esp + 0x28]
push eax
call fcn.0051f2c0
lea ecx, [esp + 0x1c]
push ecx
call fcn.0051f2c0
lea edx, [esp + 0x2c]
push edx
call fcn.0051f2c0
lea eax, [esp + 0x38]
push eax
call fcn.0051f2c0
lea ecx, [esp + 0x40]
push ecx
call fcn.0051f2c0
add esp, 0x1c
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret