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

```asm
<crumb_canonize_path>:
  endbr64
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x210,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  movslq %eax,%r12
  test   %r12d,%r12d
  jne    L230
  movb   $0x0,0x0(%rbp)
L1:
  mov    0x208(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L233
  add    $0x210,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopw   0x0(%rax,%rax,1)
L230:
  mov    %rsp,%rdi
  mov    $0x200,%esi
  call   <getcwd@plt>
  mov    $0x2f,%esi
  mov    %rbx,%rdi
  mov    %rax,%r14
  call   <strrchr@plt>
  mov    %rax,%r8
  lea    -0x1(%rbx,%r12,1),%rax
  xor    %r12d,%r12d
  cmp    %rax,%r8
  sete   %r12b
  cmpb   $0x2f,(%rbx)
  je     L35
  mov    %r13d,%esi
  mov    %r14,%rcx
  lea    D3(%rip),%rdx
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  movslq %eax,%r13
  add    %rbp,%r13
L69:
  cmpb   $0x0,(%rbx)
  je     L215
L128:
  mov    $0x2f,%esi
  mov    %rbx,%rdi
  call   <strchrnul@plt>
  cmp    %rbx,%rax
  jbe    L134
  mov    %rax,%rsi
  xor    %edx,%edx
  sub    %rbx,%rsi
  xchg   %ax,%ax
L64:
  movzbl (%rbx,%rdx,1),%ecx
  mov    %cl,0x0(%r13,%rdx,1)
  add    $0x1,%rdx
  cmp    %rsi,%rdx
  jne    L64
  add    %r13,%rdx
  mov    %rax,%rbx
L21:
  xor    %eax,%eax
  cmpb   $0x2f,(%rbx)
  movb   $0x0,(%rdx)
  sete   %al
  add    %rax,%rbx
  cmpb   $0x0,0x0(%r13)
  je     L121
  cmpb   $0x2e,0x0(%r13)
  jne    L58
  cmpb   $0x0,0x1(%r13)
  jne    L58
  movb   $0x0,-0x1(%rdx)
  lea    -0x1(%rdx),%r13
  mov    $0x1,%eax
L144:
  cmpb   $0x0,(%rbx)
  jne    L128
  or     %eax,%r12d
L215:
  cmp    %r13,%rbp
  jae    L1
  and    $0x1,%r12d
  jne    L1
  cmpb   $0x2f,-0x1(%r13)
  jne    L1
  movb   $0x0,-0x1(%r13)
  jmp    L1
  nopl   0x0(%rax)
L58:
  cmpb   $0x2e,0x0(%r13)
  jne    L86
  cmpb   $0x2e,0x1(%r13)
  jne    L86
  cmpb   $0x0,0x2(%r13)
  jne    L86
  movb   $0x0,-0x3(%rdx)
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L202
  movb   $0x0,0x1(%rax)
  lea    0x1(%rax),%r13
  mov    $0x1,%eax
  jmp    L144
  nopw   0x0(%rax,%rax,1)
L86:
  mov    $0x2f,%eax
  lea    0x1(%rdx),%r13
  mov    %ax,(%rdx)
  xor    %eax,%eax
  jmp    L144
  nopl   0x0(%rax,%rax,1)
L121:
  mov    %rdx,%r13
  xor    %eax,%eax
  jmp    L144
  nopw   0x0(%rax,%rax,1)
L134:
  mov    %r13,%rdx
  jmp    L21
L35:
  mov    $0x2f,%edx
  lea    0x1(%rbp),%r13
  mov    %dx,0x0(%rbp)
  jmp    L69
L202:
  movb   $0x0,0x0(%rbp)
  mov    %rbp,%r13
  mov    $0x1,%eax
  jmp    L144
L233:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D3
type: string

tool: D3: %s/

assistant: ```c
void crumb_canonize_path(const char *filename, char *ostr, int ostr_max) {
  char bcwd[0x200], *cwd;
  const char *b, *scan = filename;
  char *o, *x, *p;
  int dont_remove_slash = 0, last_is_dotted = 0;
  int lf = strlen(filename);
  if (lf == 0) {
    *ostr = '\0';
    return;
  }
  cwd = getcwd(bcwd, sizeof(bcwd));
  if (strrchr(filename, '/') == filename + lf - 1) {
    dont_remove_slash = 1;
  }
  if (filename[0] != '/') {
    snprintf(ostr, ostr_max, "%s/", cwd);
    o = ostr + strlen(ostr);
  } else {
    o = ostr;
    o[0] = '/';
    o[1] = '\0';
    o++;
  }
  while (*scan != '\0') {
    p = strchrnul(scan, '/');
    b = o;
    while (scan < p) {
      *o = *scan;
      o++;
      scan++;
    }
    if (*scan == '/')
      scan++;
    o[0] = '\0';
    last_is_dotted = 0;
    if (!strcmp(b, "")) {
      continue;
    }
    if (!strcmp(b, ".")) {
      o -= 1;
      o[0] = '\0';
      last_is_dotted = 1;
      continue;
    }
    if (!strcmp(b, "..")) {
      o -= 3;
      o[0] = '\0';
      x = strrchr(ostr, '/');
      if (x) {
        o = x + 1;
        *o = '\0';
      } else {
        o = ostr;
        *o = '\0';
      }
      last_is_dotted = 1;
      continue;
    }
    o[0] = '/';
    o++;
    o[0] = '\0';
  }
  if (!dont_remove_slash && !last_is_dotted) {
    if (o > ostr && o[-1] == '/')
      o[-1] = '\0';
  }
}
```