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

```asm
<IsResourceInFile>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  lea    D9(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L21
  mov    $0x0,%eax
  jmp    L102
L21:
  mov    -0x28(%rbp),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L151
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x18(%rbp)
L151:
  mov    -0x18(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L43
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x62,%al
  je     L154
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x42,%al
  jne    L43
L154:
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x69,%al
  je     L164
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x49,%al
  jne    L43
L164:
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0x6e,%al
  je     L75
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0x4e,%al
  jne    L43
L75:
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L43
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <IsResourceInBinary@plt>
  test   %rax,%rax
  je     L62
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x1,%eax
  jmp    L102
L43:
  cmpq   $0x0,-0x8(%rbp)
  je     L62
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x68,%al
  je     L101
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x48,%al
  jne    L62
L101:
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x71,%al
  je     L180
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x51,%al
  jne    L62
L180:
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0x78,%al
  je     L74
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  cmp    $0x58,%al
  jne    L62
L74:
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L62
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <IsResourceInHex@plt>
  test   %rax,%rax
  je     L62
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    $0x1,%eax
  jmp    L102
L62:
  mov    -0x10(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <IsResourceFork@plt>
  mov    %eax,-0x1c(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  cmpl   $0x0,-0x1c(%rbp)
  jne    L90
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <HasResourceFork@plt>
  mov    %eax,-0x1c(%rbp)
L90:
  mov    -0x1c(%rbp),%eax
L102:
  leave
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D9
type_infered: string

tool: D9: r

assistant: ```c
int IsResourceInFile(char *filename) {
  FILE *f;
  char *spt, *pt;
  int ret;
  f = fopen(filename, "r");
  if (f == NULL)
    return (0);
  spt = strrchr(filename, '/');
  if (spt == NULL)
    spt = filename;
  pt = strrchr(spt, '.');
  if (pt != NULL && (pt[1] == 'b' || pt[1] == 'B') && (pt[2] == 'i' || pt[2] == 'I') && (pt[3] == 'n' || pt[3] == 'N') && pt[4] == '\0') {
    if (IsResourceInBinary(f)) {
      fclose(f);
      return (1);
    }
  } else if (pt != NULL && (pt[1] == 'h' || pt[1] == 'H') && (pt[2] == 'q' || pt[2] == 'Q') && (pt[3] == 'x' || pt[3] == 'X') && pt[4] == '\0') {
    if (IsResourceInHex(f)) {
      fclose(f);
      return (1);
    }
  }
  ret = IsResourceFork(f, 0);
  fclose(f);
  if (!ret)
    ret = HasResourceFork(filename);
  return (ret);
}
```