user: What is the c source code of the assembly code below?

```asm
<has_cachedir_tag>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  movq   $0x2b,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  sub    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,%r10
  mov    $0x0,%r11d
  mov    -0x38(%rbp),%rax
  mov    %rax,%r8
  mov    $0x0,%r9d
  mov    $0x10,%eax
  lea    -0x1(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L106:
  cmp    %rdx,%rsp
  je     L105
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L106
L105:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L96
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L96:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x40(%rbp)
  mov    -0x48(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0xf,%eax
  mov    %eax,-0x3c(%rbp)
  mov    D104(%rip),%eax
  cmp    %eax,-0x3c(%rbp)
  jg     L53
  mov    D159(%rip),%rax
  test   %rax,%rax
  jne    L14
L53:
  mov    D104(%rip),%eax
  add    %eax,%eax
  mov    %eax,D5(%rip)
  mov    D5(%rip),%eax
  cmp    %eax,-0x3c(%rbp)
  jle    L66
  mov    -0x3c(%rbp),%eax
  mov    %eax,D5(%rip)
L66:
  mov    D159(%rip),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    D5(%rip),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,D5(%rip)
L14:
  mov    D5(%rip),%esi
  mov    D5(%rip),%rax
  mov    -0x48(%rbp),%rdx
  lea    D5(%rip),%r8
  mov    %rdx,%rcx
  lea    D34(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    D5(%rip),%rax
  lea    D136(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  je     L17
  mov    -0x20(%rbp),%rcx
  mov    -0x38(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  cmp    %rax,-0x38(%rbp)
  jne    L77
  mov    -0x38(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  lea    D110(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcmp@plt>
  test   %eax,%eax
  jne    L77
  mov    $0x1,%eax
  jmp    L42
L77:
  mov    $0x0,%eax
L42:
  mov    %eax,-0x40(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
L17:
  mov    -0x40(%rbp),%eax
  mov    %rbx,%rsp
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L65
  call   <__stack_chk_fail@plt>
L65:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: tag: D5
type_infered: string
name: retrieve_data
arguments: tag: D34
type_infered: string
name: retrieve_data
arguments: tag: D136
type_infered: string
name: retrieve_data
arguments: tag: D110
type_infered: string

tool: D5: CACHEDIR.TAG

tool: D34: %s/%s

tool: D136: rb

tool: D110: Signature: 8a477f597d28d172789f06886806bc55

assistant: ```c
int has_cachedir_tag(const char *name) {
  static int path_l = 1024;
  static char *path = NULL;
  int l;
  const size_t signature_l = sizeof "Signature: 8a477f597d28d172789f06886806bc55" - 1;
  char buf[signature_l];
  FILE *f;
  int match = 0;
  l = strlen(name) + sizeof "CACHEDIR.TAG" + 2;
  if (l > path_l || path == NULL) {
    path_l = path_l * 2;
    if (path_l < l)
      path_l = l;
    free(path);
    path = malloc(path_l);
  }
  snprintf(path, path_l, "%s/%s", name, "CACHEDIR.TAG");
  f = fopen(path, "rb");
  if (f != NULL) {
    match = ((fread(buf, 1, signature_l, f) == signature_l) && !memcmp(buf, "Signature: 8a477f597d28d172789f06886806bc55", signature_l));
    fclose(f);
  }
  return match;
}
```