Function at 0x10022720
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x160
mov eax, dword [0x100a9040]
xor eax, esp
mov dword [esp + 0x15c], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x50], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x54], eax
push esi
mov esi, ecx
mov dword [esp + 0x4c], 0xf
push edi
mov edi, edx
mov dword [esp + 0x20], esi
mov dword [esp + 0x1c], edi
mov edx, 1
mov eax, dword [esi + 0x5c]
mov ecx, dword [esi + 4]
mov dword [esp + 0x28], eax
mov eax, dword [esi + 0x28]
mov dword [esp + 0x2c], eax
mov eax, dword [esi + 0x24]
mov dword [esp + 0x14], eax
mov eax, edi
sub eax, ecx
mov dword [esp + 0x24], ecx
mov ecx, dword [esi + 0xb8]
mov dword [esp + 0xc], eax
mov edi, dword [esp + 0xc]
shl edx, cl
mov ecx, dword [esi + 0x10]
sub edi, edx
sub eax, ecx
cmp eax, edx
mov eax, edi
mov edi, dword [esp + 0x1c]
cmovbe eax, ecx
cmp dword [esi + 0x18], 0
cmovne eax, ecx
mov ecx, 4
mov dword [esp + 0x44], eax
mov eax, dword [esi + 0xc4]
cmp eax, ecx
cmovb ecx, eax
mov eax, dword [esi + 0x50]
mov dword [esp + 0x54], eax
mov eax, 1
shl eax, cl
mov ecx, 0x18
cmp dword [esi + 0xdc], 0
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0xc]
jne 0x100229c1
mov edi, dword [esi + 0x1c]
sub eax, edi
cmp eax, 0x180
jbe 0x10022901
lea eax, [edi + 0x60]
mov dword [esp + 0x4c], eax
cmp edi, eax
jae 0x10022887
sub ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x24]
add edx, 8
mov dword [esp + 0x30], ecx
mov dword [esp + 0x18], edx
nop word [eax + eax]
imul edx, dword [edi + edx], 0x9e3779b1
mov eax, edi
and eax, 7
xor edx, dword [esi + 0x50]
shr edx, cl
mov ecx, dword [esi + eax*4 + 0x2c]
mov dword [esi + eax*4 + 0x2c], edx
mov esi, ecx
mov edx, dword [esp + 0x2c]
mov eax, 0
shr esi, 4
and esi, 0xffffff0
mov dword [esp + 0x10], ecx
add edx, esi
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, dword [esp + 0x50]
add ecx, eax
mov eax, dword [esp + 0x10]
mov byte [edx], cl
mov byte [ecx + edx], al
lea eax, [ecx + esi]
mov ecx, dword [esp + 0x28]
mov esi, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov dword [ecx + eax*4], edi
inc edi
mov ecx, dword [esp + 0x30]
cmp edi, dword [esp + 0x4c]
jb 0x10022820
mov edi, dword [esp + 0xc]
mov ecx, dword [esp + 0x1c]
add edi, 0xffffffe0
mov eax, dword [esp + 0x24]
inc ecx
add eax, edi
mov dword [esp + 0x30], edi
mov edx, edi
mov dword [esp + 0x10], edx
cmp eax, ecx
jbe 0x100228ab
xor ecx, ecx
jmp 0x100228b2
sub ecx, dword [esp + 0x24]
sub ecx, edi
inc ecx
mov eax, 8
cmp ecx, eax
cmova ecx, eax
add ecx, edi
mov dword [esp + 0x18], ecx
cmp edi, ecx
lea ecx, [eax + 0x10]
jae 0x10022901
sub ecx, dword [esi + 0x24]
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x24]
imul edx, dword [edx + eax], 0x9e3779b1
mov eax, dword [esp + 0x10]
and eax, 7
xor edx, dword [esi + 0x50]
shr edx, cl
mov dword [esi + eax*4 + 0x2c], edx
mov edx, dword [esp + 0x10]
inc edx
mov dword [esp + 0x10], edx
cmp edx, edi
jb 0x100228d0
mov edi, dword [esp + 0x30]
mov ecx, 0x18
mov eax, dword [esi + 0x5c]
mov edx, dword [esi + 4]
mov dword [esp + 0x4c], eax
mov eax, dword [esi + 0x28]
mov dword [esp + 0x18], eax
mov dword [esp + 0x38], edx
cmp edi, dword [esp + 0xc]
jae 0x1002298b
sub ecx, dword [esi + 0x24]
mov dword [esp + 0x10], ecx
imul edx, dword [edi + edx + 8], 0x9e3779b1
mov eax, edi
and eax, 7
xor edx, dword [esi + 0x50]
shr edx, cl
mov ecx, dword [esi + eax*4 + 0x2c]
mov dword [esi + eax*4 + 0x2c], edx
mov esi, ecx
mov edx, dword [esp + 0x18]
mov eax, 0
shr esi, 4
and esi, 0xffffff0
mov dword [esp + 0x30], ecx
add edx, esi
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, dword [esp + 0x50]
add ecx, eax
mov eax, dword [esp + 0x30]
mov byte [edx], cl
mov byte [ecx + edx], al
lea eax, [ecx + esi]
mov ecx, dword [esp + 0x4c]
mov esi, dword [esp + 0x20]
mov edx, dword [esp + 0x38]
mov dword [ecx + eax*4], edi
inc edi
mov ecx, dword [esp + 0x10]
cmp edi, dword [esp + 0xc]
jb 0x10022923
mov eax, dword [esp + 0x1c]
mov ecx, 0x18
mov edi, dword [esp + 0xc]
sub ecx, dword [esp + 0x14]
mov dword [esi + 0x1c], edi
imul edx, dword [eax + 8], 0x9e3779b1
mov eax, edi
xor edx, dword [esp + 0x54]
shr edx, cl
and eax, 7
mov ecx, dword [esi + eax*4 + 0x2c]
mov dword [esi + eax*4 + 0x2c], edx
mov edx, ecx
mov dword [esp + 0x38], ecx
jmp 0x100229d4
imul edx, dword [edi], 0x9e3779b1
sub ecx, dword [esp + 0x14]
mov dword [esi + 0x1c], eax
xor edx, dword [esp + 0x54]
shr edx, cl
mov ecx, dword [esp + 0x28]
mov eax, edx
add dword [esi + 0x58], edx
shr eax, 4
and eax, 0xffffff0
movzx edx, dl
mov dword [esp + 0x30], edx
mov dword [esp + 0x14], 0
lea ecx, [ecx + eax*4]
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x2c]
add ecx, eax
movsx eax, dl
mov dword [esp + 0x18], ecx
movzx edi, byte [ecx]
movd xmm0, eax
and edi, 0xf
punpcklbw xmm0, xmm0
punpcklwd xmm0, xmm0
pshufd xmm1, xmm0, 0
movups xmm0, xmmword [ecx]
mov ecx, edi
mov dword [esp + 0x38], edi
neg ecx
pcmpeqb xmm0, xmm1
and ecx, 0xf
pmovmskb edx, xmm0
mov ax, dx
shl ax, cl
mov cx, di
shr dx, cl
or ax, dx
movzx eax, ax
cdq
mov dword [esp + 0x2c], edx
mov edi, eax
test edx, edx
jne 0x10022a56
test edi, edi
je 0x10022aae
xor esi, esi
cmp dword [esp + 0x48], 0
jbe 0x10022aa6
push edx
push edi
call fcn.100218d0
add eax, dword [esp + 0x40]
add esp, 8
and eax, 0xf
je 0x10022a88
mov ecx, dword [esp + 0x28]
mov eax, dword [ecx + eax*4]
cmp eax, dword [esp + 0x44]
jb 0x10022aa6
mov dword [esp + esi*4 + 0x60], eax
inc esi
dec dword [esp + 0x48]
mov edx, dword [esp + 0x2c]
mov ecx, edi
add ecx, 0xffffffff
mov eax, edx
adc eax, 0xffffffff
and edi, ecx
and edx, eax
mov dword [esp + 0x2c], edx
ja 0x10022a58
jb 0x10022aa6
test edi, edi
jne 0x10022a58
mov dword [esp + 0x14], esi
mov esi, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov eax, 0
mov edi, 0xf
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, edi
add ecx, eax
mov eax, dword [esp + 0x30]
mov byte [edx], cl
mov byte [ecx + edx], al
mov edx, dword [esp + 0x28]
mov eax, dword [esi + 0x1c]
mov dword [edx + ecx*4], eax
inc dword [esi + 0x1c]
cmp dword [esp + 0x14], 0
jbe 0x10022b54
mov ecx, dword [esp + 0x1c]
xor esi, esi
mov edi, 3
mov edx, dword [esp + 0x24]
add edx, dword [esp + esi*4 + 0x60]
mov eax, dword [edx + edi - 3]
cmp eax, dword [edi + ecx - 3]
jne 0x10022b37
push dword [esp + 0x58]
call fcn.1001b5f0
add esp, 4
cmp eax, edi
jbe 0x10022b33
mov ecx, dword [esp + 0xc]
mov edi, eax
sub ecx, dword [esp + esi*4 + 0x60]
mov edx, dword [esp + 0x5c]
add ecx, 3
mov dword [edx], ecx
mov ecx, dword [esp + 0x1c]
add eax, ecx
cmp eax, dword [esp + 0x58]
je 0x10022b3e
jmp 0x10022b37
mov ecx, dword [esp + 0x1c]
inc esi
cmp esi, dword [esp + 0x14]
jb 0x10022af0
mov eax, edi
pop edi
pop esi
mov ecx, dword [esp + 0x15c]
xor ecx, esp
call fcn.1007143a
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x164]
mov eax, 3
pop edi
pop esi
xor ecx, esp
call fcn.1007143a
mov esp, ebp
pop ebp
ret