Function at 0x170053730
Capabilities:
Encode data using xor

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0x58
lea rbp, [rsp + 0x50]
movdqa xmmword [rbp - 0x10], xmm7
movdqa xmmword [rbp - 0x20], xmm6
and rsp, 0xfffffffffffffff0
mov r15, r8
cmp edx, 1
ja 0x170053772
test r15, r15
je 0x170053adf
mov dword [r15], 0
xor eax, eax
jmp 0x170053ae1
mov r12, rcx
test r15, r15
je 0x17005377f
mov edi, dword [r15]
jmp 0x170053784
mov edi, 0xffffffff
mov eax, edx
and eax, 1
shl eax, 9
movsxd rcx, edx
lea rsi, [rcx - 1]
cmp byte [r12 + rcx - 1], 0
cmovne esi, edx
mov ecx, esi
sar ecx, 1
cmp ecx, 0x100
mov r13d, 0x100
cmovl r13d, ecx
movzx edx, word [r12]
lea ecx, [rax + 8]
cmp edx, 0xfeff
cmovne ecx, eax
lea r14d, [rcx + 0x80]
cmp dx, 0xfffe
cmovne r14d, ecx
test dil, 2
je 0x1700539be
xor eax, eax
cmp esi, 2
jl 0x1700539a7
movzx ecx, dx
xor eax, eax
cmp ecx, 0x100
setb al
mov r10d, 1
cmp r13d, 2
cmovge r10d, r13d
jl 0x1700539a7
lea r8, [r10 - 1]
mov ecx, 1
cmp r8, 8
jb 0x170053990
mov rcx, r8
and rcx, 0xfffffffffffffff8
movd xmm0, eax
lea rax, [rcx - 8]
mov r9, rax
shr r9, 3
add r9, 1
test rax, rax
je 0x1700538fc
mov rax, r9
and rax, 0xfffffffffffffffe
neg rax
pxor xmm1, xmm1
xor ebx, ebx
movdqa xmm2, xmmword [0x170078a60]
movdqa xmm3, xmmword [0x170078a70]
movdqa xmm4, xmmword [0x170078a80]
nop word cs:[rax + rax]
nop
movq xmm5, qword [r12 + rbx*2 + 2]
movq xmm6, qword [r12 + rbx*2 + 0xa]
pxor xmm5, xmm2
movdqa xmm7, xmm3
pcmpgtw xmm7, xmm5
punpcklwd xmm7, xmm7
pand xmm7, xmm4
paddd xmm7, xmm0
pxor xmm6, xmm2
movdqa xmm5, xmm3
pcmpgtw xmm5, xmm6
punpcklwd xmm5, xmm5
pand xmm5, xmm4
paddd xmm5, xmm1
movq xmm1, qword [r12 + rbx*2 + 0x12]
movq xmm6, qword [r12 + rbx*2 + 0x1a]
pxor xmm1, xmm2
movdqa xmm0, xmm3
pcmpgtw xmm0, xmm1
punpcklwd xmm0, xmm0
pand xmm0, xmm4
paddd xmm0, xmm7
pxor xmm6, xmm2
movdqa xmm1, xmm3
pcmpgtw xmm1, xmm6
punpcklwd xmm1, xmm1
pand xmm1, xmm4
paddd xmm1, xmm5
add rbx, 0x10
add rax, 2
jne 0x170053870
jmp 0x170053902
pxor xmm1, xmm1
xor ebx, ebx
test r9b, 1
je 0x170053960
add rbx, rbx
or rbx, 2
movq xmm2, qword [r12 + rbx + 8]
movdqa xmm3, xmmword [0x170078a60]
pxor xmm2, xmm3
movdqa xmm4, xmmword [0x170078a70]
movdqa xmm5, xmm4
pcmpgtw xmm5, xmm2
punpcklwd xmm5, xmm5
movdqa xmm2, xmmword [0x170078a80]
pand xmm5, xmm2
paddd xmm1, xmm5
movq xmm5, qword [r12 + rbx]
pxor xmm5, xmm3
pcmpgtw xmm4, xmm5
punpcklwd xmm4, xmm4
pand xmm4, xmm2
paddd xmm0, xmm4
paddd xmm0, xmm1
pshufd xmm1, xmm0, 0xee
paddd xmm1, xmm0
pshufd xmm0, xmm1, 0x55
paddd xmm0, xmm1
movd eax, xmm0
cmp r8, rcx
je 0x1700539a7
or rcx, 1
nop word cs:[rax + rax]
nop dword [rax]
movzx ebx, word [r12 + rcx*2]
cmp ebx, 0x100
adc eax, 0
add rcx, 1
cmp r10, rcx
jne 0x170053990
mov ecx, r13d
shr ecx, 0x1f
add ecx, r13d
sar ecx, 1
mov ebx, r14d
or ebx, 2
cmp eax, ecx
cmovg r14d, ebx
test edi, 0x1000
je 0x170053a15
cmp esi, 2
jl 0x170053a15
cmp r13d, 2
mov eax, 1
cmovge eax, r13d
movzx ecx, dx
cmp ecx, 0x100
jb 0x170053a0e
movzx ecx, dl
test cx, cx
je 0x170053a0e
mov ecx, 1
cmp rax, rcx
je 0x170053a15
movzx ebx, word [r12 + rcx*2]
cmp ebx, 0x100
jb 0x170053a0e
movzx ebx, bl
add rcx, 1
test bx, bx
jne 0x1700539f0
or r14d, 0x1000
test dil, 4
je 0x170053a88
cmp esi, 2
jl 0x170053a88
mov dword [rsp + 0x24], edi
mov qword [rsp + 0x28], r15
cmp r13d, 2
mov r15d, 1
cmovge r15d, r13d
lea rcx, [0x170078a90]
call sym.ntdll.dll_wcschr
test rax, rax
jne 0x170053a7b
mov edi, 1
lea rbx, [0x170078a90]
nop word cs:[rax + rax]
nop
cmp r15, rdi
je 0x170053a7f
movzx edx, word [r12 + rdi*2]
mov rcx, rbx
call sym.ntdll.dll_wcschr
add rdi, 1
test rax, rax
je 0x170053a60
or r14d, 4
mov r15, qword [rsp + 0x28]
mov edi, dword [rsp + 0x24]
test dil, 0x40
je 0x170053acb
cmp esi, 2
jl 0x170053acb
cmp r13d, 2
mov esi, 1
cmovge esi, r13d
xor edi, edi
lea rbx, [0x170078a9c]
nop dword [rax]
movzx edx, word [r12 + rdi*2]
mov rcx, rbx
call sym.ntdll.dll_wcschr
test rax, rax
jne 0x170053b0e
add rdi, 1
cmp rsi, rdi
jne 0x170053ab0
test r15, r15
je 0x170053ad6
and r14d, dword [r15]
mov dword [r15], r14d
test r14d, 0xff0
je 0x170053afa
xor eax, eax
movaps xmm6, xmmword [rbp - 0x20]
movaps xmm7, xmmword [rbp - 0x10]
lea rsp, [rbp + 8]
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov al, 1
test r14d, 0x1000
jne 0x170053ae1
test r14b, 0xf
setne al
jmp 0x170053ae1
or r14d, 0x40
test r15, r15
jne 0x170053ad0
jmp 0x170053ad6