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

```asm
<FindResourceFile>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  sub    $0x590,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x588(%rsp)
  xor    %eax,%eax
  call   <IsResourceInFile@plt>
  test   %eax,%eax
  je     L64
L137:
  mov    $0x1,%eax
L68:
  mov    0x588(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L26
  add    $0x590,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  xchg   %ax,%ax
L64:
  lea    0x10(%rsp),%r12
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    %r12,%r13
  call   <strcpy@plt>
  mov    $0x2f,%esi
  mov    %r12,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L87
  lea    0x1(%rax),%r13
  mov    %r13,%rax
  sub    %r12,%rax
  add    %rax,%rbp
L87:
  lea    D2(%rip),%rsi
  mov    %r13,%rdi
  call   <strcpy@plt>
  mov    %r13,%rdi
  mov    %rbp,%rsi
  call   <strcat@plt>
  mov    %r12,%rdi
  call   <IsResourceInFile@plt>
  test   %eax,%eax
  jne    L137
  mov    %r12,%rdi
  mov    $0x2f,%esi
  call   <strrchr@plt>
  movsbl 0x1(%rax),%edi
  mov    %rax,%rbp
  lea    0x1(%rax),%r13
  test   %dil,%dil
  je     L128
  mov    %r13,%rbx
  nopl   0x0(%rax)
L9:
  call   <isupper@plt>
  test   %rax,%rax
  jne    L115
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  test   %dil,%dil
  jne    L9
L128:
  mov    $0x2e,%esi
  mov    %r13,%rdi
  call   <strchr@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L48
L43:
  mov    %r14,%rbx
  sub    %r13,%rbx
  cmp    $0x8,%rbx
  jg     L86
  mov    %r14,%rdi
  call   <strlen@plt>
  cmp    $0x4,%eax
  jle    L31
  lea    0x8(%rsp),%r13
  mov    $0x7,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <strncpy@plt>
  movb   $0x0,0xc(%rsp)
  cmp    $0x6,%rbx
  jg     L32
L66:
  mov    $0x317e,%eax
  lea    0x2(%r14),%rdi
  mov    %r13,%rsi
  mov    %ax,(%r14)
  call   <strcpy@plt>
L31:
  mov    %r12,%rdi
  call   <IsResourceInFile@plt>
  jmp    L68
  nop
L115:
  movsbl (%rbx),%edi
  add    $0x1,%rbx
  call   <tolower@plt>
  mov    %al,-0x1(%rbx)
  movsbl (%rbx),%edi
  test   %dil,%dil
  jne    L9
  jmp    L128
L86:
  lea    0x8(%rsp),%r13
  mov    $0x7,%edx
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <strncpy@plt>
  movb   $0x0,0xc(%rsp)
L32:
  lea    0x7(%rbp),%r14
  jmp    L66
L48:
  mov    %r13,%rdi
  call   <strlen@plt>
  movslq %eax,%r14
  add    %r13,%r14
  jmp    L43
L26:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D2
type: string

tool: D2: resource.frk/

assistant: ```c
int FindResourceFile(char *filename) {
  char *spt, *pt, *dpt;
  char buffer[1400];
  if (IsResourceInFile(filename))
    return (1);
  strcpy(buffer, filename);
  spt = strrchr(buffer, '/');
  if (spt == NULL) {
    spt = buffer;
    pt = filename;
  } else {
    ++spt;
    pt = filename + (spt - buffer);
  }
  strcpy(spt, "resource.frk/");
  strcat(spt, pt);
  if (IsResourceInFile(buffer))
    return (1);
  spt = strrchr(buffer, '/') + 1;
  for (pt = spt; *pt; ++pt)
    if (isupper(*pt))
      *pt = tolower(*pt);
  dpt = strchr(spt, '.');
  if (dpt == NULL)
    dpt = spt + strlen(spt);
  if (dpt - spt > 8 || strlen(dpt) > 4) {
    char exten[8];
    strncpy(exten, dpt, 7);
    exten[4] = '\0';
    if (dpt - spt > 6)
      dpt = spt + 6;
    *dpt++ = '~';
    *dpt++ = '1';
    strcpy(dpt, exten);
  }
  return (IsResourceInFile(buffer));
}
```