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

```asm
<ascii2int>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  mov    $0x1000,%edx
  mov    $0x0,%esi
  lea    D181(%rip),%rax
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x0,-0xc(%rbp)
  jmp    L81
L115:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  jne    L16
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x5c,(%rdx,%rax,1)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x72,(%rdx,%rax,1)
  jmp    L93
L16:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L72
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x5c,(%rdx,%rax,1)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x6e,(%rdx,%rax,1)
  jmp    L93
L72:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  jne    L39
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x5c,(%rdx,%rax,1)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x74,(%rdx,%rax,1)
  jmp    L93
L39:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x1f,%al
  jg     L88
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x5c,(%rdx,%rax,1)
  cmpl   $0x9,-0x4(%rbp)
  jle    L51
  mov    -0x4(%rbp),%edx
  movslq %edx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %edx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  add    %eax,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    %ecx,%eax
  lea    0x30(%rax),%ecx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  mov    %cl,(%rdx,%rax,1)
  mov    -0x4(%rbp),%ecx
  movslq %ecx,%rax
  imul   $0x66666667,%rax,%rax
  shr    $0x20,%rax
  sar    $0x2,%eax
  mov    %ecx,%esi
  sar    $0x1f,%esi
  sub    %esi,%eax
  mov    %eax,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  imul   $0xfffffff6,%edx,%eax
  add    %eax,-0x4(%rbp)
L51:
  mov    -0x4(%rbp),%eax
  lea    0x30(%rax),%ecx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  mov    %cl,(%rdx,%rax,1)
  jmp    L93
L88:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%edx
  lea    0x1(%rdx),%eax
  mov    %eax,-0x8(%rbp)
  movzbl (%rcx),%eax
  mov    %edx,%ecx
  lea    D181(%rip),%rdx
  mov    %al,(%rcx,%rdx,1)
L93:
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x20,(%rdx,%rax,1)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x28,(%rdx,%rax,1)
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    $0x1000,%edx
  sub    -0x8(%rbp),%edx
  mov    %edx,%esi
  mov    -0x8(%rbp),%edx
  lea    D181(%rip),%rcx
  lea    (%rdx,%rcx,1),%rdi
  mov    %eax,%ecx
  lea    D42(%rip),%rax
  mov    %rax,%rdx
  call   <snprintf@plt>
  addl   $0x3,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x29,(%rdx,%rax,1)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D181(%rip),%rax
  movb   $0x20,(%rdx,%rax,1)
  cmpl   $0xfec,-0x8(%rbp)
  ja     L34
  addl   $0x1,-0xc(%rbp)
L81:
  mov    -0xc(%rbp),%eax
  cmp    %rax,-0x20(%rbp)
  ja     L115
  jmp    L73
L34:
  nop
L73:
  mov    -0x8(%rbp),%eax
  lea    D181(%rip),%rdx
  movb   $0x0,(%rax,%rdx,1)
  lea    D181(%rip),%rax
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D42
datatype: string

tool: D42: %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;
}
```