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

```asm
<PINT_dotconf_find_wild_card>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    %r8,-0x48(%rbp)
  movl   $0xffffffff,-0x1c(%rbp)
  movl   $0x0,-0x10(%rbp)
  movl   $0x0,-0x18(%rbp)
  movq   $0x0,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xc(%rbp)
  cmpq   $0x0,-0x30(%rbp)
  je     L61
  cmpl   $0x0,-0xc(%rbp)
  jle    L61
  cmpq   $0x0,-0x38(%rbp)
  je     L61
  cmpq   $0x0,-0x40(%rbp)
  je     L61
  cmpq   $0x0,-0x48(%rbp)
  je     L61
  mov    -0x28(%rbp),%rax
  lea    D2(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcspn@plt>
  mov    %eax,-0x10(%rbp)
  mov    -0x10(%rbp),%eax
  cmp    -0xc(%rbp),%eax
  jge    L61
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  jmp    L96
L128:
  subq   $0x1,-0x8(%rbp)
  subl   $0x1,-0x18(%rbp)
L96:
  mov    -0x8(%rbp),%rax
  cmp    -0x28(%rbp),%rax
  je     L118
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L128
L118:
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L1
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,(%rax)
  movl   $0x1,-0x14(%rbp)
  jmp    L43
L1:
  mov    $0x1,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x38(%rbp),%rax
  mov    %rdx,(%rax)
L43:
  cmpl   $0x0,-0x14(%rbp)
  sete   %al
  movzbl %al,%edx
  mov    -0x18(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%eax
  sub    %ecx,%eax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L61
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  je     L61
  cmpl   $0x0,-0x14(%rbp)
  je     L97
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rax
  mov    -0x18(%rbp),%edx
  mov    -0x28(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
L97:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%eax
  cltq
  add    %rdx,%rax
  movb   $0x0,(%rax)
  cmpl   $0x0,-0x14(%rbp)
  sete   %al
  movzbl %al,%edx
  mov    -0x18(%rbp),%eax
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x10(%rbp),%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  cmpl   $0x0,-0x14(%rbp)
  je     L32
  mov    $0x1,%ecx
  jmp    L6
L32:
  mov    $0x0,%ecx
L6:
  mov    -0x8(%rbp),%rax
  add    %rax,%rcx
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x40(%rbp),%rax
  mov    (%rax),%rdx
  cmpl   $0x0,-0x14(%rbp)
  sete   %al
  movzbl %al,%ecx
  mov    -0x18(%rbp),%eax
  sub    %ecx,%eax
  mov    %eax,%esi
  mov    -0x10(%rbp),%eax
  sub    %esi,%eax
  cltq
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  movzbl (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
L61:
  mov    -0x1c(%rbp),%eax
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D2
data_type: string

tool: D2: *?

assistant: ```c
int PINT_dotconf_find_wild_card(char *filename, char *wildcard, char **path, char **pre, char **ext) {
  int retval = -1;
  int prefix_len = 0;
  int tmp_count = 0;
  char *tmp = 0;
  int found_path = 0;
  int len = strlen(filename);
  if (wildcard != NULL && len > 0 && path != NULL && pre != NULL && ext != NULL) {
    prefix_len = strcspn(filename, "*?");
    if (prefix_len < len) {
      tmp = filename + prefix_len;
      tmp_count = prefix_len + 1;
      while (tmp != filename && *(tmp) != '/') {
        tmp--;
        tmp_count--;
      }
      if (*(tmp) == '/') {
        *path = (char *)malloc(tmp_count + 1);
        found_path = 1;
      } else
        *path = (char *)malloc(1);
      *pre = (char *)malloc((prefix_len - (tmp_count - (found_path ? 0 : 1))) + 1);
      if (*path && *pre) {
        if (found_path)
          strncpy(*path, filename, tmp_count);
        (*path)[tmp_count] = '\0';
        strncpy(*pre, (tmp + (found_path ? 1 : 0)), (prefix_len - (tmp_count - (found_path ? 0 : 1))));
        (*pre)[(prefix_len - (tmp_count - (found_path ? 0 : 1)))] = '\0';
        *ext = filename + prefix_len;
        *wildcard = (**ext);
        (*ext)++;
        retval = prefix_len;
      }
    }
  }
  return retval;
}
```