Function at 0x59b090
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
push esi
mov esi, dword [ebp + 0x24]
test esi, esi
je 0x59b32c
mov ecx, dword [ebp + 0x20]
mov edx, dword [ebp + 8]
add ecx, 0xfffffffc
mov dword [ebp - 0x40], ecx
mov ecx, dword [ebp + 0x10]
push edi
dec esi
mov dword [ebp + 0x24], esi
xor esi, esi
cmp byte [0x708fa1], 0
mov edi, dword [ebp + 0x20]
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x3c], edi
je 0x59b1d1
lea eax, [edi - 0x20]
mov dword [ebp - 0x38], eax
test eax, eax
js 0x59b171
sub ecx, edx
lea eax, [edx + 0x10]
mov dword [ebp - 0x30], ecx
mov ecx, dword [ebp + 0x18]
sub ecx, edx
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x44], ecx
mov ecx, dword [ebp + 0x10]
sub ecx, dword [ebp + 0x18]
mov edi, dword [ebp - 0x44]
mov dword [ebp - 0x48], ecx
mov ecx, dword [ebp - 0x38]
add ecx, 0x20
shr ecx, 5
mov esi, ecx
mov dword [ebp - 0x38], ecx
mov ecx, dword [ebp + 0x18]
shl esi, 5
mov dword [ebp - 0x2c], esi
mov esi, dword [ebp - 0x48]
dec dword [ebp - 0x38]
lea eax, [eax + 0x20]
movdqu xmm1, xmmword [esi + ecx]
lea ecx, [ecx + 0x20]
movdqu xmm3, xmmword [eax - 0x30]
movdqu xmm2, xmmword [edx + eax - 0x20]
movdqu xmm4, xmmword [eax - 0x20]
movdqa xmm0, xmm1
pcmpgtb xmm1, xmm3
pxor xmm0, xmm3
pand xmm0, xmm1
pxor xmm0, xmm3
movdqu xmmword [ecx - 0x20], xmm0
movdqa xmm0, xmm2
pcmpgtb xmm2, xmm4
pxor xmm0, xmm4
pand xmm0, xmm2
pxor xmm0, xmm4
movdqu xmmword [edi + eax - 0x20], xmm0
jne 0x59b115
mov esi, dword [ebp - 0x2c]
mov edi, dword [ebp - 0x3c]
mov edx, dword [ebp + 8]
lea ecx, [edi - 8]
cmp esi, ecx
jg 0x59b1d1
sub edx, dword [ebp + 0x10]
sub ecx, esi
mov eax, dword [ebp + 0x10]
mov edi, dword [ebp - 0x3c]
add eax, esi
mov dword [ebp - 0x48], edx
mov edx, dword [ebp + 0x18]
sub edx, dword [ebp + 0x10]
shr ecx, 3
inc ecx
mov dword [ebp - 0x44], edx
mov edx, dword [ebp - 0x48]
lea esi, [esi + ecx*8]
mov dword [ebp - 0x2c], esi
mov esi, dword [ebp - 0x44]
movq xmm0, qword [eax]
lea eax, [eax + 8]
movq xmm2, qword [edx + eax - 8]
movdqa xmm1, xmm0
pxor xmm1, xmm2
pcmpgtb xmm0, xmm2
pand xmm1, xmm0
pxor xmm1, xmm2
movq qword [esi + eax - 8], xmm1
dec ecx
jne 0x59b1a1
mov esi, dword [ebp - 0x2c]
mov edx, dword [ebp + 8]
cmp esi, dword [ebp - 0x40]
jg 0x59b2be
mov eax, dword [ebp + 0x18]
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x38], edi
sub dword [ebp - 0x38], edx
lea ecx, [eax + 1]
add ecx, esi
mov dword [ebp - 0x34], ecx
lea ecx, [esi + edx]
mov dword [ebp - 0x30], ecx
mov ecx, eax
sub ecx, edx
mov dword [ebp - 0x44], ecx
mov ecx, edi
sub ecx, eax
mov dword [ebp - 0x48], ecx
mov ecx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x38]
mov esi, dword [ebp - 0x48]
mov edi, dword [ebp - 0x30]
mov dl, byte [ecx + eax]
mov cl, byte [ecx]
mov eax, dword [ebp - 0x34]
cmp cl, dl
mov byte [ebp - 8], cl
mov byte [ebp - 4], dl
mov dh, byte [eax + esi]
lea esi, [ebp - 8]
mov eax, dword [ebp - 0x30]
mov byte [ebp - 0xc], dh
mov ch, byte [eax + 1]
lea eax, [ebp - 4]
cmovge eax, esi
mov byte [ebp - 0x10], ch
mov esi, dword [ebp - 0x44]
cmp ch, dh
mov ecx, dword [ebp - 0x34]
movzx eax, byte [eax]
mov byte [edi + esi], al
lea esi, [ebp - 0x10]
mov edi, dword [ebp + 0x10]
lea eax, [ebp - 0xc]
cmovge eax, esi
mov esi, dword [ebp - 0x2c]
movzx eax, byte [eax]
mov byte [ecx], al
mov dl, byte [edi + esi + 2]
mov eax, dword [ebp - 0x30]
mov dh, byte [edi + esi + 3]
lea edi, [ebp - 0x18]
mov byte [ebp - 0x14], dl
mov byte [ebp - 0x1c], dh
mov cl, byte [eax + 2]
mov ch, byte [eax + 3]
cmp cl, dl
lea eax, [ebp - 0x14]
mov byte [ebp - 0x18], cl
cmovge eax, edi
mov byte [ebp - 0x20], ch
mov edi, dword [ebp - 0x34]
cmp ch, dh
mov edx, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x30]
movzx eax, byte [eax]
mov byte [edi + 1], al
lea eax, [ebp - 0x1c]
lea edi, [ebp - 0x20]
cmovge eax, edi
add esi, 4
add ecx, 4
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x30], ecx
movzx eax, byte [eax]
mov byte [edx + 2], al
add edx, 4
mov dword [ebp - 0x34], edx
cmp esi, dword [ebp - 0x40]
jle 0x59b205
mov edi, dword [ebp - 0x3c]
cmp esi, edi
jge 0x59b308
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
sub edx, ecx
mov dword [ebp - 0x3c], edx
mov edx, dword [ebp + 0x18]
lea eax, [esi + ecx]
sub edx, ecx
sub edi, esi
mov dword [ebp - 0x48], edx
mov edx, dword [ebp - 0x3c]
lea ecx, [ecx]
mov ch, byte [edx + eax]
lea esi, [ebp - 0x28]
mov cl, byte [eax]
lea edx, [ebp - 0x24]
cmp cl, ch
mov byte [ebp - 0x24], ch
mov byte [ebp - 0x28], cl
lea eax, [eax + 1]
cmovge edx, esi
mov cl, byte [edx]
mov edx, dword [ebp - 0x48]
mov byte [edx + eax - 1], cl
mov edx, dword [ebp - 0x3c]
dec edi
jne 0x59b2e0
mov edx, dword [ebp + 8]
mov ecx, dword [ebp + 0x10]
add edx, dword [ebp + 0xc]
add ecx, dword [ebp + 0x14]
mov eax, dword [ebp + 0x1c]
add dword [ebp + 0x18], eax
mov esi, dword [ebp + 0x24]
mov dword [ebp + 8], edx
mov dword [ebp + 0x10], ecx
test esi, esi
jne 0x59b0b2
pop edi
pop esi
mov esp, ebp
pop ebp
ret