user: Please show me the C implementation that matches the assembly code listed below:

```asm
<mmini_lzl_compress>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x8,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %rcx,-0x80(%rbp)
  movq   $0x3,-0x58(%rbp)
  movq   $0x0,-0x40(%rbp)
  mov    -0x68(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x68(%rbp),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x78(%rbp),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x5c(%rbp)
  jmp    L106
L193:
  mov    -0x5c(%rbp),%eax
  shr    $0x4,%eax
  mov    $0x7ff,%edx
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  cltq
  mov    %rax,-0x18(%rbp)
  mov    -0x38(%rbp),%rax
  sub    -0x68(%rbp),%rax
  cmp    %rax,-0x18(%rbp)
  jae    L155
  mov    -0x18(%rbp),%rax
  neg    %rax
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  jmp    L100
L155:
  mov    -0x68(%rbp),%rax
L100:
  mov    %rax,-0x48(%rbp)
  mov    -0x28(%rbp),%rax
  sub    -0x38(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    $0x7f,%edx
  cmp    %rdx,%rax
  cmova  %rdx,%rax
  mov    %rax,-0x10(%rbp)
  jmp    L121
L149:
  movq   $0x0,-0x50(%rbp)
  jmp    L130
L173:
  addq   $0x1,-0x50(%rbp)
L130:
  mov    -0x48(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0x38(%rbp),%rcx
  mov    -0x50(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L192
  mov    -0x50(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jne    L173
L192:
  mov    -0x50(%rbp),%rax
  cmp    -0x58(%rbp),%rax
  jbe    L123
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x40(%rbp)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x50(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  je     L227
L123:
  nop
L176:
  addq   $0x1,-0x48(%rbp)
  mov    -0x48(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    %al,%dl
  jne    L176
L121:
  mov    -0x48(%rbp),%rax
  cmp    -0x38(%rbp),%rax
  jne    L149
  jmp    L177
L227:
  nop
L177:
  cmpq   $0x3,-0x58(%rbp)
  jbe    L7
  mov    -0x38(%rbp),%rax
  sub    -0x40(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x30(%rbp),%rax
  add    $0x3,%rax
  cmp    %rax,-0x20(%rbp)
  jae    L76
  mov    $0x0,%eax
  jmp    L20
L76:
  mov    -0x58(%rbp),%rax
  mov    %eax,%ecx
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  and    $0x3,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x58(%rbp),%rax
  add    %eax,%eax
  and    $0xfffffff8,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  shr    $0x8,%rax
  mov    %eax,%esi
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  or     %esi,%ecx
  mov    %ecx,%edx
  mov    %dl,(%rax)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  mov    -0x8(%rbp),%rdx
  mov    %dl,(%rax)
  mov    -0x58(%rbp),%rax
  add    %rax,-0x38(%rbp)
  movq   $0x3,-0x58(%rbp)
  movl   $0x0,-0x5c(%rbp)
  jmp    L106
L7:
  mov    -0x38(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x3,%al
  ja     L144
  mov    -0x30(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jne    L67
  mov    $0x0,%eax
  jmp    L20
L67:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  mov    -0x38(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L144:
  mov    -0x30(%rbp),%rax
  cmp    -0x20(%rbp),%rax
  jne    L211
  mov    $0x0,%eax
  jmp    L20
L211:
  mov    -0x38(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x30(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  cmpl   $0x7e,-0x5c(%rbp)
  ja     L106
  addl   $0x1,-0x5c(%rbp)
L106:
  mov    -0x38(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L193
  mov    -0x30(%rbp),%rax
  sub    -0x78(%rbp),%rax
L20:
  leave
  ret
```

assistant: ```c
unsigned long mmini_lzl_compress(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long outlen) {
  unsigned long best_match_l = 3, match_l, match_max, offset, tmp;
  const unsigned char *scan_i, *best_scan_match_i = (const unsigned char *)0, *i = in, *ieof = (in + inlen);
  unsigned char *o = out, *oeof = (out + outlen);
  unsigned int slack = 0;
  while (i != ieof) {
    tmp = 0x7ff >> (slack >> 4);
    scan_i = (((unsigned long)(i - in)) > tmp) ? (i - tmp) : in;
    tmp = (unsigned long)(ieof - i);
    match_max = (tmp > 0x7f) ? 0x7f : tmp;
    while (scan_i != i) {
      match_l = 0;
      while ((scan_i[match_l] == i[match_l]) && (match_l != match_max))
        ++match_l;
      if (match_l > best_match_l) {
        best_scan_match_i = scan_i;
        best_match_l = match_l;
        if (match_l == match_max)
          break;
      }
      while (*(++scan_i) != *i) {
      }
    }
    if (best_match_l >= 4) {
      offset = (unsigned long)(i - best_scan_match_i);
      if ((o + 3) > oeof)
        return 0;
      *(o++) = (unsigned char)(best_match_l & 0x03);
      *(o++) = (unsigned char)(((best_match_l & 0x7c) << 1) | (offset >> 8));
      *(o++) = (unsigned char)(offset & 0xff);
      i += best_match_l;
      best_match_l = 3;
      slack = 0;
    } else {
      if (*i <= 0x03) {
        if (o == oeof)
          return 0;
        *(o++) = *i;
      }
      if (o == oeof)
        return 0;
      *(o++) = *(i++);
      if (slack < 0x7f)
        ++slack;
    }
  }
  return (unsigned long)(o - out);
}
```