user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<compress>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  test   %edx,%edx
  je     L132
  mov    %rdi,%r14
  mov    %edx,%r13d
  jmp    L50
  nopl   (%rax)
L44:
  test   %r12d,%r12d
  je     L236
  lea    -0x1(%r15),%ebx
  test   %r15d,%r15d
  je     L208
L6:
  mov    %r12d,(%rsi)
  add    $0x4,%r14
  sub    $0x1,%r13d
  mov    %ebx,%r15d
  add    $0x4,%rsi
L256:
  test   %r13d,%r13d
  je     L132
L50:
  mov    (%r14),%r12d
  cmp    $0xff,%r12d
  jne    L44
L236:
  cmp    $0x1,%r15d
  jle    L207
  lea    0x4(%r14),%rbp
  lea    -0x1(%r13),%ebx
  cmp    0x4(%r14),%r12d
  jne    L71
  test   %ebx,%ebx
  jne    L220
  jmp    L71
  cs nopw 0x0(%rax,%rax,1)
L166:
  test   %ebx,%ebx
  je     L139
L220:
  mov    %r13d,%r14d
  add    $0x4,%rbp
  sub    %ebx,%r14d
  sub    $0x1,%ebx
  cmp    %r12d,0x0(%rbp)
  je     L166
L139:
  cmp    $0xfd,%r14d
  jg     L199
  movd   %r12d,%xmm0
  movd   %r14d,%xmm1
  punpckldq %xmm1,%xmm0
  cmp    $0x1,%r15d
  jle    L38
L222:
  mov    %rbp,%r14
  mov    %ebx,%r13d
L151:
  movq   %xmm0,(%rsi)
  sub    $0x2,%r15d
  add    $0x8,%rsi
  test   %r13d,%r13d
  jne    L50
L132:
  cmp    $0x1,%r15d
  jle    L186
L61:
  mov    D6(%rip),%rax
  mov    %rax,(%rsi)
  add    $0x18,%rsp
  lea    -0x2(%r15),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L208:
  xor    %eax,%eax
  mov    %rsi,(%rsp)
  call   <noroom@plt>
  mov    (%r14),%r12d
  mov    (%rsp),%rsi
  jmp    L6
  nopw   0x0(%rax,%rax,1)
L199:
  cmp    $0x3,%r15d
  jle    L252
L27:
  mov    %r14d,0x8(%rsi)
  sar    $0x8,%r14d
  sub    $0x4,%r15d
  mov    %ebx,%r13d
  mov    %r14d,0xc(%rsi)
  add    $0x10,%rsi
  mov    %rbp,%r14
  mov    %r12d,-0x10(%rsi)
  movl   $0xfe,-0xc(%rsi)
  jmp    L256
  nopl   0x0(%rax)
L207:
  xor    %eax,%eax
  mov    %rsi,(%rsp)
  lea    0x4(%r14),%rbp
  lea    -0x1(%r13),%ebx
  call   <noroom@plt>
  mov    (%r14),%r12d
  cmp    %r12d,0x4(%r14)
  mov    (%rsp),%rsi
  jne    L171
  test   %ebx,%ebx
  jne    L220
  movd   %r12d,%xmm0
  nopl   (%rax)
L38:
  mov    %rbp,%r14
  mov    %ebx,%r13d
L178:
  xor    %eax,%eax
  mov    %rsi,0x8(%rsp)
  movq   %xmm0,(%rsp)
  call   <noroom@plt>
  mov    0x8(%rsp),%rsi
  movq   (%rsp),%xmm0
  jmp    L151
  xchg   %ax,%ax
L252:
  xor    %eax,%eax
  mov    %rsi,(%rsp)
  call   <noroom@plt>
  mov    (%rsp),%rsi
  jmp    L27
L71:
  movd   %r12d,%xmm0
  jmp    L222
L186:
  xor    %eax,%eax
  mov    %rsi,(%rsp)
  call   <noroom@plt>
  mov    (%rsp),%rsi
  jmp    L61
L171:
  movd   %r12d,%xmm0
  mov    %rbp,%r14
  mov    %ebx,%r13d
  jmp    L178
```

tool_calls: name: parse_data
arguments: data_tag: D6
data_type: byte[8]

tool: {"D6": [0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00]}

assistant: ```c
uint16_t compress(uint8_t *in, uint8_t *out, uint16_t ilen, uint16_t omax) {
  uint8_t c;
  uint16_t n;
  while (ilen) {
    if (*in != 0xFF && *in != 0x00) {
      if (omax-- == 0)
        noroom();
      *out++ = *in++;
      ilen--;
      continue;
    }
    if (omax < 2)
      noroom();
    c = *in++;
    ilen--;
    n = 0;
    while (*in == c && ilen) {
      in++;
      n++;
      ilen--;
    }
    if (n > 253) {
      if (omax < 4)
        noroom();
      omax -= 4;
      *out++ = c;
      *out++ = 254;
      *out++ = n;
      *out++ = n >> 8;
      continue;
    }
    if (omax < 2)
      noroom();
    omax -= 2;
    *out++ = c;
    *out++ = n;
  }
  if (omax < 2)
    noroom();
  omax -= 2;
  *out++ = 255;
  *out++ = 255;
  return omax;
}
```