user: Please show me the C implementation that matches the assembly code listed below:

```asm
<mus_complete_filename>:
  endbr64
  push   %r12
  mov    $0x1,%esi
  push   %rbp
  mov    %rdi,%rbp
  mov    $0x80,%edi
  sub    $0x8,%rsp
  call   <calloc@plt>
  mov    %rax,%r12
  test   %rbp,%rbp
  je     L189
  cmpb   $0x0,0x0(%rbp)
  jne    L243
L259:
  movb   $0x0,(%r12)
  cmpb   $0x7e,0x0(%rbp)
  je     L192
  mov    %r12,%rdi
  mov    $0x80,%esi
  call   <getcwd@plt>
  mov    %r12,%rdi
  lea    D2(%rip),%rsi
  call   <strcat@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
L243:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%esi
  cmp    $0x1,%eax
  jle    L190
  lea    -0x2(%rax),%ecx
  xor    %edx,%edx
  mov    $0x1,%eax
  add    $0x2,%rcx
  nopl   0x0(%rax)
L226:
  cmpb   $0x2f,-0x1(%rbp,%rax,1)
  jne    L126
  cmpb   $0x2f,0x0(%rbp,%rax,1)
  cmove  %eax,%edx
L126:
  add    $0x1,%rax
  cmp    %rcx,%rax
  jne    L226
  test   %edx,%edx
  je     L190
  cmp    %esi,%edx
  jge    L207
  mov    %esi,%ecx
  movslq %edx,%rdi
  sub    %edx,%ecx
  lea    -0x1(%rcx),%eax
  cmp    $0x6,%eax
  jbe    L131
  cmp    $0xe,%eax
  jbe    L255
  mov    %ecx,%r8d
  add    %rbp,%rdi
  xor    %eax,%eax
  shr    $0x4,%r8d
  shl    $0x4,%r8
  nopl   0x0(%rax)
L34:
  movdqu (%rdi,%rax,1),%xmm0
  movups %xmm0,0x0(%rbp,%rax,1)
  add    $0x10,%rax
  cmp    %r8,%rax
  jne    L34
  mov    %ecx,%eax
  and    $0xfffffff0,%eax
  mov    %eax,%r8d
  add    %eax,%edx
  cmp    %eax,%ecx
  je     L61
  mov    %ecx,%r9d
  sub    %eax,%r9d
  lea    -0x1(%r9),%r10d
  cmp    $0x6,%r10d
  jbe    L84
L80:
  mov    (%rdi,%rax,1),%rdi
  mov    %rdi,0x0(%rbp,%rax,1)
  mov    %r9d,%eax
  and    $0xfffffff8,%eax
  add    %eax,%r8d
  add    %eax,%edx
  cmp    %eax,%r9d
  je     L61
L84:
  movslq %edx,%rax
  movzbl 0x0(%rbp,%rax,1),%edi
  movslq %r8d,%rax
  mov    %dil,0x0(%rbp,%rax,1)
  lea    0x1(%rdx),%eax
  lea    0x1(%r8),%edi
  cmp    %eax,%esi
  jle    L61
  cltq
  movslq %edi,%rdi
  movzbl 0x0(%rbp,%rax,1),%eax
  mov    %al,0x0(%rbp,%rdi,1)
  lea    0x2(%rdx),%eax
  lea    0x2(%r8),%edi
  cmp    %eax,%esi
  jle    L61
  cltq
  movslq %edi,%rdi
  movzbl 0x0(%rbp,%rax,1),%eax
  mov    %al,0x0(%rbp,%rdi,1)
  lea    0x3(%rdx),%eax
  lea    0x3(%r8),%edi
  cmp    %eax,%esi
  jle    L61
  cltq
  movslq %edi,%rdi
  movzbl 0x0(%rbp,%rax,1),%eax
  mov    %al,0x0(%rbp,%rdi,1)
  lea    0x4(%rdx),%eax
  lea    0x4(%r8),%edi
  cmp    %eax,%esi
  jle    L61
  cltq
  movslq %edi,%rdi
  movzbl 0x0(%rbp,%rax,1),%eax
  mov    %al,0x0(%rbp,%rdi,1)
  lea    0x5(%rdx),%eax
  lea    0x5(%r8),%edi
  cmp    %eax,%esi
  jle    L61
  cltq
  movslq %edi,%rdi
  add    $0x6,%edx
  add    $0x6,%r8d
  movzbl 0x0(%rbp,%rax,1),%eax
  mov    %al,0x0(%rbp,%rdi,1)
  cmp    %edx,%esi
  jle    L61
  movslq %edx,%rdx
  movslq %r8d,%r8
  movzbl 0x0(%rbp,%rdx,1),%eax
  mov    %al,0x0(%rbp,%r8,1)
L61:
  movslq %ecx,%rcx
  add    %rbp,%rcx
L73:
  movb   $0x0,(%rcx)
L190:
  movzbl 0x0(%rbp),%eax
L49:
  cmp    $0x2f,%al
  jne    L259
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax)
L189:
  movzbl 0x0,%eax
  jmp    L49
  nopw   0x0(%rax,%rax,1)
L192:
  lea    D3(%rip),%rdi
  call   <getenv@plt>
  mov    %r12,%rdi
  mov    %rax,%rsi
  call   <strcpy@plt>
  lea    0x1(%rbp),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  ret
  xchg   %ax,%ax
L131:
  sub    $0x1,%esi
  mov    %rbp,%rax
  sub    %edx,%esi
  lea    0x1(%rbp,%rsi,1),%rsi
  nopl   (%rax)
L57:
  movzbl (%rax,%rdi,1),%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  cmp    %rsi,%rax
  jne    L57
  jmp    L61
L207:
  mov    %rbp,%rcx
  jmp    L73
L255:
  mov    %ecx,%r9d
  xor    %eax,%eax
  xor    %r8d,%r8d
  add    %rbp,%rdi
  jmp    L80
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D2
type_infered: string
name: extract_symbolic_data
arguments: data_label: D3
type_infered: string

tool: D2: /

tool: D3: HOME

assistant: ```c
char *mus_complete_filename(char *tok) {
  char *file_name_buf;
  int i, j, len;
  file_name_buf = (char *)calloc(128, sizeof(char));
  if ((tok) && (*tok))
    len = strlen(tok);
  else
    len = 0;
  j = 0;
  for (i = 0; i < len - 1; i++) {
    if ((tok[i] == '/') && (tok[i + 1] == '/'))
      j = i + 1;
  }
  if (j > 0) {
    for (i = 0; j < len; i++, j++)
      tok[i] = tok[j];
    tok[i] = '\0';
  }
  if (tok[0] != '/') {
    file_name_buf[0] = '\0';
    if (tok[0] == '~') {
      strcpy(file_name_buf, getenv("HOME"));
      strcat(file_name_buf, ++tok);
    } else {
      getcwd(file_name_buf, 128);
      strcat(file_name_buf, "/");
      strcat(file_name_buf, tok);
    }
  } else
    strcpy(file_name_buf, tok);
  return (file_name_buf);
}
```