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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x38c
fldz
push ebx
push esi
mov esi, dword [ebp + 0x14]
push edi
xor edi, edi
mov dword [esp + 0x30], edi
fst qword [esp + 0x70]
fldz
lea ecx, [esp + 0x80]
fst dword [esp + 0x20]
mov ebx, 1
fxch st(1)
push ecx
fst qword [esp + 0x6c]
lea eax, [esp + 0x7c]
fst qword [esp + 0x5c]
mov dword [esp + 0x7c], edi
fxch st(1)
mov dword [esp + 0x84], ebx
fstp dword [esp + 0x40]
push esi
mov dword [esp + 0x8c], ebx
mov dword [esp + 0x90], eax
fst qword [esp + 0x60]
fstp qword [esp + 0x30]
mov dword [esp + 0x3c], edi
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x14], 0xfb01d7fe
call fcn.004015b0
add esp, 8
test eax, eax
jl 0x40758b
mov edx, dword [esi + 8]
test byte [edx], bl
je 0x40758b
lea eax, [esp + 0x1c]
push esi
push eax
call fcn.004011f0
push edi
lea ecx, [esp + 0x4c]
push ecx
lea edx, [esp + 0x5c]
push edx
call fcn.004017a0
push 0x300
lea eax, [esp + 0xb0]
push edi
push eax
call fcn.0040b3d0
fld dword [esp + 0x40]
mov ecx, dword [esp + 0x54]
mov edx, dword [ebp + 0x10]
mov dword [esp + 0x2c], ecx
fild dword [esp + 0x2c]
push edx
fadd qword [esp + 0x7c]
fsub qword [0x41f7c8]
fsubp st(1)
fstp dword [esp + 0x44]
call fcn.00401460
add esp, 0x24
cmp eax, 0x29f
jle 0x406d21
mov dword [esp + 0x24], 6
jmp 0x406d51
cmp eax, 0xef
jle 0x406d32
mov dword [esp + 0x24], 5
jmp 0x406d51
cmp eax, 0x4f
jle 0x406d41
mov dword [esp + 0x24], 4
jmp 0x406d51
xor ecx, ecx
cmp eax, 0x17
setg cl
lea ecx, [ecx + ecx + 1]
mov dword [esp + 0x24], ecx
mov edi, dword [esi + 4]
fld qword [0x41f7c0]
add edi, ebx
fstp qword [esp + 0x58]
mov ebx, dword [ebp + 8]
push edi
push ebx
call fcn.00401da0
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750c
lea edx, [esp + 0xa4]
push edi
push edx
call fcn.00401da0
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750c
lea eax, [edi + edi]
push eax
lea ecx, [esp + 0x44]
push ecx
call fcn.00401da0
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750c
mov edi, dword [ebp + 0x18]
test edi, edi
je 0x406dd5
cmp dword [edi + 8], eax
je 0x406dd5
mov edx, dword [edi]
mov eax, dword [edi + 4]
mov ecx, dword [edi + 8]
mov dword [esp + 0x4c], edx
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], ecx
jmp 0x406e45
lea edx, [esp + 0x4c]
push 1
push edx
call fcn.00403280
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750f
mov eax, dword [esi + 4]
shl eax, 6
push eax
lea ecx, [esp + 0x50]
push ecx
call fcn.00402ee0
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750f
lea edx, [esp + 0x4c]
push esi
push edx
mov eax, edx
push eax
call fcn.004066b0
add esp, 0xc
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750f
test edi, edi
je 0x406e45
mov ecx, dword [esp + 0x4c]
mov edx, dword [esp + 0x50]
mov eax, dword [esp + 0x54]
mov dword [edi], ecx
mov dword [edi + 4], edx
mov dword [edi + 8], eax
fld qword [esp + 0x70]
mov cx, word [0x424384]
mov edi, dword [ebp + 0xc]
movsx edx, cx
add edx, 0x545005fd
mov dword [esp + 0xc], edx
push esi
push edi
fild dword [esp + 0x14]
fsubp st(1)
fstp qword [esp + 0x78]
inc word [0x424384]
call fcn.004015b0
add esp, 8
test eax, eax
jl 0x406e93
push esi
lea eax, [esp + 0xa8]
push edi
push eax
call fcn.004066b0
add esp, 0xc
jmp 0x406ea4
lea ecx, [esp + 0xa4]
push edi
push ecx
call fcn.00403610
add esp, 8
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x40]
push edx
push eax
push esi
lea ecx, [esp + 0x58]
push ecx
lea edx, [esp + 0xb4]
push edx
call fcn.00404190
lea eax, [esp + 0x60]
push eax
push ebx
call fcn.00403610
add esp, 0x1c
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750c
fld qword [0x4242e8]
mov edx, dword [esp + 0x1c]
fsub qword [0x41f7b8]
lea ecx, [esp + 0x40]
push ecx
push edx
push esi
fstp qword [0x4242e8]
push ebx
call fcn.00404530
mov eax, dword [esp + 0x34]
add esp, 0x10
cmp eax, 1
jle 0x406ffc
lea ecx, [eax - 1]
mov eax, dword [esi + 4]
mov ebx, 1
shl ebx, cl
inc eax
push eax
lea edi, [ebx + ebx*2]
lea edi, [esp + edi*4 + 0x9c]
push edi
call fcn.00401da0
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750c
lea ecx, [esp + 0xa4]
push ecx
push edi
call fcn.00403610
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750c
mov eax, dword [esp + 0x24]
dec eax
test eax, eax
jle 0x406f82
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x40]
push edx
push eax
push esi
push edi
push edi
call fcn.00404190
add esp, 0x14
sub dword [esp + 0xc], 1
jne 0x406f66
mov ecx, dword [esp + 0x24]
mov eax, 1
shl eax, cl
inc ebx
cmp ebx, eax
mov dword [esp + 0xc], eax
jge 0x406ff9
lea edi, [ebx + ebx*2]
lea edi, [esp + edi*4 + 0x98]
mov ecx, dword [esi + 4]
inc ecx
push ecx
push edi
call fcn.00401da0
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750c
lea edx, [edi - 0xc]
push edx
push edi
call fcn.00403610
add esp, 8
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40750c
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x40]
push eax
push ecx
push esi
lea edx, [esp + 0xb0]
push edx
push edi
call fcn.00404190
inc ebx
add esp, 0x14
add edi, 0xc
cmp ebx, dword [esp + 0xc]
jl 0x406fa0
mov ebx, dword [ebp + 8]
fld qword [0x4242d8]
mov eax, dword [ebp + 0x10]
fadd qword [0x425918]
mov edx, dword [esp + 0x34]
mov ecx, dword [eax + 4]
mov dword [esp + 0xc], edx
fild dword [esp + 0xc]
xor edi, edi
mov dword [esp + 0x64], ecx
mov dword [esp + 0x18], edi
fmulp st(1)
mov dword [esp + 0x38], edi
call fcn.0040adf0
mov dword [esp + 0x34], eax
mov dword [esp + 0xc], edi
fld1
cmp dword [esp + 0x18], 0
jne 0x407159
mov eax, dword [esp + 0x64]
mov ecx, eax
dec eax
mov dword [esp + 0x64], eax
test ecx, ecx
je 0x4073b0
mov edx, dword [esp + 0x30]
sub edx, 0x2d1bc78f
mov dword [esp + 0x18], edx
fild dword [esp + 0x18]
fld dword [0x424418]
fcompp
fnstsw ax
fld dword [0x424418]
fadd st(1)
fstp dword [0x424418]
test ah, 0x41
jne 0x4070ed
fld qword [0x424298]
fadd st(1)
fstp qword [0x424298]
fld qword [esp + 0x68]
mov ax, word [0x425378]
movsx ecx, ax
mov dword [esp + 0x18], ecx
fild dword [esp + 0x18]
fsubp st(1)
fsub qword [0x424298]
dec word [0x425378]
fcomp qword [0x41f7b0]
fnstsw ax
test ah, 0x41
jp 0x4070d7
fld dword [0x4241f4]
fadd dword [esp + 0x20]
fstp dword [0x4241f4]
jmp 0x40711f
movzx edx, word [0x424194]
imul edx, edx, 0xd38179a6
mov word [0x424194], dx
jmp 0x40711f
fld dword [esp + 0x20]
mov ax, word [0x42442c]
fsubr qword [0x41f7a8]
movsx ecx, ax
mov dword [esp + 0x18], ecx
fild dword [esp + 0x18]
fmulp st(1)
call fcn.0040adf0
mov word [0x42442c], ax
fld dword [esp + 0x20]
fsub st(1)
fstp dword [esp + 0x20]
fld qword [esp + 0x28]
mov dword [esp + 0x18], 0x20
fsub st(1)
fstp qword [esp + 0x28]
fld qword [esp + 0x28]
fld qword [esp + 0x28]
mov dx, word [0x42442c]
movsx eax, dx
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
fsubp st(1)
fadd qword [0x41f7a0]
fsubp st(1)
fstp qword [esp + 0x28]
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 8]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x64]
mov edx, dword [eax + edx*4]
dec ecx
shr edx, cl
mov dword [esp + 0x18], ecx
and edx, 1
jne 0x4071a3
mov eax, dword [esp + 0xc]
test eax, eax
je 0x407039
cmp eax, 1
jne 0x4071a3
mov ecx, dword [esp + 0x1c]
fstp st(0)
lea eax, [esp + 0x40]
push eax
push ecx
push esi
push ebx
push ebx
call fcn.00404190
add esp, 0x14
jmp 0x407037
fld dword [esp + 0x20]
fadd qword [0x41f798]
fcomp qword [0x41f790]
fnstsw ax
test ah, 0x44
jp 0x4071de
fld qword [esp + 0x70]
fld dword [0x4243c4]
fsubr qword [0x41f788]
fsubp st(1)
fstp qword [esp + 0x70]
fld dword [0x4243c4]
fsub st(1)
fstp dword [0x4243c4]
fld dword [0x425de0]
mov eax, dword [esp + 0x24]
fadd st(1)
inc edi
mov ecx, eax
sub ecx, edi
fstp dword [0x425de0]
shl edx, cl
fld dword [0x425de0]
mov dword [esp + 0xc], 2
fsub qword [0x41f780]
or dword [esp + 0x38], edx
fadd qword [esp + 0x58]
fstp qword [esp + 0x58]
cmp edi, eax
jne 0x40731c
test eax, eax
jle 0x407243
fstp st(0)
mov edi, eax
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x40]
push edx
push eax
push esi
push ebx
push ebx
call fcn.00404190
add esp, 0x14
sub edi, 1
jne 0x407227
fld1
fld dword [esp + 0x3c]
mov ecx, dword [0x4252f4]
mov dx, word [0x424294]
mov dword [esp + 0x10], ecx
fisub dword [esp + 0x10]
mov ecx, dword [esp + 0x30]
movsx eax, dx
sub eax, ecx
mov dword [esp + 0x10], eax
fild dword [esp + 0x10]
fucompp
fnstsw ax
fld dword [esp + 0x3c]
fadd st(1)
fstp dword [esp + 0x3c]
test ah, 0x44
jp 0x4072a0
fld qword [0x424458]
fmul qword [0x425dd8]
fstp qword [0x425dd8]
fsubr qword [0x424458]
fstp qword [0x424458]
jmp 0x4072a2
fstp st(0)
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x40]
push edx
push eax
mov eax, dword [esp + 0x40]
lea ecx, [eax + eax*2]
push esi
lea edx, [esp + ecx*4 + 0xa4]
push edx
push ebx
call fcn.00404190
add dword [0x4242c0], 0xcc3c163a
fld qword [esp + 0x3c]
mov eax, dword [esp + 0x44]
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
add esp, 0x14
xor edi, edi
mov dword [esp + 0xc], 1
fucompp
fnstsw ax
test ah, 0x44
jnp 0x407300
fld dword [esp + 0x20]
fmul qword [0x41f778]
fstp dword [esp + 0x20]
fld qword [0x425980]
mov dword [esp + 0x38], 0
fsub qword [0x41f770]
fstp dword [0x4253b8]
fld1
fld qword [esp + 0x28]
mov ecx, dword [0x4247f4]
mov dword [esp + 0x10], ecx
fild dword [esp + 0x10]
fsubp st(1)
fadd qword [0x4247e0]
fld qword [esp + 0x28]
fsub dword [0x4253b8]
fcompp
fnstsw ax
fld dword [0x4253b8]
fsub st(1)
fstp dword [0x4253b8]
fld qword [0x4247e0]
fsub st(1)
fstp qword [0x4247e0]
inc dword [0x4247f4]
fld qword [esp + 0x28]
fsub st(1)
fstp qword [esp + 0x28]
test ah, 1
jne 0x407039
or ecx, 0xffffffff
add dword [0x4242cc], ecx
add dword [esp + 0x30], ecx
mov eax, dword [0x4242cc]
mov edx, dword [esp + 0x34]
sub eax, edx
mov edx, dword [esp + 0x30]
add edx, eax
mov dword [esp + 0x10], edx
fild dword [esp + 0x10]
fadd qword [esp + 0x28]
fstp qword [esp + 0x28]
add dword [esp + 0x34], ecx
jmp 0x407039
mov ecx, dword [esp + 0x24]
mov eax, 1
rol eax, cl
mov dword [esp + 0xc], eax
test edi, edi
jle 0x40749e
fld dword [esp + 0x3c]
fsubr qword [0x41f768]
fcomp qword [0x41f760]
fnstsw ax
fsubr dword [esp + 0x3c]
fstp dword [esp + 0x3c]
test ah, 5
jp 0x407414
mov ax, word [0x42530c]
movsx ecx, ax
mov dword [esp + 0x10], ecx
fild dword [esp + 0x10]
fld qword [esp + 0x28]
fadd qword [0x41f758]
fadd qword [0x41f750]
fsubp st(1)
call fcn.0040adf0
mov word [0x42530c], ax
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x40]
push edx
push eax
push esi
push ebx
push ebx
call fcn.00404190
fld qword [esp + 0x3c]
mov ecx, dword [esp + 0x44]
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x24], ecx
fild dword [esp + 0x24]
add eax, eax
add esp, 0x14
mov dword [esp + 0x38], eax
fadd qword [esp + 0x58]
fsub dword [0x423d10]
fsubp st(1)
fstp qword [esp + 0x28]
fld dword [0x423d10]
fld1
fsub st(1), st(0)
fxch st(1)
fstp dword [0x423d10]
fld qword [esp + 0x58]
fsub st(1)
fstp qword [esp + 0x58]
test dword [esp + 0xc], eax
je 0x407495
mov eax, dword [esp + 0x1c]
fstp st(0)
lea edx, [esp + 0x40]
push edx
push eax
push esi
lea ecx, [esp + 0xb0]
push ecx
push ebx
call fcn.00404190
fld1
add esp, 0x14
sub edi, 1
jne 0x4073c7
xor edx, edx
fstp st(0)
mov word [esp + 0x20], dx
mov eax, 1
mov dword [esp + 0xc], edx
mov dword [esp + 0x7c], eax
add dword [esp + 0xc], 0x34be2d55
mov edx, dword [esp + 0x1c]
lea ecx, [esp + 0x40]
push ecx
mov dword [esp + 0x90], eax
mov dword [esp + 0x94], eax
push edx
lea eax, [esp + 0x84]
mov dword [esp + 0x9c], eax
push esi
lea eax, [esp + 0x98]
push eax
push ebx
call fcn.00404190
fld qword [esp + 0x7c]
fld qword [esp + 0x7c]
add esp, 0x14
fadd qword [0x41f748]
fsub qword [esp + 0x28]
fsubp st(1)
fstp qword [esp + 0x68]
mov edi, dword [ebp + 0x18]
mov esi, dword [esp + 0x24]
lea ecx, [esi - 1]
mov eax, 1
shl eax, cl
mov edx, 1
mov ecx, esi
shl edx, cl
cmp eax, edx
jge 0x40754b
lea esi, [eax + eax*2]
sub edx, eax
lea esi, [esp + esi*4 + 0x98]
mov ebx, edx
push 0
push esi
call fcn.00401d00
add esp, 8
add esi, 0xc
sub ebx, 1
jne 0x407538
push 0
lea ecx, [esp + 0x44]
lea edx, [esp + 0xa8]
test edi, edi
je 0x407571
push ecx
push edx
call fcn.00401d00
mov eax, dword [esp + 0x20]
add esp, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x50]
push eax
push ecx
push edx
call fcn.00401d00
mov eax, dword [esp + 0x24]
add esp, 0x10
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0xfffffffc
pop ebx
mov esp, ebp
pop ebp
ret