Function at 0x1801ccf40
Capabilities:
Encode data using xor

Disassembly:
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x28
movdqa xmmword [rsp + 0x10], xmm7
movdqa xmmword [rsp], xmm6
xor eax, eax
test r8, r8
jne 0x1801ccf6b
jmp 0x1801cd1cb
je 0x1801ccfbb
dec r8
je 0x1801cd1cb
cmp r8, rdx
jae 0x1801ccf60
cmp byte [rcx + r8], 0xbf
jle 0x1801ccf62
mov rax, r8
cmp rax, 4
jb 0x1801ccfc4
add rax, 0xfffffffffffffffd
lea rbx, [rcx + 0xf]
and rbx, 0xfffffffffffffff0
mov rdi, rbx
sub rdi, rcx
mov r9, rax
sub r9, rdi
jae 0x1801ccfcb
mov esi, 0x10
mov r9d, 1
xor r10d, r10d
xor r11d, r11d
cmp rax, 4
jae 0x1801ccff9
xor edx, edx
mov rdi, rcx
jmp 0x1801cd0bd
mov rax, rdx
cmp rax, 4
jae 0x1801ccf80
xor eax, eax
jmp 0x1801cd1cb
lea rsi, [rcx + rdi]
mov r11, r9
shr r11, 4
mov r10d, r9d
and r10d, 0xf
and r9, 0xfffffffffffffff0
add r9, rsi
cmp rbx, rcx
jne 0x1801ccff0
xor edx, edx
jmp 0x1801cd0d3
mov rax, rdi
cmp rax, 4
jb 0x1801ccfb1
mov rbx, rax
and rbx, 0xfffffffffffffffc
cmp rdx, r8
cmovb r8, rdx
add r8, 0xfffffffffffffffd
cmp rdi, r8
cmovb r8, rdi
lea rdi, [rcx + rbx]
and r8, 0xfffffffffffffffc
pxor xmm0, xmm0
xor edx, edx
movdqa xmm2, xmmword [0x18029c450]
pcmpeqd xmm3, xmm3
movdqa xmm4, xmmword [0x180210320]
pxor xmm1, xmm1
nop dword [rax + rax]
movzx ebp, word [rcx + rdx]
movd xmm5, ebp
movzx ebp, word [rcx + rdx + 2]
movd xmm6, ebp
movdqa xmm7, xmm5
pminub xmm7, xmm2
pcmpeqb xmm7, xmm5
pxor xmm7, xmm3
punpcklbw xmm7, xmm7
pshuflw xmm5, xmm7, 0xd4
pshufd xmm5, xmm5, 0xd4
pand xmm5, xmm4
paddq xmm0, xmm5
movdqa xmm5, xmm6
pminub xmm5, xmm2
pcmpeqb xmm5, xmm6
pxor xmm5, xmm3
punpcklbw xmm5, xmm5
pshuflw xmm5, xmm5, 0xd4
pshufd xmm5, xmm5, 0xd4
pand xmm5, xmm4
paddq xmm1, xmm5
add rdx, 4
cmp r8, rdx
jne 0x1801cd040
paddq xmm1, xmm0
pshufd xmm0, xmm1, 0xee
paddq xmm0, xmm1
movq rdx, xmm0
cmp rax, rbx
je 0x1801cd0d3
add rcx, rax
cmp byte [rdi], 0xf0
lea rax, [rdi + 1]
sbb rdx, 0xffffffffffffffff
mov rdi, rax
cmp rax, rcx
jne 0x1801cd0c0
test r11, r11
je 0x1801cd159
movdqa xmm0, xmmword [0x18029c460]
pxor xmm1, xmm1
nop dword [rax + rax]
cmp r11, 0xff
mov ecx, 0xff
cmovb rcx, r11
mov eax, ecx
shl eax, 4
lea r8, [rsi + rax]
xor edi, edi
pxor xmm2, xmm2
nop
movdqa xmm3, xmmword [rsi + rdi]
movdqa xmm4, xmm3
pmaxub xmm4, xmm0
pcmpeqb xmm4, xmm3
psubb xmm2, xmm4
add rdi, 0x10
cmp rax, rdi
jne 0x1801cd110
psadbw xmm2, xmm1
movq rax, xmm2
add rdx, rax
pshufd xmm2, xmm2, 0xee
movq rax, xmm2
add rax, rdx
mov rdx, rax
mov rsi, r8
sub r11, rcx
jne 0x1801cd0f0
test r10, r10
jne 0x1801cd161
jmp 0x1801cd1cb
mov rax, rdx
test r10, r10
je 0x1801cd1cb
mov rdx, r10
and rdx, 3
je 0x1801cd18c
mov r8, r9
nop dword [rax]
lea rcx, [r8 + 1]
cmp byte [r8], 0xf0
sbb rax, 0xffffffffffffffff
mov r8, rcx
dec rdx
jne 0x1801cd170
cmp r10d, 4
jae 0x1801cd195
jmp 0x1801cd1cb
mov rcx, r9
cmp r10d, 4
jb 0x1801cd1cb
add r9, r10
nop dword [rax + rax]
cmp byte [rcx], 0xf0
sbb rax, 0xffffffffffffffff
cmp byte [rcx + 1], 0xf0
sbb rax, 0xffffffffffffffff
cmp byte [rcx + 2], 0xf0
sbb rax, 0xffffffffffffffff
cmp byte [rcx + 3], 0xf0
lea rdx, [rcx + 4]
sbb rax, 0xffffffffffffffff
mov rcx, rdx
cmp rdx, r9
jne 0x1801cd1a0
movaps xmm6, xmmword [rsp]
movaps xmm7, xmmword [rsp + 0x10]
add rsp, 0x28
pop rbx
pop rbp
pop rdi
pop rsi
ret