user: Converte this assembly snippet into its equivalent C code:

```asm
<canonicalizePath>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  lea    D3(%rip),%r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x18,%rsp
  mov    %rdi,(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L93:
  cmpb   $0x2f,(%r14)
  je     L36
L17:
  mov    $0x2f,%esi
  mov    %r14,%rdi
  call   <strchr@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L162
  movb   $0x0,(%rax)
  mov    %r12,%rsi
  mov    %r14,%rdi
  mov    %r15,%rbp
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L46
L152:
  cmpb   $0x2f,0x1(%r15)
  lea    0x1(%r15),%r14
  jne    L17
L36:
  add    $0x1,%r14
  jmp    L93
  nopw   0x0(%rax,%rax,1)
L136:
  add    %r14,%rbp
  nopl   0x0(%rax,%rax,1)
L46:
  lea    D8(%rip),%rsi
  mov    %r14,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L101
  cmp    %r13,%rbx
  ja     L39
  add    $0x3,%r13
L101:
  mov    %rbp,%rax
  cmp    %rbx,%r14
  ja     L24
L19:
  movb   $0x2f,(%rax)
  lea    0x1(%rax),%rbx
L53:
  test   %r15,%r15
  je     L128
  mov    %rbp,%r15
  jmp    L152
  nopw   0x0(%rax,%rax,1)
L162:
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %r12,%rsi
  mov    %r14,%rdi
  movslq %eax,%rbp
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L136
L128:
  cmp    %rbx,(%rsp)
  je     L130
  movb   $0x0,-0x1(%rbx)
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L24:
  mov    %rbp,%r9
  mov    %r14,%rsi
  mov    %rbx,%rdi
  sub    %r14,%r9
  mov    %r9d,%edx
  mov    %r9,0x8(%rsp)
  call   <memmove@plt>
  mov    0x8(%rsp),%r9
  lea    (%rbx,%r9,1),%rax
  jmp    L19
  nopl   0x0(%rax)
L39:
  sub    $0x1,%rbx
  cmp    %rbx,%r13
  jb     L62
  jmp    L53
  nopl   0x0(%rax,%rax,1)
L6:
  sub    $0x1,%rbx
  cmp    %rbx,%r13
  je     L53
L62:
  cmpb   $0x2f,-0x1(%rbx)
  jne    L6
  jmp    L53
  nopl   0x0(%rax,%rax,1)
L130:
  mov    (%rsp),%rdi
  add    $0x18,%rsp
  mov    %r12,%rsi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1090 <strcpy@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D3
type_guessed: string
name: extract_symbolic_data
arguments: label: D8
type_guessed: string

tool: D3: .

tool: D8: ..

assistant: ```c
void canonicalizePath(char *path) {
  char *src = path;
  char *dst = path;
  char *locked = dst;
  char *partEnd;
  int hasMore;
  for (;;) {
    while (*src == '/') {
      ++src;
    }
    partEnd = strchr(src, '/');
    hasMore = partEnd != NULL;
    if (hasMore) {
      *partEnd = '\0';
    } else {
      partEnd = src + strlen(src);
    }
    if (strcmp(src, ".") == 0) {
    } else if (strcmp(src, "..") == 0) {
      if (dst > locked) {
        --dst;
        while (dst > locked && dst[-1] != '/')
          --dst;
      } else {
        locked += 3;
        goto copy;
      }
    } else {
    copy:
      if (dst < src) {
        memmove(dst, src, partEnd - src);
        dst += partEnd - src;
      } else {
        dst = partEnd;
      }
      *dst++ = '/';
    }
    if (hasMore) {
      src = partEnd + 1;
    } else {
      if (dst == path) {
        strcpy(path, ".");
      } else {
        --dst;
        *dst = '\0';
      }
      return;
    }
  }
}
```