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

```asm
<ll2escaped>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,0x8(%rsp)
  test   %r8d,%r8d
  jle    L11
  mov    %edx,%r13d
  lea    -0x1(%rdx),%eax
  test   %edx,%edx
  je     L102
  mov    %rcx,%r15
  mov    %rsi,%rbx
  mov    %r8d,%r14d
  mov    %rsi,%rcx
  nopw   0x0(%rax,%rax,1)
L129:
  movslq (%rcx),%r12
  lea    0x4(%rcx),%rbp
  test   %r12d,%r12d
  jne    L182
  test   %r14d,%r14d
  je     L25
  mov    %rbp,%r9
  movb   $0x0,(%r15)
  sub    %rbx,%r9
  sar    $0x2,%r9
L5:
  add    $0x18,%rsp
  mov    %r9d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L182:
  mov    %r12d,%edx
  and    $0xc0,%edx
  cmp    $0xc0,%edx
  je     L76
  test   %edx,%edx
  jne    L29
  mov    %eax,%r13d
  sub    %r12d,%r13d
  js     L144
  mov    %r14d,%ecx
  mov    %r15,%rdx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <l2escaped@plt>
  mov    %eax,%r9d
  test   %eax,%eax
  js     L5
  mov    %r14d,%edx
  cltq
  lea    0x0(%rbp,%r12,4),%rcx
  add    %r15,%rax
  sub    %r9d,%edx
  lea    -0x1(%rdx),%r14d
  je     L21
  movb   $0x2e,(%rax)
  lea    0x1(%rax),%r15
  lea    -0x1(%r13),%eax
  test   %r13d,%r13d
  jne    L129
L102:
  lea    D29(%rip),%rdi
  xor    %eax,%eax
  call   <L_DEBUG@plt>
  mov    $0xfffffffe,%r9d
  jmp    L5
  nopl   0x0(%rax)
L21:
  mov    $0x2e,%esi
  lea    D33(%rip),%rdi
  xor    %eax,%eax
  call   <L_DEBUG@plt>
  mov    $0xffffffff,%r9d
  jmp    L5
L76:
  mov    0x8(%rsp),%rdi
  test   %rdi,%rdi
  je     L61
  lea    -0x2(%r13),%edx
  test   %eax,%eax
  je     L102
  mov    %r12d,%esi
  lea    0x8(%rcx),%r13
  movslq 0x4(%rcx),%rcx
  movslq %edx,%rdx
  sar    $0x1f,%esi
  lea    0x0(%r13,%rdx,4),%rdx
  mov    %r14d,%r8d
  sub    %rbx,%r13
  shr    $0x1a,%esi
  sar    $0x2,%r13
  lea    (%r12,%rsi,1),%eax
  and    $0x3f,%eax
  sub    %esi,%eax
  shl    $0x8,%eax
  cltq
  add    %rcx,%rax
  mov    %r15,%rcx
  lea    (%rdi,%rax,4),%rsi
  sub    %rsi,%rdx
  sar    $0x2,%rdx
  call   <ll2escaped>
  mov    %eax,%r9d
  test   %eax,%eax
  cmovns %r13d,%r9d
  jmp    L5
L29:
  lea    D31(%rip),%rdi
  xor    %eax,%eax
  call   <L_DEBUG@plt>
  mov    $0xfffffffe,%r9d
  jmp    L5
L144:
  mov    %r12d,%esi
  mov    %r12d,%edx
  lea    D11(%rip),%rdi
  sub    %eax,%esi
  xor    %eax,%eax
  call   <L_DEBUG@plt>
  mov    $0xfffffffe,%r9d
  jmp    L5
L25:
  xor    %esi,%esi
  lea    D33(%rip),%rdi
  xor    %eax,%eax
  call   <L_DEBUG@plt>
  mov    $0xffffffff,%r9d
  jmp    L5
L11:
  lea    D35(%rip),%rdi
  xor    %eax,%eax
  call   <L_DEBUG@plt>
  mov    $0xffffffff,%r9d
  jmp    L5
L61:
  mov    $0xfffffffd,%r9d
  jmp    L5
```

tool_calls: name: disassemble_data
arguments: data_label: D29
data_type: string
name: disassemble_data
arguments: data_label: D33
data_type: string
name: disassemble_data
arguments: data_label: D31
data_type: string
name: disassemble_data
arguments: data_label: D11
data_type: string
name: disassemble_data
arguments: data_label: D35
data_type: string

tool: D29: out of input string (before last null label)

tool: D33: out of space in escaped pushing %d

tool: D31: high-order bits set in length

tool: D11: %d/%d bytes of label body missing

tool: D35: no output string available

assistant: ```c
int ll2escaped(const uint8_t *base, const uint8_t *ll, int ll_left, char *escaped, int escaped_left) {
  const uint8_t *oll = ll;
  int r;
  if (escaped_left <= 0) {
    L_DEBUG("no output string available");
    return -1;
  }
  while (1) {
    if (!ll_left--) {
      L_DEBUG("out of input string (before last null label)");
      return -2;
    }
    uint8_t c = *(ll++);
    if (c) {
      if ((c & (64 | 128)) == (64 | 128)) {
        if (!base)
          return -3;
        if (!ll_left--) {
          L_DEBUG("out of input string (before last null label)");
          return -2;
        }
        uint8_t c2 = *(ll++);
        const uint8_t *nofs = base + ((c % 64) << 8) + c2;
        r = ll2escaped(base, nofs, ll + ll_left - nofs, escaped, escaped_left);
        if (r < 0)
          return r;
        return ll - oll;
      }
      if (c & (64 | 128)) {
        L_DEBUG("high-order bits set in length");
        return -2;
      }
      ll_left -= c;
      if (ll_left < 0) {
        L_DEBUG("%d/%d bytes of label body missing", -ll_left, c);
        return -2;
      }
      r = l2escaped(ll, c, escaped, escaped_left);
      if (r < 0)
        return r;
      ll += c;
      escaped += r;
      escaped_left -= r;
    }
    if (!c)
      break;
    do {
      if (!escaped_left--) {
        L_DEBUG("out of space in escaped pushing %d", '.');
        return -1;
      }
      *(escaped++) = '.';
    } while (0);
  }
  do {
    if (!escaped_left--) {
      L_DEBUG("out of space in escaped pushing %d", 0);
      return -1;
    }
    *(escaped++) = 0;
  } while (0);
  return ll - oll;
}
```