user: 请从给定的汇编指令推导出C源代码：

```asm
<tidy_path>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  call   <strlen@plt>
  cltq
  lea    -0x1(%r13,%rax,1),%rax
  cmpb   $0x2f,(%rax)
  je     L80
  mov    $0x2f,%edx
  mov    %dx,0x1(%rax)
L80:
  xor    %r12d,%r12d
  lea    D11(%rip),%rbp
  lea    D7(%rip),%rbx
  jmp    L205
  xchg   %ax,%ax
L137:
  mov    $0x1,%r12d
L205:
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <substr@plt>
  test   %rax,%rax
  jne    L137
  lea    D49(%rip),%rbx
  jmp    L69
  nopw   0x0(%rax,%rax,1)
L147:
  mov    $0x1,%r12d
L69:
  mov    %rbp,%rdx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <substr@plt>
  test   %rax,%rax
  jne    L147
  lea    D35(%rip),%rbx
  mov    %r13,%rdi
  mov    %rbx,%rsi
  call   <strstr@plt>
  test   %rax,%rax
  je     L226
  nopl   0x0(%rax,%rax,1)
L88:
  lea    -0x1(%rax),%rdx
  cmp    %rdx,%r13
  jne    L217
  jmp    L14
  xchg   %ax,%ax
L73:
  sub    $0x1,%rdx
  cmp    %rdx,%r13
  je     L14
L217:
  cmpb   $0x2f,(%rdx)
  jne    L73
L9:
  xor    %ecx,%ecx
  nopl   0x0(%rax)
L8:
  movzbl 0x3(%rax,%rcx,1),%esi
  mov    $0x1,%r12d
  mov    %sil,(%rdx,%rcx,1)
  add    $0x1,%rcx
  test   %sil,%sil
  jne    L8
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L88
L226:
  cmpb   $0x0,0x0(%r13)
  je     L241
L211:
  mov    %r13,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x1(%r13,%rax,1),%rax
  cmp    %rax,%r13
  je     L195
  cmpb   $0x2f,(%rax)
  jne    L131
  movb   $0x0,(%rax)
  sub    $0x1,%rax
  cmp    %rax,%r13
  jne    L131
  nopl   0x0(%rax,%rax,1)
L195:
  lea    D18(%rip),%rbx
  nopw   0x0(%rax,%rax,1)
L202:
  mov    $0x2,%edx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L198
  lea    0x2(%r13),%rax
  nopl   0x0(%rax,%rax,1)
L52:
  movzbl (%rax),%edx
  add    $0x1,%rax
  mov    $0x1,%r12d
  mov    %dl,-0x3(%rax)
  test   %dl,%dl
  jne    L52
  jmp    L202
  cs nopw 0x0(%rax,%rax,1)
L14:
  cmpb   $0x2f,(%rdx)
  je     L9
  cmpb   $0x0,0x0(%r13)
  jne    L211
L241:
  mov    %rbp,%rsi
  mov    %r13,%rdi
  call   <strcpy@plt>
  jmp    L211
  nopl   0x0(%rax)
L139:
  sub    $0x1,%rax
  mov    $0x1,%r12d
  movb   $0x0,0x1(%rax)
  cmp    %rax,%r13
  je     L195
L131:
  cmpb   $0x2f,(%rax)
  je     L139
  jmp    L195
  nopl   0x0(%rax)
L198:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: extract_symbolic_data
arguments: label: D11
datatype: string
name: extract_symbolic_data
arguments: label: D7
datatype: string
name: extract_symbolic_data
arguments: label: D49
datatype: string
name: extract_symbolic_data
arguments: label: D35
datatype: string
name: extract_symbolic_data
arguments: label: D18
datatype: string

tool: D11: /

tool: D7: /./

tool: D49: //

tool: D35: /../

tool: D18: ./

assistant: ```c
int tidy_path(char *path) {
  int tidied = 0;
  char *s, *p;
  s = path + strlen(path) - 1;
  if (s[0] != '/') {
    s[1] = '/';
    s[2] = '\0';
  }
  while (substr(path, "/./", "/"))
    tidied = 1;
  while (substr(path, "//", "/"))
    tidied = 1;
  while ((p = strstr(path, "/../")) != NULL) {
    s = p + 3;
    for (p--; p != path; p--)
      if (*p == '/')
        break;
    if (*p != '/')
      break;
    while ((*p++ = *s++))
      ;
    tidied = 1;
  }
  if (*path == '\0')
    strcpy(path, "/");
  p = path + strlen(path) - 1;
  if (p != path && *p == '/')
    *p-- = '\0';
  while (p != path && *p == '/') {
    *p-- = '\0';
    tidied = 1;
  }
  while (!strncmp(path, "./", 2)) {
    for (p = path, s = path + 2; (*p++ = *s++);)
      ;
    tidied = 1;
  }
  return tidied;
}
```