Function at 0x1003e340
Capabilities:
Encode data using xor

Disassembly:
sub esp, 8
push esi
mov esi, dword [esp + 0x14]
push edi
mov edi, ecx
test esi, esi
jle 0x1003e6f7
cmp dword [esp + 0x14], esi
jle 0x1003e6f7
mov eax, dword [edi]
push 0xf00
add eax, 8
push 0
push eax
call fcn.1004baa0
mov eax, dword [edi]
add esp, 0xc
mov ecx, dword [esp + 0x14]
mov dword [eax + 8], ecx
mov eax, dword [edi]
mov dword [eax + 0xc], esi
mov eax, dword [edi]
movd xmm1, dword [eax + 8]
movd xmm0, dword [eax + 0xc]
cvtdq2pd xmm1, xmm1
cvtdq2pd xmm0, xmm0
divsd xmm1, xmm0
divsd xmm1, qword [0x1007bb48]
movsd qword [eax + 0x50], xmm1
mov ecx, dword [edi]
movsd xmm1, qword [0x1007bb50]
movsd xmm0, qword [ecx + 0x50]
mulsd xmm0, xmm1
cvttsd2si eax, xmm0
mov dword [ecx + 0x10], eax
cmp byte [edi + 0xa], 0
mov esi, dword [edi]
je 0x1003e426
movsd xmm2, qword [esi + 0x50]
comisd xmm2, xmmword [0x10076978]
jbe 0x1003e426
movsd xmm0, qword [0x1007bda8]
divsd xmm0, xmm2
call fcn.1004a310
mov dword [esi + 0x5c], eax
mov eax, dword [edi]
movsd xmm1, qword [0x1007bb50]
mov dword [eax + 0x58], 0
mov ecx, dword [edi]
movd xmm0, dword [ecx + 8]
cvtdq2pd xmm0, xmm0
divsd xmm0, qword [0x1007bb48]
cvttsd2si eax, xmm0
movsd xmm0, qword [0x10076978]
mov dword [ecx + 0xc], eax
mov eax, dword [edi]
movsd qword [eax + 0x50], xmm0
jmp 0x1003e436
mov dword [esi + 0x5c], 0x4000
mov eax, dword [edi]
mov dword [eax + 0x58], 0
xor eax, eax
mov dword [esp + 0x18], 0xf08
mov dword [esp + 0x14], eax
mov esi, dword [edi]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
mulsd xmm0, qword [esi + 0x50]
mulsd xmm0, xmm1
mulsd xmm0, qword [0x1008bc68]
call fcn.1004a310
mov ecx, dword [esp + 0x18]
movsd xmm1, qword [0x1007bb50]
mov dword [esi + ecx], eax
add ecx, 4
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], eax
cmp ecx, 0x2f08
jl 0x1003e444
mov eax, dword [edi]
xor ecx, ecx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], 0x3118
mov dword [eax + 0x2f08], 0
mov eax, dword [edi]
mov dword [eax + 0x3108], 0
mov eax, dword [edi]
mov dword [eax + 0x2f0c], 0
mov eax, dword [edi]
mov dword [eax + 0x310c], 0
mov eax, dword [edi]
mov dword [eax + 0x2f10], 0
mov eax, dword [edi]
mov dword [eax + 0x3110], 0
mov eax, dword [edi]
mov dword [eax + 0x2f14], 0
mov eax, dword [edi]
mov dword [eax + 0x3114], 0
nop dword [eax]
mov esi, dword [edi]
mov eax, ecx
and eax, 3
sar ecx, 2
movd xmm1, eax
mov eax, 1
cvtdq2pd xmm1, xmm1
shl eax, cl
movd xmm0, eax
mulsd xmm1, qword [0x1007bd78]
cvtdq2pd xmm0, xmm0
addsd xmm1, qword [0x10076978]
mulsd xmm1, qword [esi + 0x50]
mulsd xmm1, xmm0
mulsd xmm1, qword [0x1007bdc8]
movaps xmm0, xmm1
movsd qword [esp + 8], xmm1
divsd xmm0, qword [0x1007bdb0]
call fcn.1004a310
movsd xmm0, qword [esp + 8]
divsd xmm0, qword [0x1007bdb8]
mov ecx, dword [esp + 0x14]
mov dword [esi + ecx - 0x200], eax
call fcn.1004a310
mov edx, dword [esp + 0x14]
mov ecx, dword [edi]
mov dword [edx + ecx], eax
add edx, 4
mov ecx, dword [esp + 0x18]
inc ecx
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], ecx
cmp edx, 0x3208
jl 0x1003e500
mov edx, 0x3208
mov ecx, dword [edi]
mov eax, dword [ecx + 0x3004]
mov dword [ecx + edx - 0x200], eax
mov ecx, dword [edi]
mov eax, dword [ecx + 0x3204]
mov dword [ecx + edx], eax
mov ecx, dword [edi]
mov eax, dword [ecx + 0x3004]
mov dword [ecx + edx - 0x1fc], eax
mov ecx, dword [edi]
mov eax, dword [ecx + 0x3204]
mov dword [ecx + edx + 4], eax
mov ecx, dword [edi]
mov eax, dword [ecx + 0x3004]
mov dword [ecx + edx - 0x1f8], eax
mov ecx, dword [edi]
mov eax, dword [ecx + 0x3204]
mov dword [ecx + edx + 8], eax
mov ecx, dword [edi]
mov eax, dword [ecx + 0x3004]
mov dword [ecx + edx - 0x1f4], eax
mov ecx, dword [edi]
mov eax, dword [ecx + 0x3204]
mov dword [ecx + edx + 0xc], eax
add edx, 0x10
cmp edx, 0x3288
jl 0x1003e5a0
movsd xmm1, qword [0x10076ae0]
mov edx, 0x3488
movsd xmm2, qword [0x1007bb38]
mov esi, 0x1007bc90
mov dword [esp + 0x14], 0x20
movzx eax, byte [esi]
inc esi
mov ecx, dword [edi]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
mulsd xmm0, qword [ecx + 0x50]
mulsd xmm0, xmm2
cvttsd2si eax, xmm0
xorps xmm0, xmm1
mov dword [ecx + edx - 0x200], eax
mov eax, dword [edi]
cvttsd2si ecx, xmm0
mov dword [edx + eax], ecx
add edx, 4
sub dword [esp + 0x14], 1
jne 0x1003e638
cmp esi, 0x1007bd10
jl 0x1003e630
mov eax, dword [edi]
mov esi, 0x7508
mov ecx, dword [eax + 0x5c]
imul ecx, dword [eax + 0xc]
mov eax, str.p_n
mov dword [esp + 0x14], eax
shr ecx, 0xe
movd xmm1, ecx
cvtdq2pd xmm1, xmm1
shr ecx, 0x1f
addsd xmm1, qword [ecx*8 + 0x10077640]
movsd qword [esp + 8], xmm1
nop dword [eax]
movsd xmm0, qword [eax]
mulsd xmm0, qword [0x1007bdc8]
divsd xmm0, xmm1
call fcn.1004a310
mov ecx, dword [edi]
movsd xmm1, qword [esp + 8]
mov dword [esi + ecx], eax
add esi, 4
mov eax, dword [esp + 0x14]
add eax, 8
mov dword [esp + 0x14], eax
cmp esi, 0x7528
jl 0x1003e6b0
mov ecx, edi
call fcn.1003e710
pop edi
xor eax, eax
pop esi
add esp, 8
ret 8
pop edi
or eax, 0xffffffff
pop esi
add esp, 8
ret 8