user: Converte this assembly snippet into its equivalent C code:

```asm
<ascii2int>:
  endbr64
  push   %r15
  mov    $0x1000,%edx
  push   %r14
  push   %r13
  push   %r12
  lea    D3(%rip),%r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %r12,%rdi
  push   %rbx
  mov    %rsi,%rbx
  xor    %esi,%esi
  sub    $0x8,%rsp
  call   <memset@plt>
  xor    %edx,%edx
  test   %rbx,%rbx
  je     L101
  xor    %r13d,%r13d
  xor    %eax,%eax
  lea    D8(%rip),%r14
  jmp    L65
  nopw   0x0(%rax,%rax,1)
L52:
  cmp    $0xa,%sil
  je     L8
  cmp    $0x9,%sil
  je     L12
  cmp    $0x1f,%sil
  jg     L123
  mov    %edx,%r9d
  movsbl %sil,%edi
  movb   $0x5c,(%r12,%r9,1)
  cmp    $0x9,%sil
  jle    L121
  movslq %edi,%rsi
  mov    %edi,%r9d
  imul   $0x66666667,%rsi,%rsi
  sar    $0x1f,%r9d
  sar    $0x22,%rsi
  sub    %r9d,%esi
  lea    (%rsi,%rsi,4),%r9d
  mov    %edi,%esi
  add    %r9d,%r9d
  sub    %r9d,%esi
  lea    0x30(%rsi),%r9d
  imul   $0xfffffff6,%esi,%esi
  mov    %r9b,(%r12,%rcx,1)
  lea    0x2(%rdx),%ecx
  add    %esi,%edi
L121:
  add    $0x30,%edi
  lea    0x1(%rcx),%r15d
  mov    %dil,(%r12,%rcx,1)
  nop
L76:
  mov    %r15d,%edx
  lea    0x2(%r15),%edi
  mov    $0x1000,%esi
  movb   $0x20,(%r12,%rdx,1)
  lea    0x1(%r15),%edx
  sub    %edi,%esi
  add    %r12,%rdi
  movb   $0x28,(%r12,%rdx,1)
  movsbl (%rax),%ecx
  mov    %r14,%rdx
  call   <snprintf@plt>
  lea    0x5(%r15),%eax
  lea    0x7(%r15),%edx
  movb   $0x29,(%r12,%rax,1)
  lea    0x6(%r15),%eax
  movb   $0x20,(%r12,%rax,1)
  cmp    $0xfec,%edx
  ja     L101
  lea    0x1(%r13),%eax
  mov    %rax,%r13
  cmp    %rbx,%rax
  jae    L101
L65:
  add    %rbp,%rax
  lea    0x1(%rdx),%ecx
  movzbl (%rax),%esi
  cmp    $0xd,%sil
  jne    L52
  mov    %edx,%esi
  lea    0x2(%rdx),%r15d
  movb   $0x5c,(%r12,%rsi,1)
  movb   $0x72,(%r12,%rcx,1)
  jmp    L76
  nopl   0x0(%rax)
L8:
  mov    %edx,%esi
  lea    0x2(%rdx),%r15d
  movb   $0x5c,(%r12,%rsi,1)
  movb   $0x6e,(%r12,%rcx,1)
  jmp    L76
  nopl   (%rax)
L12:
  mov    %edx,%esi
  lea    0x2(%rdx),%r15d
  movb   $0x5c,(%r12,%rsi,1)
  movb   $0x74,(%r12,%rcx,1)
  jmp    L76
  nopl   (%rax)
L123:
  mov    %sil,(%r12,%rdx,1)
  mov    %ecx,%r15d
  jmp    L76
  nopl   0x0(%rax)
L101:
  movb   $0x0,(%r12,%rdx,1)
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D8
type: string

tool: D8: %3d

assistant: ```c
char *ascii2int(const char *string, size_t len) {
  static char buffer[4096];
  unsigned int idx, bufIdx = 0;
  memset(buffer, 0, sizeof(buffer));
  for (idx = 0; idx < len; ++idx) {
    if (string[idx] == '\r') {
      buffer[bufIdx++] = '\\';
      buffer[bufIdx++] = 'r';
    } else if (string[idx] == '\n') {
      buffer[bufIdx++] = '\\';
      buffer[bufIdx++] = 'n';
    } else if (string[idx] == '\t') {
      buffer[bufIdx++] = '\\';
      buffer[bufIdx++] = 't';
    } else if (string[idx] < 32) {
      int ascii = string[idx];
      buffer[bufIdx++] = '\\';
      if (ascii > 9) {
        buffer[bufIdx++] = (ascii % 10) + 48;
        ascii -= (ascii % 10) * 10;
      }
      buffer[bufIdx++] = ascii + 48;
    } else
      buffer[bufIdx++] = string[idx];
    buffer[bufIdx++] = ' ';
    buffer[bufIdx++] = '(';
    snprintf(buffer + bufIdx, sizeof(buffer) - bufIdx, "%3d", (unsigned int)string[idx]);
    bufIdx += 3;
    buffer[bufIdx++] = ')';
    buffer[bufIdx++] = ' ';
    if (bufIdx > (sizeof(buffer) - 20))
      break;
  }
  buffer[bufIdx] = '\0';
  return buffer;
}
```