Function at 0x101dd370
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0xc
mov eax, dword [esp + 0x1c]
xor edx, edx
sub eax, dword [esp + 0x18]
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
push esi
lea ecx, [eax - 1]
mov dword [esp + 0xc], 0
push edi
mov edi, dword [esp + 0x30]
mov dword [esp + 0x14], edx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x18], ecx
xor esi, esi
xor ebx, ebx
test edi, edi
jle 0x101dd3d6
mov eax, dword [ebp + ebx*4]
cdq
xor eax, edx
sub eax, edx
cmp eax, esi
mov edx, eax
mov eax, ebx
cmovle eax, dword [esp + 0x10]
cmovle edx, esi
inc ebx
mov dword [esp + 0x10], eax
mov esi, edx
cmp ebx, edi
jl 0x101dd3a8
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x10], eax
mov ebx, dword [esp + 0x2c]
mov eax, esi
cmp ebx, 1
jne 0x101dd3e9
sar eax, 1
and esi, ebx
add eax, esi
jmp 0x101dd3ee
sar eax, cl
inc eax
sar eax, 1
cmp eax, 0x7fff
jle 0x101dd43c
mov ecx, dword [esp + 0x10]
mov edx, 0x27ffe
cmp eax, edx
cmovl edx, eax
inc ecx
imul ecx, edx
mov eax, 0x7fff
sub eax, edx
shl eax, 0xe
cdq
sar ecx, 2
idiv ecx
add eax, 0xffbe
push eax
push edi
push ebp
call fcn.101dd2d0
mov edx, dword [esp + 0x20]
lea ecx, [ebx - 1]
inc edx
add esp, 0xc
mov dword [esp + 0x14], edx
cmp edx, 0xa
jl 0x101dd3a0
cmp edx, 0xa
jne 0x101dd4e4
xor edx, edx
test edi, edi
jle 0x101dd632
mov esi, dword [esp + 0x20]
cmp ebx, 1
jne 0x101dd49d
mov ecx, dword [ebp + edx*4]
mov eax, ecx
sar eax, 1
and ecx, 1
add eax, ecx
cmp eax, 0x7fff
jle 0x101dd473
mov eax, 0x7fff
jmp 0x101dd480
cmp eax, 0xffff8000
mov ecx, 0xffff8000
cmovl eax, ecx
movzx eax, ax
mov ecx, ebx
mov word [esi + edx*2], ax
cwde
shl eax, cl
mov dword [ebp + edx*4], eax
inc edx
cmp edx, edi
jl 0x101dd458
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
xor edx, edx
nop
mov eax, dword [ebp + edx*4]
lea ecx, [ebx - 1]
sar eax, cl
inc eax
sar eax, 1
cmp eax, 0x7fff
jle 0x101dd4ba
mov eax, 0x7fff
jmp 0x101dd4c7
cmp eax, 0xffff8000
mov ecx, 0xffff8000
cmovl eax, ecx
movzx eax, ax
mov ecx, ebx
mov word [esi + edx*2], ax
cwde
shl eax, cl
mov dword [ebp + edx*4], eax
inc edx
cmp edx, edi
jl 0x101dd4a0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
xor edx, edx
test edi, edi
jle 0x101dd632
cmp edi, 0x10
jb 0x101dd5e8
cmp ebx, 1
jne 0x101dd611
mov ebx, dword [esp + 0x20]
lea eax, [edi*4 - 4]
add eax, ebp
lea ecx, [edi - 1]
lea ecx, [ebx + ecx*2]
cmp ebx, eax
ja 0x101dd51f
cmp ecx, ebp
jae 0x101dd5f3
movaps xmm2, xmmword [0x101f3b40]
lea ecx, [ebx + 0x10]
mov esi, edi
lea eax, [ebp + 0x20]
and esi, 0xfffffff0
movups xmm1, xmmword [eax - 0x20]
lea eax, [eax + 0x40]
add edx, 0x10
movaps xmm0, xmm2
lea ecx, [ecx + 0x20]
andps xmm0, xmm1
psrad xmm1, 1
paddd xmm0, xmm1
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [ecx - 0x30], xmm0
movaps xmm0, xmm2
movups xmm1, xmmword [eax - 0x50]
andps xmm0, xmm1
psrad xmm1, 1
paddd xmm0, xmm1
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [ecx - 0x28], xmm0
movaps xmm0, xmm2
movups xmm1, xmmword [eax - 0x40]
andps xmm0, xmm1
psrad xmm1, 1
paddd xmm0, xmm1
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [ecx - 0x20], xmm0
movaps xmm0, xmm2
movups xmm1, xmmword [eax - 0x30]
andps xmm0, xmm1
psrad xmm1, 1
paddd xmm0, xmm1
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [ecx - 0x18], xmm0
cmp edx, esi
jl 0x101dd531
mov dword [esp + 0x14], edx
cmp edx, edi
jge 0x101dd632
jmp 0x101dd5ec
mov ebx, dword [esp + 0x20]
cmp dword [esp + 0x2c], 1
jne 0x101dd611
mov ecx, dword [ebp + edx*4]
mov eax, ecx
sar eax, 1
and ecx, 1
add eax, ecx
mov word [ebx + edx*2], ax
inc edx
cmp edx, edi
jl 0x101dd5f3
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov esi, dword [esp + 0x20]
xor edx, edx
mov ecx, dword [esp + 0x18]
nop dword [eax + eax]
mov eax, dword [ebp + edx*4]
sar eax, cl
inc eax
sar eax, 1
mov word [esi + edx*2], ax
inc edx
cmp edx, edi
jl 0x101dd620
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret