Function at 0x791ae0
Capabilities:
Encode data using xor

Disassembly:
test ecx, ecx
je 0x791d9f
push ebp
push ebx
push edi
push esi
mov edi, fcn.007f17e0
xor eax, eax
mov esi, ecx
mov ebp, edx
movzx edx, byte [0xbacec7]
imul edi, edi
and edi, 3
cmp edi, 3
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 6]
and al, 7
movzx eax, al
bt edx, eax
jb 0x791d74
mov al, byte [0xbacec7]
xor ecx, ecx
cmp edi, 3
mov ah, 1
sete cl
mov ebx, ecx
xor ebx, 1
lea ecx, [ecx + ebx*2 + 6]
and cl, 7
xor cl, 7
shl ah, cl
or ah, al
lock cmpxchg byte [0xbacec7], ah
jne 0x791b26
mov ecx, fcn.007f17e0
xor edx, edx
movzx eax, al
imul ecx, ecx
and ecx, 3
cmp ecx, 3
sete dl
mov ebx, edx
xor ebx, 1
lea edx, [edx + ebx*2 + 6]
and dl, 7
xor dl, 7
movzx edx, dl
bt eax, edx
jae 0x791ba1
xor eax, eax
cmp ecx, 3
movzx edi, byte [0xbacec7]
sete al
mov edx, eax
xor edx, 1
lea eax, [eax + edx*2 + 6]
and al, 7
movzx eax, al
bt edi, eax
jae 0x791b7a
jmp 0x791d74
xor eax, eax
cmp ecx, 3
movzx edx, byte [0xbacec7]
sete al
mov ecx, eax
xor ecx, 1
lea eax, [eax + ecx*2 + 6]
and al, 7
movzx eax, al
bt edx, eax
jb 0x791d48
mov eax, fcn.007f17e0
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 3
sete cl
mov eax, ecx
xor eax, 1
lea ecx, [ecx + eax*2 - 0x7e1d9202]
mov eax, dword [0xbace90]
mov edx, ecx
shr edx, 0x1f
or edx, ecx
xor eax, ecx
and cl, 7
mov dword [0xbace90], eax
not eax
imul edx, eax
mov eax, dword [0xbace94]
lea edi, [edx + edx]
xor eax, edx
shr edx, 0x1e
mov dword [0xbace94], eax
or edi, edx
not eax
mov edx, dword [0xbace98]
imul eax, edi
lea edi, [eax*4]
xor edx, eax
shr eax, 0x1d
mov dword [0xbace98], edx
or edi, eax
not edx
mov eax, dword [0xbace9c]
imul edx, edi
lea edi, [edx*8]
xor eax, edx
shr edx, 0x1c
mov dword [0xbace9c], eax
or edi, edx
not eax
mov edx, dword [0xbacea0]
imul eax, edi
mov edi, eax
shl edi, 4
xor edx, eax
shr eax, 0x1b
mov dword [0xbacea0], edx
or eax, edi
not edx
imul edx, eax
mov eax, dword [0xbacea4]
mov edi, edx
shl edi, 5
xor eax, edx
shr edx, 0x1a
mov dword [0xbacea4], eax
or edx, edi
not eax
imul eax, edx
mov edx, dword [0xbacea8]
mov edi, eax
shl edi, 6
xor edx, eax
shr eax, 0x19
mov dword [0xbacea8], edx
or eax, edi
not edx
imul edx, eax
mov eax, dword [0xbaceac]
mov edi, edx
shl edi, 7
xor eax, edx
shr edx, 0x18
mov dword [0xbaceac], eax
or edx, edi
not eax
imul eax, edx
mov edx, dword [0xbaceb0]
mov edi, eax
shl edi, 8
xor edx, eax
shr eax, 0x17
mov dword [0xbaceb0], edx
or eax, edi
not edx
imul edx, eax
mov eax, dword [0xbaceb4]
mov edi, edx
shl edi, 9
xor eax, edx
shr edx, 0x16
mov dword [0xbaceb4], eax
or edx, edi
not eax
imul eax, edx
mov edx, dword [0xbaceb8]
mov edi, eax
shl edi, 0xa
xor edx, eax
shr eax, 0x15
mov dword [0xbaceb8], edx
or eax, edi
not edx
mov ebx, dword [0xbacebc]
imul edx, eax
mov edi, edx
shl edi, 0xb
xor ebx, edx
shr edx, 0x14
mov dword [0xbacebc], ebx
or edx, edi
not ebx
imul ebx, edx
mov dl, 1
xor dword [0xbacec0], ebx
shl dl, cl
or byte [0xbacec7], dl
mov eax, fcn.007f17e0
xor ecx, ecx
imul eax, eax
and eax, 3
cmp eax, 3
sete cl
mov eax, ecx
xor eax, 1
lea ecx, [ecx + eax*2 + 6]
mov al, 0xfe
and cl, 7
xor cl, 7
rol al, cl
and byte [0xbacec7], al
lea eax, [esi + 1]
imul eax, esi
imul eax, dword [0xbace88]
mov ecx, eax
shr ecx, 0x1f
add ecx, eax
sar ecx, 1
push ebp
push ecx
push 0xbace90
push 0x1b
call fcn.00777b70
add esp, 0x10
pop esi
pop edi
pop ebx
pop ebp
ret