user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<fwrite_repr>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x18,%rsp
  mov    %rdx,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x2008(%rsp)
  xor    %eax,%eax
  movb   $0x22,(%rsp)
  test   %rsi,%rsi
  je     L93
  mov    %rdi,%rbp
  lea    (%rdi,%rsi,1),%r12
  mov    $0x1,%ebx
  mov    %rsp,%r15
  lea    D18(%rip),%r13
  jmp    L60
L40:
  cmp    $0x5c,%dil
  jne    L161
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,(%rsp,%rdx,1)
  add    $0x2,%ebx
  cltq
  movb   $0x5c,(%rsp,%rax,1)
  jmp    L62
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,(%rsp,%rdx,1)
  add    $0x2,%ebx
  cltq
  movb   $0x22,(%rsp,%rax,1)
L62:
  add    $0x1,%rbp
  cmp    $0x1f40,%ebx
  jg     L133
L70:
  cmp    %rbp,%r12
  je     L131
L60:
  movzbl 0x0(%rbp),%edi
  cmp    $0x2f,%dil
  jg     L40
  cmp    $0x7,%dil
  jle    L161
  lea    -0x8(%rdi),%eax
  cmp    $0x27,%al
  ja     L161
  movzbl %al,%eax
  movslq 0x0(%r13,%rax,4),%rax
  add    %r13,%rax
  notrack jmp *%rax
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,(%rsp,%rdx,1)
  add    $0x2,%ebx
  cltq
  movb   $0x2f,(%rsp,%rax,1)
  jmp    L62
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,(%rsp,%rdx,1)
  add    $0x2,%ebx
  cltq
  movb   $0x62,(%rsp,%rax,1)
  jmp    L62
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,(%rsp,%rdx,1)
  add    $0x2,%ebx
  cltq
  movb   $0x66,(%rsp,%rax,1)
  jmp    L62
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,(%rsp,%rdx,1)
  add    $0x2,%ebx
  cltq
  movb   $0x6e,(%rsp,%rax,1)
  jmp    L62
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,(%rsp,%rdx,1)
  add    $0x2,%ebx
  cltq
  movb   $0x72,(%rsp,%rax,1)
  jmp    L62
  lea    0x1(%rbx),%eax
  movslq %ebx,%rdx
  movb   $0x5c,(%rsp,%rdx,1)
  add    $0x2,%ebx
  cltq
  movb   $0x74,(%rsp,%rax,1)
  jmp    L62
L161:
  movsbl %dil,%edi
  call   <isprint@plt>
  test   %eax,%eax
  je     L144
  movslq %ebx,%rax
  movzbl 0x0(%rbp),%edx
  mov    %dl,(%rsp,%rax,1)
  lea    0x1(%rbx),%ebx
  jmp    L62
L144:
  movzbl 0x0(%rbp),%ecx
  movslq %ebx,%rdi
  add    %r15,%rdi
  lea    D1(%rip),%rdx
  mov    $0x10,%esi
  call   <snprintf@plt>
  add    %eax,%ebx
  jmp    L62
L133:
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    %ebx,%esi
  mov    %r15,%rdi
  call   <fwrite@plt>
  mov    $0x0,%ebx
  jmp    L70
L93:
  mov    $0x1,%ebx
L131:
  movslq %ebx,%rax
  movb   $0x22,(%rsp,%rax,1)
  lea    0x1(%rbx),%esi
  mov    %rsp,%rdi
  mov    %r14,%rcx
  mov    $0x1,%edx
  call   <fwrite@plt>
  mov    0x2008(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L102
  add    $0x2018,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L102:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D1
type: string

tool: D1: \u%04x

assistant: ```c
void fwrite_repr(char *p, size_t len, FILE *fp) {
  int index, n;
  char s[8192];
  index = 0;
  s[index++] = '"';
  while (len--) {
    switch (*p) {
    case '"':
      s[index++] = '\\';
      s[index++] = '\"';
      break;
    case '\\':
      s[index++] = '\\';
      s[index++] = '\\';
      break;
    case '/':
      s[index++] = '\\';
      s[index++] = '/';
      break;
    case '\b':
      s[index++] = '\\';
      s[index++] = 'b';
      break;
    case '\f':
      s[index++] = '\\';
      s[index++] = 'f';
      break;
    case '\n':
      s[index++] = '\\';
      s[index++] = 'n';
      break;
    case '\r':
      s[index++] = '\\';
      s[index++] = 'r';
      break;
    case '\t':
      s[index++] = '\\';
      s[index++] = 't';
      break;
    default:
      if (isprint(*p)) {
        s[index++] = *p;
      } else {
        n = snprintf(s + index, 16, "\\u%04x", (unsigned char)*p);
        index += n;
      }
      break;
    }
    p++;
    if (index > 8000) {
      fwrite(s, index, 1, fp);
      index = 0;
    }
  }
  s[index++] = '"';
  fwrite(s, index, 1, fp);
}
```