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

```asm
<ascii2char>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L119
L18:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xd,%al
  jne    L20
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D101(%rip),%rax
  movb   $0x5c,(%rdx,%rax,1)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D101(%rip),%rax
  movb   $0x72,(%rdx,%rax,1)
  jmp    L121
L20:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L59
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D101(%rip),%rax
  movb   $0x5c,(%rdx,%rax,1)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D101(%rip),%rax
  movb   $0x6e,(%rdx,%rax,1)
  jmp    L121
L59:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  jne    L32
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D101(%rip),%rax
  movb   $0x5c,(%rdx,%rax,1)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D101(%rip),%rax
  movb   $0x74,(%rdx,%rax,1)
  jmp    L121
L32:
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x1f,%al
  jg     L115
  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    D101(%rip),%rax
  movb   $0x5c,(%rdx,%rax,1)
  cmpl   $0x9,-0x4(%rbp)
  jle    L29
  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    D101(%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)
L29:
  mov    -0x4(%rbp),%eax
  lea    0x30(%rax),%ecx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  lea    D101(%rip),%rax
  mov    %cl,(%rdx,%rax,1)
  jmp    L121
L115:
  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    D101(%rip),%rdx
  mov    %al,(%rcx,%rdx,1)
L121:
  cmpl   $0xfec,-0x8(%rbp)
  ja     L127
  addl   $0x1,-0xc(%rbp)
L119:
  mov    -0xc(%rbp),%eax
  cmp    %rax,-0x20(%rbp)
  ja     L18
  jmp    L8
L127:
  nop
L8:
  mov    -0x8(%rbp),%eax
  lea    D101(%rip),%rdx
  movb   $0x0,(%rax,%rdx,1)
  lea    D101(%rip),%rax
  pop    %rbp
  ret
```

assistant: ```c
char *ascii2char(const char *string, size_t len) {
  static char buffer[4096];
  unsigned int idx, bufIdx = 0;
  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];
    if (bufIdx > (sizeof(buffer) - 20))
      break;
  }
  buffer[bufIdx] = '\0';
  return buffer;
}
```