user: 请从给定的汇编指令推导出C源代码:

```asm
<json_serialize_string>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  mov    %rsi,%rbx
  call   <strlen@plt>
  mov    %rax,%r14
  lea    D18(%rip),%rsi
  mov    %rbx,%rdi
  call   <append_string@plt>
  test   %eax,%eax
  js     L281
  mov    %eax,%r12d
  cltq
  add    %rbx,%rax
  test   %rbx,%rbx
  cmovne %rax,%rbx
  test   %r14,%r14
  je     L262
  mov    %r13,%rbp
  add    %r14,%r13
  lea    D47(%rip),%r15
  lea    D5(%rip),%r14
  jmp    L174
L358:
  cmp    $0x5c,%al
  jne    L123
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <append_string@plt>
  test   %eax,%eax
  js     L68
  movslq %eax,%rdx
  add    %rbx,%rdx
  test   %rbx,%rbx
  cmovne %rdx,%rbx
  add    %eax,%r12d
  jmp    L267
  lea    D63(%rip),%rsi
  mov    %rbx,%rdi
  call   <append_string@plt>
  test   %eax,%eax
  js     L107
  movslq %eax,%rdx
  add    %rbx,%rdx
  test   %rbx,%rbx
  cmovne %rdx,%rbx
  add    %eax,%r12d
  jmp    L267
  lea    D56(%rip),%rsi
  mov    %rbx,%rdi
  call   <append_string@plt>
  test   %eax,%eax
  js     L319
  movslq %eax,%rdx
  add    %rbx,%rdx
  test   %rbx,%rbx
  cmovne %rdx,%rbx
  add    %eax,%r12d
  jmp    L267
  lea    D107(%rip),%rsi
  mov    %rbx,%rdi
  call   <append_string@plt>
  test   %eax,%eax
  js     L13
  movslq %eax,%rdx
  add    %rbx,%rdx
  test   %rbx,%rbx
  cmovne %rdx,%rbx
  add    %eax,%r12d
  jmp    L267
  lea    D77(%rip),%rsi
  mov    %rbx,%rdi
  call   <append_string@plt>
  test   %eax,%eax
  js     L268
  movslq %eax,%rdx
  add    %rbx,%rdx
  test   %rbx,%rbx
  cmovne %rdx,%rbx
  add    %eax,%r12d
  jmp    L267
  lea    D6(%rip),%rsi
  mov    %rbx,%rdi
  call   <append_string@plt>
  test   %eax,%eax
  js     L87
  movslq %eax,%rdx
  add    %rbx,%rdx
  test   %rbx,%rbx
  cmovne %rdx,%rbx
  add    %eax,%r12d
  jmp    L267
  lea    D90(%rip),%rsi
  mov    %rbx,%rdi
  call   <append_string@plt>
  test   %eax,%eax
  js     L99
  movslq %eax,%rdx
  add    %rbx,%rdx
  test   %rbx,%rbx
  cmovne %rdx,%rbx
  add    %eax,%r12d
  jmp    L267
  lea    D103(%rip),%rsi
  mov    %rbx,%rdi
  call   <append_string@plt>
  test   %eax,%eax
  js     L183
  movslq %eax,%rdx
  add    %rbx,%rdx
  test   %rbx,%rbx
  cmovne %rdx,%rbx
  add    %eax,%r12d
  jmp    L267
L123:
  test   %rbx,%rbx
  je     L152
  mov    %al,(%rbx)
  add    $0x1,%rbx
L152:
  add    $0x1,%r12d
L267:
  add    $0x1,%rbp
  cmp    %rbp,%r13
  je     L262
L174:
  movzbl 0x0(%rbp),%eax
  cmp    $0x2f,%al
  jg     L358
  cmp    $0x7,%al
  jle    L123
  lea    -0x8(%rax),%edx
  cmp    $0x27,%dl
  ja     L123
  movzbl %dl,%edx
  movslq (%r14,%rdx,4),%rdx
  add    %r14,%rdx
  notrack jmp *%rdx
L262:
  lea    D18(%rip),%rsi
  mov    %rbx,%rdi
  call   <append_string@plt>
  test   %eax,%eax
  js     L196
  add    %r12d,%eax
L192:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L281:
  mov    $0xffffffff,%eax
  jmp    L192
L107:
  mov    $0xffffffff,%eax
  jmp    L192
L68:
  mov    $0xffffffff,%eax
  jmp    L192
L319:
  mov    $0xffffffff,%eax
  jmp    L192
L13:
  mov    $0xffffffff,%eax
  jmp    L192
L268:
  mov    $0xffffffff,%eax
  jmp    L192
L87:
  mov    $0xffffffff,%eax
  jmp    L192
L99:
  mov    $0xffffffff,%eax
  jmp    L192
L183:
  mov    $0xffffffff,%eax
  jmp    L192
L196:
  mov    $0xffffffff,%eax
  jmp    L192
```

