user: 请将以下的汇编代码转换成C语言代码：

```asm
<canonicalize>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L14
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L14
  mov    -0x10(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x22,%al
  jne    L14
  mov    $0x1,%eax
  jmp    L36
L14:
  mov    $0x0,%eax
L36:
  mov    %eax,-0x20(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  setne  %al
  movzbl %al,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  test   %rax,%rax
  jne    L22
  mov    $0x0,%eax
  jmp    L51
L22:
  mov    -0x18(%rbp),%rdx
  mov    -0x1c(%rbp),%eax
  add    %eax,%eax
  movslq %eax,%rcx
  mov    -0x10(%rbp),%rax
  sub    %rcx,%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  lea    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <utf8_tolower@plt>
  mov    -0x18(%rbp),%rax
  lea    D2(%rip),%rdx
  lea    D53(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strrepl@plt>
  mov    -0x18(%rbp),%rax
  lea    D19(%rip),%rdx
  lea    D74(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strrepl@plt>
  mov    -0x18(%rbp),%rax
  lea    D19(%rip),%rdx
  lea    D68(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strrepl@plt>
  mov    -0x18(%rbp),%rax
  lea    D19(%rip),%rdx
  lea    D75(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strrepl@plt>
  mov    -0x18(%rbp),%rax
  lea    D19(%rip),%rdx
  lea    D109(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strrepl@plt>
  mov    -0x18(%rbp),%rax
  lea    D19(%rip),%rdx
  lea    D98(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strrepl@plt>
  mov    -0x18(%rbp),%rax
L51:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L62
  call   <__stack_chk_fail@plt>
L62:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_label: D2
datatype: string
name: disassemble_data
arguments: data_label: D53
datatype: string
name: disassemble_data
arguments: data_label: D19
datatype: string
name: disassemble_data
arguments: data_label: D74
datatype: string
name: disassemble_data
arguments: data_label: D68
datatype: string
name: disassemble_data
arguments: data_label: D75
datatype: string
name: disassemble_data
arguments: data_label: D109
datatype: string
name: disassemble_data
arguments: data_label: D98
datatype: string

tool: D2: \

tool: D53: \\

tool: D19: _

tool: D74: \n

tool: D68: \r

tool: D75: 


tool: D109: 

tool: D98:  

assistant: ```c
char *canonicalize(const char *n) {
  char *result;
  size_t len = strlen(n);
  bool quoted = len > 0 && n[0] == '"' && n[len - 1] == '"';
  int off = quoted ? 1 : 0;
  result = strdup(n + off);
  if (!result)
    return NULL;
  result[len - 2 * off] = '\0';
  utf8_tolower(&result);
  strrepl(result, "\\\\", "\\");
  strrepl(result, "\\n", "_");
  strrepl(result, "\\r", "_");
  strrepl(result, "\n", "_");
  strrepl(result, "\r", "_");
  strrepl(result, " ", "_");
  return result;
}
```