Function at 0x140172c52
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 0x140172d23
mov r12, rdx
test rdx, rdx
je 0x140172d23
mov edi, r8d
mov rsi, rcx
test r8d, r8d
js 0x140172e41
mov rax, qword [rsi + 0x38]
test rax, rax
jne 0x140172e23
cmp edi, 0x3fffffff
ja 0x140172dbf
mov rbp, qword [rsi + 0x10]
mov r8d, dword [rsi + 0x30]
cmp rbp, 0x80
jne 0x140172e51
mov rcx, r12
mov edx, edi
call fcn.140172fe8
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 0x140172d37
lea r14, [rax + rcx]
mov rax, qword [rax + rcx]
xor r13d, r13d
test rax, rax
jne 0x140172dc6
cmp dword [r14 + 0x18], r15d
jne 0x140172d37
cmp dword [r14 + 0x10], edi
jne 0x140172d37
mov rcx, qword [r14 + 8]
mov rdx, r12
mov r8d, edi
call fcn.1400fc7b1
test eax, eax
jne 0x140172d37
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 0x140172e9c
mov rcx, rsi
mov rdx, r12
mov r8d, edi
call fcn.14017307c
test rax, rax
je 0x140172dbf
mov rbx, rax
test r14, r14
jne 0x140172e05
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 0x140172e1b
inc dword [rsi + 0x18]
cmp r13d, 4
jb 0x140172d23
mov rax, qword [rsi + 0x10]
cmp rax, 0xaaa
ja 0x140172d23
add rax, rax
lea rdx, [rax + rax*2]
mov rcx, rsi
call fcn.14025604f
test eax, eax
je 0x140172d23
xor ebx, ebx
jmp 0x140172d23
xor r13d, r13d
cmp dword [r14 + 0x18], r15d
jne 0x140172df1
cmp dword [r14 + 0x10], edi
jne 0x140172df1
mov rcx, qword [r14 + 8]
mov rdx, r12
mov r8d, edi
call fcn.1400fc7b1
test eax, eax
je 0x140172d1f
jmp 0x140172fa7
mov r14, rax
inc r13d
mov rax, qword [rax]
test rax, rax
je 0x140172d00
jmp 0x140172dc9
mov ecx, 0x20
call qword [fcn.1400c4590]
test rax, rax
jne 0x140172d6d
jmp 0x140172dbf
mov qword [r14], rax
jmp 0x140172d8f
xor ebx, ebx
cmp edi, 0x3fffffff
ja 0x140172d23
mov ecx, edi
cmp rax, rcx
ja 0x140172ca1
jmp 0x140172d23
mov rcx, r12
call fcn.140132750
mov rdi, rax
jmp 0x140172c88
test edi, edi
jle 0x140172e94
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 0x140172e59
lea eax, [r8 + r8*8]
mov ecx, eax
shr ecx, 0xb
xor ecx, eax
mov r15d, ecx
shl r15d, 0xf
add r15d, ecx
jmp 0x140172cc3
xor r15d, r15d
jmp 0x140172cc3
cmp qword [rsi + 0x10], 0x80
mov qword [rsp + 0x28], rax
mov rax, qword [rax + 0x10]
mov qword [rsp + 0x30], rax
jne 0x140172f0d
mov dword [rsp + 0x24], r15d
cmp qword [rsp + 0x30], 0x80
je 0x140172f21
test edi, edi
jle 0x140172fc0
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 0x140172ed9
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 0x140172f21
mov dword [rsp + 0x24], r15d
cmp qword [rsp + 0x30], 0x80
je 0x140172fcd
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 0x140172faf
lea rbp, [rax + rdx]
mov rax, qword [rax + rdx]
test rax, rax
je 0x140172f7d
mov ecx, dword [rsp + 0x24]
cmp dword [rbp + 0x18], ecx
jne 0x140172f72
cmp dword [rbp + 0x10], edi
jne 0x140172f72
mov rcx, qword [rbp + 8]
mov rdx, r12
mov r8d, edi
call fcn.1400fc7b1
test eax, eax
je 0x140172f9e
mov rax, qword [rbp]
mov rbp, rax
inc r13d
mov rax, qword [rax]
jmp 0x140172f48
mov eax, dword [rsp + 0x24]
cmp dword [rbp + 0x18], eax
jne 0x140172faf
cmp dword [rbp + 0x10], edi
jne 0x140172faf
mov rcx, qword [rbp + 8]
mov rdx, r12
mov r8d, edi
call fcn.1400fc7b1
test eax, eax
jne 0x140172faf
mov rbx, qword [rbp + 8]
jmp 0x140172d23
mov rax, qword [r14]
jmp 0x140172df1
mov rax, rbx
xor edx, edx
div qword [rsi + 0x10]
mov rbp, rdx
jmp 0x140172d44
mov dword [rsp + 0x24], 0
jmp 0x140172f21
mov rax, qword [rsp + 0x28]
mov r8d, dword [rax + 0x30]
mov rcx, r12
mov edx, edi
call fcn.140172fe8
jmp 0x140172f07