Function at 0x4645b1
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov rdi, qword [0x0048e390]
mov rbx, rcx
mov esi, edx
cmp dword [rbx + 0x9c], 0x105
jbe 0x4645e7
cmp dword [rbx + 0x9c], 2
ja 0x464610
jmp 0x464676
mov rcx, rbx
call sym.fill_window
mov eax, dword [rbx + 0x9c]
cmp eax, 0x105
ja 0x4645d9
test esi, esi
jne 0x464607
xor eax, eax
jmp 0x464953
test eax, eax
jne 0x4645d9
jmp 0x46489c
mov r8d, dword [rbx + 0x94]
mov rdx, qword [rbx + 0x50]
mov ecx, dword [rbx + 0x80]
lea eax, [r8 + 2]
mov r9d, r8d
and r9d, dword [rbx + 0x4c]
movzx edx, byte [rdx + rax]
mov eax, dword [rbx + 0x70]
shl eax, cl
mov rcx, qword [rbx + 0x60]
xor eax, edx
and eax, dword [rbx + 0x7c]
mov dword [rbx + 0x70], eax
add rax, rax
add rax, qword [rbx + 0x68]
movzx edx, word [rax]
test edx, edx
mov word [rcx + r9*2], dx
mov word [rax], r8w
je 0x464676
mov eax, dword [rbx + 0x44]
sub r8d, edx
sub eax, 0x106
cmp r8d, eax
ja 0x464676
mov rcx, rbx
call sym.longest_match
mov dword [rbx + 0x88], eax
mov ecx, dword [rbx + 0x88]
mov edx, dword [rbx + 0x16f4]
mov r9, qword [rbx + 0x16f8]
mov r8, qword [rbx + 0x16e8]
cmp ecx, 2
jbe 0x4647f8
mov eax, dword [rbx + 0x94]
sub eax, dword [rbx + 0x98]
mov r10d, edx
inc edx
sub ecx, 3
mov word [r9 + r10*2], ax
mov dword [rbx + 0x16f4], edx
dec eax
mov rdx, qword [0x0048e3d0]
mov byte [r8 + r10], cl
movzx ecx, cl
movzx edx, byte [rdx + rcx]
inc word [rbx + rdx*4 + 0x4c0]
cmp ax, 0xff
ja 0x4646df
movzx eax, ax
jmp 0x4646ee
shr ax, 7
add rax, 0x100
and eax, 0x3ff
movzx eax, byte [rdi + rax]
xor r9d, r9d
inc word [rbx + rax*4 + 0x9b0]
mov eax, dword [rbx + 0x16f0]
mov r8d, dword [rbx + 0x9c]
mov rdx, qword [rbx + 0x50]
mov ecx, dword [rbx + 0x80]
dec eax
cmp eax, dword [rbx + 0x16f4]
mov eax, dword [rbx + 0x88]
sete r9b
sub r8d, eax
cmp eax, dword [rbx + 0xa8]
mov dword [rbx + 0x9c], r8d
ja 0x4647c0
cmp r8d, 2
jbe 0x4647c0
mov r14d, dword [rbx + 0x7c]
mov r11, qword [rbx + 0x60]
dec eax
mov r12d, dword [rbx + 0x4c]
mov r13, qword [rbx + 0x68]
mov dword [rbx + 0x88], eax
mov eax, dword [rbx + 0x94]
mov ebp, dword [rbx + 0x70]
lea r8d, [rax + 1]
lea r10d, [rax + 3]
shl ebp, cl
mov dword [rbx + 0x94], r8d
movzx r10d, byte [rdx + r10]
xor r10d, ebp
mov ebp, r8d
and r10d, r14d
and ebp, r12d
mov dword [rbx + 0x70], r10d
lea r10, [r13 + r10*2]
mov r15w, word [r10]
mov word [r11 + rbp*2], r15w
mov r15d, dword [rbx + 0x88]
mov word [r10], r8w
lea r8d, [r15 - 1]
test r8d, r8d
mov dword [rbx + 0x88], r8d
jne 0x46475a
add eax, 2
mov dword [rbx + 0x94], eax
jmp 0x464844
add eax, dword [rbx + 0x94]
mov dword [rbx + 0x88], 0
mov r8d, eax
mov dword [rbx + 0x94], eax
inc eax
movzx r8d, byte [rdx + r8]
mov dword [rbx + 0x70], r8d
movzx eax, byte [rdx + rax]
shl r8d, cl
xor r8d, eax
and r8d, dword [rbx + 0x7c]
mov dword [rbx + 0x70], r8d
jmp 0x464844
mov eax, dword [rbx + 0x94]
mov rcx, qword [rbx + 0x50]
movzx eax, byte [rcx + rax]
mov ecx, edx
inc edx
mov word [r9 + rcx*2], 0
mov dword [rbx + 0x16f4], edx
xor r9d, r9d
mov byte [r8 + rcx], al
inc word [rbx + rax*4 + 0xbc]
mov eax, dword [rbx + 0x16f0]
dec eax
cmp eax, dword [rbx + 0x16f4]
sete r9b
dec dword [rbx + 0x9c]
inc dword [rbx + 0x94]
test r9d, r9d
je 0x4645cd
movsxd rax, dword [rbx + 0x84]
mov r8d, dword [rbx + 0x94]
xor edx, edx
sub r8d, eax
test eax, eax
js 0x46486b
add rax, qword [rbx + 0x50]
mov rdx, rax
xor r9d, r9d
mov rcx, rbx
call sym._tr_flush_block
mov eax, dword [rbx + 0x94]
mov rcx, qword [rbx]
mov dword [rbx + 0x84], eax
call sym.flush_pending
mov rax, qword [rbx]
cmp dword [rax + 0x18], 0
jne 0x4645cd
jmp 0x464600
mov r8d, dword [rbx + 0x94]
mov eax, 2
cmp r8d, 2
cmovbe eax, r8d
cmp esi, 4
mov dword [rbx + 0x170c], eax
jne 0x464902
movsxd rax, dword [rbx + 0x84]
xor edx, edx
sub r8d, eax
test eax, eax
js 0x4648d2
add rax, qword [rbx + 0x50]
mov rdx, rax
mov r9d, 1
mov rcx, rbx
call sym._tr_flush_block
mov eax, dword [rbx + 0x94]
mov rcx, qword [rbx]
mov dword [rbx + 0x84], eax
call sym.flush_pending
mov rax, qword [rbx]
cmp dword [rax + 0x18], 1
sbb eax, eax
add eax, 3
jmp 0x464953
cmp dword [rbx + 0x16f4], 0
mov eax, 1
je 0x464953
movsxd rax, dword [rbx + 0x84]
xor edx, edx
sub r8d, eax
test eax, eax
js 0x464927
add rax, qword [rbx + 0x50]
mov rdx, rax
xor r9d, r9d
mov rcx, rbx
call sym._tr_flush_block
mov eax, dword [rbx + 0x94]
mov rcx, qword [rbx]
mov dword [rbx + 0x84], eax
call sym.flush_pending
mov rax, qword [rbx]
cmp dword [rax + 0x18], 0
setne al
movzx eax, al
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret