Function at 0x413353
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push edi
mov edi, dword [ebp + 8]
test edi, edi
je 0x413614
cmp dword [ebp + 0x10], 0
je 0x413614
cmp dword [ebp + 0x14], 0
je 0x413614
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x413614
push esi
mov esi, dword [ebp + 0x1c]
push dword [ebp + 0x20]
shl esi, 4
add esi, dword [eax + 0x18]
push esi
mov eax, dword [esi + 4]
mov dword [ebp - 0x10], eax
call fcn.00413175
push eax
push esi
call fcn.0041313b
add esp, 0x10
mov dword [ebp - 8], eax
cmp dword [ebp + 0x24], 0
mov eax, dword [esi + 0xc]
mov dword [ebp - 0xc], eax
je 0x4133df
xor ecx, ecx
mov eax, ecx
mov esi, 0x200
cdq
idiv esi
xor eax, edx
mov edx, 0xffffff
test al, 4
mov eax, 0xc0c0c0
cmovne eax, edx
mov dword [edi + ecx*4], eax
inc ecx
cmp ecx, 0x20000
jl 0x4133b8
mov eax, dword [ebp + 0x18]
and dword [ebp - 4], 0
mov esi, dword [ebp - 8]
mov ecx, dword [eax + 0x1c]
test ecx, ecx
je 0x413425
mov eax, dword [ebp + 0x10]
mov edx, dword [eax + 0x48]
test edx, edx
je 0x413425
xor eax, eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0x1c]
mov eax, dword [ecx + eax*4]
mov ecx, dword [eax + esi*4]
mov eax, dword [edx + ecx*8]
and dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], eax
mov eax, dword [edx + ecx*8 + 4]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x1c]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x10]
movzx eax, ax
test eax, eax
jne 0x41349b
mov eax, dword [ebp - 0xc]
sub esp, 0x10
fld1
mov ecx, dword [ebp + 0x2c]
mov eax, dword [eax + esi*8]
fst dword [esp + 0xc]
fldz
fst dword [esp + 8]
movzx eax, word [eax]
imul esi, eax, 0x1c
mov eax, dword [ebp + 0x14]
fstp dword [esp + 4]
fstp dword [esp]
add esi, dword [eax + 0x20]
push 0xffffffffffffffff
push 0
mov eax, dword [esi + 0x14]
add eax, dword [esi + 0xc]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [esi + 0x10]
add eax, dword [esi + 8]
sub ecx, 0xffffff80
push ecx
mov ecx, dword [ebp + 0x28]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [ebp + 0x14]
add ecx, 0x100
push ecx
push dword [ebp - 4]
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [eax + 0x1c]
push esi
jmp 0x413606
cmp eax, 1
jne 0x41358c
mov eax, dword [ebp - 0xc]
sub esp, 0x10
movss xmm4, dword [0x439354]
movaps xmm1, xmm4
mov edi, dword [eax + esi*8]
movzx eax, word [edi + 2]
mov dword [ebp - 0x10], eax
fild dword [ebp - 0x10]
movzx eax, word [edi]
movsx ecx, word [edi + 0xe]
cvtsi2ss xmm2, dword [edi + 8]
fmul dword [0x439bac]
cvtsi2ss xmm3, dword [edi + 4]
fmul dword [0x439bb4]
mulss xmm2, dword [0x439bb0]
mulss xmm3, dword [0x439bb0]
fld st(0)
imul esi, eax, 0x1c
fsin
mov eax, dword [ebp + 0x14]
add esi, dword [eax + 0x20]
mov eax, dword [esi + 0x14]
add eax, dword [esi + 0xc]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [ebp + 0x2c]
sub eax, 0xffffff80
add eax, ecx
movsx ecx, word [edi + 0xc]
divss xmm1, xmm2
fstp dword [ebp - 0xc]
divss xmm4, xmm3
fcos
movaps xmm0, xmm1
mulss xmm1, dword [ebp - 0xc]
fstp dword [ebp - 8]
mulss xmm0, dword [ebp - 8]
xorps xmm1, xmmword [0x439bc0]
movss dword [esp + 0xc], xmm0
movaps xmm0, xmm4
mulss xmm0, dword [ebp - 0xc]
mulss xmm4, dword [ebp - 8]
movss dword [esp + 8], xmm1
movss dword [esp + 4], xmm0
movss dword [esp], xmm4
push 0xffffffffffffffff
push 0
push eax
mov eax, dword [esi + 0x10]
add eax, dword [esi + 8]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [ebp + 0x28]
add eax, 0x100
add eax, ecx
push eax
push dword [ebp - 4]
mov eax, dword [ebp + 0x14]
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [eax + 0x1c]
push esi
jmp 0x413603
cmp eax, 2
jne 0x41360f
mov eax, dword [ebp - 0xc]
sub esp, 0x10
fld1
mov esi, dword [eax + esi*8]
fst dword [esp + 0xc]
fldz
fst dword [esp + 8]
movzx eax, word [esi]
imul edi, eax, 0x1c
mov eax, dword [ebp + 0x14]
movsx ecx, word [esi + 6]
fstp dword [esp + 4]
add edi, dword [eax + 0x20]
fstp dword [esp]
push 0xffffffffffffffff
push 0
mov eax, dword [edi + 0x14]
add eax, dword [edi + 0xc]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [ebp + 0x2c]
sub eax, 0xffffff80
add eax, ecx
movsx ecx, word [esi + 4]
push eax
mov eax, dword [edi + 0x10]
add eax, dword [edi + 8]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [ebp + 0x28]
add eax, 0x100
add eax, ecx
push eax
push dword [ebp - 4]
mov eax, dword [ebp + 0x14]
push dword [ebp + 0xc]
push dword [ebp + 0x10]
push dword [eax + 0x1c]
push edi
mov edi, dword [ebp + 8]
push edi
call fcn.00414569
add esp, 0x38
mov eax, edi
pop esi
jmp 0x413616
xor eax, eax
pop edi
mov esp, ebp
pop ebp
ret