Function at 0x1400847c0
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]
mov qword [rbp], 0xfffffffffffffffe
mov rdi, r8
mov rsi, rcx
mov rbx, qword [rdx + 0x10]
movzx eax, word [rdx + 0x1c]
mov qword [rbp - 0x18], rdx
movzx ecx, byte [rdx + 0x1e]
shl ecx, 0x10
or ecx, eax
call fcn.1400c99e0
mov rcx, qword [rbp - 0x18]
movq xmm0, qword [rcx + 0x18]
punpcklbw xmm0, xmm0
punpcklwd xmm0, xmm0
pxor xmm1, xmm1
pcmpeqb xmm1, xmm0
movmskps ecx, xmm1
test cl, 8
sete r14b
test cl, 4
sete dl
test cl, 2
sete r8b
xor r9d, r9d
test cl, 1
sete r9b
shl r9d, 7
shl r8b, 6
or al, r8b
or al, r9b
shl dl, 5
shl r14b, 4
or r14b, dl
or r14b, al
cmp rbx, 0x10000
mov ecx, 2
sbb rcx, 0
xor eax, eax
cmp rbx, 0x7e
cmovae rax, rcx
cmp rax, 2
je 0x140084917
cmp rax, 1
jne 0x140084a39
mov rax, qword [rbp - 0x18]
movzx r15d, byte [rax + 0x1f]
test r15b, r15b
mov eax, 0x7e
mov r12d, 0xfe
cmove r12d, eax
mov rcx, qword [rdi + 8]
mov rdx, qword [rdi + 0x10]
mov rax, rcx
sub rax, rdx
cmp rax, 1
ja 0x1400848c5
mov r8d, 2
mov rcx, rdi
call fcn.14033e5b0
mov rcx, qword [rdi + 8]
mov rdx, qword [rdi + 0x10]
mov rax, qword [rdi]
mov byte [rax + rdx], r14b
mov byte [rax + rdx + 1], r12b
add rdx, 2
mov qword [rdi + 0x10], rdx
sub rcx, rdx
cmp rcx, 1
ja 0x1400848f7
mov r8d, 2
mov rcx, rdi
call fcn.14033e5b0
mov rax, qword [rdi]
mov rdx, qword [rdi + 0x10]
mov ecx, ebx
rol cx, 8
lea r14, [rdx + 2]
mov word [rax + rdx], cx
mov qword [rdi + 0x10], r14
test r15b, r15b
jne 0x1400849a6
jmp 0x140084a90
mov rax, qword [rbp - 0x18]
movzx r15d, byte [rax + 0x1f]
test r15b, r15b
setne r12b
mov rcx, qword [rdi + 8]
mov rdx, qword [rdi + 0x10]
mov rax, rcx
sub rax, rdx
cmp rax, 1
ja 0x140084951
mov r8d, 2
mov rcx, rdi
call fcn.14033e5b0
mov rcx, qword [rdi + 8]
mov rdx, qword [rdi + 0x10]
shl r12b, 7
or r12b, 0x7f
mov rax, qword [rdi]
mov byte [rax + rdx], r14b
mov byte [rax + rdx + 1], r12b
add rdx, 2
mov qword [rdi + 0x10], rdx
sub rcx, rdx
cmp rcx, 7
ja 0x14008498b
mov r8d, 8
mov rcx, rdi
call fcn.14033e5b0
mov rax, qword [rdi]
mov rdx, qword [rdi + 0x10]
mov rcx, rbx
bswap rcx
lea r14, [rdx + 8]
mov qword [rax + rdx], rcx
mov qword [rdi + 0x10], r14
test r15b, r15b
je 0x140084a90
mov rcx, qword [rdi + 8]
sub rcx, r14
cmp rcx, 3
ja 0x1400849cb
mov r8d, 4
mov rcx, rdi
mov rdx, r14
call fcn.14033e5b0
mov rax, qword [rdi]
mov r14, qword [rdi + 0x10]
mov rdx, qword [rbp - 0x18]
mov ecx, dword [rdx + 0x20]
mov dword [rax + r14], ecx
add r14, 4
test byte [rdx + 0x1f], 1
mov qword [rdi + 0x10], r14
mov r10d, dword [rdx + 0x20]
mov byte [rdx + 0x1f], 0
mov r15, qword [rdx]
je 0x140084c33
lea r11, [r15 + 3]
and r11, 0xfffffffffffffffc
sub r11, r15
mov rax, rbx
sub rax, r11
mov qword [rbp - 0x30], rsi
jae 0x140084aa0
lea r8, str.tungstenite::handshake::clientC:Users_antoi.cargo_registry_srcindex.crates.io_6f17d22bba15001f_tungstenite_0.20.1_srchandshakeclient.rs
xor eax, eax
mov qword [rbp - 0x20], rax
mov r11, rbx
mov rax, r8
xor ecx, ecx
mov qword [rbp - 0x28], rcx
mov dword [rbp - 0x10], r10d
test r11, r11
jne 0x140084acc
jmp 0x140084b57
mov rax, qword [rbp - 0x18]
movzx r15d, byte [rax + 0x1f]
test r15b, r15b
setne r12b
mov rax, qword [rdi + 8]
mov rdx, qword [rdi + 0x10]
sub rax, rdx
cmp rax, 1
ja 0x140084a6c
mov r8d, 2
mov rcx, rdi
call fcn.14033e5b0
mov rdx, qword [rdi + 0x10]
shl r12b, 7
or r12b, bl
mov rax, qword [rdi]
mov byte [rax + rdx], r14b
lea r14, [rdx + 2]
mov byte [rax + rdx + 1], r12b
mov qword [rdi + 0x10], r14
test r15b, r15b
jne 0x1400849a6
mov rax, qword [rbp - 0x18]
mov byte [rax + 0x1f], 0
mov r15, qword [rax]
jmp 0x140084c33
lea r8, [r15 + r11]
mov rcx, rax
shr rcx, 2
mov qword [rbp - 0x20], rcx
mov ecx, eax
and ecx, 3
mov qword [rbp - 0x28], rcx
and rax, 0xfffffffffffffffc
add rax, r8
mov dword [rbp - 0x10], r10d
test r11, r11
je 0x140084b57
mov rcx, r11
xor r12d, r12d
and rcx, 3
je 0x140084afe
nop dword [rax + rax]
movzx edx, byte [rbp + r12 - 0x10]
xor byte [r15 + r12], dl
inc r12
cmp rcx, r12
jne 0x140084ae0
lea rcx, [r15 + r12]
cmp r11, 4
jae 0x140084b07
jmp 0x140084b57
mov rcx, r15
cmp r11, 4
jb 0x140084b57
lea r13, [r15 + r11]
lea r9d, [r12 - 1]
and r9d, 3
mov edx, r12d
and edx, 3
xor rdx, 2
lea esi, [r12 + 1]
and esi, 3
movzx r12d, byte [rbp + r12 - 0x10]
movzx esi, byte [rbp + rsi - 0x10]
movzx edx, byte [rbp + rdx - 0x10]
movzx r9d, byte [rbp + r9 - 0x10]
nop dword [rax]
xor byte [rcx], r12b
xor byte [rcx + 1], sil
xor byte [rcx + 2], dl
xor byte [rcx + 3], r9b
add rcx, 4
cmp rcx, r13
jne 0x140084b40
mov ecx, r11d
shl ecx, 3
mov r12d, r10d
ror r12d, cl
test r11b, 3
cmove r12d, r10d
mov rdx, qword [rbp - 0x20]
test rdx, rdx
mov rsi, qword [rbp - 0x30]
je 0x140084c0c
lea rcx, [rdx - 1]
movabs r10, 0x3fffffffffffffff
and r10, rcx
mov rcx, r8
cmp r10, 7
jb 0x140084bf0
inc r10
mov r11, r10
and r11, 0xfffffffffffffff8
lea rcx, [r8 + r11*4]
movd xmm0, r12d
pshufd xmm0, xmm0, 0
xor r13d, r13d
nop word cs:[rax + rax]
movdqu xmm1, xmmword [r8 + r13*4]
movdqu xmm2, xmmword [r8 + r13*4 + 0x10]
pxor xmm1, xmm0
pxor xmm2, xmm0
movdqu xmmword [r8 + r13*4], xmm1
movdqu xmmword [r8 + r13*4 + 0x10], xmm2
add r13, 8
cmp r11, r13
jne 0x140084bc0
cmp r10, r11
je 0x140084c0c
lea rdx, [r8 + rdx*4]
nop word cs:[rax + rax]
xor dword [rcx], r12d
add rcx, 4
cmp rcx, rdx
jne 0x140084c00
mov rdx, qword [rbp - 0x28]
test rdx, rdx
je 0x140084c33
xor byte [rax], r12b
cmp edx, 1
je 0x140084c33
mov ecx, r12d
shr ecx, 8
xor byte [rax + 1], cl
cmp edx, 2
je 0x140084c33
shr r12d, 0x10
xor byte [rax + 2], r12b
mov rax, qword [rdi + 8]
sub rax, r14
cmp rax, rbx
jae 0x140084c51
mov rcx, rdi
mov rdx, r14
mov r8, rbx
call fcn.14033e5b0
mov r14, qword [rdi + 0x10]
mov rcx, qword [rdi]
add rcx, r14
mov rdx, r15
mov r8, rbx
call sub.VCRUNTIME140.dll_memcpy
add r14, rbx
mov qword [rdi + 0x10], r14
mov qword [rsi], 0xf
mov rax, qword [rbp - 0x18]
mov rdx, qword [rax + 8]
test rdx, rdx
je 0x140084c8b
mov r8d, 1
mov rcx, r15
call fcn.140089ca0
mov rax, rsi
add rsp, 0x58
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret