Function at 0x14012ffa2
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x38
xor ebx, ebx
test rcx, rcx
je 0x140130073
mov r12, rdx
test rdx, rdx
je 0x140130073
mov edi, r8d
mov rsi, rcx
test r8d, r8d
js 0x140130191
mov rax, qword [rsi + 0x38]
test rax, rax
jne 0x140130173
cmp edi, 0x3fffffff
ja 0x14013010f
mov rbp, qword [rsi + 0x10]
mov r8d, dword [rsi + 0x30]
cmp rbp, 0x80
jne 0x1401301a1
mov rcx, r12
mov edx, edi
call fcn.140130338
mov r15d, eax
mov ebx, r15d
xor r13d, r13d
mov rax, rbx
xor edx, edx
div rbp
mov rbp, rdx
mov rax, qword [rsi + 8]
mov rcx, rdx
shl rcx, 5
cmp dword [rax + rcx + 0x14], 0
mov r14d, 0
je 0x140130087
lea r14, [rax + rcx]
mov rax, qword [rax + rcx]
xor r13d, r13d
test rax, rax
jne 0x140130116
cmp dword [r14 + 0x18], r15d
jne 0x140130087
cmp dword [r14 + 0x10], edi
jne 0x140130087
mov rcx, qword [r14 + 8]
mov rdx, r12
mov r8d, edi
call fcn.1400b3639
test eax, eax
jne 0x140130087
mov rbx, qword [r14 + 8]
mov rax, rbx
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov rax, qword [rsi + 0x28]
test rax, rax
jne 0x1401301ec
mov rcx, rsi
mov rdx, r12
mov r8d, edi
call fcn.1401303cc
test rax, rax
je 0x14013010f
mov rbx, rax
test r14, r14
jne 0x140130155
mov eax, ebp
shl rax, 5
add rax, qword [rsi + 8]
mov qword [rax + 8], rbx
mov dword [rax + 0x10], edi
mov qword [rax], 0
mov dword [rax + 0x14], 1
mov dword [rax + 0x18], r15d
test r14, r14
jne 0x14013016b
inc dword [rsi + 0x18]
cmp r13d, 4
jb 0x140130073
mov rax, qword [rsi + 0x10]
cmp rax, 0xaaa
ja 0x140130073
add rax, rax
lea rdx, [rax + rax*2]
mov rcx, rsi
call fcn.1401dc11f
test eax, eax
je 0x140130073
xor ebx, ebx
jmp 0x140130073
xor r13d, r13d
cmp dword [r14 + 0x18], r15d
jne 0x140130141
cmp dword [r14 + 0x10], edi
jne 0x140130141
mov rcx, qword [r14 + 8]
mov rdx, r12
mov r8d, edi
call fcn.1400b3639
test eax, eax
je 0x14013006f
jmp 0x1401302f7
mov r14, rax
inc r13d
mov rax, qword [rax]
test rax, rax
je 0x140130050
jmp 0x140130119
mov ecx, 0x20
call qword [fcn.14008fb20]
test rax, rax
jne 0x1401300bd
jmp 0x14013010f
mov qword [r14], rax
jmp 0x1401300df
xor ebx, ebx
cmp edi, 0x3fffffff
ja 0x140130073
mov ecx, edi
cmp rax, rcx
ja 0x14012fff1
jmp 0x140130073
mov rcx, r12
call fcn.1400ed270
mov rdi, rax
jmp 0x14012ffd8
test edi, edi
jle 0x1401301e4
mov eax, edi
xor ecx, ecx
movzx ebx, byte [r12 + rcx]
add ebx, r8d
mov edx, ebx
shl edx, 0xa
add edx, ebx
mov r8d, edx
shr r8d, 6
xor r8d, edx
inc rcx
cmp rax, rcx
jne 0x1401301a9
lea eax, [r8 + r8*8]
mov ecx, eax
shr ecx, 0xb
xor ecx, eax
mov r15d, ecx
shl r15d, 0xf
add r15d, ecx
jmp 0x140130013
xor r15d, r15d
jmp 0x140130013
cmp qword [rsi + 0x10], 0x80
mov qword [rsp + 0x28], rax
mov rax, qword [rax + 0x10]
mov qword [rsp + 0x30], rax
jne 0x14013025d
mov dword [rsp + 0x24], r15d
cmp qword [rsp + 0x30], 0x80
je 0x140130271
test edi, edi
jle 0x140130310
mov rax, qword [rsp + 0x28]
mov ecx, dword [rax + 0x30]
mov r8d, edi
xor edx, edx
movzx eax, byte [r12 + rdx]
add eax, ecx
mov ebp, eax
shl ebp, 0xa
add ebp, eax
mov ecx, ebp
shr ecx, 6
xor ecx, ebp
inc rdx
cmp r8, rdx
jne 0x140130229
lea eax, [rcx + rcx*8]
mov ecx, eax
shr ecx, 0xb
xor ecx, eax
mov eax, ecx
shl eax, 0xf
add eax, ecx
mov dword [rsp + 0x24], eax
jmp 0x140130271
mov dword [rsp + 0x24], r15d
cmp qword [rsp + 0x30], 0x80
je 0x14013031d
mov eax, dword [rsp + 0x24]
xor edx, edx
div qword [rsp + 0x30]
mov rax, qword [rsp + 0x28]
mov rax, qword [rax + 8]
shl rdx, 5
cmp dword [rax + rdx + 0x14], 0
je 0x1401302ff
lea rbp, [rax + rdx]
mov rax, qword [rax + rdx]
test rax, rax
je 0x1401302cd
mov ecx, dword [rsp + 0x24]
cmp dword [rbp + 0x18], ecx
jne 0x1401302c2
cmp dword [rbp + 0x10], edi
jne 0x1401302c2
mov rcx, qword [rbp + 8]
mov rdx, r12
mov r8d, edi
call fcn.1400b3639
test eax, eax
je 0x1401302ee
mov rax, qword [rbp]
mov rbp, rax
inc r13d
mov rax, qword [rax]
jmp 0x140130298
mov eax, dword [rsp + 0x24]
cmp dword [rbp + 0x18], eax
jne 0x1401302ff
cmp dword [rbp + 0x10], edi
jne 0x1401302ff
mov rcx, qword [rbp + 8]
mov rdx, r12
mov r8d, edi
call fcn.1400b3639
test eax, eax
jne 0x1401302ff
mov rbx, qword [rbp + 8]
jmp 0x140130073
mov rax, qword [r14]
jmp 0x140130141
mov rax, rbx
xor edx, edx
div qword [rsi + 0x10]
mov rbp, rdx
jmp 0x140130094
mov dword [rsp + 0x24], 0
jmp 0x140130271
mov rax, qword [rsp + 0x28]
mov r8d, dword [rax + 0x30]
mov rcx, r12
mov edx, edi
call fcn.140130338
jmp 0x140130257