Function at 0x18018b9f0
Capabilities:
Encode data using xor

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x98
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x10], 0xfffffffffffffffe
mov rsi, rcx
mov dword [rdx + 0x14], 6
mov qword [rbp - 0x30], rdx
mov r14, qword [rdx]
mov r15, qword [0x180277178]
movzx eax, byte [r15]
test al, al
jne 0x18018bb25
mov edi, dword [0x18028e9b8]
test dil, 1
jne 0x18018bb25
cmp edi, 0x100
jae 0x18018ba6c
mov ecx, edi
or ecx, 0x20000000
mov eax, edi
lock cmpxchg dword [0x18028e9b8], ecx
jne 0x18018ba6c
lea rbx, [0x18028e9b8]
jmp 0x18018ba9e
lea rdx, [0x18028e9b8]
lea r9, [0x18028e9b0]
lea rcx, [rbp - 0x10]
lea r8, [rbp + 0xf]
call fcn.1801844d0
mov eax, dword [rbp - 0x10]
test eax, eax
je 0x18018baef
cmp eax, 2
je 0x18018bb25
mov rbx, qword [rbp - 8]
mov edi, dword [rbp]
xor ecx, ecx
call sub.kernel32.dll_GetModuleHandleW
mov qword [0x18028e9b0], rax
mov eax, edi
or eax, 0x20000000
mov ecx, 1
lock cmpxchg dword [rbx], ecx
je 0x18018bb25
and edi, 0xdfffffff
xor edi, 0x20000001
mov eax, dword [rbx]
nop dword [rax]
mov ecx, eax
xor ecx, edi
lock cmpxchg dword [rbx], ecx
jne 0x18018bad0
cmp eax, 0x40000000
jb 0x18018bb25
xor eax, edi
mov rcx, rbx
mov edx, eax
call fcn.18018b3e0
jmp 0x18018bb25
mov rcx, qword [rbp - 8]
mov edx, 0xffffff00
lock xadd dword [rcx], edx
mov eax, edx
and eax, 0x3fffff00
cmp eax, 0x100
setne al
cmp edx, 0x40000000
setb r8b
or r8b, al
jne 0x18018bb25
add edx, 0xffffff00
call fcn.18018b3e0
movzx eax, byte [r15]
test al, al
jne 0x18018bc45
mov ecx, dword [0x18028e9e0]
test cl, 1
jne 0x18018bc45
cmp ecx, 0x100
jae 0x18018bb6e
mov edx, ecx
or edx, 0x20000000
mov eax, ecx
lock cmpxchg dword [0x18028e9e0], edx
jne 0x18018bb6e
lea rax, [0x18028e9e0]
movd xmm0, ecx
pshufd xmm0, xmm0, 0x50
jmp 0x18018bba2
lea rdx, [0x18028e9e0]
lea r9, [0x18028e9c8]
lea rcx, [rbp - 0x10]
lea r8, [rbp + 0xf]
call fcn.1801844d0
mov eax, dword [rbp - 0x10]
test eax, eax
je 0x18018bc0f
cmp eax, 2
je 0x18018bc45
mov rax, qword [rbp - 8]
movq xmm0, qword [rbp]
lea rcx, [0x18028e9c8]
mov qword [rbp - 0x58], rcx
mov qword [rbp - 0x50], rax
movq qword [rbp - 0x48], xmm0
lea rcx, [rbp - 0x10]
lea rdx, [rbp - 0x58]
call fcn.18018c340
mov r8d, dword [rbp]
mov rcx, qword [rbp - 8]
mov eax, r8d
or eax, 0x20000000
mov edx, dword [rbp + 4]
lock cmpxchg dword [rcx], edx
je 0x18018bc45
xor edx, r8d
or edx, 0x20000000
mov eax, dword [rcx]
nop word [rax + rax]
mov r8d, eax
xor r8d, edx
lock cmpxchg dword [rcx], r8d
jne 0x18018bbf0
cmp eax, 0x40000000
jb 0x18018bc45
xor eax, edx
mov edx, eax
call fcn.18018b3e0
jmp 0x18018bc45
mov rcx, qword [rbp - 8]
mov edx, 0xffffff00
lock xadd dword [rcx], edx
mov eax, edx
and eax, 0x3fffff00
cmp eax, 0x100
setne al
cmp edx, 0x40000000
setb r8b
or r8b, al
jne 0x18018bc45
add edx, 0xffffff00
call fcn.18018b3e0
mov qword [rbp - 0x20], r14
mov qword [rbp - 0x28], rsi
mov rdx, qword [0x18028e9c8]
test rdx, rdx
je 0x18018bdaa
mov rax, qword [0x18028e9d0]
mov qword [rbp - 0x18], rax
lea rdi, [0x1801a0d70]
mov r13d, 0xff
lea rax, [rdx + 0x168]
movzx ecx, word [rdx + 0x272]
mov qword [rbp - 0x40], rcx
lea ecx, [rcx*8]
lea r15, [rcx + rcx*2]
mov qword [rbp - 0x38], rdx
lea rsi, [rdx - 8]
mov r14, 0xffffffffffffffff
nop word cs:[rax + rax]
test r15, r15
je 0x18018bd10
lea rbx, [rax + 0x18]
mov rdx, qword [rax + 8]
mov r8, qword [rax + 0x10]
mov r12, r8
sub r12, 3
mov eax, 3
cmovae r8, rax
neg r12
mov rcx, rdi
call sub.VCRUNTIME140.dll_memcmp
cdqe
test eax, eax
cmovne r12, rax
xor ecx, ecx
test r12, r12
setne cl
cmovs ecx, r13d
add r15, 0xffffffffffffffe8
add rsi, 0x20
inc r14
mov rax, rbx
cmp cl, 1
je 0x18018bcb0
movzx eax, cl
test eax, eax
je 0x18018bd37
jmp 0x18018bd14
mov r14, qword [rbp - 0x40]
mov rdx, qword [rbp - 0x38]
mov rax, qword [rbp - 0x18]
sub rax, 1
jb 0x18018bdaa
mov qword [rbp - 0x18], rax
mov rdx, qword [rdx + r14*8 + 0x278]
jmp 0x18018bc75
cmp qword [rsi - 8], 4
jne 0x18018bd70
mov rax, qword [rsi - 0x10]
mov rcx, qword [rsi]
mov eax, dword [rax]
mov edx, dword [str.selfviewscreen.child]
bswap eax
bswap edx
xor r8d, r8d
cmp eax, edx
seta r8b
sbb r8d, 0
add rcx, qword [0x18028e9b0]
xor eax, eax
test r8d, r8d
cmove rax, rcx
jmp 0x18018bd72
xor eax, eax
mov rcx, qword [rbp - 0x28]
mov rdx, qword [rbp - 0x20]
mov qword [rdx], rax
mov rax, qword [rbp - 0x30]
mov dword [rax + 0x14], 1
movups xmm0, xmmword [rax]
movups xmmword [rcx], xmm0
mov rax, qword [rax + 0x10]
mov qword [rcx + 0x10], rax
add rsp, 0x98
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
lea rcx, [0x1801a0d78]
call fcn.18019e0f0
ud2