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

```asm
<ll2escaped>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %ecx,%ecx
  jle    L37
  mov    %ecx,%ebp
  mov    %rdi,%rbx
  mov    %rdx,%r14
  mov    %rdi,%rcx
  lea    -0x1(%rsi),%eax
  test   %esi,%esi
  je     L13
  nopl   0x0(%rax)
L8:
  mov    (%rcx),%r12
  lea    0x8(%rcx),%r15
  test   %r12,%r12
  jne    L71
  test   %ebp,%ebp
  je     L48
  sub    %rbx,%r15
  movb   $0x0,(%r14)
  sar    $0x3,%r15
  mov    %r15d,%eax
L3:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L71:
  sub    %r12d,%eax
  mov    %eax,%r13d
  js     L20
  mov    %ebp,%ecx
  mov    %r14,%rdx
  mov    %r12,%rsi
  mov    %r15,%rdi
  call   <l2escaped@plt>
  test   %eax,%eax
  js     L3
  mov    %ebp,%esi
  movslq %eax,%rdx
  lea    (%r15,%r12,8),%rcx
  add    %r14,%rdx
  sub    %eax,%esi
  lea    -0x1(%rsi),%ebp
  je     L38
  movb   $0x2e,(%rdx)
  lea    0x1(%rdx),%r14
  lea    -0x1(%r13),%eax
  test   %r13d,%r13d
  jne    L8
L13:
  lea    D28(%rip),%rdi
  xor    %eax,%eax
  call   <L_DEBUG@plt>
  add    $0x8,%rsp
  mov    $0xfffffffe,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L38:
  mov    $0x2e,%esi
  lea    D43(%rip),%rdi
  xor    %eax,%eax
  call   <L_DEBUG@plt>
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L20:
  mov    %eax,%esi
  mov    %r12,%rdx
  lea    D1(%rip),%rdi
  xor    %eax,%eax
  neg    %esi
  call   <L_DEBUG@plt>
  add    $0x8,%rsp
  mov    $0xfffffffe,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L48:
  xor    %esi,%esi
  lea    D43(%rip),%rdi
  xor    %eax,%eax
  call   <L_DEBUG@plt>
  mov    $0xffffffff,%eax
  jmp    L3
L37:
  lea    D18(%rip),%rdi
  xor    %eax,%eax
  call   <L_DEBUG@plt>
  mov    $0xffffffff,%eax
  jmp    L3
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D28
type: string
name: extract_symbolic_data
arguments: data_tag: D43
type: string
name: extract_symbolic_data
arguments: data_tag: D1
type: string
name: extract_symbolic_data
arguments: data_tag: D18
type: string

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

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

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

tool: D18: no output string available

assistant: ```c
int ll2escaped(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) {
      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;
}
```