// File: /workspace/github_cpp_makefile_star2_O3/sbingner[P]kerneldec/lzfse/src/lzvn_encode_base.c
// Function: lzvn_encode_buffer
size_t lzvn_encode_buffer(void *__restrict dst, size_t dst_size,
                          const void *__restrict src, size_t src_size,
                          void *__restrict work) {
  size_t src_used = 0;
  size_t dst_used =
      lzvn_encode_partial(dst, dst_size, src, src_size, &src_used, work);
  if (src_used != src_size)
    return 0;      // could not encode entire input stream = fail
  return dst_used; // return encoded size
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rcx, %r14
cmpq $0x8, %rsi
jae 0x7074
xorl %edx, %edx
xorl %ecx, %ecx
jmp 0x725f
movq %rdx, %r15
movq %rsi, %r12
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq %rbp, %r14
cmovbq %r14, %rbp
pxor %xmm0, %xmm0
movdqu %xmm0, 0x50(%rsp)
movdqu %xmm0, 0x60(%rsp)
movdqu %xmm0, 0x80(%rsp)
movdqu %xmm0, 0x70(%rsp)
movdqu %xmm0, 0x40(%rsp)
xorl %eax, %eax
movq %rax, 0x90(%rsp)
movq %rdx, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movq %rbp, 0x30(%rsp)
movq %rax, 0x38(%rsp)
movq %rdi, 0x50(%rsp)
movq %rdi, 0x58(%rsp)
leaq (%rdi,%rsi), %rbx
addq $-0x8, %rbx
movq %rbx, 0x60(%rsp)
movq %r8, 0x98(%rsp)
cmpq $0x8, %r14
jb 0x715f
movq %rdi, 0x8(%rsp)
addq $-0x8, %rbp
movq %rbp, 0x40(%rsp)
movd (%r15), %xmm1
movdqa %xmm0, 0xa0(%rsp)
pshufd $0x0, %xmm1, %xmm0      # xmm0 = xmm1[0,0,0,0]
addq $0x10, %r8
xorl %eax, %eax
movdqa 0xa0(%rsp), %xmm1
movdqu %xmm1, -0x10(%r8,%rax)
movdqu %xmm0, (%r8,%rax)
addq $0x20, %rax
cmpq $0x80000, %rax          # imm = 0x80000
jne 0x7115
leaq 0x20(%rsp), %r13
movq %r13, %rdi
callq 0x645c
movq (%r13), %r15
movq 0x10(%r13), %rbp
movq 0x28(%r13), %rax
movq 0x30(%r13), %rcx
movq 0x40(%r13), %rbx
movq 0x8(%rsp), %rdi
jmp 0x7162
movq %rdi, %rcx
movq %r14, 0x18(%rsp)
addq %r12, %rdi
movq %rdi, 0x8(%rsp)
subq %rax, %rbp
addq %rax, %r15
cmpq $0x10, %rbp
movq %rcx, 0x10(%rsp)
jb 0x71dc
movq %rbp, %r12
movq %rcx, %r14
movl $0x10f, %eax            # imm = 0x10F
cmpq %rax, %r12
movl $0x10f, %r13d           # imm = 0x10F
cmovbq %r12, %r13
leaq (%r14,%r13), %rax
addq $0xa, %rax
cmpq %rbx, %rax
jae 0x7234
movl %r13d, %eax
shll $0x8, %eax
addl $0xfffff0e0, %eax       # imm = 0xFFFFF0E0
movw %ax, (%r14)
leaq 0x2(%r14), %rdi
subq %r13, %r12
movq %r15, %rsi
movq %r13, %rdx
callq 0x30c0
addq %r13, %r14
addq $0x2, %r14
addq %r13, %r15
cmpq $0xf, %r12
ja 0x7186
jmp 0x71e2
movq %rcx, %r14
movq %rbp, %r12
testq %r12, %r12
je 0x721e
leaq (%r14,%r12), %rax
addq $0xa, %rax
cmpq %rbx, %rax
movq 0x10(%rsp), %rax
jae 0x7239
movl %r12d, %eax
orb $-0x20, %al
leaq 0x1(%r14), %rdi
movb %al, (%r14)
movq %r15, %rsi
movq %r12, %rdx
callq 0x30c0
leaq (%r14,%r12), %rax
incq %rax
movq 0x60(%rsp), %rbx
jmp 0x7221
movq %r14, %rax
cmpq %rbx, %rax
jae 0x722d
addq %rbp, 0x48(%rsp)
jmp 0x7239
movq 0x50(%rsp), %rax
jmp 0x7239
movq 0x10(%rsp), %rax
leaq 0x8(%rax), %rcx
cmpq %rcx, 0x8(%rsp)
jae 0x7249
movq %rax, %rcx
jmp 0x7250
movq $0x6, (%rax)
movq 0x18(%rsp), %r14
movq 0x48(%rsp), %rdx
subq 0x58(%rsp), %rcx
xorl %eax, %eax
cmpq %r14, %rdx
cmoveq %rcx, %rax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop