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

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x48
test rdx, rdx
je 0x140001ba4
mov ebx, r9d
cmp r9d, 0x20
ja 0x140001ba4
mov rsi, rcx
mov ecx, ebx
movabs rax, 0x101010000
bt rax, rcx
jae 0x140001ba4
mov r12d, dword [rsp + 0xb0]
cmp r12d, 0x20
ja 0x140001ba4
mov r15d, r12d
bt rax, r15
jae 0x140001ba4
mov r14, r8
mov rdi, rdx
mov dword [rsi + 0x3cc], ebx
mov dword [rsi + 0x3d0], r12d
lea rcx, [rsi + 0x3d8]
mov rdx, r8
mov r8, r15
call fcn.14000c250
lea rcx, [rsi + 0x3f8]
mov rdx, r14
mov r8, r15
call fcn.14000c250
cmp ebx, 0x18
je 0x1400016ff
mov eax, 0xe
cmp ebx, 0x10
jne 0x14000170d
xor eax, eax
cmp r12d, 0x18
setne al
cmp r12d, 0x10
lea ecx, [rax + rax + 0xc]
mov eax, 0xa
cmovne eax, ecx
jmp 0x14000170d
xor eax, eax
cmp r12d, 0x20
sete al
add eax, eax
add eax, 0xc
mov dword [rsi + 0x3d4], eax
mov r15d, r12d
shr r15d, 2
mov ebx, r12d
and ebx, 0xfc
lea r14, [rsi + 0xc]
mov ebp, 0xffffffff
nop dword [rax]
mov rcx, r14
xor edx, edx
mov r8, rbx
call fcn.14000c8f0
mov r8d, dword [rsi + 0x3d4]
inc ebp
add r14, 0x20
cmp r8d, ebp
jg 0x140001730
test r8d, r8d
js 0x140001797
lea r14, [rsi + 0x1ec]
mov ebp, 0xffffffff
jmp 0x14000177b
inc ebp
add r14, 0x20
cmp r8d, ebp
jle 0x140001797
cmp r12d, 4
jb 0x140001770
mov rcx, r14
xor edx, edx
mov r8, rbx
call fcn.14000c8f0
mov r8d, dword [rsi + 0x3d4]
jmp 0x140001770
inc r8d
imul r8d, r15d
mov eax, dword [rsi + 0x3cc]
lea ebx, [rax + 3]
test eax, eax
cmovns ebx, eax
sar ebx, 2
xor ecx, ecx
mov qword [rsp + 0x20], rax
cmp eax, 4
jl 0x140001886
mov eax, ebx
xor ecx, ecx
nop word cs:[rax + rax]
movzx edx, byte [rdi + rcx*4]
shl edx, 0x18
mov dword [rsi + rcx*4 + 0x418], edx
movzx r10d, byte [rdi + rcx*4 + 1]
shl r10d, 0x10
or r10d, edx
mov dword [rsi + rcx*4 + 0x418], r10d
movzx edx, byte [rdi + rcx*4 + 2]
shl edx, 8
or edx, r10d
mov dword [rsi + rcx*4 + 0x418], edx
movzx r10d, byte [rdi + rcx*4 + 3]
or r10d, edx
mov dword [rsi + rcx*4 + 0x418], r10d
inc rcx
cmp eax, ecx
jne 0x1400017d0
xor ecx, ecx
cmp dword [rsp + 0x20], 4
jl 0x140001886
test r8d, r8d
jle 0x140001886
lea eax, [rbx - 1]
lea r10d, [r8 - 1]
cmp eax, r10d
cmovb r10d, eax
inc r10d
xor ecx, ecx
nop
mov r11d, dword [rsi + rcx*4 + 0x418]
mov eax, ecx
xor edx, edx
div r15d
movsxd rdi, eax
shl rax, 5
add rax, rsi
mov dword [rax + rdx*4 + 0xc], r11d
mov eax, dword [rsi + rcx*4 + 0x418]
movsxd r11, dword [rsi + 0x3d4]
sub r11, rdi
shl r11, 5
add r11, rsi
mov dword [r11 + rdx*4 + 0x1ec], eax
inc rcx
cmp r10, rcx
jne 0x140001840
cmp ecx, r8d
jge 0x140001af4
lea eax, [rbx - 1]
cdqe
mov qword [rsp + 0x40], rax
mov rax, qword [rsp + 0x20]
and eax, 0xfffffffc
mov dword [rsp + 0x2c], eax
cmp ebx, 3
mov edi, 2
cmovge edi, ebx
dec edi
movsxd rbx, ebx
lea rax, [rdi - 1]
mov qword [rsp + 0x38], rax
mov r12d, edi
and r12d, 3
and edi, 0xfffffffc
lea rax, [rsi + 0x418]
mov qword [rsp + 0x30], rax
xor r14d, r14d
lea r11, str.cw
jmp 0x1400018ec
inc r14
cmp ecx, r8d
jge 0x140001af4
mov rax, qword [rsp + 0x40]
mov eax, dword [rsi + rax*4 + 0x418]
mov edx, eax
shr edx, 0x10
movzx edx, dl
movzx edx, byte [rdx + r11]
shl edx, 0x18
movzx ebp, ah
movzx r10d, byte [rbp + r11]
shl r10d, 0x10
or r10d, edx
movzx edx, al
movzx edx, byte [rdx + r11]
shl edx, 8
or edx, r10d
shr rax, 0x18
movzx r10d, byte [rax + r11]
lea rax, [0x14001d260]
movzx eax, byte [r14 + rax]
shl eax, 0x18
xor eax, dword [rsi + 0x418]
or r10d, edx
xor eax, r10d
mov dword [rsi + 0x418], eax
cmp dword [rsp + 0x2c], 0x20
jne 0x1400019f0
xor eax, dword [rsi + 0x41c]
mov dword [rsi + 0x41c], eax
xor eax, dword [rsi + 0x420]
mov dword [rsi + 0x420], eax
xor eax, dword [rsi + 0x424]
mov dword [rsi + 0x424], eax
movzx edx, al
movzx edx, byte [rdx + r11]
mov r10d, eax
shr r10d, 8
movzx r10d, r10b
movzx r10d, byte [r10 + r11]
shl r10d, 8
or r10d, edx
mov edx, eax
shr edx, 0x10
movzx edx, dl
movzx edx, byte [rdx + r11]
shl edx, 0x10
or edx, r10d
shr rax, 0x18
movzx eax, byte [rax + r11]
shl eax, 0x18
or eax, edx
xor eax, dword [rsi + 0x428]
mov dword [rsi + 0x428], eax
xor eax, dword [rsi + 0x42c]
mov dword [rsi + 0x42c], eax
xor eax, dword [rsi + 0x430]
mov dword [rsi + 0x430], eax
xor dword [rsi + 0x434], eax
jmp 0x140001a80
cmp dword [rsp + 0x20], 8
jl 0x140001a80
mov eax, dword [rsi + 0x418]
mov edx, 1
cmp qword [rsp + 0x38], 3
jb 0x140001a54
xor edx, edx
xor eax, dword [rsi + rdx*4 + 0x41c]
mov dword [rsi + rdx*4 + 0x41c], eax
xor eax, dword [rsi + rdx*4 + 0x420]
mov dword [rsi + rdx*4 + 0x420], eax
xor eax, dword [rsi + rdx*4 + 0x424]
mov dword [rsi + rdx*4 + 0x424], eax
xor eax, dword [rsi + rdx*4 + 0x428]
mov dword [rsi + rdx*4 + 0x428], eax
add rdx, 4
cmp rdi, rdx
jne 0x140001a10
inc rdx
test r12, r12
je 0x140001a80
mov r9, qword [rsp + 0x30]
lea rdx, [r9 + rdx*4]
xor r10d, r10d
nop word cs:[rax + rax]
xor eax, dword [rdx + r10*4]
mov dword [rdx + r10*4], eax
inc r10
cmp r12, r10
jne 0x140001a70
cmp dword [rsp + 0x20], 4
jl 0x1400018e0
cmp ecx, r8d
jge 0x1400018e0
mov r13d, 1
mov r10, qword [rsp + 0x30]
nop
mov ebp, dword [r10]
mov eax, ecx
cdq
idiv r15d
movsxd r9, eax
movsxd rdx, edx
mov rax, r9
shl rax, 5
add rax, rsi
mov dword [rax + rdx*4 + 0xc], ebp
mov eax, dword [r10]
movsxd rbp, dword [rsi + 0x3d4]
sub rbp, r9
shl rbp, 5
add rbp, rsi
mov dword [rbp + rdx*4 + 0x1ec], eax
inc ecx
cmp r13, rbx
jge 0x1400018e0
add r10, 4
inc r13
cmp ecx, r8d
jl 0x140001aa0
jmp 0x1400018e0
mov edi, dword [rsi + 0x3d4]
cmp edi, 2
mov r12d, dword [rsp + 0xb0]
jl 0x140001ba0
mov eax, r15d
lea rcx, [rsi + 0x20c]
mov edx, 1
lea r8, [0x14001d280]
lea r9, [0x14001d680]
lea r10, [0x14001da80]
lea r11, [0x14001de80]
jmp 0x140001b4f
inc rdx
movsxd rbx, edi
add rcx, 0x20
cmp rdx, rbx
jge 0x140001ba0
cmp r12d, 4
jb 0x140001b40
xor edi, edi
nop word [rax + rax]
mov ebx, dword [rcx + rdi*4]
mov r14, rbx
movzx ebp, bh
movzx r15d, bl
shr rbx, 0x18
shr r14, 0xe
and r14d, 0x3fc
mov r14d, dword [r14 + r9]
xor r14d, dword [r8 + rbx*4]
xor r14d, dword [r10 + rbp*4]
xor r14d, dword [r11 + r15*4]
mov dword [rcx + rdi*4], r14d
inc rdi
cmp rax, rdi
jne 0x140001b60
mov edi, dword [rsi + 0x3d4]
jmp 0x140001b40
mov byte [rsi + 8], 1
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret