Function at 0x4310a0
Capabilities:
Encode data using xor

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x88
lea rbp, [rsp + 0x80]
mov rax, qword [0x005270d0]
mov qword [rbp - 0x30], rax
mov r15, rcx
mov rdi, rdx
mov qword [rbp - 0x28], rax
movzx eax, byte [rdx]
lea r12, [rdx + rax - 1]
movsx eax, byte [r12]
lea eax, [rax*4 + 0x1c]
cdqe
lea rsi, [rax - 1]
add rax, 0xf
and rax, 0xfffffffffffffff0
call fcn.004476b0
xor ecx, ecx
lea rdx, [rbp - 0x32]
sub rsp, rax
movabs rax, 0x2220680017001768
mov qword [rsp + 0x30], rax
lea r8, [rdx + 1]
movabs rax, 0x140146875090103
mov qword [rsp + 0x38], rax
lea rbx, [rsp + 0x30]
movabs rax, 0x51000007004023a
mov qword [rsp + 0x40], rax
lea r14, [rbp - 0x28]
movabs rax, 0x16e43c0110000101
mov qword [rsp + 0x48], rax
lea rax, [rbp - 0x30]
mov qword [rbp - 0x48], rax
call fcn.0040f1c0
mov edx, dword [r15 + 0x3a0]
lea r9, [rbx + 6]
movzx eax, byte [r15 + 0x3a6]
mov dword [rsp + 0x36], edx
movzx edx, word [r15 + 0x3a4]
mov byte [r9 + 6], al
movsx eax, byte [r12]
mov word [r9 + 4], dx
lea ecx, [rax - 1]
test eax, eax
mov byte [rsp + 0x48], al
lea r8d, [rcx*4 + 0x17]
mov word [rsp + 0x31], r8w
mov word [rsp + 0x33], r8w
movzx r8d, byte [rbp - 0x32]
mov byte [rsp + 0x44], r8b
movzx r8d, byte [rbp - 0x31]
mov byte [rsp + 0x45], r8b
jle 0x4311f3
lea rdx, [rdi + 1]
mov eax, 1
nop
movzx ecx, byte [rdx]
mov byte [rbx + rax*4 + 0x16], 0
mov r8d, eax
add rdx, 3
mov byte [rbx + rax*4 + 0x15], cl
movzx ecx, byte [rdx - 2]
mov byte [rbx + rax*4 + 0x17], cl
movzx ecx, byte [rdx - 1]
mov byte [rbx + rax*4 + 0x18], cl
movsx ecx, byte [rbx + 0x18]
add rax, 1
cmp ecx, r8d
jg 0x4311c0
sub ecx, 1
lea r10d, [rcx*4]
cmp r10d, 0xffffffea
jl 0x4315dc
lea eax, [r10 + 0x16]
mov edx, 0xffffffff
lea r11, [rbx + rax + 7]
movzx eax, byte [r9]
mov ecx, 8
xor edx, eax
nop
movzx eax, dx
sar eax, 1
mov r8d, eax
xor r8w, 0xa001
and edx, 1
mov edx, r8d
cmove edx, eax
sub ecx, 1
jne 0x431220
add r9, 1
cmp r9, r11
jne 0x431213
mov eax, edx
movzx edx, dh
lea r8d, [rsi + 1]
add r10d, 0x1d
lea r14, [rbp - 0x28]
movsxd r10, r10d
mov byte [rbx + r10], al
movsx eax, byte [rbx + 0x18]
lea eax, [rax*4 + 0x1a]
cdqe
mov byte [rbx + rax], dl
movsx eax, byte [rbx + 0x18]
mov rdx, rbx
lea eax, [rax*4 + 0x1b]
cdqe
mov byte [rbx + rax], 0x16
lea rax, [rbp - 0x30]
mov qword [rbp - 0x48], rax
mov rcx, rax
call qword [0x005270e0]
mov rdx, qword [rbp - 0x30]
mov qword [rbp - 0x10], rdx
mov eax, dword [rdx]
add eax, 1
cmp eax, 1
ja 0x4315d3
lea rdi, [rbp - 0x10]
mov rcx, r15
mov rdx, rdi
call fcn.0042c940
mov rcx, qword [rbp - 0x10]
mov eax, dword [rcx]
test eax, eax
je 0x4315a0
cmp eax, 0xffffffff
je 0x4312d4
lock sub dword [rcx], 1
je 0x431599
mov rax, qword [rbp - 0x30]
lea r14, [rbp - 0x28]
mov r10d, dword [rax + 4]
test r10d, r10d
jle 0x431493
lea r14, [rbp - 0x28]
mov esi, 1
jmp 0x4313cc
movsxd rcx, dword [rax + 4]
mov r8d, dword [rax + 8]
lea edx, [rcx + 2]
and r8d, 0x7fffffff
cmp edx, r8d
jbe 0x43132e
mov r8d, 1
mov rcx, rdi
call qword [0x00527248]
mov rax, qword [rbp - 0x10]
movsxd rcx, dword [rax + 4]
lea edx, [rcx + 1]
mov dword [rax + 4], edx
add rax, qword [rax + 0x10]
mov edx, 0x20
lea rax, [rax + rcx*2]
xor ecx, ecx
mov word [rax], dx
mov rdx, rdi
mov word [rax + 2], cx
mov rcx, r14
call qword [0x00527298]
mov rcx, qword [rbp - 0x10]
mov eax, dword [rcx]
test eax, eax
je 0x431575
cmp eax, 0xffffffff
je 0x431377
lock sub dword [rcx], 1
mov rcx, qword [rbp - 0x10]
je 0x431575
mov rcx, qword [rbp - 0x18]
mov eax, dword [rcx]
test eax, eax
je 0x431450
cmp eax, 0xffffffff
je 0x431398
lock sub dword [rcx], 1
mov rcx, qword [rbp - 0x18]
je 0x431450
mov rcx, qword [rbp - 0x20]
mov eax, dword [rcx]
test eax, eax
je 0x43146f
cmp eax, 0xffffffff
je 0x4313b9
lock sub dword [rcx], 1
mov rcx, qword [rbp - 0x20]
je 0x43146f
mov rax, qword [rbp - 0x30]
mov edx, esi
add rsi, 1
cmp edx, dword [rax + 4]
jge 0x431493
lea rcx, [0x004a0d91]
mov edx, 2
call qword [0x00527278]
mov r9d, 0x30
movzx r8d, byte [rbx + rsi - 1]
mov qword [rbp - 0x20], rax
lea r12, [rbp - 0x18]
mov word [rsp + 0x28], r9w
mov r9d, 2
lea r13, [rbp - 0x20]
mov dword [rsp + 0x20], 0x10
mov rcx, r12
mov rdx, r13
call qword [0x005273a8]
mov rdx, qword [rbp - 0x18]
mov qword [rbp - 0x10], rdx
mov eax, dword [rdx]
add eax, 1
cmp eax, 1
ja 0x431590
mov rax, qword [rbp - 0x10]
mov edx, dword [rax]
cmp edx, 1
jbe 0x431300
mov edx, dword [rax + 4]
add edx, 2
jmp 0x431317
mov r8d, 8
mov edx, 2
call qword [0x005270c8]
mov rcx, qword [rbp - 0x20]
mov eax, dword [rcx]
test eax, eax
jne 0x4313a6
mov edx, 2
mov r8d, 8
call qword [0x005270c8]
mov rax, qword [rbp - 0x30]
mov edx, esi
add rsi, 1
cmp edx, dword [rax + 4]
jl 0x4313cc
mov rax, qword [r15 + 0x40]
mov edx, 7
mov rcx, rdi
mov rbx, qword [rax + 0x108]
call qword [0x00527478]
mov rdx, rdi
mov rcx, rbx
mov rbx, qword [0x00527c08]
call rbx
mov rcx, r15
call fcn.0042cc80
mov rax, qword [r15 + 0x40]
lea r12, [rbp - 0x18]
mov r8d, 0xd
lea rdx, [0x004a0d94]
mov rcx, r12
mov rsi, qword [rax + 0x108]
call qword [0x00527268]
mov rdx, r14
mov rcx, r12
call qword [0x00527298]
lea r8, [0x004a0da2]
mov rdx, r12
mov rcx, rdi
call fcn.00491630
mov rdx, rdi
mov rcx, rsi
call qword [0x00527c30]
mov rcx, rdi
call fcn.00491270
mov rcx, r12
call fcn.00491270
mov rax, qword [r15 + 0x40]
mov edx, 0x386487
mov rcx, rdi
mov rsi, qword [rax + 0x108]
call qword [0x00527480]
mov rdx, rdi
mov rcx, rsi
call rbx
mov rcx, r14
call fcn.00491270
mov rcx, qword [rbp - 0x30]
mov eax, dword [rcx]
test eax, eax
je 0x4315c0
cmp eax, 0xffffffff
je 0x431564
lock sub dword [rcx], 1
mov rcx, qword [rbp - 0x30]
je 0x4315c0
lea rsp, [rbp + 8]
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov r8d, 8
mov edx, 2
call qword [0x005270c8]
jmp 0x431377
lock add dword [rdx], 1
jmp 0x43142c
mov rcx, qword [rbp - 0x10]
nop dword [rax]
mov r8d, 8
mov edx, 1
call qword [0x005270c8]
jmp 0x4312d4
mov r8d, 8
mov edx, 1
call qword [0x005270c8]
jmp 0x431564
lock add dword [rdx], 1
jmp 0x4312a8
mov edx, 0xffffffff
mov eax, edx
jmp 0x43124a