// File: /workspace/github_cpp_makefile_star2_O1/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 $0xd8, %rsp
movq %rcx, %rbx
cmpq $0x8, %rsi
jae 0x7421
xorl %ecx, %ecx
xorl %edx, %edx
jmp 0x7622
movq %rsi, %r15
movq %rdi, %r14
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, %rbx
cmovbq %rbx, %rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movaps %xmm0, 0x60(%rsp)
movq %rdx, 0x10(%rsp)
xorl %ecx, %ecx
movq %rcx, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movq %rcx, 0x38(%rsp)
movq %rcx, 0x28(%rsp)
movq %rdi, 0x40(%rsp)
movq %rdi, 0x48(%rsp)
leaq (%rdi,%rsi), %rcx
addq $-0x8, %rcx
movq %rcx, 0x50(%rsp)
movq %r8, 0x88(%rsp)
cmpq $0x8, %rbx
jb 0x74fc
addq $-0x8, %rax
movq %rax, 0x30(%rsp)
movl (%rdx), %eax
movaps %xmm0, 0xb0(%rsp)
movl $0x4, %ecx
movl %eax, 0xb0(%rsp,%rcx,4)
incq %rcx
cmpq $0x8, %rcx
jne 0x74b9
xorl %eax, %eax
movaps 0xb0(%rsp), %xmm0
movaps 0xc0(%rsp), %xmm1
movups %xmm1, 0x10(%r8,%rax)
movups %xmm0, (%r8,%rax)
addq $0x20, %rax
cmpq $0x80000, %rax          # imm = 0x80000
jne 0x74cb
leaq 0x10(%rsp), %rdi
callq 0x666c
movq %r15, 0xa0(%rsp)
movq %rbx, 0xa8(%rsp)
movq 0x20(%rsp), %r13
movq 0x38(%rsp), %r12
subq %r12, %r13
addq 0x10(%rsp), %r12
movq 0x40(%rsp), %r15
movq 0x50(%rsp), %rbx
cmpq $0x10, %r13
movq %r14, 0x8(%rsp)
movq %r13, 0x98(%rsp)
jb 0x758a
movl $0x10f, %r14d           # imm = 0x10F
cmpq %r14, %r13
movl $0x10f, %ebp            # imm = 0x10F
cmovbq %r13, %rbp
leaq (%r15,%rbp), %rax
addq $0xa, %rax
cmpq %rbx, %rax
jae 0x75c6
movl %ebp, %eax
shll $0x8, %eax
addl $0xfffff0e0, %eax       # imm = 0xFFFFF0E0
movw %ax, (%r15)
leaq 0x2(%r15), %rdi
subq %rbp, %r13
movq %r12, %rsi
movq %rbp, %rdx
callq 0x30c0
addq %rbp, %r15
addq $0x2, %r15
addq %rbp, %r12
cmpq $0xf, %r13
ja 0x7541
testq %r13, %r13
movq 0x8(%rsp), %r14
je 0x75c1
leaq (%r15,%r13), %rax
addq $0xa, %rax
cmpq %rbx, %rax
jae 0x75cb
movl %r13d, %eax
orb $-0x20, %al
leaq 0x1(%r15), %rdi
movb %al, (%r15)
movq %r12, %rsi
movq %r13, %rdx
callq 0x30c0
leaq (%r15,%r13), %rbx
incq %rbx
jmp 0x75cb
movq %r15, %rbx
jmp 0x75cb
movq 0x8(%rsp), %r14
addq 0xa0(%rsp), %r14
cmpq 0x50(%rsp), %rbx
jae 0x75ec
movq %rbx, 0x40(%rsp)
movq 0x98(%rsp), %rax
addq %rax, 0x38(%rsp)
movq %r14, 0x50(%rsp)
movq 0x40(%rsp), %rax
leaq 0x8(%rax), %rcx
cmpq %rcx, %r14
jb 0x760b
movq $0x6, (%rax)
movq %rcx, 0x40(%rsp)
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rdx
subq 0x48(%rsp), %rdx
movq 0xa8(%rsp), %rbx
xorl %eax, %eax
cmpq %rbx, %rcx
cmoveq %rdx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)