Function at 0x474a80
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x1c
push ebx
mov ebx, dword [esp + 0x24]
push ebp
mov ebp, dword [esp + 0x2c]
push esi
push edi
mov esi, eax
cmp ebp, 0x1000000
jb 0x474ce3
lea edi, [esp + 0x38]
mov edx, ebx
call fcn.00473770
cmp eax, 3
je 0x474ce3
mov eax, dword [esp + 0x38]
cmp dword [esi], eax
mov ecx, dword [esi + 8]
movq xmm0, qword [esp + 0x38]
setge dl
cmp ecx, dword [esp + 0x40]
movq qword [esp + 0x18], xmm0
movq xmm0, qword [esp + 0x40]
setle cl
mov byte [esp + 0x34], dl
mov byte [esp + 0x30], cl
movq qword [esp + 0x20], xmm0
test dl, dl
je 0x474aed
inc eax
mov dword [esp + 0x18], eax
test cl, cl
je 0x474af5
dec dword [esp + 0x20]
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x44]
cmp eax, ecx
mov dword [esp + 0x10], eax
jge 0x474be8
jmp 0x474b14
mov dl, byte [esp + 0x34]
test dl, dl
je 0x474b71
mov edx, dword [ebx + 4]
imul edx, eax
add edx, dword [esi]
mov eax, dword [ebx + 0x10]
lea eax, [eax + edx*4]
mov dword [esp + 0x14], eax
mov eax, dword [eax]
mov ecx, ebp
shr ecx, 0x18
mov edi, 0x100
sub edi, ecx
mov ecx, eax
shr ecx, 8
and eax, 0xff00ff
imul eax, edi
mov edx, ecx
and edx, 0xffff00ff
imul edx, edi
and ecx, 0xff00ff
imul ecx, edi
shr eax, 8
xor eax, edx
and eax, 0xff00ff
xor eax, ecx
mov ecx, dword [esp + 0x14]
add eax, ebp
mov dword [ecx], eax
mov eax, dword [esp + 0x10]
cmp byte [esp + 0x30], 0
je 0x474bd3
mov edx, dword [ebx + 4]
imul edx, eax
add edx, dword [esi + 8]
mov eax, dword [ebx + 0x10]
lea eax, [eax + edx*4 - 4]
mov dword [esp + 0x14], eax
mov eax, dword [eax]
mov ecx, ebp
shr ecx, 0x18
mov edi, 0x100
sub edi, ecx
mov ecx, eax
shr ecx, 8
and eax, 0xff00ff
imul eax, edi
mov edx, ecx
and edx, 0xffff00ff
imul edx, edi
and ecx, 0xff00ff
imul ecx, edi
shr eax, 8
xor eax, edx
and eax, 0xff00ff
xor eax, ecx
mov ecx, dword [esp + 0x14]
add eax, ebp
mov dword [ecx], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x44]
inc eax
cmp eax, ecx
mov dword [esp + 0x10], eax
jl 0x474b10
mov eax, dword [esp + 0x3c]
cmp dword [esi + 0xc], ecx
setle byte [esp + 0x34]
cmp dword [esi + 4], eax
jl 0x474c68
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x30], eax
jge 0x474c68
mov ecx, ebp
shr ecx, 0x18
mov edx, 0x100
sub edx, ecx
mov ecx, dword [ebx + 4]
imul ecx, dword [esi + 4]
add ecx, eax
mov eax, dword [ebx + 0x10]
lea eax, [eax + ecx*4]
mov dword [esp + 0x14], eax
mov eax, dword [eax]
mov ecx, eax
and eax, 0xff00ff
shr ecx, 8
imul eax, edx
mov edi, ecx
and edi, 0xffff00ff
imul edi, edx
and ecx, 0xff00ff
imul ecx, edx
shr eax, 8
xor eax, edi
and eax, 0xff00ff
xor eax, ecx
mov ecx, dword [esp + 0x14]
add eax, ebp
mov dword [ecx], eax
mov eax, dword [esp + 0x30]
inc eax
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x30], eax
jl 0x474c0f
cmp byte [esp + 0x34], 0
je 0x474ce3
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x34], eax
jge 0x474ce3
mov ecx, ebp
shr ecx, 0x18
mov edx, 0x100
sub edx, ecx
mov ecx, dword [esi + 0xc]
dec ecx
imul ecx, dword [ebx + 4]
add ecx, eax
mov eax, dword [ebx + 0x10]
lea eax, [eax + ecx*4]
mov dword [esp + 0x30], eax
mov eax, dword [eax]
mov ecx, eax
and eax, 0xff00ff
shr ecx, 8
imul eax, edx
mov edi, ecx
and edi, 0xffff00ff
imul edi, edx
and ecx, 0xff00ff
imul ecx, edx
shr eax, 8
xor eax, edi
and eax, 0xff00ff
xor eax, ecx
mov ecx, dword [esp + 0x30]
add eax, ebp
mov dword [ecx], eax
mov eax, dword [esp + 0x34]
inc eax
cmp eax, dword [esp + 0x20]
mov dword [esp + 0x34], eax
jl 0x474c89
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x1c
ret 0x18