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

```asm
<wordsplit_c_quote_copy>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  jmp    L56
L8:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L42
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movb   $0x5c,(%rax)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x20(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L77
L42:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x9,%al
  je     L114
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x5c,%al
  je     L114
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x1f,%al
  jbe    L114
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  js     L114
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x20(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  jmp    L77
L114:
  cmpl   $0x0,-0x24(%rbp)
  je     L78
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0xc(%rbp),%rax
  mov    %edx,%ecx
  lea    D9(%rip),%rdx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0xc(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addq   $0x3,-0x18(%rbp)
  jmp    L77
L78:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <wordsplit_c_quote_char@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  movb   $0x5c,(%rax)
  cmpl   $0xffffffff,-0x10(%rbp)
  je     L130
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x10(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L77
L130:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  lea    -0xc(%rbp),%rax
  mov    %edx,%ecx
  lea    D12(%rip),%rdx
  mov    $0x4,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  lea    -0xc(%rbp),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x3,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  addq   $0x3,-0x18(%rbp)
L77:
  addq   $0x1,-0x20(%rbp)
L56:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L8
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L107
  call   <__stack_chk_fail@plt>
L107:
  leave
  ret
```

tool_calls: name: parse_data
arguments: tag: D9
data_type: string
name: parse_data
arguments: tag: D12
data_type: string

tool: D9: %%%02X

tool: D12: %03o

assistant: ```c
void wordsplit_c_quote_copy(char *dst, const char *src, int quote_hex) {
  for (; *src; src++) {
    if (*src == '"') {
      *dst++ = '\\';
      *dst++ = *src;
    } else if (*src != '\t' && *src != '\\' && (' ' <= ((unsigned)(*src)) && ((unsigned)(*src)) <= 127))
      *dst++ = *src;
    else {
      char tmp[4];
      if (quote_hex) {
        snprintf(tmp, sizeof tmp, "%%%02X", *(unsigned char *)src);
        memcpy(dst, tmp, 3);
        dst += 3;
      } else {
        int c = wordsplit_c_quote_char(*src);
        *dst++ = '\\';
        if (c != -1)
          *dst++ = c;
        else {
          snprintf(tmp, sizeof tmp, "%03o", *(unsigned char *)src);
          memcpy(dst, tmp, 3);
          dst += 3;
        }
      }
    }
  }
}
```