Function at 0x47f210
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x1c
mov esi, ecx
cmp dword [0x7bd4d4], 0
je 0x47f232
push esi
call fcn.00411020
add esp, 0x20
jmp 0x47f673
mov ecx, dword [esi + 0x7c]
mov eax, dword [esi + 0xc4]
lea edx, [ecx - 0x106]
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x24], esi
nop word [eax + eax]
mov ebx, dword [esi + 0x8c]
mov edx, dword [esi + 0xbc]
add eax, edx
sub ebx, eax
add ecx, dword [ebp - 0x28]
cmp edx, ecx
jae 0x47f270
mov edx, ebx
jmp 0x47f46d
mov eax, dword [esi + 0x88]
mov edi, dword [ebp - 0x20]
lea ecx, [eax + edi]
mov edx, edi
mov dword [ebp - 0x10], ebx
sub edx, ebx
push edx
push ecx
push eax
call fcn.006cca40
add esp, 0xc
sub dword [esi + 0xc0], edi
sub dword [esi + 0xbc], edi
sub dword [esi + 0xac], edi
mov edx, dword [esi + 0x7c]
mov ecx, dword [esi + 0x9c]
lea ebx, [ecx + ecx]
add ebx, dword [esi + 0x94]
movd xmm0, edx
cmp ecx, 8
mov dword [ebp - 0x18], edx
jae 0x47f2e0
mov esi, ebx
movdqa xmm5, xmmword [0x6fac20]
movdqa xmm6, xmmword [0x7368c0]
pcmpeqd xmm7, xmm7
jmp 0x47f378
mov edx, ecx
and edx, 0xfffffff8
mov eax, ecx
and eax, 7
mov dword [ebp - 0x14], eax
mov edi, edx
neg edx
mov dword [ebp - 0x1c], edi
add edi, edi
mov esi, ebx
sub esi, edi
pshufd xmm1, xmm0, 0
add ebx, 0xfffffff0
xor edi, edi
movdqa xmm5, xmmword [0x6fac20]
movdqa xmm6, xmmword [0x7368c0]
pcmpeqd xmm7, xmm7
nop dword [eax + eax]
movdqu xmm2, xmmword [ebx + edi*2]
movdqa xmm3, xmm1
pxor xmm3, xmm5
movdqa xmm4, xmm6
pcmpgtd xmm4, xmm3
movdqa xmm3, xmm1
pand xmm3, xmm4
pxor xmm4, xmm7
por xmm4, xmm3
pslld xmm4, 0x10
psrad xmm4, 0x10
packssdw xmm4, xmm4
pshuflw xmm3, xmm4, 0x1b
pshufhw xmm3, xmm3, 0x1b
psubusw xmm2, xmm3
movdqu xmmword [ebx + edi*2], xmm2
add edi, 0xfffffff8
cmp edx, edi
jne 0x47f320
cmp ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x14]
je 0x47f39f
neg ecx
xor edi, edi
nop dword [eax]
movzx ebx, word [esi + edi*2 - 2]
sub ebx, edx
mov eax, edx
mov edx, 0
cmovb ebx, edx
mov edx, eax
mov word [esi + edi*2 - 2], bx
add edi, 0xffffffff
cmp ecx, edi
jne 0x47f380
lea ebx, [edx + edx]
mov esi, dword [ebp - 0x24]
add ebx, dword [esi + 0x90]
cmp edx, 8
mov eax, edx
jae 0x47f3c0
mov ecx, eax
mov edx, ebx
xor eax, eax
jmp 0x47f44a
mov edx, eax
and edx, 0xfffffff8
mov ecx, eax
and ecx, 7
mov dword [ebp - 0x14], ecx
mov edi, edx
mov ecx, edx
neg ecx
mov dword [ebp - 0x1c], edx
lea edi, [edx + edx]
mov edx, ebx
sub edx, edi
pshufd xmm0, xmm0, 0
add ebx, 0xfffffff0
xor edi, edi
nop word [eax + eax]
movdqu xmm1, xmmword [ebx + edi*2]
movdqa xmm2, xmm0
pxor xmm2, xmm5
movdqa xmm3, xmm6
pcmpgtd xmm3, xmm2
movdqa xmm2, xmm0
pand xmm2, xmm3
pxor xmm3, xmm7
por xmm3, xmm2
pslld xmm3, 0x10
psrad xmm3, 0x10
packssdw xmm3, xmm3
pshuflw xmm2, xmm3, 0x1b
pshufhw xmm2, xmm2, 0x1b
psubusw xmm1, xmm2
movdqu xmmword [ebx + edi*2], xmm1
add edi, 0xfffffff8
cmp ecx, edi
jne 0x47f3f0
cmp eax, dword [ebp - 0x1c]
mov eax, 0
mov ecx, dword [ebp - 0x14]
je 0x47f467
neg ecx
xor edi, edi
nop
movzx ebx, word [edx + edi*2 - 2]
sub ebx, dword [ebp - 0x18]
cmovb ebx, eax
mov word [edx + edi*2 - 2], bx
add edi, 0xffffffff
cmp ecx, edi
jne 0x47f450
mov edx, dword [ebp - 0x10]
add edx, dword [ebp - 0x20]
mov ebx, dword [esi]
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x47f5f7
mov eax, dword [esi + 0xc4]
cmp ecx, edx
cmovbe edx, ecx
test edx, edx
je 0x47f4f5
mov edi, dword [esi + 0x88]
add edi, dword [esi + 0xbc]
add edi, eax
sub ecx, edx
mov dword [ebx + 4], ecx
mov eax, dword [ebx + 0x1c]
cmp dword [eax + 0x18], 2
mov dword [ebp - 0x10], edx
jne 0x47f4c0
push edx
push edi
push ebx
call fcn.0047ec60
add esp, 0xc
jmp 0x47f4e7
push edx
push dword [ebx]
push edi
call fcn.006cca40
add esp, 0xc
mov eax, dword [ebx + 0x1c]
cmp dword [eax + 0x18], 1
jne 0x47f4e7
push dword [ebp - 0x10]
push edi
push dword [ebx + 0x30]
call fcn.0047e850
add esp, 0xc
mov dword [ebx + 0x30], eax
mov edx, dword [ebp - 0x10]
add dword [ebx], edx
add dword [ebx + 8], edx
mov eax, dword [esi + 0xc4]
add eax, edx
mov dword [esi + 0xc4], eax
mov edi, dword [esi + 0x1704]
lea ecx, [edi + eax]
cmp ecx, 3
jb 0x47f5e0
mov edx, dword [esi + 0xbc]
sub edx, edi
mov dword [ebp - 0x10], edi
mov edi, dword [esi + 0x88]
mov ecx, dword [esi + 0xa4]
mov dword [ebp - 0x18], ecx
movzx ebx, byte [edi + edx]
mov dword [esi + 0x98], ebx
mov ecx, dword [esi + 0xa8]
shl ebx, cl
mov dword [ebp - 0x14], edi
movzx edi, byte [edi + edx + 1]
xor edi, ebx
and edi, dword [ebp - 0x18]
mov dword [esi + 0x98], edi
cmp dword [ebp - 0x10], 0
je 0x47f5e0
mov ebx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x14]
nop
shl edi, cl
movzx eax, byte [eax + edx + 2]
xor eax, edi
and eax, ebx
mov dword [esi + 0x98], eax
mov ecx, dword [esi + 0x90]
mov edi, dword [esi + 0x94]
movzx eax, word [edi + eax*2]
mov edi, dword [esi + 0x84]
and edi, edx
mov word [ecx + edi*2], ax
mov eax, dword [esi + 0x94]
mov ecx, dword [esi + 0x98]
mov word [eax + ecx*2], dx
mov edi, dword [esi + 0x1704]
lea ecx, [edi - 1]
mov dword [esi + 0x1704], ecx
mov eax, dword [esi + 0xc4]
add edi, eax
add edi, 0xffffffff
cmp edi, 3
jb 0x47f5e0
test ecx, ecx
je 0x47f5e0
add edx, 1
mov eax, dword [esi + 0x88]
mov edi, dword [esi + 0x98]
mov ecx, dword [esi + 0xa8]
mov ebx, dword [esi + 0xa4]
jmp 0x47f560
cmp eax, 0x105
ja 0x47f5f7
mov ecx, dword [esi]
cmp dword [ecx + 4], 0
je 0x47f5f7
mov ecx, dword [esi + 0x7c]
jmp 0x47f250
mov eax, dword [esi + 0x1710]
mov edx, dword [esi + 0x8c]
mov ecx, edx
sub ecx, eax
jbe 0x47f670
mov edi, dword [esi + 0xc4]
add edi, dword [esi + 0xbc]
cmp eax, edi
jae 0x47f641
sub edx, edi
cmp edx, 0x102
mov ebx, 0x102
cmovb ebx, edx
mov eax, dword [esi + 0x88]
add eax, edi
push ebx
push 0
push eax
call fcn.006ccfc0
add esp, 0xc
add ebx, edi
jmp 0x47f66a
add edi, 0x102
sub edi, eax
jbe 0x47f670
cmp edi, ecx
cmova edi, ecx
add eax, dword [esi + 0x88]
push edi
push 0
push eax
call fcn.006ccfc0
add esp, 0xc
add edi, dword [esi + 0x1710]
mov ebx, edi
mov dword [esi + 0x1710], ebx
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret