user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<json_serialize_string>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  movq   $0x0,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x8(%rbp)
  movb   $0x0,-0x19(%rbp)
  movl   $0xffffffff,-0x14(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  lea    D74(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <append_string@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L13
  mov    $0xffffffff,%eax
  jmp    L438
L13:
  cmpq   $0x0,-0x30(%rbp)
  je     L321
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
L321:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  movq   $0x0,-0x10(%rbp)
  jmp    L17
L218:
  mov    -0x28(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x19(%rbp)
  movsbl -0x19(%rbp),%eax
  cmp    $0x2f,%eax
  jg     L394
  cmp    $0x8,%eax
  jl     L319
  sub    $0x8,%eax
  cmp    $0x27,%eax
  ja     L319
  mov    %eax,%eax
  lea    0x0(,%rax,4),%rdx
  lea    D1(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D1(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
L394:
  cmp    $0x5c,%eax
  je     L75
  jmp    L319
  mov    -0x30(%rbp),%rax
  lea    D7(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <append_string@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L436
  mov    $0xffffffff,%eax
  jmp    L438
L436:
  cmpq   $0x0,-0x30(%rbp)
  je     L267
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
L267:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L445
L75:
  mov    -0x30(%rbp),%rax
  lea    D23(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <append_string@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L276
  mov    $0xffffffff,%eax
  jmp    L438
L276:
  cmpq   $0x0,-0x30(%rbp)
  je     L163
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
L163:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L445
  mov    -0x30(%rbp),%rax
  lea    D97(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <append_string@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L342
  mov    $0xffffffff,%eax
  jmp    L438
L342:
  cmpq   $0x0,-0x30(%rbp)
  je     L144
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
L144:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L445
  mov    -0x30(%rbp),%rax
  lea    D91(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <append_string@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L282
  mov    $0xffffffff,%eax
  jmp    L438
L282:
  cmpq   $0x0,-0x30(%rbp)
  je     L217
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
L217:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L445
  mov    -0x30(%rbp),%rax
  lea    D73(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <append_string@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L200
  mov    $0xffffffff,%eax
  jmp    L438
L200:
  cmpq   $0x0,-0x30(%rbp)
  je     L407
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
L407:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L445
  mov    -0x30(%rbp),%rax
  lea    D78(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <append_string@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L69
  mov    $0xffffffff,%eax
  jmp    L438
L69:
  cmpq   $0x0,-0x30(%rbp)
  je     L180
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
L180:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L445
  mov    -0x30(%rbp),%rax
  lea    D72(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <append_string@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L45
  mov    $0xffffffff,%eax
  jmp    L438
L45:
  cmpq   $0x0,-0x30(%rbp)
  je     L433
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
L433:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L445
  mov    -0x30(%rbp),%rax
  lea    D83(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <append_string@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L289
  mov    $0xffffffff,%eax
  jmp    L438
L289:
  cmpq   $0x0,-0x30(%rbp)
  je     L236
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
L236:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  jmp    L445
L319:
  cmpq   $0x0,-0x30(%rbp)
  je     L14
  mov    -0x30(%rbp),%rax
  movzbl -0x19(%rbp),%edx
  mov    %dl,(%rax)
  addq   $0x1,-0x30(%rbp)
L14:
  addl   $0x1,-0x18(%rbp)
  nop
L445:
  addq   $0x1,-0x10(%rbp)
L17:
  mov    -0x10(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  jb     L218
  mov    -0x30(%rbp),%rax
  lea    D74(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <append_string@plt>
  mov    %eax,-0x14(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jns    L408
  mov    $0xffffffff,%eax
  jmp    L438
L408:
  cmpq   $0x0,-0x30(%rbp)
  je     L159
  mov    -0x14(%rbp),%eax
  cltq
  add    %rax,-0x30(%rbp)
L159:
  mov    -0x14(%rbp),%eax
  add    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%eax
L438:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D74
type_infered: string
name: unpack_data
arguments: label: D7
type_infered: string
name: unpack_data
arguments: label: D23
type_infered: string
name: unpack_data
arguments: label: D97
type_infered: string
name: unpack_data
arguments: label: D91
type_infered: string
name: unpack_data
arguments: label: D73
type_infered: string
name: unpack_data
arguments: label: D78
type_infered: string
name: unpack_data
arguments: label: D72
type_infered: string
name: unpack_data
arguments: label: D83
type_infered: string

tool: D74: "

tool: D7: \"

tool: D23: \\

tool: D97: \/

tool: D91: \b

tool: D73: \f

tool: D78: \n

tool: D72: \r

tool: D83: \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;
}
```