user: Translate the below assembly code into C programming language:

```asm
<json_print_string>:
  endbr64
  test   %rdi,%rdi
  je     L29
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rsi,%rsi
  je     L69
  movzbl (%rdi),%esi
  mov    %rdi,%r12
  test   %sil,%sil
  je     L174
  mov    %rdi,%rbx
  xor    %r14d,%r14d
  lea    D35(%rip),%r13
  jmp    L189
  nopl   (%rax)
L53:
  movzbl 0x1(%rbx),%esi
  add    $0x1,%rbx
  add    $0x1,%r14
  test   %sil,%sil
  je     L28
L189:
  mov    %r13,%rdi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L53
  cmpb   $0x20,(%rbx)
  lea    0x5(%r14),%rax
  cmovb  %rax,%r14
  movzbl 0x1(%rbx),%esi
  add    $0x1,%rbx
  test   %sil,%sil
  jne    L189
L28:
  sub    %r12,%rbx
  lea    0x1(%rbp),%rdi
  lea    (%rbx,%r14,1),%rdx
  mov    %rdi,%rbx
  lea    0x1(%rdx),%r13
  lea    0x2(%rdx),%r15
  test   %r14,%r14
  je     L78
  movb   $0x22,0x0(%rbp)
  movzbl (%r12),%eax
  lea    D6(%rip),%rcx
  lea    D20(%rip),%r14
  test   %al,%al
  jne    L65
L160:
  movb   $0x22,0x0(%rbp,%r13,1)
  mov    $0x1,%eax
  movb   $0x0,0x0(%rbp,%r15,1)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L50:
  cmp    $0x5c,%al
  je     L105
  mov    %al,(%rbx)
  mov    %rbx,%rdi
L157:
  movzbl 0x1(%r12),%eax
  add    $0x1,%r12
  lea    0x1(%rdi),%rbx
  test   %al,%al
  je     L160
L65:
  cmp    $0x1f,%al
  seta   %sil
  cmp    $0x22,%al
  setne  %dl
  test   %dl,%sil
  jne    L50
L105:
  movb   $0x5c,(%rbx)
  movzbl (%r12),%edx
  lea    0x1(%rbx),%rdi
  cmp    $0x22,%dl
  ja     L199
  cmp    $0x7,%dl
  jbe    L104
  lea    -0x8(%rdx),%eax
  cmp    $0x1a,%al
  ja     L104
  movzbl %al,%eax
  movslq (%r14,%rax,4),%rax
  add    %r14,%rax
  notrack jmp *%rax
  nopl   (%rax)
L199:
  cmp    $0x5c,%dl
  jne    L104
  movb   $0x5c,0x1(%rbx)
  jmp    L157
  nopl   0x0(%rax,%rax,1)
L104:
  mov    %rcx,%rsi
  call   <sprintf@plt>
  lea    0x5(%rbx),%rdi
  lea    D6(%rip),%rcx
  jmp    L157
  nopl   (%rax)
  movb   $0x22,0x1(%rbx)
  jmp    L157
  cs nopw 0x0(%rax,%rax,1)
  movb   $0x72,0x1(%rbx)
  jmp    L157
  nopl   0x0(%rax)
  movb   $0x66,0x1(%rbx)
  jmp    L157
  nopl   0x0(%rax)
  movb   $0x6e,0x1(%rbx)
  jmp    L157
  nopl   0x0(%rax)
  movb   $0x74,0x1(%rbx)
  jmp    L157
  nopl   0x0(%rax)
  movb   $0x62,0x1(%rbx)
  jmp    L157
  nopl   0x0(%rax)
L69:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L174:
  mov    $0x2,%r15d
  mov    $0x1,%r13d
  lea    0x1(%rbp),%rdi
  xor    %edx,%edx
L78:
  movb   $0x22,0x0(%rbp)
  mov    %r12,%rsi
  call   <memcpy@plt>
  movb   $0x22,0x0(%rbp,%r13,1)
  mov    $0x1,%eax
  movb   $0x0,0x0(%rbp,%r15,1)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L29:
  xor    %eax,%eax
  ret
```

tool_calls: name: read_data
arguments: data_tag: D35
type: string
name: read_data
arguments: data_tag: D6
type: string
name: read_data
arguments: data_tag: D20
type: string

tool: D35: "\
	

tool: D6: u%04x

tool: 

assistant: ```c
bool json_print_string(const unsigned char *input, unsigned char *output_buffer) {
  const unsigned char *input_pointer = NULL;
  unsigned char *output = NULL;
  unsigned char *output_pointer = NULL;
  size_t output_length = 0;
  size_t escape_characters = 0;
  if (output_buffer == NULL) {
    return false;
  }
  if (input == NULL) {
    if (output == NULL) {
      return false;
    }
    strcpy((char *)output, "\"\"");
    return true;
  }
  for (input_pointer = input; *input_pointer; input_pointer++) {
    if (strchr("\"\\\b\f\n\r\t", *input_pointer)) {
      escape_characters++;
    } else if (*input_pointer < 32) {
      escape_characters += 5;
    }
  }
  output_length = (size_t)(input_pointer - input) + escape_characters;
  output = output_buffer;
  if (escape_characters == 0) {
    output[0] = '\"';
    memcpy(output + 1, input, output_length);
    output[output_length + 1] = '\"';
    output[output_length + 2] = '\0';
    return true;
  }
  output[0] = '\"';
  output_pointer = output + 1;
  for (input_pointer = input; *input_pointer != '\0'; (void)input_pointer++, output_pointer++) {
    if ((*input_pointer > 31) && (*input_pointer != '\"') && (*input_pointer != '\\')) {
      *output_pointer = *input_pointer;
    } else {
      *output_pointer++ = '\\';
      switch (*input_pointer) {
      case '\\':
        *output_pointer = '\\';
        break;
      case '\"':
        *output_pointer = '\"';
        break;
      case '\b':
        *output_pointer = 'b';
        break;
      case '\f':
        *output_pointer = 'f';
        break;
      case '\n':
        *output_pointer = 'n';
        break;
      case '\r':
        *output_pointer = 'r';
        break;
      case '\t':
        *output_pointer = 't';
        break;
      default:
        sprintf((char *)output_pointer, "u%04x", *input_pointer);
        output_pointer += 4;
        break;
      }
    }
  }
  output[output_length + 1] = '\"';
  output[output_length + 2] = '\0';
  return true;
}
```