user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<FindResourceFile>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x598,%rsp
  mov    %rdi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x588(%rsp)
  xor    %eax,%eax
  mov    $0x0,%esi
  call   <IsResourceInFile@plt>
  mov    %eax,%edx
  mov    $0x1,%eax
  test   %edx,%edx
  je     L78
L126:
  mov    0x588(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L41
  add    $0x598,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L78:
  lea    0x10(%rsp),%rbp
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    $0x2f,%esi
  mov    %rbp,%rdi
  call   <strrchr@plt>
  test   %rax,%rax
  je     L94
  lea    0x1(%rax),%rbp
  mov    %rbp,%rax
  lea    0x590(%rsp),%rcx
  sub    %rcx,%rax
  lea    0x580(%rax,%rbx,1),%rbx
L94:
  lea    D1(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  lea    0x10(%rsp),%rdi
  mov    $0x0,%esi
  call   <IsResourceInFile@plt>
  mov    %eax,%edx
  mov    $0x1,%eax
  test   %edx,%edx
  jne    L126
  lea    0x10(%rsp),%rdi
  mov    $0x2f,%esi
  call   <strrchr@plt>
  mov    %rax,%rbp
  lea    0x1(%rax),%r12
  movzbl 0x1(%rax),%edi
  test   %dil,%dil
  je     L30
  mov    %r12,%rbx
  jmp    L107
L46:
  add    $0x1,%rbx
  movzbl (%rbx),%edi
  test   %dil,%dil
  je     L30
L107:
  movsbl %dil,%edi
  call   <isupper@plt>
  test   %rax,%rax
  je     L46
  movsbl (%rbx),%edi
  call   <tolower@plt>
  mov    %al,(%rbx)
  jmp    L46
L30:
  mov    $0x2e,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L83
L77:
  mov    %rbx,%r13
  sub    %r12,%r13
  cmp    $0x8,%r13
  jg     L127
  mov    %rbx,%rdi
  call   <strlen@plt>
  cmp    $0x4,%eax
  jle    L32
L127:
  lea    0x8(%rsp),%rdi
  mov    $0x7,%edx
  mov    %rbx,%rsi
  call   <strncpy@plt>
  movb   $0x0,0xc(%rsp)
  add    $0x7,%rbp
  cmp    $0x6,%r13
  cmovg  %rbp,%rbx
  movb   $0x7e,(%rbx)
  movb   $0x31,0x1(%rbx)
  lea    0x8(%rsp),%rsi
  lea    0x2(%rbx),%rdi
  call   <strcpy@plt>
L32:
  lea    0x10(%rsp),%rdi
  mov    $0x0,%esi
  call   <IsResourceInFile@plt>
  jmp    L126
L83:
  mov    %r12,%rdi
  call   <strlen@plt>
  movslq %eax,%rbx
  add    %r12,%rbx
  jmp    L77
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D1
type: string

tool: D1: resource.frk/

assistant: ```c
int FindResourceFile(char *filename) {
  char *spt, *pt, *dpt;
  char buffer[1400];
  if (IsResourceInFile(filename, NULL))
    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, NULL))
    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, NULL));
}
```