Function at 0x5132d0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [ebp + 0x10]
movsd xmm1, qword [0x5fb588]
push esi
push edi
movd xmm0, eax
cvtdq2pd xmm0, xmm0
sar eax, 2
mov dword [ebp - 0xc], eax
lea esi, [eax*8]
push esi
divsd xmm1, xmm0
movsd qword [ebp - 0x30], xmm1
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
push esi
mov dword [ebp - 4], eax
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
movsd xmm0, qword [ebp - 0x30]
add esp, 8
mov edi, eax
mov dword [ebp - 0x24], edi
call sub.api_ms_win_crt_math_l1_1_0.dll__libm_sse2_cos_precise
movsd qword [ebp - 0x48], xmm0
movsd xmm0, qword [ebp - 0x30]
call sub.api_ms_win_crt_math_l1_1_0.dll__libm_sse2_sin_precise
movsd qword [ebp - 0x50], xmm0
movsd xmm0, qword [ebp - 0x30]
mulsd xmm0, qword [0x5fa5e0]
movsd qword [ebp - 0x30], xmm0
call sub.api_ms_win_crt_math_l1_1_0.dll__libm_sse2_cos_precise
movsd qword [ebp - 0x38], xmm0
movsd xmm0, qword [ebp - 0x30]
call sub.api_ms_win_crt_math_l1_1_0.dll__libm_sse2_sin_precise
mov eax, dword [ebp + 0x10]
movaps xmm7, xmm0
movsd xmm6, qword [ebp - 0x38]
mov ecx, eax
mov edx, dword [ebp - 0xc]
xor esi, esi
sar ecx, 1
movaps xmm4, xmm6
movsd qword [ebp - 0x40], xmm7
movaps xmm5, xmm7
mov dword [ebp - 0x10], ecx
test edx, edx
jle 0x513481
mov edi, dword [ebp + 0xc]
sar eax, 3
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0x20], eax
lea ecx, [edi + edx*8]
lea eax, [ecx - 8]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0x10]
dec eax
add eax, edx
dec edx
lea eax, [edi + eax*8]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x10]
add eax, edx
lea edx, [edi + eax*8]
mov eax, dword [ebp - 0xc]
sub eax, dword [ebp - 0x10]
lea edi, [edi + eax*8]
add eax, dword [ebp + 0x10]
mov dword [ebp - 0x18], edi
mov edi, dword [ebp + 0xc]
lea eax, [edi + eax*8]
mov edi, dword [ebp - 0x24]
sub edi, dword [ebp - 4]
mov dword [ebp - 0x2c], edi
mov edi, dword [ebp - 0x1c]
mov dword [ebp - 0x14], eax
movsd xmm3, qword [edx]
cmp esi, dword [ebp - 0x28]
jge 0x5133f4
mov eax, dword [ebp - 0x14]
movsd xmm2, qword [ecx]
addsd xmm3, qword [eax]
mov eax, dword [ebp - 8]
subsd xmm2, qword [eax]
jmp 0x513403
mov eax, dword [ebp - 0x18]
movsd xmm2, qword [edi]
addsd xmm2, qword [ecx]
subsd xmm3, qword [eax]
mov eax, dword [ebp - 0x20]
movaps xmm1, xmm2
mov edi, dword [ebp - 0x2c]
movaps xmm0, xmm3
add dword [ebp - 0x14], 0x10
inc esi
add dword [ebp - 0x18], 0x10
add ecx, 0x10
sub dword [ebp - 8], 0x10
sub edx, 0x10
add dword [ebp - 0x20], 8
mulsd xmm1, xmm5
mulsd xmm0, xmm4
mulsd xmm2, xmm4
mulsd xmm3, xmm5
addsd xmm1, xmm0
movaps xmm0, xmm5
mulsd xmm0, qword [ebp - 0x50]
mulsd xmm5, qword [ebp - 0x48]
subsd xmm2, xmm3
movsd qword [edi + eax], xmm1
movaps xmm1, xmm4
mulsd xmm4, qword [ebp - 0x48]
mov edi, dword [ebp - 0x1c]
mulsd xmm1, qword [ebp - 0x50]
sub edi, 0x10
mov dword [ebp - 0x1c], edi
movsd qword [eax], xmm2
subsd xmm4, xmm0
addsd xmm5, xmm1
cmp esi, dword [ebp - 0xc]
jl 0x5133d7
mov edi, dword [ebp - 0x24]
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp - 4]
cmp eax, 0x100
je 0x513496
cmp eax, 0x800
jne 0x5134b2
push 9
jmp 0x513498
push 6
push esi
push edi
push dword [ebp + 8]
call fcn.005105b0
mov eax, dword [ebp + 0x10]
add esp, 0x10
movsd xmm7, qword [ebp - 0x40]
movsd xmm6, qword [ebp - 0x38]
mov ecx, dword [ebp - 0xc]
test ecx, ecx
jle 0x513583
mov edx, dword [ebp + 0xc]
movsd xmm4, qword [0x619f20]
mov dword [ebp - 0x20], edx
sub edx, 8
mov dword [ebp + 0x10], edi
lea eax, [edx + eax*8]
mov edx, esi
mov esi, dword [ebp + 0xc]
sub edx, edi
mov dword [ebp - 0x1c], eax
xor edi, edi
mov eax, dword [ebp + 0x10]
movsd xmm1, qword [eax]
movsd xmm3, qword [eax + edx]
movaps xmm2, xmm1
mov eax, dword [ebp - 0x20]
movaps xmm0, xmm3
mulsd xmm0, xmm7
add dword [ebp - 0x20], 0x10
mulsd xmm2, xmm6
mulsd xmm3, xmm6
mulsd xmm1, xmm7
addsd xmm2, xmm0
subsd xmm3, xmm1
movaps xmm1, xmm6
mulsd xmm6, qword [ebp - 0x48]
addsd xmm2, xmm2
mulsd xmm1, qword [ebp - 0x50]
addsd xmm3, xmm3
movaps xmm0, xmm2
xorps xmm0, xmm4
movsd qword [eax], xmm0
movaps xmm0, xmm7
mov eax, dword [ebp - 0x10]
mulsd xmm0, qword [ebp - 0x50]
sub eax, edi
mulsd xmm7, qword [ebp - 0x48]
movsd qword [esi + eax*8 - 8], xmm3
xorps xmm3, xmm4
mov eax, dword [ebp - 0x10]
subsd xmm6, xmm0
add eax, edi
add edi, 2
addsd xmm7, xmm1
movsd qword [esi + eax*8], xmm3
mov eax, dword [ebp - 0x1c]
sub dword [ebp - 0x1c], 0x10
movsd qword [eax], xmm2
mov eax, dword [ebp + 0x10]
add eax, 8
mov dword [ebp + 0x10], eax
sub ecx, 1
jne 0x5134e3
mov edi, dword [ebp - 0x24]
mov esi, dword [ebp - 4]
test edi, edi
je 0x513590
push edi
call fcn.0055241f
add esp, 4
test esi, esi
je 0x51359d
push esi
call fcn.0055241f
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
ret