Function at 0x1800013f0
Capabilities:
Encode data using xor
Encrypt data using aes
Reference aes constants

Disassembly:
push rbx
push rsi
push r12
sub rsp, 0x30
cmp qword [rcx + 0x20], 0
mov r12, r8
mov qword [rsp + 0x50], rbp
mov rbx, rcx
mov qword [rsp + 0x58], rdi
mov ebp, 4
mov qword [rsp + 0x60], r13
mov qword [rsp + 0x28], r14
lea r14, [rcx + 0x20]
mov qword [rsp + 0x20], r15
mov r15, rdx
jne 0x180001445
mov rdi, r14
mov esi, ebp
movsxd rcx, dword [rbx]
call fcn.180008704
mov qword [rdi], rax
lea rdi, [rdi + 8]
sub rsi, 1
jne 0x180001430
mov eax, dword [rbx]
xor esi, esi
shl eax, 2
mov r8d, esi
test eax, eax
jle 0x180001498
nop dword [rax]
nop word [rax + rax]
mov eax, r8d
mov ecx, r8d
and eax, 3
test r8d, r8d
jns 0x180001474
lea ecx, [r8 + 3]
sub eax, ebp
cdqe
inc r8d
sar ecx, 2
movsxd rdx, ecx
mov rcx, qword [rbx + rax*8 + 0x20]
movzx eax, byte [r15]
inc r15
mov byte [rdx + rcx], al
mov eax, dword [rbx]
shl eax, 2
cmp r8d, eax
jl 0x180001460
mov r8, rsi
mov r9, r14
mov r10, rbp
mov rax, qword [rbx + 0x18]
lea r8, [r8 + 1]
mov rdx, qword [r9]
lea r9, [r9 + 8]
movzx ecx, byte [r8 + rax - 1]
xor byte [rdx], cl
mov rax, qword [rbx + 0x18]
mov rdx, qword [r9 - 8]
movzx ecx, byte [r8 + rax + 3]
xor byte [rdx + 1], cl
mov rax, qword [rbx + 0x18]
mov rdx, qword [r9 - 8]
movzx ecx, byte [r8 + rax + 7]
xor byte [rdx + 2], cl
mov rax, qword [rbx + 0x18]
mov rdx, qword [r9 - 8]
movzx ecx, byte [r8 + rax + 0xb]
xor byte [rdx + 3], cl
sub r10, 1
jne 0x1800014a1
mov eax, dword [rbx + 8]
lea r13, str.cw
dec eax
mov r15d, 1
cmp eax, r15d
jl 0x180001620
lea edi, [r10 + 0x10]
mov r8, r14
mov r9, rbp
nop word [rax + rax]
mov rdx, qword [r8]
lea r8, [r8 + 8]
movzx eax, byte [rdx]
mov ecx, eax
and eax, 0xf
and rcx, 0xfffffffffffffff0
add rcx, rax
movzx eax, byte [rcx + r13]
mov byte [rdx], al
mov rdx, qword [r8 - 8]
movzx eax, byte [rdx + 1]
mov ecx, eax
and eax, 0xf
and rcx, 0xfffffffffffffff0
add rcx, rax
movzx eax, byte [rcx + r13]
mov byte [rdx + 1], al
mov rdx, qword [r8 - 8]
movzx eax, byte [rdx + 2]
mov ecx, eax
and eax, 0xf
and rcx, 0xfffffffffffffff0
add rcx, rax
movzx eax, byte [rcx + r13]
mov byte [rdx + 2], al
mov rdx, qword [r8 - 8]
movzx eax, byte [rdx + 3]
mov ecx, eax
and eax, 0xf
and rcx, 0xfffffffffffffff0
add rcx, rax
movzx eax, byte [rcx + r13]
mov byte [rdx + 3], al
sub r9, 1
jne 0x180001520
mov rcx, rbx
call fcn.180001770
mov rcx, rbx
call fcn.180001870
mov r8, rsi
mov r9, r14
mov r10, rbp
mov rax, qword [rbx + 0x18]
lea rcx, [rdi + r8]
mov rdx, qword [r9]
lea r9, [r9 + 8]
movzx ecx, byte [rcx + rax]
xor byte [rdx], cl
lea rcx, [rdi + r8]
mov rax, qword [rbx + 0x18]
mov rdx, qword [r9 - 8]
movzx ecx, byte [rcx + rax + 4]
xor byte [rdx + 1], cl
lea rcx, [rdi + r8]
mov rax, qword [rbx + 0x18]
mov rdx, qword [r9 - 8]
movzx ecx, byte [rcx + rax + 8]
xor byte [rdx + 2], cl
lea rcx, [rdi + r8]
mov rax, qword [rbx + 0x18]
lea r8, [r8 + 1]
mov rdx, qword [r9 - 8]
movzx ecx, byte [rcx + rax + 0xc]
xor byte [rdx + 3], cl
sub r10, 1
jne 0x1800015b0
mov eax, dword [rbx + 8]
inc r15d
dec eax
add rdi, 0x10
cmp r15d, eax
jle 0x180001510
mov r15, qword [rsp + 0x20]
mov r8, r14
mov rdi, qword [rsp + 0x58]
mov r9, rbp
mov rdx, qword [r8]
lea r8, [r8 + 8]
movzx eax, byte [rdx]
mov ecx, eax
and eax, 0xf
and rcx, 0xfffffffffffffff0
add rcx, rax
movzx eax, byte [rcx + r13]
mov byte [rdx], al
mov rdx, qword [r8 - 8]
movzx eax, byte [rdx + 1]
mov ecx, eax
and eax, 0xf
and rcx, 0xfffffffffffffff0
add rcx, rax
movzx eax, byte [rcx + r13]
mov byte [rdx + 1], al
mov rdx, qword [r8 - 8]
movzx eax, byte [rdx + 2]
mov ecx, eax
and eax, 0xf
and rcx, 0xfffffffffffffff0
add rcx, rax
movzx eax, byte [rcx + r13]
mov byte [rdx + 2], al
mov rdx, qword [r8 - 8]
movzx eax, byte [rdx + 3]
mov ecx, eax
and eax, 0xf
and rcx, 0xfffffffffffffff0
add rcx, rax
movzx eax, byte [rcx + r13]
mov byte [rdx + 3], al
sub r9, 1
jne 0x180001630
mov rcx, rbx
call fcn.180001770
movsxd r9, dword [rbx + 8]
mov r8, rsi
mov r13, qword [rsp + 0x60]
add r9, r9
nop
mov rax, qword [rbx + 0x18]
lea rcx, [r8 + r9*8]
mov rdx, qword [r14]
lea r14, [r14 + 8]
movzx ecx, byte [rcx + rax]
xor byte [rdx], cl
lea rcx, [r8 + r9*8]
mov rax, qword [rbx + 0x18]
mov rdx, qword [r14 - 8]
movzx ecx, byte [rcx + rax + 4]
xor byte [rdx + 1], cl
lea rcx, [r8 + r9*8]
mov rax, qword [rbx + 0x18]
mov rdx, qword [r14 - 8]
movzx ecx, byte [rcx + rax + 8]
xor byte [rdx + 2], cl
lea rcx, [r8 + r9*8]
mov rax, qword [rbx + 0x18]
lea r8, [r8 + 1]
mov rdx, qword [r14 - 8]
movzx ecx, byte [rcx + rax + 0xc]
xor byte [rdx + 3], cl
sub rbp, 1
jne 0x1800016c0
mov eax, dword [rbx]
mov r14, qword [rsp + 0x28]
mov rbp, qword [rsp + 0x50]
shl eax, 2
test eax, eax
jle 0x180001764
nop
mov eax, esi
mov ecx, esi
and eax, 3
test esi, esi
jns 0x180001741
lea ecx, [rsi + 3]
sub eax, 4
cdqe
inc esi
sar ecx, 2
movsxd rcx, ecx
mov rax, qword [rbx + rax*8 + 0x20]
movzx ecx, byte [rcx + rax]
mov byte [r12], cl
inc r12
mov eax, dword [rbx]
shl eax, 2
cmp esi, eax
jl 0x180001730
add rsp, 0x30
pop r12
pop rsi
pop rbx
ret