tool_calls: name: retrieve_data
arguments: tag: D18
type_infered: string
name: retrieve_data
arguments: tag: D47
type_infered: string
name: retrieve_data
arguments: tag: D63
type_infered: string
name: retrieve_data
arguments: tag: D56
type_infered: string
name: retrieve_data
arguments: tag: D107
type_infered: string
name: retrieve_data
arguments: tag: D77
type_infered: string
name: retrieve_data
arguments: tag: D6
type_infered: string
name: retrieve_data
arguments: tag: D90
type_infered: string
name: retrieve_data
arguments: tag: D103
type_infered: string

tool: D18: "

tool: D47: \\

tool: D63: \"

tool: D56: \/

tool: D107: \b

tool: D77: \f

tool: D6: \n

tool: D90: \r

tool: D103: \t

assistant: ```c
int json_serialize_string(const char *string, char *buf) {
  size_t i = 0, len = strlen(string);
  char c = '\0';
  int written = -1, written_total = 0;
  do {
    written = append_string(buf, ("\""));
    if (written < 0) {
      return -1;
    }
    if (buf != NULL) {
      buf += written;
    }
    written_total += written;
  } while (0);
  for (i = 0; i < len; i++) {
    c = string[i];
    switch (c) {
    case '\"':
      do {
        written = append_string(buf, ("\\\""));
        if (written < 0) {
          return -1;
        }
        if (buf != NULL) {
          buf += written;
        }
        written_total += written;
      } while (0);
      break;
    case '\\':
      do {
        written = append_string(buf, ("\\\\"));
        if (written < 0) {
          return -1;
        }
        if (buf != NULL) {
          buf += written;
        }
        written_total += written;
      } while (0);
      break;
    case '/':
      do {
        written = append_string(buf, ("\\/"));
        if (written < 0) {
          return -1;
        }
        if (buf != NULL) {
          buf += written;
        }
        written_total += written;
      } while (0);
      break;
    case '\b':
      do {
        written = append_string(buf, ("\\b"));
        if (written < 0) {
          return -1;
        }
        if (buf != NULL) {
          buf += written;
        }
        written_total += written;
      } while (0);
      break;
    case '\f':
      do {
        written = append_string(buf, ("\\f"));
        if (written < 0) {
          return -1;
        }
        if (buf != NULL) {
          buf += written;
        }
        written_total += written;
      } while (0);
      break;
    case '\n':
      do {
        written = append_string(buf, ("\\n"));
        if (written < 0) {
          return -1;
        }
        if (buf != NULL) {
          buf += written;
        }
        written_total += written;
      } while (0);
      break;
    case '\r':
      do {
        written = append_string(buf, ("\\r"));
        if (written < 0) {
          return -1;
        }
        if (buf != NULL) {
          buf += written;
        }
        written_total += written;
      } while (0);
      break;
    case '\t':
      do {
        written = append_string(buf, ("\\t"));
        if (written < 0) {
          return -1;
        }
        if (buf != NULL) {
          buf += written;
        }
        written_total += written;
      } while (0);
      break;
    default:
      if (buf != NULL) {
        buf[0] = c;
        buf += 1;
      }
      written_total += 1;
      break;
    }
  }
  do {
    written = append_string(buf, ("\""));
    if (written < 0) {
      return -1;
    }
    if (buf != NULL) {
      buf += written;
    }
    written_total += written;
  } while (0);
  return written_total;
}
```