Function at 0x49bdd5
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x10
push esi
mov esi, dword [esp + 0x34]
push esi
call fcn.00489b65
add esp, 4
test eax, eax
jne 0x49c03e
mov eax, dword [esp + 0x30]
push eax
call fcn.0049c095
add esp, 4
test eax, eax
jne 0x49c03e
mov eax, dword [esp + 0x28]
imul esi, esi, 0x64
mov esi, dword [esi + 0x507350]
mov ecx, eax
and cl, 7
neg cl
push ebp
sbb ecx, ecx
shr eax, 3
neg ecx
add ecx, eax
mov ebp, ecx
lea edx, [ebp - 2]
lea eax, [esi + esi]
cmp eax, edx
jae 0x49c07b
mov ecx, dword [esp + 0x20]
mov eax, 0x7fffffff
sub eax, esi
shl eax, 1
mov dword [esp + 0x14], eax
add eax, ebp
cmp ecx, eax
ja 0x49c07b
push ebx
push edi
push ebp
call fcn.004664f5
push ebp
mov edi, eax
call fcn.004664f5
mov ebx, eax
push esi
mov dword [esp + 0x24], ebx
call fcn.004664f5
add esp, 0xc
test edi, edi
mov dword [esp + 0x14], eax
je 0x49c050
test ebx, ebx
je 0x49c043
test eax, eax
je 0x49c043
mov eax, dword [esp + 0x2c]
test eax, eax
lea ecx, [esp + 0x10]
push ecx
mov dword [esp + 0x14], ebp
push edi
je 0x49bea6
mov edx, dword [esp + 0x38]
push edx
push eax
mov eax, dword [esp + 0x50]
push eax
jmp 0x49beae
mov edx, dword [esp + 0x48]
push 0
push edi
push edx
call fcn.004bbdd5
mov ebx, eax
add esp, 0x14
test ebx, ebx
jne 0x49c01c
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x1c]
sub eax, edx
add eax, ebp
mov ebx, eax
push ebx
lea eax, [edi + esi]
push 0
push eax
mov dword [esp + 0x1c], esi
call fcn.00481245
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x30]
add eax, ebx
mov ebx, dword [esp + 0x34]
mov dword [esp + 0x1c], eax
mov byte [eax + edi], 1
mov eax, dword [esp + 0x1c]
inc eax
push ebx
mov dword [esp + 0x20], eax
push ecx
add eax, edi
push eax
call fcn.00488ee5
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x50]
add eax, ebx
mov ebx, dword [esp + 0x2c]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x54]
imul eax, eax, 0x2c
push edx
push esi
push ebx
call dword [eax + 0x510718]
add esp, 0x24
cmp eax, esi
je 0x49bf3a
mov ebx, 0x20007
jmp 0x49c01c
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x40]
mov eax, ebp
sub eax, esi
dec eax
push eax
push ecx
push esi
push ebx
push edx
mov dword [esp + 0x30], eax
call fcn.004b5075
mov ebx, eax
add esp, 0x14
test ebx, ebx
jne 0x49c01c
mov edx, dword [esp + 0x1c]
test edx, edx
jbe 0x49bf82
mov ecx, dword [esp + 0x18]
mov eax, edi
sub ecx, edi
lea ecx, [ecx]
mov bl, byte [ecx + eax]
xor byte [eax], bl
inc eax
dec edx
jne 0x49bf75
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x40]
push esi
push eax
push edx
push edi
push ecx
call fcn.004b5075
mov ebx, eax
add esp, 0x14
test ebx, ebx
jne 0x49c01c
test esi, esi
jbe 0x49bfb6
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
sub ecx, eax
mov edx, esi
mov bl, byte [ecx + eax]
xor byte [eax], bl
inc eax
dec edx
jne 0x49bfad
mov eax, dword [esp + 0x48]
cmp dword [eax], ebp
jae 0x49bfc5
mov ebx, 0x20004
jmp 0x49c01a
mov ebx, dword [esp + 0x44]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x10], 0
mov byte [ebx], 0
mov eax, dword [esp + 0x10]
inc eax
push esi
mov dword [esp + 0x14], eax
push edx
add eax, ebx
push eax
call fcn.00488ee5
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x28]
add eax, esi
push ecx
mov dword [esp + 0x20], eax
add eax, ebx
push edi
push eax
call fcn.00488ee5
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x60]
sub ebp, esi
lea ebp, [edx + ebp - 1]
add esp, 0x18
mov dword [esp + 0x10], ebp
xor ebx, ebx
mov dword [eax], ebp
mov ecx, dword [esp + 0x14]
push ecx
call fcn.00466485
mov edx, dword [esp + 0x1c]
push edx
call fcn.00466485
push edi
call fcn.00466485
add esp, 0xc
pop edi
mov eax, ebx
pop ebx
pop ebp
pop esi
add esp, 0x10
ret
push edi
call fcn.00466485
mov eax, dword [esp + 0x18]
add esp, 4
test ebx, ebx
je 0x49c061
push ebx
call fcn.00466485
mov eax, dword [esp + 0x18]
add esp, 4
test eax, eax
je 0x49c06e
push eax
call fcn.00466485
add esp, 4
pop edi
pop ebx
pop ebp
mov eax, 0xc
pop esi
add esp, 0x10
ret
pop ebp
mov eax, 0x20012
pop esi
add esp, 0x10
ret