Function at 0x140040ba4
Capabilities:
Encode data using xor

Disassembly:
test r8, r8
je 0x140041019
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
mov qword [rsp + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x40
mov r11, r8
mov rax, r9
shr r11, 4
mov rbx, rdx
cmp byte [rcx], 0
mov r10, rcx
je 0x140040bee
mov r8, r11
call fcn.14004101c
jmp 0x140040ffc
lea r9, [rcx + 8]
mov r13d, 4
mov qword [rbp + 0x40], r9
mov r8, r9
test r11, r11
je 0x140040fe6
lea rdi, [rbp - 0x20]
mov r12, rcx
sub rdi, rax
lea r14, [rbp - 0x10]
lea rsi, [rax + 4]
sub r14, rdx
lea rax, [rbp - 0x20]
sub r12, rax
lea r9, [rcx + 0x18]
lea r15, [0x140000000]
cmp byte [r10 + 1], 0
je 0x140040c54
mov rcx, rbx
sub r8, rbx
mov rdx, r13
mov eax, dword [r8 + rcx]
xor eax, dword [rcx]
mov dword [r14 + rcx], eax
add rcx, r13
sub rdx, 1
jne 0x140040c3f
jmp 0x140040c5b
movups xmm0, xmmword [rbx]
movups xmmword [rbp - 0x10], xmm0
lea rax, [rbp - 0x10]
mov r8, r9
sub r8, rax
xor edx, edx
lea rax, [rbp - 0x10]
add rax, rdx
mov ecx, dword [r8 + rax]
xor ecx, dword [rax]
mov dword [rbp + rdx - 0x20], ecx
add rdx, r13
cmp rdx, 0x10
jl 0x140040c67
movzx ecx, byte [rbp - 0x20]
lea r8, [rsi - 4]
movzx eax, byte [rbp - 0x1b]
mov r13d, 1
mov edx, dword [r15 + rcx*4 + 0x97ac0]
xor edx, dword [r15 + rax*4 + 0x97ec0]
movzx eax, byte [rbp - 0x16]
movzx ecx, byte [rbp - 0x1d]
xor edx, dword [r15 + rax*4 + 0x982c0]
movzx eax, byte [rbp - 0x11]
xor edx, dword [r15 + rax*4 + 0x986c0]
movzx eax, byte [rbp - 0x1c]
mov dword [r8], edx
mov edx, dword [r15 + rcx*4 + 0x986c0]
movzx ecx, byte [rbp - 0x1e]
xor edx, dword [r15 + rax*4 + 0x97ac0]
movzx eax, byte [rbp - 0x17]
xor edx, dword [r15 + rax*4 + 0x97ec0]
movzx eax, byte [rbp - 0x12]
xor edx, dword [r15 + rax*4 + 0x982c0]
movzx eax, byte [rbp - 0x19]
mov dword [rsi], edx
mov edx, dword [r15 + rcx*4 + 0x982c0]
movzx ecx, byte [rbp - 0x1f]
xor edx, dword [r15 + rax*4 + 0x986c0]
movzx eax, byte [rbp - 0x18]
xor edx, dword [r15 + rax*4 + 0x97ac0]
movzx eax, byte [rbp - 0x13]
xor edx, dword [r15 + rax*4 + 0x97ec0]
movzx eax, byte [rbp - 0x1a]
mov dword [rsi + 4], edx
mov edx, dword [r15 + rcx*4 + 0x97ec0]
xor edx, dword [r15 + rax*4 + 0x982c0]
movzx eax, byte [rbp - 0x15]
xor edx, dword [r15 + rax*4 + 0x986c0]
movzx eax, byte [rbp - 0x14]
xor edx, dword [r15 + rax*4 + 0x97ac0]
mov dword [rsi + 8], edx
mov eax, dword [r10 + 4]
dec eax
cmp eax, r13d
jle 0x140040e74
lea r15, [r12 + 0x28]
add r15, rdi
lea r9, [0x140000000]
mov rcx, r8
mov edx, 4
mov eax, dword [r15 + rcx]
xor eax, dword [rcx]
mov dword [rdi + rcx], eax
lea rcx, [rcx + 4]
sub rdx, 1
jne 0x140040d7c
movzx ecx, byte [rbp - 0x20]
inc r13d
movzx eax, byte [rbp - 0x1b]
add r15, 0x10
mov edx, dword [r9 + rcx*4 + 0x97ac0]
xor edx, dword [r9 + rax*4 + 0x97ec0]
movzx eax, byte [rbp - 0x16]
movzx ecx, byte [rbp - 0x1d]
xor edx, dword [r9 + rax*4 + 0x982c0]
movzx eax, byte [rbp - 0x11]
xor edx, dword [r9 + rax*4 + 0x986c0]
movzx eax, byte [rbp - 0x1c]
mov dword [r8], edx
mov edx, dword [r9 + rcx*4 + 0x986c0]
movzx ecx, byte [rbp - 0x1e]
xor edx, dword [r9 + rax*4 + 0x97ac0]
movzx eax, byte [rbp - 0x17]
xor edx, dword [r9 + rax*4 + 0x97ec0]
movzx eax, byte [rbp - 0x12]
xor edx, dword [r9 + rax*4 + 0x982c0]
movzx eax, byte [rbp - 0x19]
mov dword [rsi], edx
mov edx, dword [r9 + rcx*4 + 0x982c0]
movzx ecx, byte [rbp - 0x1f]
xor edx, dword [r9 + rax*4 + 0x986c0]
movzx eax, byte [rbp - 0x18]
xor edx, dword [r9 + rax*4 + 0x97ac0]
movzx eax, byte [rbp - 0x13]
xor edx, dword [r9 + rax*4 + 0x97ec0]
movzx eax, byte [rbp - 0x1a]
mov dword [rsi + 4], edx
mov edx, dword [r9 + rcx*4 + 0x97ec0]
xor edx, dword [r9 + rax*4 + 0x982c0]
movzx eax, byte [rbp - 0x15]
xor edx, dword [r9 + rax*4 + 0x986c0]
movzx eax, byte [rbp - 0x14]
xor edx, dword [r9 + rax*4 + 0x97ac0]
mov dword [rsi + 8], edx
mov eax, dword [r10 + 4]
dec eax
cmp r13d, eax
jl 0x140040d74
lea r9, [r10 + 0x18]
mov eax, dword [r10 + 4]
lea rdx, [r10 + 0x18]
dec eax
lea r15, [rbp - 0x20]
movsxd rcx, eax
mov r13d, 4
shl rcx, 4
add rdx, rcx
mov rcx, r8
sub rcx, rdx
sub r15, rdx
mov eax, dword [rdx + rcx]
xor eax, dword [rdx]
mov dword [r15 + rdx], eax
lea rdx, [rdx + 4]
sub r13, 1
jne 0x140040e9b
movzx eax, byte [rbp - 0x20]
lea rcx, [0x140000000]
lea r15, [r10 + 0x18]
mov r13d, 4
mov edx, r13d
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [r8], al
movzx eax, byte [rbp - 0x1b]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi - 3], al
movzx eax, byte [rbp - 0x16]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi - 2], al
movzx eax, byte [rbp - 0x11]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi - 1], al
movzx eax, byte [rbp - 0x1c]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi], al
movzx eax, byte [rbp - 0x17]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi + 1], al
movzx eax, byte [rbp - 0x12]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi + 2], al
movzx eax, byte [rbp - 0x1d]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi + 3], al
movzx eax, byte [rbp - 0x18]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi + 4], al
movzx eax, byte [rbp - 0x13]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi + 5], al
movzx eax, byte [rbp - 0x1e]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi + 6], al
movzx eax, byte [rbp - 0x19]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi + 7], al
movzx eax, byte [rbp - 0x14]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi + 8], al
movzx eax, byte [rbp - 0x1f]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi + 9], al
movzx eax, byte [rbp - 0x1a]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov byte [rsi + 0xa], al
movzx eax, byte [rbp - 0x15]
mov al, byte [rcx + rax*4 + 0x97ac1]
mov rcx, r8
mov byte [rsi + 0xb], al
movsxd rax, dword [r10 + 4]
shl rax, 4
add r15, rax
sub r15, r8
mov eax, dword [rcx + r15]
xor dword [rcx], eax
add rcx, r13
sub rdx, 1
jne 0x140040fb2
add rbx, 0x10
lea r15, [0x140000000]
sub r14, 0x10
sub rdi, 0x10
add rsi, 0x10
sub r11, 1
jne 0x140040c2f
mov r9, qword [rbp + 0x40]
sub r8, r9
mov rcx, r13
mov eax, dword [r8 + r9]
mov dword [r9], eax
add r9, r13
sub rcx, 1
jne 0x140040fec
lea r11, [rsp + 0x40]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret