Function at 0x140004020
Capabilities:
Encode data using xor

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r12
push r14
push r15
mov rbp, rsp
sub rsp, 0x80
mov rax, qword [0x1400cb180]
xor rax, rsp
mov qword [rbp - 0x10], rax
mov r14, rdx
mov qword [rbp - 0x60], rdx
xor ebx, ebx
add rcx, 0xaa8
call fcn.140003a30
mov rdi, rax
lea rcx, [rax + 0x10]
call fcn.1400053b0
movsxd r15, eax
mov rsi, r15
test eax, eax
jne 0x140004167
mov eax, dword [str.wYC8Xbox]
mov dword [rbp - 0x60], eax
cmp byte [0x1400ac653], bl
je 0x140004156
cmp dword [0x1400cb1d8], 2
jl 0x140004120
movdqa xmm3, xmmword [0x1400b3740]
movdqa xmm2, xmm3
punpckldq xmm2, xmm3
pmuldq xmm2, xmmword [0x1400b3cf0]
movdqa xmm0, xmm3
punpckhdq xmm0, xmm3
pmuldq xmm0, xmmword [0x1400b3cf0]
shufps xmm2, xmm0, 0xdd
paddd xmm2, xmm3
psrad xmm2, 5
movdqa xmm0, xmm2
psrld xmm0, 0x1f
paddd xmm0, xmm2
pmulld xmm0, xmmword [0x1400b37f0]
psubd xmm3, xmm0
andps xmm3, xmmword [0x1400b3800]
packuswb xmm3, xmm3
packuswb xmm3, xmm3
paddb xmm3, xmmword [0x1400b3860]
movd xmm0, eax
xorps xmm3, xmm0
movd dword [rbp - 0x60], xmm3
lea rdx, [rbp - 0x60]
mov rcx, r14
call fcn.140004f60
jmp 0x14000430e
lea r8, [rbp - 0x60]
nop dword [rax]
nop dword [rax + rax]
mov eax, 0x8d3dcb09
mul ebx
shr edx, 5
movsx eax, dl
imul ecx, eax, 0x3a
movzx edx, bl
sub dl, cl
add dl, 0x35
xor byte [r8], dl
inc ebx
lea r8, [r8 + 1]
cmp ebx, 4
jl 0x140004130
lea rdx, [rbp - 0x60]
mov rcx, r14
call fcn.140004f60
jmp 0x14000430e
lea rcx, [rdi + 8]
call fcn.140003a30
mov r12, rax
xorps xmm0, xmm0
movdqu xmmword [rbp - 0x48], xmm0
mov qword [rbp - 0x38], rbx
movabs rax, 0x7fffffffffffffff
cmp rsi, rax
ja 0x14000433f
add rsi, rsi
jne 0x14000419c
mov rax, rbx
jmp 0x1400041d9
cmp rsi, 0x1000
jb 0x1400041d1
lea rcx, [rsi + 0x27]
cmp rcx, rsi
jbe 0x140004339
call fcn.14009cf00
mov rcx, rax
test rax, rax
je 0x140004302
add rax, 0x27
and rax, 0xffffffffffffffe0
mov qword [rax - 8], rcx
jmp 0x1400041d9
mov rcx, rsi
call fcn.14009cf00
mov qword [rbp - 0x48], rax
lea rdi, [rax + rsi]
mov qword [rbp - 0x38], rdi
mov r8, rsi
xor edx, edx
mov rcx, rax
call sub.VCRUNTIME140.dll_memset
mov qword [rbp - 0x40], rdi
lea r8d, [r15 + r15]
mov rdx, qword [rbp - 0x48]
mov rcx, r12
call fcn.1400016c0
mov r8d, ebx
mov rcx, qword [rbp - 0x48]
lea edx, [r15 - 1]
and edx, 3
lea r9d, [r15 - 1]
cmp r8d, r9d
jge 0x140004233
add edx, 3
inc r8d
movzx eax, dx
and ax, 7
add word [rcx], ax
add rcx, 2
jmp 0x140004218
mov rdx, qword [rbp - 0x48]
lea rcx, [rbp - 0x30]
call fcn.140004e20
nop
mov rax, qword [rbp - 0x48]
cmp rax, qword [rbp - 0x40]
je 0x14000424f
mov qword [rbp - 0x40], rax
lea rdx, [rbp - 0x30]
cmp qword [rbp - 0x18], 7
cmova rdx, qword [rbp - 0x30]
mov rax, qword [rbp - 0x20]
lea r8, [rdx + rax*2]
lea rdx, [rbp - 0x30]
cmova rdx, qword [rbp - 0x30]
mov rcx, r14
call fcn.1400051a0
nop
mov rdx, qword [rbp - 0x18]
cmp rdx, 7
jbe 0x1400042ba
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x30]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400042b5
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400042b5
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14009d184
movdqa xmm0, xmmword [0x1400b36d0]
movdqu xmmword [rbp - 0x20], xmm0
mov word [rbp - 0x30], bx
mov rcx, qword [rbp - 0x48]
test rcx, rcx
je 0x14000430e
mov rdx, qword [rbp - 0x38]
sub rdx, rcx
sar rdx, 1
add rdx, rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140004309
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x140004309
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14009d184
mov rax, r14
mov rcx, qword [rbp - 0x10]
xor rcx, rsp
call fcn.14009cee0
lea r11, [rsp + 0x80]
mov rbx, qword [r11 + 0x40]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret
call fcn.140003f60
int3
call fcn.140005690
int3