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

```asm
<fossilize>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  test   %esi,%esi
  js     L69
L221:
  test   %esi,%esi
  jle    L169
  mov    %rbx,%rbp
  lea    -0x1(%rsi),%eax
  lea    0x1(%rbx,%rax,1),%r15
  mov    %rbx,%rdx
  mov    $0x0,%edi
  jmp    L112
L69:
  call   <strlen@plt>
  mov    %eax,%esi
  jmp    L221
L90:
  add    $0x1,%edi
L21:
  add    $0x1,%rdx
  cmp    %r15,%rdx
  je     L93
L112:
  movzbl (%rdx),%ecx
  test   $0xdf,%cl
  je     L90
  lea    -0x9(%rcx),%r8d
  cmp    $0x4,%r8b
  jbe    L90
  cmp    $0x5c,%cl
  jne    L21
  jmp    L90
L127:
  cmp    $0x5c,%r12d
  jne    L12
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,0x0(%r13,%rdx,1)
  add    $0x2,%ebx
  cltq
  movb   $0x5c,0x0(%r13,%rax,1)
L180:
  add    $0x1,%rbp
  cmp    %r15,%rbp
  je     L176
L8:
  movzbl 0x0(%rbp),%r14d
  movsbl %r14b,%r12d
  test   %r12d,%r12d
  jne    L127
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,0x0(%r13,%rdx,1)
  add    $0x2,%ebx
  cltq
  movb   $0x30,0x0(%r13,%rax,1)
  jmp    L180
L12:
  mov    %r12d,%edi
  call   <fossil_isspace@plt>
  test   %rax,%rax
  je     L131
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,0x0(%r13,%rdx,1)
  sub    $0x9,%r14d
  cmp    $0x17,%r14b
  ja     L144
  movzbl %r14b,%r14d
  lea    D2(%rip),%rsi
  movslq (%rsi,%r14,4),%rdx
  add    %rsi,%rdx
  notrack jmp *%rdx
  mov    $0x6e,%r12d
  jmp    L144
  mov    $0x73,%r12d
L144:
  add    $0x2,%ebx
  cltq
  mov    %r12b,0x0(%r13,%rax,1)
  jmp    L180
  mov    $0x74,%r12d
  jmp    L144
  mov    $0x72,%r12d
  jmp    L144
  mov    $0x76,%r12d
  jmp    L144
  mov    $0x66,%r12d
  jmp    L144
L131:
  movslq %ebx,%rax
  mov    %r14b,0x0(%r13,%rax,1)
  lea    0x1(%rbx),%ebx
  jmp    L180
L169:
  lea    0x1(%rsi),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    $0x0,%ebx
  test   %rax,%rax
  je     L141
L176:
  movslq %ebx,%rbx
  movb   $0x0,0x0(%r13,%rbx,1)
L141:
  mov    %r13,%rax
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L93:
  lea    0x1(%rdi,%rsi,1),%edi
  call   <malloc@plt>
  mov    %rax,%r13
  mov    $0x0,%ebx
  test   %rax,%rax
  jne    L8
  jmp    L141
```

assistant: ```c
char *fossilize(const char *zIn, int nIn) {
  int n, i, j, c;
  char *zOut;
  if (nIn < 0)
    nIn = strlen(zIn);
  for (i = n = 0; i < nIn; i++) {
    c = zIn[i];
    if (c == 0 || c == ' ' || c == '\n' || c == '\t' || c == '\r' || c == '\f' || c == '\v' || c == '\\')
      n++;
  }
  n += nIn;
  zOut = malloc(n + 1);
  if (zOut) {
    for (i = j = 0; i < nIn; i++) {
      int c = zIn[i];
      if (c == 0) {
        zOut[j++] = '\\';
        zOut[j++] = '0';
      } else if (c == '\\') {
        zOut[j++] = '\\';
        zOut[j++] = '\\';
      } else if (fossil_isspace(c)) {
        zOut[j++] = '\\';
        switch (c) {
        case '\n':
          c = 'n';
          break;
        case ' ':
          c = 's';
          break;
        case '\t':
          c = 't';
          break;
        case '\r':
          c = 'r';
          break;
        case '\v':
          c = 'v';
          break;
        case '\f':
          c = 'f';
          break;
        }
        zOut[j++] = c;
      } else {
        zOut[j++] = c;
      }
    }
    zOut[j] = 0;
  }
  return zOut;
}
```