user: What is the c source code of the assembly code below:

```asm
<ser_escape_str>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L111
  mov    $0x0,%eax
  jmp    L152
L111:
  movl   $0x0,-0x1c(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L14
L79:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L106
  addl   $0x1,-0x1c(%rbp)
  jmp    L50
L106:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isprint@plt>
  test   %eax,%eax
  jne    L56
  addl   $0x3,-0x1c(%rbp)
  jmp    L50
L56:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  je     L116
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L50
L116:
  addl   $0x1,-0x1c(%rbp)
L50:
  addl   $0x1,-0x1c(%rbp)
  addq   $0x1,-0x18(%rbp)
L14:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L79
  addl   $0x1,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L100
  mov    $0x0,%eax
  jmp    L152
L100:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L68
L13:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0xa,%al
  jne    L45
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x6e,(%rax)
  addq   $0x1,-0x18(%rbp)
  jmp    L68
L45:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <isprint@plt>
  test   %eax,%eax
  jne    L43
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x78,(%rax)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cltd
  shr    $0x18,%edx
  add    %edx,%eax
  movzbl %al,%eax
  sub    %edx,%eax
  movsbl %al,%edx
  mov    -0x10(%rbp),%rax
  lea    D9(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  addq   $0x2,-0x10(%rbp)
  addq   $0x1,-0x18(%rbp)
  jmp    L68
L43:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  je     L140
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  jne    L125
L140:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x5c,(%rax)
L125:
  mov    -0x18(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
L68:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L13
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
L152:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D9
type_infered: string

tool: D9: %02X

assistant: ```c
char *ser_escape_str(char *s) {
  char *a;
  char *b;
  char *ret;
  int c;
  if (!s)
    return NULL;
  c = 0;
  a = s;
  while (*a) {
    if (*a == '\n')
      c++;
    else if (!isprint(*a))
      c += 3;
    else if (*a == '\"' || *a == '\\')
      c++;
    c++;
    a++;
  }
  c++;
  ret = malloc(c);
  if (!ret)
    return NULL;
  a = s;
  b = ret;
  while (*a) {
    if (*a == '\n') {
      *b++ = '\\';
      *b++ = 'n';
      a++;
      continue;
    } else if (!isprint(*a)) {
      *b++ = '\\';
      *b++ = 'x';
      sprintf(b, "%02X", *a % 256);
      b += 2;
      a++;
      continue;
    } else if (*a == '\"' || *a == '\\')
      *b++ = '\\';
    *b++ = *a++;
  }
  *b = '\0';
  return ret;
}
```