Function at 0x1004a201
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 4], ebx
mov eax, dword [esi + 0x6af90]
mov dword [esi + 0x6af80], 2
cmp eax, ebx
je 0x1004a441
push edi
mov edi, 0x7fff
cmp eax, 3
jb 0x1004a281
mov ecx, dword [esi + 0x6af84]
mov edx, dword [esi + 0x6af7c]
and edx, 0x3ff
movzx eax, byte [ecx + esi + 0x1af72]
and eax, edi
shl edx, 5
xor eax, edx
and ecx, edi
mov dword [esi + 0x6af7c], eax
mov eax, dword [esi + eax*4 + 0x4af70]
mov dword [ebp - 4], eax
mov dword [esi + ecx*4 + 0x2af70], eax
mov eax, dword [esi + 0x6af7c]
mov ecx, dword [esi + 0x6af84]
mov dword [esi + eax*4 + 0x4af70], ecx
cmp dword [ebp - 4], 0
je 0x1004a2c2
mov eax, dword [esi + 0x6af84]
sub eax, dword [ebp - 4]
cmp eax, 0x7efa
ja 0x1004a2c2
mov ecx, dword [esi + 0x6af90]
lea eax, [esi + 0x6afa0]
cmp dword [eax], ecx
jbe 0x1004a2a9
mov dword [eax], ecx
push dword [ebp - 4]
push esi
call fcn.10049ea4
mov ebx, eax
mov eax, dword [esi + 0x6af90]
pop ecx
cmp ebx, eax
pop ecx
jbe 0x1004a2c2
mov ebx, eax
cmp ebx, 3
jb 0x1004a3ba
lea eax, [ebx - 3]
push eax
mov eax, dword [esi + 0x6af84]
sub eax, dword [esi + 0x6af88]
push eax
push esi
call fcn.1004962a
sub dword [esi + 0x6af90], ebx
add esp, 0xc
cmp ebx, dword [esi + 0x6af98]
mov dword [ebp + 8], eax
mov eax, dword [esi + 0x6af90]
ja 0x1004a35d
cmp eax, 3
jb 0x1004a35d
dec ebx
inc dword [esi + 0x6af84]
mov ecx, dword [esi + 0x6af84]
mov edx, dword [esi + 0x6af7c]
movzx eax, byte [esi + ecx + 0x1af72]
and edx, 0x3ff
and eax, edi
shl edx, 5
xor eax, edx
and ecx, edi
mov dword [esi + 0x6af7c], eax
dec ebx
mov eax, dword [esi + eax*4 + 0x4af70]
mov dword [ebp - 4], eax
mov dword [esi + ecx*4 + 0x2af70], eax
mov eax, dword [esi + 0x6af7c]
mov ecx, dword [esi + 0x6af84]
mov dword [esi + eax*4 + 0x4af70], ecx
jne 0x1004a302
jmp 0x1004a3dd
add dword [esi + 0x6af84], ebx
mov eax, dword [esi + 0x6af84]
lea edx, [esi + 0x6af7c]
xor ebx, ebx
lea ecx, [eax + esi]
movzx eax, byte [eax + esi + 0x1af70]
mov dword [edx], eax
and eax, 0x3ff
movzx ecx, byte [ecx + 0x1af71]
and ecx, edi
shl eax, 5
xor ecx, eax
lea eax, [ebp - 0x14]
push eax
mov dword [edx], ecx
call fcn.100402e8
pop ecx
mov ecx, eax
call fcn.10001ba2
push eax
push 1
push esi
call fcn.10048544
add esp, 0xc
lea ecx, [ebp - 0x14]
call fcn.10001b82
jmp 0x1004a3e3
mov eax, dword [esi + 0x6af84]
movzx eax, byte [eax + esi + 0x1af70]
push eax
push 0
push esi
call fcn.1004962a
add esp, 0xc
dec dword [esi + 0x6af90]
mov dword [ebp + 8], eax
inc dword [esi + 0x6af84]
cmp dword [ebp + 8], 0
je 0x1004a41f
mov eax, dword [esi + 0x6af74]
test eax, eax
jl 0x1004a3fc
lea ecx, [eax + esi + 0x1af70]
jmp 0x1004a3fe
xor ecx, ecx
mov edx, dword [esi + 0x6af84]
push 0
sub edx, eax
push edx
push ecx
push esi
call fcn.10049377
mov eax, dword [esi + 0x6af84]
add esp, 0x10
mov dword [esi + 0x6af74], eax
cmp dword [esi + 0x6af90], 0x106
jae 0x1004a432
push esi
call fcn.1004a0be
pop ecx
mov eax, dword [esi + 0x6af90]
test eax, eax
jne 0x1004a22f
pop edi
mov eax, dword [esi + 0x6af74]
test eax, eax
jl 0x1004a454
lea ecx, [eax + esi + 0x1af70]
jmp 0x1004a456
xor ecx, ecx
mov edx, dword [esi + 0x6af84]
push 1
sub edx, eax
push edx
push ecx
push esi
call fcn.10049377
add esp, 0x10
pop esi
pop ebx
leave
ret