Function at 0x40afa5
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x40
push ebx
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 + 0x14], eax
fild dword [esp + 0x14]
fstp qword [esp + 0x48]
fild dword [esp + 0x54]
fmul qword [0x5db038]
fdiv qword [esp + 0x48]
call fcn.00573170
mov ebx, eax
cmp ebx, 0xa
mov dword [esp + 0x24], ebx
jl 0x40b608
cmp ebx, 0x3cf
jg 0x40b608
mov eax, dword [esi + 0x54]
fld dword [esi + eax*4 + 0x98]
fcomp dword [0x5db2d0]
lea edi, [esi + eax*4 + 0x98]
fnstsw ax
test ah, 0x41
jne 0x40b2cd
fld dword [edi]
fsub dword [0x5db2cc]
call fcn.00573170
mov dword [esp + 0x3c], eax
fild dword [esp + 0x3c]
fild dword [esp + 0x14]
fld dword [edi]
fsub st(2)
fmul dword [0x5db2bc]
fdiv st(1)
fmul dword [0x5db258]
call fcn.00573170
fxch st(1)
fadd dword [edi]
mov ebp, eax
fmul dword [0x5db2bc]
fdiv st(1)
fmul dword [0x5db258]
call fcn.00573170
fstp st(0)
fild dword [esp + 0x54]
mov dword [esp + 0x34], eax
fld st(0)
fsub dword [edi]
fmul qword [0x5db038]
fdiv qword [esp + 0x48]
call fcn.00573170
fadd dword [edi]
mov dword [esp + 0x2c], eax
fmul qword [0x5db038]
fdiv qword [esp + 0x48]
call fcn.00573170
xor ecx, ecx
mov edi, eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x38], edi
test ebp, ebp
setl cl
dec ecx
mov dword [esp + 0x28], 0x1e3ce508
and ebp, ecx
mov dword [esp + 0x1c], 0x1e3ce508
cmp ebp, eax
jge 0x40b1a6
lea edx, [ebx + ebp]
mov dword [esp + 0x20], edx
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], 0
mov edi, 0xfffffffe
jmp 0x40b0ee
mov ebx, dword [esp + 0x24]
mov eax, edi
sub eax, ebp
lea ecx, [eax + ebx]
test ecx, ecx
jl 0x40b608
mov edx, dword [esp + 0x20]
lea ebx, [edx + edi]
cmp ebx, 0x3ff
jg 0x40b608
mov eax, edi
push ecx
cdq
xor eax, edx
mov ecx, esi
sub eax, edx
inc eax
mov dword [esp + 0x40], eax
fild dword [esp + 0x40]
fstp dword [esp + 0x34]
call fcn.005021d0
fdiv dword [esp + 0x30]
push ebx
mov ecx, esi
fadd dword [esp + 0x1c]
fstp dword [esp + 0x1c]
call fcn.005021d0
fdiv dword [esp + 0x30]
inc edi
cmp edi, 2
fadd dword [esp + 0x10]
fstp dword [esp + 0x10]
jle 0x40b0ea
fld dword [esp + 0x18]
fcomp dword [esp + 0x1c]
fnstsw ax
test ah, 0x41
jne 0x40b16d
mov eax, dword [esp + 0x18]
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x1c], eax
fld dword [esp + 0x10]
fcomp dword [esp + 0x28]
fnstsw ax
test ah, 0x41
jne 0x40b188
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x38], ebp
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x34]
mov ebx, dword [esp + 0x24]
inc ebp
inc ecx
cmp ebp, eax
mov dword [esp + 0x20], ecx
jl 0x40b0d3
mov edi, dword [esp + 0x38]
mov dword [esp + 0x18], 0
mov ebp, 0xfffffffd
lea edx, [ebx + ebp]
mov ecx, esi
push edx
call fcn.005021d0
mov eax, ebp
cdq
xor eax, edx
sub eax, edx
inc eax
inc ebp
mov dword [esp + 0x3c], eax
cmp ebp, 3
fidiv dword [esp + 0x3c]
fadd dword [esp + 0x18]
fstp dword [esp + 0x18]
jle 0x40b1b3
fld dword [esp + 0x1c]
fsub dword [esp + 0x18]
fabs
fcomp qword [0x5dafe8]
fnstsw ax
test ah, 1
je 0x40b1fa
mov ecx, 1
jmp 0x40b1fc
xor ecx, ecx
fld dword [esp + 0x28]
fsub dword [esp + 0x18]
fabs
fcomp qword [0x5dafe8]
fnstsw ax
test ah, 1
je 0x40b21a
mov eax, 1
jmp 0x40b21c
xor eax, eax
test ecx, ecx
je 0x40b25e
test eax, eax
jne 0x40b608
add edi, ebx
mov eax, dword [esi + 0x54]
imul edi, dword [esp + 0x14]
mov dword [esp + 0x54], edi
fild dword [esp + 0x54]
fmul qword [0x5daff8]
fld dword [esi + eax*4 + 0x98]
fmul dword [0x5db258]
fsubp st(1)
call fcn.00573170
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret 4
test eax, eax
je 0x40b29c
mov eax, dword [esp + 0x2c]
mov ecx, dword [esi + 0x54]
sub ebx, eax
imul ebx, dword [esp + 0x14]
fld dword [esi + ecx*4 + 0x98]
fmul dword [0x5db258]
mov dword [esp + 0x54], ebx
fild dword [esp + 0x54]
fmul qword [0x5daff8]
faddp st(1)
call fcn.00573170
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret 4
mov eax, edi
mov edi, dword [esp + 0x2c]
sub eax, edi
cdq
sub eax, edx
sar eax, 1
add eax, ebx
imul eax, dword [esp + 0x14]
mov dword [esp + 0x54], eax
fild dword [esp + 0x54]
fmul qword [0x5daff8]
call fcn.00573170
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret 4
fld qword [0x5db030]
fdiv qword [esp + 0x48]
fadd qword [0x5daf38]
call fcn.00573170
mov edi, eax
push ebx
mov ecx, esi
mov dword [esp + 0x20], edi
call fcn.005021d0
fstp dword [esp + 0x20]
cmp edi, 1
mov dword [esp + 0x10], 1
jl 0x40b38b
lea ebp, [ebx + 1]
lea edi, [ebx - 1]
test edi, edi
jl 0x40b608
cmp ebp, 0x3ff
jg 0x40b608
push edi
mov ecx, esi
call fcn.005021d0
fstp dword [esp + 0x18]
push ebp
mov ecx, esi
call fcn.005021d0
fld dword [esp + 0x18]
fcomp st(1)
fnstsw ax
test ah, 0x41
jne 0x40b346
fld dword [esp + 0x18]
jmp 0x40b348
fld st(0)
fld dword [esp + 0x20]
fcomp st(1)
fnstsw ax
test ah, 0x41
fstp st(0)
je 0x40b376
fld dword [esp + 0x18]
fcomp st(1)
fnstsw ax
test ah, 0x41
jne 0x40b370
mov edx, dword [esp + 0x18]
fstp st(0)
mov dword [esp + 0x20], edx
jmp 0x40b378
fstp dword [esp + 0x20]
jmp 0x40b378
fstp st(0)
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
inc eax
dec edi
inc ebp
cmp eax, ecx
mov dword [esp + 0x10], eax
jle 0x40b30b
fld qword [0x5db028]
fdiv qword [esp + 0x48]
mov dword [esp + 0x2c], 0
call fcn.00573170
fld qword [0x5db020]
fdiv qword [esp + 0x48]
mov ebp, eax
mov dword [esp + 0x1c], ebp
fadd qword [0x5daf38]
call fcn.00573170
cmp ebp, eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x10], ebp
jg 0x40b420
mov eax, dword [esp + 0x1c]
mov edi, ebx
add ebp, ebx
sub edi, eax
test edi, edi
jl 0x40b608
cmp ebp, 0x3ff
jg 0x40b608
push edi
mov ecx, esi
call fcn.005021d0
fstp dword [esp + 0x3c]
push ebp
mov ecx, esi
call fcn.005021d0
fadd dword [esp + 0x3c]
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x38]
inc eax
dec edi
fadd dword [esp + 0x2c]
inc ebp
cmp eax, ecx
mov dword [esp + 0x10], eax
fstp dword [esp + 0x2c]
jle 0x40b3d3
mov ebp, dword [esp + 0x1c]
mov eax, ecx
sub eax, ebp
lea eax, [eax + eax + 2]
mov dword [esp + 0x3c], eax
fild dword [esp + 0x3c]
fdivr dword [esp + 0x2c]
fsubr dword [esp + 0x20]
fcomp dword [0x5db018]
fnstsw ax
test ah, 1
jne 0x40b608
fld qword [0x5db008]
fdiv qword [esp + 0x48]
call fcn.00573170
fild dword [esp + 0x24]
mov ecx, ebx
mov dword [esp + 0x34], eax
sub ecx, eax
add eax, ebx
fstp dword [esp + 0x3c]
mov dword [esp + 0x38], ecx
mov dword [esp + 0x20], 0x7149f2ca
fild dword [esp + 0x38]
mov dword [esp + 0x38], eax
fstp dword [esp + 0x10]
fild dword [esp + 0x38]
fstp dword [esp + 0x1c]
fld dword [esp + 0x10]
fcomp dword [esp + 0x1c]
fnstsw ax
test ah, 0x41
je 0x40b5e9
fild dword [esp + 0x34]
fstp dword [esp + 0x28]
fld dword [0x5db004]
fcomp dword [esp + 0x28]
mov dword [esp + 0x24], 0
mov dword [esp + 0x18], 0
fnstsw ax
test ah, 0x41
je 0x40b5ad
fld dword [esp + 0x18]
fadd dword [esp + 0x10]
fstp dword [esp + 0x2c]
fld dword [esp + 0x10]
fsub dword [esp + 0x18]
fst dword [esp + 0x34]
fld dword [esp + 0x2c]
fcomp dword [0x5db004]
fnstsw ax
test ah, 1
jne 0x40b606
fcomp dword [0x5db2c8]
fnstsw ax
test ah, 0x41
je 0x40b608
fld dword [esp + 0x2c]
call fcn.00573170
mov edi, eax
mov ecx, esi
push edi
mov dword [esp + 0x44], edi
call fcn.005021d0
fstp dword [esp + 0x38]
inc edi
mov ecx, esi
push edi
call fcn.005021d0
fstp dword [esp + 0x44]
fld dword [esp + 0x34]
call fcn.00573170
mov edi, eax
mov ecx, esi
push edi
mov dword [esp + 0x4c], edi
call fcn.005021d0
fstp dword [esp + 0x30]
fild dword [esp + 0x40]
inc edi
mov ecx, esi
push edi
fsubr dword [esp + 0x30]
fld dword [esp + 0x48]
fsub dword [esp + 0x3c]
fmulp st(1)
fadd dword [esp + 0x3c]
fstp dword [esp + 0x48]
call fcn.005021d0
fsub dword [esp + 0x30]
fild dword [esp + 0x48]
fsubr dword [esp + 0x34]
fmulp st(1)
fadd dword [esp + 0x30]
fsubr dword [esp + 0x44]
fld st(0)
fmul st(1)
fadd dword [esp + 0x24]
fstp dword [esp + 0x24]
fstp st(0)
fld dword [esp + 0x18]
fadd dword [0x5db000]
fst dword [esp + 0x18]
fcomp dword [esp + 0x28]
fnstsw ax
test ah, 0x41
jne 0x40b4c8
fld dword [esp + 0x24]
fcomp dword [esp + 0x20]
fnstsw ax
test ah, 1
je 0x40b5cc
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x20], edx
mov dword [esp + 0x3c], eax
fld dword [esp + 0x10]
fadd dword [0x5db000]
fst dword [esp + 0x10]
fcomp dword [esp + 0x1c]
fnstsw ax
test ah, 0x41
jne 0x40b4a3
fild dword [esp + 0x14]
fmul dword [esp + 0x3c]
fmul qword [0x5daff8]
call fcn.00573170
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret 4
fstp st(0)
mov eax, dword [esp + 0x54]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret 4