user: 请将以下的汇编代码转换成C语言代码：

```asm
<mmini_lzl_compress>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  lea    (%rdx,%rcx,1),%r12
  push   %rbp
  lea    (%rdi,%rsi,1),%rbp
  push   %rbx
  cmp    %rbp,%rdi
  je     L189
  mov    %rdx,%r14
  mov    %rdx,%r10
  mov    %rdi,%rbx
  mov    %rdi,%rsi
  mov    %rdi,%rdx
  mov    $0x3,%r8d
  xor    %r9d,%r9d
  xor    %r11d,%r11d
  mov    $0x7ff,%r13d
L86:
  mov    %rbp,%r15
  mov    $0x7f,%eax
  movzbl (%rsi),%edi
  sub    %rsi,%r15
  cmp    %rax,%r15
  cmova  %rax,%r15
  cmp    %rsi,%rdx
  je     L183
  movzbl (%rdx),%ecx
  nopl   0x0(%rax)
L65:
  xor    %eax,%eax
  cmp    %dil,%cl
  je     L82
  jmp    L9
  nopl   0x0(%rax)
L112:
  cmp    %rax,%r15
  je     L13
L82:
  add    $0x1,%rax
  movzbl (%rsi,%rax,1),%ecx
  cmp    %cl,(%rdx,%rax,1)
  je     L112
  cmp    %r8,%rax
  jbe    L9
  mov    %rdx,%r9
  cmp    %rax,%r15
  je     L68
  mov    %rax,%r8
  nopw   0x0(%rax,%rax,1)
L9:
  movzbl 0x1(%rdx),%ecx
  add    $0x1,%rdx
  cmp    %dil,%cl
  jne    L9
  cmp    %rsi,%rdx
  jne    L65
  cmp    $0x3,%r8
  jbe    L183
L138:
  mov    %rsi,%rcx
  lea    0x3(%r10),%rdx
  sub    %r9,%rcx
  cmp    %rdx,%r12
  jb     L189
  mov    %r8d,%eax
  mov    %rcx,%rdi
  add    %r8,%rsi
  mov    %cl,0x2(%r10)
  and    $0x3,%eax
  shr    $0x8,%rdi
  xor    %r11d,%r11d
  mov    %al,(%r10)
  lea    (%r8,%r8,1),%eax
  mov    $0x3,%r8d
  and    $0xfffffff8,%eax
  or     %edi,%eax
  mov    %al,0x1(%r10)
  mov    %rdx,%r10
  cmp    %rsi,%rbp
  je     L142
L5:
  mov    %r11d,%ecx
  mov    %r13d,%eax
  mov    %rsi,%rdx
  shr    $0x4,%ecx
  sar    %cl,%eax
  mov    %rsi,%rcx
  cltq
  sub    %rbx,%rcx
  sub    %rax,%rdx
  cmp    %rax,%rcx
  cmovbe %rbx,%rdx
  jmp    L86
  nopl   0x0(%rax)
L13:
  cmp    %r8,%r15
  jbe    L9
  mov    %rdx,%r9
L68:
  mov    %r15,%r8
  cmp    $0x3,%r8
  ja     L138
L183:
  cmp    $0x3,%dil
  ja     L50
  cmp    %r10,%r12
  je     L189
  lea    0x1(%r10),%rax
  mov    %dil,(%r10)
  cmp    %r12,%rax
  je     L189
L171:
  movzbl (%rsi),%edx
  add    $0x1,%rsi
  cmp    $0x7f,%r11d
  lea    0x1(%rax),%r10
  adc    $0x0,%r11d
  mov    %dl,(%rax)
  cmp    %rsi,%rbp
  jne    L5
L142:
  mov    %r10,%rax
  pop    %rbx
  pop    %rbp
  sub    %r14,%rax
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L50:
  mov    %r10,%rax
  cmp    %r12,%rax
  jne    L171
L189:
  pop    %rbx
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  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);
}
```