Function at 0x5966a0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
mov edx, dword [ebp + 0xc]
sub esp, 0x20
mov eax, 1
push ebx
push esi
push edi
cmp edx, 3
je 0x5966cd
mov ecx, dword [ebp + 0x10]
push 0
shl eax, cl
push eax
push 0
push 0x200000
call fcn.0059ee00
mov edx, dword [ebp + 0xc]
lea esi, [eax + eax*2]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
shl esi, 4
add esi, 0x167
and esi, 0xffffff00
mov dword [ebp - 4], esi
test eax, eax
jne 0x5966f3
mov edi, 0x200000
jmp 0x596701
lea edi, [eax + 0x3ffff]
add edi, esi
and edi, 0xfffc0000
mov ebx, dword [ebp + 0x1c]
cmp edx, 1
jg 0x596726
call fcn.005988a0
cmp eax, 1
jbe 0x596726
push 0xe
call fcn.00594ee0
add esp, 4
cmp dword [ebx + 0x20], eax
jae 0x596726
xor al, al
jmp 0x596743
push 3
mov byte [ebp + 0xb], 1
call fcn.00595280
add esp, 4
test al, al
je 0x596740
mov byte [ebp + 8], 1
mov al, 1
jmp 0x596747
mov al, byte [ebp + 0xb]
mov byte [ebp + 8], 0
mov byte [ebp - 0xc], al
xor ecx, ecx
mov eax, dword [ebp + 0x14]
mov edx, 0x200000
test eax, eax
je 0x59676c
lea ecx, [esi + 0x1fffff]
mov edx, eax
and ecx, 0xffe00000
mov eax, ecx
sub eax, esi
add edi, eax
push dword [ebp + 0x20]
lea eax, [ebp - 0x20]
push eax
push dword [ebp + 0x18]
push dword [ebp - 0xc]
push dword [ebp + 8]
push ecx
push edx
push edi
call fcn.0059a0b0
mov esi, eax
add esp, 0x20
test esi, esi
je 0x5967cf
cmp byte [ebp - 0x13], 0
jne 0x5967d8
mov eax, dword [ebp + 0x20]
push dword [eax + 4]
push 0
push dword [ebp - 4]
push esi
call fcn.0059d0d0
add esp, 0x10
test al, al
jne 0x5967d8
mov eax, dword [ebp + 0x20]
movups xmm0, xmmword [ebp - 0x20]
push dword [eax + 4]
mov eax, dword [ebp - 0x10]
sub esp, 0x14
mov ecx, esp
push 0
push edi
movups xmmword [ecx], xmm0
push esi
mov dword [ecx + 0x10], eax
call fcn.0059a3d0
add esp, 0x24
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
movups xmm0, xmmword [ebp - 0x20]
movups xmmword [esi], xmm0
mov eax, dword [ebp - 0x10]
mov dword [esi + 0x10], eax
cmp byte [ebp - 0x14], 0
sete al
mov byte [esi + 0x14], al
test al, al
je 0x596805
push 0xf
call fcn.00594ee0
add esp, 4
test eax, eax
js 0x596805
mov al, 1
jmp 0x596807
xor al, al
mov byte [esi + 0x15], al
mov dword [esi + 0x18], edi
mov eax, dword [ebx + 0x30]
mov dword [esi + 0x1c], eax
mov eax, dword [ebx + 0x34]
push 1
push eax
test edi, edi
js 0x596824
call fcn.0059ba50
jmp 0x596829
call fcn.0059ba30
mov eax, dword [ebx + 0x1c]
mov ecx, edi
sar ecx, 0x1f
inc eax
and ecx, 0xfffffffe
add esp, 8
add eax, ecx
mov dword [ebx + 0x1c], eax
cmp eax, dword [ebx + 0x20]
jbe 0x596845
mov dword [ebx + 0x20], eax
mov eax, dword [ebx + 0x24]
add eax, edi
mov dword [ebx + 0x24], eax
cmp eax, dword [ebx + 0x28]
jbe 0x596855
mov dword [ebx + 0x28], eax
push esi
call fcn.0059dca0
mov ecx, dword [ebp - 4]
lea eax, [esi + 0x20]
add esp, 4
add ecx, 0xffffffe0
cmp byte [0x6776c0], 0
je 0x596878
mov edi, eax
xor al, al
rep stosb byte es:[edi], al
jmp 0x596884
push ecx
push 0
push eax
call fcn.005b6630
add esp, 0xc
mov edi, dword [ebp - 8]
test edi, edi
je 0x5968d0
cmp dword [ebp + 0xc], 3
lea edx, [esi + 0x59]
setne ah
dec ah
and ah, 8
xor ebx, ebx
nop dword [eax]
mov byte [edx - 1], bl
lea edx, [edx + 0x30]
mov al, byte [esi + 0xd]
inc ebx
add al, al
xor al, byte [edx - 0x30]
and al, 2
xor byte [edx - 0x30], al
mov cl, byte [esi + 0xe]
mov al, byte [edx - 0x30]
and cl, 1
shl cl, 2
and al, 0xf3
or cl, al
or cl, ah
mov byte [edx - 0x30], cl
cmp ebx, edi
jb 0x5968a0
mov ebx, dword [ebp + 0x1c]
mov eax, dword [ebp + 0xc]
mov dword [esi + 0x54], eax
mov eax, dword [ebp + 0x10]
mov dword [esi + 0x50], eax
mov eax, dword [ebp - 4]
mov dword [esi + 0x38], edi
mov dword [esi + 0x3c], eax
call fcn.00598c30
mov dword [esi + 0x4c], eax
mov eax, esi
xor eax, dword [0x66e110]
cmp dword [ebp + 0xc], 1
mov dword [esi + 0x40], eax
jg 0x596939
mov eax, dword [esi + 0x54]
test eax, eax
je 0x596911
cmp eax, 1
jne 0x59690f
add ebx, 8
jmp 0x596911
xor ebx, ebx
mov dword [esi + 0x20], 0
mov eax, dword [ebx + 4]
mov dword [esi + 0x24], eax
mov eax, dword [ebx + 4]
test eax, eax
je 0x596934
mov dword [eax + 0x20], esi
mov eax, esi
mov dword [ebx + 4], esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebx], esi
mov dword [ebx + 4], esi
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret