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

Disassembly:
sub esp, 0x350
fldz
xor eax, eax
mov word [esp + 0x18], ax
fst qword [esp + 0x3c]
fldz
push ebx
fst dword [esp + 0x20]
push ebp
xor ecx, ecx
fxch st(1)
mov word [esp + 0xc], cx
xor ebp, ebp
mov dword [esp + 0x14], ebp
mov dword [esp + 8], ebp
fstp qword [esp + 0x44]
push esi
mov esi, dword [esp + 0x36c]
fst dword [esp + 0x20]
lea ecx, [esp + 0x50]
xor edx, edx
mov dword [esp + 0x20], ebp
push ecx
mov word [esp + 0x14], dx
fstp dword [esp + 0x48]
mov ebx, 1
lea eax, [esp + 0x48]
push esi
mov dword [esp + 0x4c], ebp
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x60], eax
call fcn.004012c0
add esp, 8
test eax, eax
jl 0x407087
mov edx, dword [esi + 8]
test byte [edx], bl
je 0x407087
lea eax, [esp + 0x1c]
push esi
push eax
call fcn.00401750
push ebp
lea ecx, [esp + 0x44]
push ecx
lea edx, [esp + 0x3c]
push edx
call fcn.004018c0
push 0x300
lea eax, [esp + 0x74]
push ebp
push eax
call fcn.0040aa40
mov ecx, dword [esp + 0x388]
push ecx
call fcn.00402140
add esp, 0x24
cmp eax, 0x29f
jle 0x406a33
mov dword [esp + 0x14], 6
jmp 0x406a63
cmp eax, 0xef
jle 0x406a44
mov dword [esp + 0x14], 5
jmp 0x406a63
cmp eax, 0x4f
jle 0x406a53
mov dword [esp + 0x14], 4
jmp 0x406a63
xor edx, edx
cmp eax, 0x17
setg dl
lea edx, [edx + edx + 1]
mov dword [esp + 0x14], edx
push edi
mov edi, dword [esi + 4]
add edi, ebx
mov ebx, dword [esp + 0x364]
push edi
push ebx
call fcn.00402200
add esp, 8
mov dword [esp + 0x14], eax
cmp eax, ebp
jne 0x407000
fld dword [0x4220b0]
lea eax, [esp + 0x6c]
fsubr qword [0x41e6d8]
push edi
push eax
fmul dword [0x424db0]
fstp dword [0x424db0]
call fcn.00402200
add esp, 8
mov dword [esp + 0x14], eax
cmp eax, ebp
jne 0x407000
lea ecx, [edi + edi]
push ecx
lea edx, [esp + 0x40]
push edx
call fcn.00402200
add esp, 8
mov dword [esp + 0x14], eax
cmp eax, ebp
jne 0x407000
mov ebp, dword [esp + 0x374]
test ebp, ebp
je 0x406b00
cmp dword [ebp + 8], 0
je 0x406b00
mov eax, dword [ebp]
mov ecx, dword [ebp + 4]
mov edx, dword [ebp + 8]
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], edx
jmp 0x406b8f
lea eax, [esp + 0x30]
push 1
push eax
call fcn.00402960
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x407007
mov ecx, dword [esp + 0x24]
mov edx, dword [0x424068]
lea eax, [edx + ecx]
mov ecx, dword [esp + 0x10]
lea edx, [ecx + eax + 0x769c0247]
mov dword [0x424068], edx
mov eax, dword [esi + 4]
shl eax, 6
push eax
lea ecx, [esp + 0x34]
push ecx
call fcn.004025e0
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x407007
lea edx, [esp + 0x30]
push esi
push edx
mov eax, edx
push eax
call fcn.00406510
add esp, 0xc
mov dword [esp + 0x14], eax
test eax, eax
jne 0x407007
test ebp, ebp
je 0x406b8f
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x38]
mov dword [ebp], ecx
mov dword [ebp + 4], edx
mov dword [ebp + 8], eax
mov edi, dword [esp + 0x368]
push esi
push edi
call fcn.004012c0
add esp, 8
test eax, eax
jl 0x406bb5
push esi
lea ecx, [esp + 0x70]
push edi
push ecx
call fcn.00406510
add esp, 0xc
jmp 0x406bc3
lea edx, [esp + 0x6c]
push edi
push edx
call fcn.00402ba0
add esp, 8
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x3c]
push eax
push ecx
push esi
lea edx, [esp + 0x3c]
push edx
lea eax, [esp + 0x7c]
push eax
call fcn.004027f0
fld dword [0x424d9c]
fsub qword [0x41e6d0]
lea ecx, [esp + 0x44]
push ecx
push ebx
fstp dword [0x424d9c]
call fcn.00402ba0
add esp, 0x1c
mov dword [esp + 0x14], eax
test eax, eax
jne 0x407007
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x3c]
push edx
push eax
push esi
push ebx
call fcn.00404360
mov ebp, dword [esp + 0x28]
add esp, 0x10
cmp ebp, 1
jle 0x406d3b
dec ebp
mov ecx, ebp
mov ebx, 1
shl ebx, cl
mov ecx, dword [esp + 0x1c]
add ecx, 0x3f75e0fd
mov dword [esp + 0x10], ecx
fild dword [esp + 0x10]
lea edi, [ebx + ebx*2]
lea edi, [esp + edi*4 + 0x60]
fmul qword [0x424e38]
fstp qword [0x424e38]
inc dword [esp + 0x1c]
mov edx, dword [esi + 4]
inc edx
push edx
push edi
call fcn.00402200
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x407000
lea eax, [esp + 0x6c]
push eax
push edi
call fcn.00402ba0
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x407000
test ebp, ebp
jle 0x406caf
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x3c]
push ecx
push edx
push esi
push edi
push edi
call fcn.004027f0
add esp, 0x14
sub ebp, 1
jne 0x406c95
mov ecx, dword [esp + 0x18]
mov ebp, 1
shl ebp, cl
inc ebx
cmp ebx, ebp
jge 0x406d3b
lea edi, [ebx + ebx*2]
lea edi, [esp + edi*4 + 0x60]
jmp 0x406cd0
mov ax, word [esp + 0x28]
mov edx, dword [esp + 0x24]
movsx ecx, ax
imul ecx, edx
mov dword [esp + 0x24], ecx
dec dword [esp + 0x28]
mov eax, dword [esi + 4]
inc eax
push eax
push edi
call fcn.00402200
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x407000
lea ecx, [edi - 0xc]
push ecx
push edi
call fcn.00402ba0
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x407000
mov eax, dword [esp + 0x20]
lea edx, [esp + 0x3c]
push edx
push eax
push esi
lea ecx, [esp + 0x78]
push ecx
push edi
call fcn.004027f0
inc ebx
add esp, 0x14
add edi, 0xc
cmp ebx, ebp
jl 0x406cd0
fld qword [esp + 0x4c]
fsub dword [0x422fc4]
fcomp qword [0x41e6c8]
fnstsw ax
fld dword [0x422fc4]
fld1
fadd st(1), st(0)
fxch st(1)
fstp dword [0x422fc4]
fld qword [esp + 0x4c]
fadd st(1)
fstp qword [esp + 0x4c]
test ah, 0x41
jne 0x406da7
fld qword [0x424dd0]
mov dx, word [0x424054]
fadd qword [0x41e6c0]
movsx eax, dx
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
faddp st(1)
call fcn.0040abf0
mov word [0x424054], ax
fadd qword [0x424dd0]
fstp qword [0x424dd0]
jmp 0x406da9
fstp st(0)
mov ecx, dword [esp + 0x36c]
mov edx, dword [ecx + 4]
xor ebp, ebp
xor edi, edi
mov dword [esp + 0x28], edx
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x24], edi
mov ebx, dword [esp + 0x20]
cmp dword [esp + 0x1c], 0
jne 0x406e2b
mov eax, dword [esp + 0x28]
mov ecx, eax
dec eax
mov dword [esp + 0x28], eax
test ecx, ecx
je 0x406f0f
movzx edx, word [0x424be8]
movsx eax, dx
mov ecx, 0xc9efa09b
sub ecx, eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x1c], 0x20
fild dword [esp + 0x10]
fsub qword [0x424b60]
movzx edx, word [0x424074]
movsx eax, dx
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
faddp st(1)
call fcn.0040abf0
mov ebx, dword [esp + 0x20]
mov word [0x424074], ax
mov edx, dword [esp + 0x36c]
mov eax, dword [edx + 8]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x28]
mov eax, dword [eax + edx*4]
dec ecx
shr eax, cl
mov dword [esp + 0x1c], ecx
and eax, 1
jne 0x406e7a
mov ecx, dword [esp + 0x24]
test ecx, ecx
je 0x406dc7
cmp ecx, 1
jne 0x406e7a
lea eax, [esp + 0x3c]
push eax
mov eax, dword [esp + 0x368]
push ebx
push esi
push eax
push eax
call fcn.004027f0
add esp, 0x14
jmp 0x406dc7
mov edx, dword [esp + 0x18]
inc edi
mov ecx, edx
sub ecx, edi
shl eax, cl
mov dword [esp + 0x24], 2
or ebp, eax
cmp edi, edx
jne 0x406dc7
mov edi, edx
test edi, edi
jle 0x406ebd
lea ecx, [ecx]
mov eax, dword [esp + 0x364]
lea ecx, [esp + 0x3c]
push ecx
push ebx
push esi
push eax
push eax
call fcn.004027f0
add esp, 0x14
sub edi, 1
jne 0x406ea0
lea edx, [esp + 0x3c]
push edx
mov edx, dword [esp + 0x368]
push ebx
lea eax, [ebp + ebp*2]
push esi
lea ecx, [esp + eax*4 + 0x6c]
push ecx
push edx
call fcn.004027f0
mov eax, dword [0x4220b8]
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
add esp, 0x14
xor edi, edi
mov dword [esp + 0x24], 1
fadd dword [0x422f70]
fmul dword [esp + 0x2c]
fstp dword [esp + 0x2c]
dec dword [0x4220b8]
xor ebp, ebp
jmp 0x406dc3
mov ecx, dword [esp + 0x18]
fld qword [0x41e6b8]
mov eax, 1
fstp qword [0x423408]
rol eax, cl
mov dword [esp + 0x10], eax
test edi, edi
jle 0x406fe9
mov dword [esp + 0x2c], edi
jmp 0x406f40
mov edi, dword [esp + 0x364]
lea ecx, [esp + 0x3c]
push ecx
push ebx
push esi
push edi
push edi
call fcn.004027f0
mov dx, word [0x422f94]
movzx ecx, word [0x424064]
movsx eax, dx
movsx edx, cx
movzx ecx, word [0x424c58]
inc word [0x424c58]
dec word [0x424064]
lea eax, [edx + eax - 0x992da30]
movsx edx, cx
add edx, 0x1f34161
add esp, 0x14
cmp eax, edx
jle 0x406fa8
movzx eax, word [0x4230b0]
imul eax, eax, 0x42610f4f
mov word [0x4230b0], ax
mov ecx, dword [0x424b58]
mov eax, 0x2e4babb7
sub eax, ecx
add dword [0x423044], eax
mov ebx, dword [esp + 0x20]
add ebp, ebp
test dword [esp + 0x10], ebp
je 0x406fdc
lea edx, [esp + 0x3c]
push edx
push ebx
push esi
lea eax, [esp + 0x78]
push eax
push edi
call fcn.004027f0
add esp, 0x14
sub dword [esp + 0x2c], 1
jne 0x406f40
jmp 0x406ff0
mov edi, dword [esp + 0x364]
lea ecx, [esp + 0x3c]
push ecx
push ebx
push esi
push edi
call fcn.00404360
add esp, 0x10
mov ebp, dword [esp + 0x374]
mov esi, dword [esp + 0x18]
lea ecx, [esi - 1]
mov eax, 1
shl eax, cl
mov edx, 1
mov ecx, esi
shl edx, cl
cmp eax, edx
jge 0x407043
lea esi, [eax + eax*2]
sub edx, eax
lea esi, [esp + esi*4 + 0x60]
mov edi, edx
lea ecx, [ecx]
push 0
push esi
call fcn.004010c0
add esp, 8
add esi, 0xc
sub edi, 1
jne 0x407030
pop edi
push 0
lea edx, [esp + 0x3c]
lea eax, [esp + 0x6c]
test ebp, ebp
je 0x40706a
push edx
push eax
call fcn.004010c0
mov eax, dword [esp + 0x1c]
add esp, 0xc
pop esi
pop ebp
pop ebx
add esp, 0x350
ret
lea ecx, [esp + 0x30]
push ecx
push edx
push eax
call fcn.004010c0
mov eax, dword [esp + 0x20]
add esp, 0x10
pop esi
pop ebp
pop ebx
add esp, 0x350
ret
pop esi
pop ebp
mov eax, 0xfffffffc
pop ebx
add esp, 0x350
ret