Function at 0x40ac60
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x24
push ebp
push esi
mov esi, ecx
push edi
mov eax, dword [esi + 0x20]
fild dword [eax + 0x7e4cc]
fmul qword [0x5db040]
fadd qword [0x5dab78]
fimul dword [eax + 0x10c]
call fcn.00573170
mov dword [esp + 0x24], eax
mov eax, dword [esi + 0x54]
fld dword [esi + eax*4 + 0x98]
fcomp dword [0x5db2c4]
lea edi, [esi + eax*4 + 0x98]
fnstsw ax
test ah, 1
je 0x40acbb
mov dword [esi + 0x1220], 0xf
pop edi
pop esi
pop ebp
add esp, 0x24
ret
fld dword [esi + 0x74]
call fcn.00573170
mov dword [esp + 0x28], eax
fild dword [esp + 0x28]
fmul qword [0x5db038]
fidiv dword [esp + 0x24]
call fcn.00573170
mov ebp, eax
cmp ebp, 0x32
jl 0x40af87
cmp ebp, 0x3cf
jg 0x40af87
fild dword [esp + 0x24]
push ebx
fstp dword [esp + 0x28]
fld dword [edi]
fadd dword [0x5db2c0]
fmul dword [0x5db2bc]
fdiv dword [esp + 0x28]
fmul dword [0x5db258]
call fcn.00573170
fld dword [edi]
fsub dword [0x5db2c0]
mov ebx, eax
mov dword [esp + 0x1c], 0x1e3ce508
mov dword [esp + 0x30], ebx
mov dword [esp + 0x18], 0x1e3ce508
fmul dword [0x5db2bc]
fdiv dword [esp + 0x28]
fmul dword [0x5db258]
call fcn.00573170
cmp eax, ebx
mov dword [esp + 0x20], eax
jge 0x40ae10
lea ecx, [eax + ebp - 2]
mov dword [esp + 0x24], ecx
mov ebx, dword [esp + 0x24]
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
mov edi, 0xfffffffe
mov eax, edi
mov ecx, dword [esp + 0x20]
cdq
xor eax, edx
sub eax, edx
mov edx, edi
inc eax
sub edx, ecx
mov dword [esp + 0x2c], eax
add edx, ebp
fild dword [esp + 0x2c]
push edx
mov ecx, esi
fstp dword [esp + 0x30]
call fcn.005021d0
fdiv dword [esp + 0x2c]
push ebx
mov ecx, esi
fadd dword [esp + 0x14]
fstp dword [esp + 0x14]
call fcn.005021d0
fdiv dword [esp + 0x2c]
inc edi
inc ebx
cmp edi, 2
fadd dword [esp + 0x14]
fstp dword [esp + 0x14]
jle 0x40ad77
fld dword [esp + 0x10]
fcomp dword [esp + 0x18]
fnstsw ax
test ah, 0x41
jne 0x40addb
mov eax, dword [esp + 0x10]
mov dword [esp + 0x18], eax
fld dword [esp + 0x14]
fcomp dword [esp + 0x1c]
fnstsw ax
test ah, 0x41
jne 0x40adf2
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x1c], ecx
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x30]
inc eax
inc edx
cmp eax, ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
jl 0x40ad5e
mov edx, dword [esi + 0x54]
mov dword [esp + 0x20], 0
mov dword [esp + 0x24], 0
fld dword [esi + edx*4 + 0x98]
fadd dword [0x5db2b8]
fmul dword [0x5db2bc]
fdiv dword [esp + 0x28]
fmul dword [0x5db258]
call fcn.00573170
mov dword [esp + 0x28], eax
mov edi, 0xfffffffd
lea ebx, [eax + ebp - 3]
mov eax, edi
mov ecx, esi
cdq
xor eax, edx
sub eax, edx
inc eax
mov dword [esp + 0x30], eax
lea eax, [edi + ebp]
fild dword [esp + 0x30]
push eax
fstp dword [esp + 0x30]
call fcn.005021d0
fdiv dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
mov ecx, edi
sub ecx, edx
add ecx, ebp
push ecx
mov ecx, esi
fadd dword [esp + 0x24]
fstp dword [esp + 0x24]
call fcn.005021d0
fstp dword [esp + 0x30]
push ebx
mov ecx, esi
call fcn.005021d0
fadd dword [esp + 0x30]
inc edi
inc ebx
cmp edi, 3
fdiv dword [esp + 0x2c]
fmul dword [0x5db258]
fadd dword [esp + 0x24]
fstp dword [esp + 0x24]
jle 0x40ae52
fld dword [esp + 0x18]
fcomp dword [esp + 0x1c]
pop ebx
fnstsw ax
test ah, 0x41
jne 0x40aece
fld dword [esp + 0x14]
jmp 0x40aed2
fld dword [esp + 0x18]
call fcn.00573170
mov dword [esp + 0x2c], eax
fild dword [esp + 0x2c]
fstp dword [esp + 0x28]
fild dword [esi + 0x1224]
fld dword [esp + 0x28]
fsub dword [esp + 0x20]
fsub st(1)
fmul dword [0x5db2b4]
fadd st(1)
call fcn.00573170
mov ecx, eax
mov eax, 0x55555556
imul ecx
fstp st(0)
mov edi, dword [esi]
mov eax, edx
shr eax, 0x1f
push 0
add edx, eax
push 0
mov dword [esi + 0x1224], ecx
push edx
push 0x49
mov ecx, esi
call dword [edi + 8]
mov edi, dword [esi + 0x1220]
mov dword [esp + 0x2c], edi
fild dword [esp + 0x2c]
fld dword [esp + 0x28]
fsub dword [esp + 0x1c]
fsubp st(1)
call fcn.00573170
mov ecx, eax
mov eax, 0x66666667
imul ecx
sar edx, 1
mov ecx, edx
mov eax, edi
shr ecx, 0x1f
add edx, ecx
sub eax, edx
mov dword [esi + 0x1220], eax
jns 0x40af6b
mov dword [esi + 0x1220], 0
mov ecx, dword [esi + 0x1220]
mov eax, 0x1f
cmp ecx, eax
jle 0x40af91
mov dword [esi + 0x1220], eax
pop edi
pop esi
pop ebp
add esp, 0x24
ret
mov dword [esi + 0x1220], 0
pop edi
pop esi
pop ebp
add esp, 0x24
ret