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     L222
  mov    %edx,%r13d
  jmp    L182
  nopw   0x0(%rax,%rax,1)
L242:
  test   %r12d,%r12d
  je     L258
  lea    -0x1(%r15),%ebx
  test   %r15d,%r15d
  je     L25
L39:
  mov    %r12d,(%rsi)
  add    $0x4,%rdi
  sub    $0x1,%r13d
  mov    %ebx,%r15d
  add    $0x4,%rsi
L149:
  test   %r13d,%r13d
  je     L222
L182:
  mov    (%rdi),%r12d
  cmp    $0xff,%r12d
  jne    L242
L258:
  cmp    $0x1,%r15d
  jle    L33
  lea    0x4(%rdi),%rbp
  lea    -0x1(%r13),%ebx
  cmp    0x4(%rdi),%r12d
  jne    L214
  xor    %r14d,%r14d
  test   %ebx,%ebx
  jne    L105
  jmp    L197
  nopw   0x0(%rax,%rax,1)
L104:
  test   %ebx,%ebx
  je     L254
L105:
  mov    %r13d,%r14d
  add    $0x4,%rbp
  sub    %ebx,%r14d
  sub    $0x1,%ebx
  cmp    %r12d,0x0(%rbp)
  je     L104
L254:
  cmp    $0xfd,%r14d
  jg     L7
  cmp    $0x1,%r15d
  jle    L131
L197:
  mov    %rbp,%rdi
  mov    %ebx,%r13d
L151:
  mov    %r12d,(%rsi)
  sub    $0x2,%r15d
  add    $0x8,%rsi
  mov    %r14d,-0x4(%rsi)
  test   %r13d,%r13d
  jne    L182
L222:
  cmp    $0x1,%r15d
  jle    L109
L210:
  movabs $0xff000000ff,%rax
  mov    %rax,(%rsi)
  add    $0x18,%rsp
  lea    -0x2(%r15),%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L25:
  xor    %eax,%eax
  mov    %rsi,0x8(%rsp)
  mov    %rdi,(%rsp)
  call   <noroom@plt>
  mov    (%rsp),%rdi
  mov    0x8(%rsp),%rsi
  mov    (%rdi),%r12d
  jmp    L39
  nopl   0x0(%rax)
L7:
  cmp    $0x3,%r15d
  jle    L43
L27:
  mov    %r14d,0x8(%rsi)
  sar    $0x8,%r14d
  sub    $0x4,%r15d
  mov    %ebx,%r13d
  mov    %r12d,(%rsi)
  mov    %rbp,%rdi
  add    $0x10,%rsi
  movl   $0xfe,-0xc(%rsi)
  mov    %r14d,-0x4(%rsi)
  jmp    L149
  nopl   0x0(%rax,%rax,1)
L33:
  xor    %eax,%eax
  mov    %rsi,0x8(%rsp)
  lea    -0x1(%r13),%ebx
  mov    %rdi,(%rsp)
  call   <noroom@plt>
  mov    (%rsp),%rdi
  mov    0x8(%rsp),%rsi
  mov    (%rdi),%r12d
  cmp    %r12d,0x4(%rdi)
  lea    0x4(%rdi),%rbp
  jne    L106
  xor    %r14d,%r14d
  test   %ebx,%ebx
  jne    L105
  nopl   (%rax)
L131:
  mov    %rbp,%rdi
  mov    %ebx,%r13d
L93:
  xor    %eax,%eax
  mov    %rsi,0x8(%rsp)
  mov    %rdi,(%rsp)
  call   <noroom@plt>
  mov    0x8(%rsp),%rsi
  mov    (%rsp),%rdi
  jmp    L151
  nopl   0x0(%rax)
L43:
  xor    %eax,%eax
  mov    %rsi,(%rsp)
  call   <noroom@plt>
  mov    (%rsp),%rsi
  jmp    L27
L109:
  xor    %eax,%eax
  mov    %rsi,(%rsp)
  call   <noroom@plt>
  mov    (%rsp),%rsi
  jmp    L210
L214:
  mov    %rbp,%rdi
  mov    %ebx,%r13d
  xor    %r14d,%r14d
  jmp    L151
L106:
  mov    %rbp,%rdi
  mov    %ebx,%r13d
  xor    %r14d,%r14d
  jmp    L93
```

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;
}
```