user: Translate the below assembly code into C programming language:

```asm
<cleanname>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  movq   $0x0,-0x18(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  je     L230
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L304
L230:
  lea    D11(%rip),%rax
  jmp    L311
L304:
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L71
L216:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L298
  mov    -0x10(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  je     L377
  mov    -0x10(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L242
L377:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x2f,(%rax)
L242:
  movl   $0x1,-0x1c(%rbp)
  jmp    L151
L298:
  cmpl   $0x0,-0x1c(%rbp)
  je     L38
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L38
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L38
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L387
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L38
L387:
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L253
  mov    $0x1,%eax
  jmp    L139
L253:
  mov    $0x0,%eax
L139:
  add    %rax,-0x8(%rbp)
  jmp    L151
L38:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    -0x8(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  movl   $0x0,-0x1c(%rbp)
L151:
  addq   $0x1,-0x8(%rbp)
L71:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L216
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  cmp    %rax,-0x10(%rbp)
  jbe    L239
  mov    -0x10(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L239
  subq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
L239:
  mov    -0x10(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  jne    L190
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x2e,(%rax)
L190:
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x1,-0x1c(%rbp)
  jmp    L264
L375:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L315
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x2f,(%rax)
  movl   $0x1,-0x1c(%rbp)
  addq   $0x1,-0x18(%rbp)
  jmp    L237
L315:
  cmpl   $0x0,-0x1c(%rbp)
  je     L272
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L272
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L272
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L389
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L272
L389:
  cmpq   $0x0,-0x18(%rbp)
  jne    L390
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L345
  lea    D10(%rip),%rax
  jmp    L296
L345:
  lea    D8(%rip),%rax
L296:
  mov    -0x10(%rbp),%rdx
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <stpcpy@plt>
  mov    %rax,-0x10(%rbp)
L390:
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L350
  mov    $0x2,%eax
  jmp    L24
L350:
  mov    $0x1,%eax
L24:
  add    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  je     L240
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  setne  %al
  movzbl %al,%eax
  sub    %rax,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  cmp    %rax,-0x10(%rbp)
  jbe    L237
L360:
  subq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x10(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L360
  jmp    L237
L272:
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  mov    -0x8(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  movl   $0x0,-0x1c(%rbp)
  jmp    L237
L240:
  nop
L237:
  addq   $0x1,-0x8(%rbp)
L264:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L375
  mov    -0x28(%rbp),%rax
  add    $0x1,%rax
  cmp    %rax,-0x10(%rbp)
  jbe    L381
  mov    -0x10(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L381
  subq   $0x1,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
L381:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L241
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x10(%rbp)
  movb   $0x2f,(%rax)
L241:
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
L311:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D11
type: string
name: read_data
arguments: data_label: D10
type: string
name: read_data
arguments: data_label: D8
type: string

tool: D11: .

tool: D10: ../

tool: D8: ..

assistant: ```c
char *cleanname(char *filename) {
  size_t parts = 0;
  int start;
  char *w;
  char *r;
  if ((filename == NULL) || !*filename)
    return ".";
  for (w = r = filename, start = 1; *r; r++)
    if (*r == '/') {
      if ((w == filename) || (w[-1] != '/'))
        *w++ = '/';
      start = 1;
    } else if (start && ((r[0] == '.') && (r[1 - 1] == '.') && (((r[1]) == '/') || !(r[1]))))
      r += r[1] ? 1 : 0;
    else
      *w++ = *r, start = 0;
  if ((w > filename + 1) && (w[-1] == '/'))
    *--w = 0;
  if (w == filename)
    *w++ = '.';
  *w = 0;
  for (w = r = filename, start = 1; *r; r++)
    if (*r == '/')
      *w++ = '/', start = 1, parts++;
    else if (start && ((r[0] == '.') && (r[2 - 1] == '.') && (((r[2]) == '/') || !(r[2])))) {
      if (!parts)
        w = stpcpy(w, r[2] ? "../" : "..");
      r += r[2] ? 2 : 1;
      if (!parts)
        continue;
      parts -= (*filename != '/');
      if (w > filename + 1)
        do
          *--w = 0;
        while (w[-1] != '/');
    } else
      *w++ = *r, start = 0;
  if ((w > filename + 1) && (w[-1] == '/'))
    *--w = 0;
  if (!*filename)
    w = filename, *w++ = '/';
  *w = 0;
  return filename;
}
```