Function at 0x515b20
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
mov ebp, r9d
mov r14d, r8d
mov r12, rdx
mov r15, rcx
mov r13, qword [rcx]
mov edx, 0x49
mov rcx, r13
call fcn.00429840
test rax, rax
je 0x515ba1
mov rsi, rax
xorps xmm0, xmm0
movups xmmword [rax], xmm0
movups xmmword [rax + 0x30], xmm0
movups xmmword [rax + 0x20], xmm0
movups xmmword [rax + 0x10], xmm0
mov qword [rax + 0x40], 0
mov byte [rax], 0xb0
mov word [rax + 0x32], 0xffff
add rax, 0x48
mov qword [rsi + 8], rax
mov byte [rsi + 0x48], 0
mov dword [rsi + 0x28], 1
test bp, bp
js 0x515b97
cmp word [r12 + 0x34], bp
jne 0x515bb7
mov dword [rsi + 0x2c], r14d
mov byte [rsi + 1], 0x44
jmp 0x515ba3
xor esi, esi
mov rax, rsi
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov r11, qword [r12 + 8]
movzx ebx, bp
mov eax, dword [r12 + 0x30]
mov ecx, eax
xor ecx, 0xffffffdf
test ecx, eax
je 0x515cf8
movzx eax, word [r11 + 0x12]
mov ecx, eax
xor ecx, 0xffffffdf
and ecx, eax
test bp, bp
je 0x515c09
cmp ebx, 1
mov r10d, 1
cmova r10d, ebx
mov rax, r10
xor rax, 0xfffffffffffffffe
cmp bp, 1
jne 0x515c13
mov r9d, 1
xor ebp, ebp
jmp 0x515cb0
xor r10d, r10d
xor ebp, ebp
jmp 0x515ce7
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x30], rbx
mov eax, r10d
and eax, 0xfffffffe
lea rbx, [r11 + 0x42]
xor r9d, r9d
xor ebp, ebp
mov rdi, rax
nop
movzx ecx, cx
shr ecx, 5
mov r8d, ecx
not r8d
and r8d, 1
and ecx, 0xfffffffe
or ecx, r8d
add ebp, ecx
mov ecx, r9d
and ecx, 1
mov rdx, r9
xor rdx, 1
or rdx, rcx
lea rcx, [rdx + rdx*2]
movzx ecx, word [r11 + rcx*8 + 0x12]
shr ecx, 5
mov edx, ecx
xor edx, 0x7fe
and edx, ecx
mov ecx, edx
not ecx
and ecx, 0x56c4
and edx, 0x13b
or edx, ecx
xor edx, 0x56c5
add edx, ebp
mov ebp, edx
add r9, 2
movzx ecx, word [rbx]
and ecx, 0x20
add rdi, 0xfffffffffffffffe
add rbx, 0x30
cmp rax, r9
jne 0x515c30
add r9, 1
mov rbx, qword [rsp + 0x30]
mov rax, qword [rsp + 0x28]
test eax, r10d
je 0x515ce7
lea rax, [r9 + r9*2]
movzx eax, word [r11 + rax*8 + 0x12]
movzx ecx, cx
mov edx, eax
xor edx, 0xffffffdf
and edx, eax
shr ecx, 5
mov eax, ecx
not eax
and eax, 0x2e63
and ecx, 0x19c
or ecx, eax
xor ecx, 0x2e62
add ebp, ecx
mov ecx, edx
test cx, cx
je 0x515cf8
sub r10d, ebp
add r10w, word [r12 + 0x38]
mov ebp, r10d
movsx eax, bp
add eax, r14d
add eax, 1
mov dword [rsi + 0x2c], eax
lea rax, [rbx + rbx*2]
mov cl, byte [r11 + rax*8 + 0xc]
mov byte [rsi + 1], cl
movzx ecx, word [r11 + rax*8 + 0x12]
mov edx, ecx
xor edx, 0xfdff
test dx, cx
je 0x515d5f
mov rax, qword [r11 + rax*8]
add rax, 0xffffffffffffffff
nop
cmp byte [rax + 1], 0
lea rax, [rax + 1]
jne 0x515d30
not ecx
or ecx, 0xfffb
cmp cx, 0xffff
je 0x515d70
lea rdi, [rax + 1]
cmp byte [rax + 1], 0
mov rax, rdi
jne 0x515d50
jmp 0x515d73
mov rax, qword [r13 + 0x10]
mov rdi, qword [rax]
test rdi, rdi
jne 0x515d77
jmp 0x515ba3
mov rdi, rax
add rdi, 1
mov rcx, rdi
call fcn.005f4bd8
mov ebx, eax
xor ebx, 0xc0000000
and ebx, eax
je 0x515ba3
mov rcx, qword [r15]
lea edx, [rbx + 0x49]
call fcn.00429840
test rax, rax
je 0x515ba3
mov rbp, rax
xorps xmm0, xmm0
movups xmmword [rax], xmm0
movups xmmword [rax + 0x30], xmm0
movups xmmword [rax + 0x20], xmm0
movups xmmword [rax + 0x10], xmm0
mov qword [rax + 0x40], 0
mov byte [rax], 0x71
mov word [rax + 0x32], 0xffff
mov rcx, rax
add rcx, 0x48
mov qword [rax + 8], rcx
mov rdx, rdi
mov r8, rbx
call fcn.005f4c20
mov byte [rbp + rbx + 0x48], 0
mov dword [rbp + 0x28], 1
mov qword [rbp + 0x10], rsi
mov dword [rbp + 4], 0x2200
mov rsi, rbp
jmp 0x515ba3