Function at 0x40d6e0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x8c
fld qword [0x4d3998]
xorps xmm0, xmm0
push ebx
mov ebx, dword [esp + 0x98]
push ebp
push esi
push edi
mov edi, dword [esp + 0xa0]
sub esp, 8
fstp qword [esp]
push edi
movss dword [esp + 0x3c], xmm0
movss dword [esp + 0x40], xmm0
call fcn.0040d470
mov eax, dword [ebx + 8]
xor ebp, ebp
mov dword [esp + 0x38], ebp
test eax, eax
jbe 0x40dc08
jmp 0x40d737
mov edi, dword [esp + 0xa0]
mov ecx, ebp
mov dword [esp + 0x18], ecx
fild dword [esp + 0x18]
test ecx, ecx
jge 0x40d74b
fadd qword [0x4d3588]
fmul qword [0x4d3520]
mov dword [esp + 0x18], eax
fild dword [esp + 0x18]
test eax, eax
jge 0x40d763
fadd qword [0x4d3588]
mov edx, dword [edi + 0xaf4]
fdivp st(1)
fild dword [edi + 0xaf4]
test edx, edx
jge 0x40d77b
fadd qword [0x4d3588]
faddp st(1)
push 0
push 0
lea esi, [esp + 0x88]
fstp dword [esp + 0x20]
cvtss2sd xmm0, dword [esp + 0x20]
movsd qword [esp + 0x80], xmm0
call fcn.0042ab10
movsd xmm0, qword [esp + 0x80]
add esp, 8
comisd xmm0, xmmword [0x4d3480]
jb 0x40d7c3
cvtpd2ps xmm0, xmm0
movss dword [esp + 0x94], xmm0
lea eax, [esp + 0x80]
push eax
push 0
push 0
lea ecx, [edi + 0xac0]
mov esi, edi
call fcn.0040f500
cvtsd2ss xmm0, xmm0
movss dword [esp + 0x54], xmm0
fld dword [esp + 0x54]
fistp dword [esp + 0x48]
cvtsi2sd xmm0, dword [esp + 0x48]
cvtsd2ss xmm0, xmm0
movss dword [esp + 0x3c], xmm0
fld dword [esp + 0x3c]
push ecx
fstp dword [esp]
call fcn.0040d090
fldz
sub esp, 8
fst dword [esp + 4]
lea ecx, [esp + 0x30]
fstp dword [esp]
lea eax, [esp + 0x24]
fld dword [esp + 0x44]
push ecx
push ecx
fstp dword [esp]
lea ecx, [esp + 0x3c]
movss dword [esp + 0x70], xmm0
call fcn.00429c30
movss xmm0, dword [esp + 0x4c]
add esp, 0x10
comiss xmm0, dword [0x4d3a20]
jbe 0x40d8f9
movsd xmm2, qword [0x4d3a18]
cvtps2pd xmm1, xmm0
comisd xmm2, xmm1
jbe 0x40d8f9
cvtps2pd xmm0, xmm0
subsd xmm0, qword [0x4d3638]
cvtpd2ps xmm0, xmm0
call fcn.004239a0
cvtss2sd xmm0, xmm0
divsd xmm0, qword [0x4d3a10]
cvtsd2ss xmm1, xmm0
movss xmm0, dword [esp + 0x2c]
cvtps2pd xmm2, xmm0
movsd xmm0, qword [0x4bab50]
subsd xmm2, xmm0
cvtss2sd xmm3, xmm1
mulsd xmm2, xmm3
addsd xmm2, xmm0
cvtsd2ss xmm3, xmm2
movss xmm2, dword [esp + 0x1c]
cvtps2pd xmm2, xmm2
cvtss2sd xmm4, xmm1
subsd xmm2, xmm0
mulsd xmm2, xmm4
movss xmm4, dword [esp + 0x28]
cvtps2pd xmm4, xmm4
subsd xmm4, xmm0
cvtss2sd xmm1, xmm1
mulsd xmm4, xmm1
addsd xmm2, xmm0
addsd xmm4, xmm0
cvtpd2ps xmm2, xmm2
cvtpd2ps xmm1, xmm4
movss dword [esp + 0x2c], xmm3
movss dword [esp + 0x1c], xmm2
movss dword [esp + 0x28], xmm1
jmp 0x40d90b
movss xmm1, dword [esp + 0x28]
movss xmm2, dword [esp + 0x1c]
movss xmm3, dword [esp + 0x2c]
cvtss2sd xmm4, xmm2
cvtss2sd xmm5, xmm3
comisd xmm4, xmm5
movaps xmm0, xmm3
jbe 0x40d91f
movaps xmm0, xmm2
cvtss2sd xmm4, xmm1
cvtps2pd xmm5, xmm0
comisd xmm4, xmm5
jbe 0x40d92f
movaps xmm0, xmm1
xorps xmm4, xmm4
ucomiss xmm0, xmm4
lahf
test ah, 0x44
jnp 0x40d97a
cvtps2pd xmm5, xmm0
cvtss2sd xmm3, xmm3
divsd xmm3, xmm5
cvtps2pd xmm5, xmm0
cvtss2sd xmm2, xmm2
cvtss2sd xmm1, xmm1
cvtps2pd xmm0, xmm0
divsd xmm2, xmm5
divsd xmm1, xmm0
cvtsd2ss xmm3, xmm3
cvtpd2ps xmm2, xmm2
cvtsd2ss xmm1, xmm1
movss dword [esp + 0x2c], xmm3
movss dword [esp + 0x1c], xmm2
movss dword [esp + 0x28], xmm1
comiss xmm4, xmm3
jbe 0x40d988
movaps xmm3, xmm4
movss dword [esp + 0x2c], xmm3
comiss xmm4, xmm2
jbe 0x40d996
movaps xmm2, xmm4
movss dword [esp + 0x1c], xmm2
comiss xmm4, xmm1
jbe 0x40d9a4
movaps xmm1, xmm4
movss dword [esp + 0x28], xmm1
movsd xmm0, qword [0x4d3580]
cvtss2sd xmm3, xmm3
mulsd xmm3, xmm0
cvtsd2ss xmm3, xmm3
movss dword [esp + 0x64], xmm3
fld dword [esp + 0x64]
fistp dword [esp + 0x4c]
cvtss2sd xmm2, xmm2
mulsd xmm2, xmm0
cvtpd2ps xmm2, xmm2
movss dword [esp + 0x58], xmm2
fld dword [esp + 0x58]
fistp dword [esp + 0x44]
cvtss2sd xmm1, xmm1
mulsd xmm1, xmm0
cvtsd2ss xmm0, xmm1
movss dword [esp + 0x5c], xmm0
fld dword [esp + 0x5c]
fistp dword [esp + 0x40]
mov eax, dword [esp + 0x4c]
or eax, 0x5000
shl eax, 8
or eax, dword [esp + 0x44]
shl eax, 8
or eax, dword [esp + 0x40]
mov ecx, eax
mov edx, eax
and edx, 0xffff00ff
mov esi, eax
and esi, 0xff00
shr ecx, 0x18
inc ecx
imul edx, ecx
imul esi, ecx
xor edx, esi
mov esi, eax
and esi, 0xff00ff
imul esi, ecx
and edx, 0xff0000
xor edx, esi
and eax, 0xff000000
shr edx, 8
or edx, eax
mov eax, ebp
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
test eax, eax
jge 0x40da60
fadd dword [0x4d3380]
mov ecx, dword [ebx + 0xc]
fstp dword [esp + 0x20]
fld dword [esp + 0x60]
fmul qword [0x4d3878]
fstp dword [esp + 0x14]
fld dword [esp + 0x14]
fsubr qword [0x4bab50]
fild dword [ebx + 0xc]
test ecx, ecx
jge 0x40da8c
fadd qword [0x4d3588]
fmulp st(1)
fstp dword [esp + 0x24]
fld dword [esp + 0x24]
fistp dword [esp + 0x50]
mov eax, dword [esp + 0x50]
mov dword [esp + 0x14], eax
test eax, eax
jge 0x40daac
xor eax, eax
mov dword [esp + 0x14], eax
mov esi, dword [ebx + 0xc]
dec esi
cmp esi, eax
jl 0x40db1a
mov eax, edx
shr eax, 0x18
mov edi, 0x100
sub edi, eax
mov ecx, dword [ebx + 4]
mov eax, dword [ebx + 0x10]
imul ecx, esi
add ecx, ebp
lea ebx, [eax + ecx*4]
mov eax, dword [ebx]
mov ecx, eax
and eax, 0xff00ff
shr ecx, 8
imul eax, edi
mov ebp, ecx
and ebp, 0xffff00ff
imul ebp, edi
and ecx, 0xff00ff
imul ecx, edi
shr eax, 8
xor eax, ebp
mov ebp, dword [esp + 0x38]
and eax, 0xff00ff
xor eax, ecx
add eax, edx
dec esi
cmp esi, dword [esp + 0x14]
mov dword [ebx], eax
mov ebx, dword [esp + 0xa4]
jge 0x40dac0
mov edi, dword [esp + 0xa0]
movss xmm0, dword [esp + 0x30]
ucomiss xmm0, xmm4
lahf
test ah, 0x44
jp 0x40db4a
movss xmm0, dword [esp + 0x34]
ucomiss xmm0, xmm4
lahf
test ah, 0x44
jp 0x40db4a
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], edx
jmp 0x40dba1
movss xmm0, dword [esp + 0x24]
cvtps2pd xmm1, xmm0
movsd xmm0, qword [0x4c88e8]
addsd xmm1, xmm0
cvtsd2ss xmm1, xmm1
movss dword [esp + 0x24], xmm1
movss xmm1, dword [esp + 0x20]
cvtps2pd xmm1, xmm1
addsd xmm1, xmm0
cvtpd2ps xmm0, xmm1
push ebx
lea edx, [esp + 0x24]
lea ecx, [esp + 0x34]
movss dword [esp + 0x24], xmm0
call fcn.00401fa0
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
add esp, 4
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], ecx
cvtss2sd xmm0, dword [esp + 0x18]
sub esp, 8
movsd qword [esp], xmm0
call fcn.0040f300
mov ecx, 0xff8ebbff
cmp eax, 1
jne 0x40dbc5
mov ecx, 0xffffcc73
jmp 0x40dbcf
cmp eax, 2
jne 0x40dbcf
mov ecx, 0xffff633d
mov eax, dword [ebx + 0xc]
mov dword [esp + 0x68], ebp
inc ebp
lea edx, [eax - 3]
mov dword [esp + 0x6c], edx
mov dword [esp + 0x70], ebp
mov dword [esp + 0x74], eax
cmp ecx, 0x1000000
jb 0x40dbf9
push ecx
push ebx
lea edi, [esp + 0x70]
call fcn.004744f0
mov eax, dword [ebx + 8]
mov dword [esp + 0x38], ebp
cmp ebp, eax
jb 0x40d730
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x8c
ret 8