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

Disassembly:
push rbx
push rsi
push rdi
push r12
sub rsp, 0x28
mov rdi, rcx
mov r12, r8
mov ecx, 4
mov rsi, rdx
call fcn.1400c79b4
mov ecx, 4
mov rbx, rax
call fcn.1400c79b4
mov r11d, dword [rdi + 4]
xor r9d, r9d
mov r10, rax
lea ecx, [r11*4]
test ecx, ecx
jle 0x140013a1e
mov rcx, r12
sub rsi, r12
nop word [rax + rax]
movzx eax, byte [rsi + rcx]
inc r9d
mov byte [rcx], al
lea rcx, [rcx + 1]
mov r11d, dword [rdi + 4]
lea eax, [r11*4]
cmp r9d, eax
jl 0x140013a00
mov eax, dword [rdi + 8]
lea r11d, [r11*4]
inc eax
imul eax, dword [rdi]
shl eax, 2
cmp r11d, eax
jge 0x140013c70
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x58], r13
lea r13, [0x1400d35b0]
movsxd rsi, r11d
add rsi, 0xfffffffffffffffd
mov qword [rsp + 0x60], r14
add rsi, r12
mov qword [rsp + 0x20], r15
nop
movzx r8d, byte [rsi - 1]
mov eax, r11d
cdq
mov byte [rbx], r8b
movzx ebp, byte [rsi]
and edx, 3
add eax, edx
mov byte [rbx + 1], bpl
movzx r14d, byte [rsi + 1]
sar eax, 2
mov byte [rbx + 2], r14b
cdq
movzx r15d, byte [rsi + 2]
mov byte [rbx + 3], r15b
mov ecx, dword [rdi + 4]
idiv ecx
mov r9d, edx
test edx, edx
jne 0x140013b6f
mov eax, ebp
mov ecx, ebp
and eax, 0xf
and rcx, 0xfffffffffffffff0
add rcx, rax
movzx eax, byte [rcx + r13]
mov ecx, r14d
mov byte [rbx], al
and rcx, 0xfffffffffffffff0
mov eax, r14d
and eax, 0xf
add rcx, rax
movzx eax, byte [rcx + r13]
mov ecx, r15d
mov byte [rbx + 1], al
and rcx, 0xfffffffffffffff0
mov eax, r15d
and eax, 0xf
add rcx, rax
movzx eax, byte [rcx + r13]
mov ecx, r8d
mov byte [rbx + 2], al
and rcx, 0xfffffffffffffff0
mov eax, r8d
and eax, 0xf
add rcx, rax
movzx eax, byte [rcx + r13]
mov cl, 1
mov byte [rbx + 3], al
mov eax, r11d
mov r8d, dword [rdi + 4]
cdq
shl r8d, 2
idiv r8d
dec eax
test eax, eax
jle 0x140013b41
mov r9d, eax
nop word [rax + rax]
movzx eax, cl
movzx edx, cl
add al, al
movzx r8d, al
movzx eax, r8b
xor al, 0x1b
test dl, dl
movzx ecx, al
cmovns ecx, r8d
sub r9, 1
jne 0x140013b20
mov byte [r10], cl
mov word [r10 + 2], 0
mov byte [r10 + 1], 0
xor byte [rbx], cl
movzx eax, byte [r10 + 1]
xor byte [rbx + 1], al
movzx eax, byte [r10 + 2]
xor byte [rbx + 2], al
movzx eax, byte [r10 + 3]
xor byte [rbx + 3], al
movzx edx, byte [rbx]
jmp 0x140013bdd
movzx edx, r8b
cmp ecx, 6
jle 0x140013bdd
cmp r9d, 4
jne 0x140013bdd
mov rax, r8
mov rcx, r8
and eax, 0xf
and rcx, 0xfffffffffffffff0
add rcx, rax
mov rax, rbp
and eax, 0xf
movzx edx, byte [rcx + r13]
mov rcx, rbp
and rcx, 0xfffffffffffffff0
mov byte [rbx], dl
add rcx, rax
movzx eax, byte [rcx + r13]
mov rcx, r14
mov byte [rbx + 1], al
and rcx, 0xfffffffffffffff0
mov rax, r14
and eax, 0xf
add rcx, rax
movzx eax, byte [rcx + r13]
mov rcx, r15
mov byte [rbx + 2], al
and rcx, 0xfffffffffffffff0
mov rax, r15
and eax, 0xf
add rcx, rax
movzx eax, byte [rcx + r13]
mov byte [rbx + 3], al
mov ecx, dword [rdi + 4]
mov eax, r11d
shl ecx, 2
sub eax, ecx
movsxd rcx, eax
mov eax, r11d
xor dl, byte [rcx + r12]
mov byte [rsi + 3], dl
mov ecx, dword [rdi + 4]
shl ecx, 2
sub eax, ecx
movsxd rcx, eax
movzx eax, byte [rcx + r12 + 1]
xor al, byte [rbx + 1]
mov byte [rsi + 4], al
mov eax, r11d
mov ecx, dword [rdi + 4]
shl ecx, 2
sub eax, ecx
movsxd rcx, eax
movzx eax, byte [rcx + r12 + 2]
xor al, byte [rbx + 2]
mov byte [rsi + 5], al
mov eax, r11d
mov ecx, dword [rdi + 4]
add r11d, 4
shl ecx, 2
sub eax, ecx
movsxd rcx, eax
movzx eax, byte [rcx + r12 + 3]
xor al, byte [rbx + 3]
mov byte [rsi + 6], al
add rsi, 4
mov eax, dword [rdi + 8]
inc eax
imul eax, dword [rdi]
shl eax, 2
cmp r11d, eax
jl 0x140013a60
mov r15, qword [rsp + 0x20]
mov r14, qword [rsp + 0x60]
mov r13, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x50]
mov rcx, r10
call fcn.1400c76e4
mov rcx, rbx
add rsp, 0x28
pop r12
pop rdi
pop rsi
pop rbx
jmp fcn.1400c76e4