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

```asm
<fs_loadall>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rsi,%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    D125(%rip),%rsi
  call   <fopen@plt>
  test   %rax,%rax
  je     L87
  mov    %rax,%rbx
  lea    0x30(%rsp),%rdi
  mov    %rax,%rcx
  mov    $0x8,%edx
  mov    $0x1,%esi
  call   <fread@plt>
  cmp    $0x8,%eax
  jne    L136
  mov    $0x4,%edx
  lea    D77(%rip),%rsi
  mov    %rbp,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L111
  cmpb   $0x0,0x0(%rbp)
  jne    L179
L111:
  movsbl 0x37(%rsp),%r12d
  movsbl 0x36(%rsp),%r15d
  movsbl 0x35(%rsp),%r14d
  movsbl 0x34(%rsp),%r13d
  movsbl 0x33(%rsp),%eax
  mov    %eax,0x4(%rsp)
  movsbl 0x32(%rsp),%ecx
  mov    %ecx,0x8(%rsp)
  movsbl 0x31(%rsp),%edx
  mov    %edx,0xc(%rsp)
  movsbl 0x30(%rsp),%esi
  mov    %esi,0x10(%rsp)
  mov    %r12d,%edi
  call   <dispchar@plt>
  mov    %eax,0x14(%rsp)
  movsbl 0x36(%rsp),%edi
  call   <dispchar@plt>
  mov    %eax,0x18(%rsp)
  movsbl 0x35(%rsp),%edi
  call   <dispchar@plt>
  mov    %eax,0x1c(%rsp)
  movsbl 0x34(%rsp),%edi
  call   <dispchar@plt>
  mov    %eax,0x20(%rsp)
  movsbl 0x33(%rsp),%edi
  call   <dispchar@plt>
  mov    %eax,0x24(%rsp)
  movsbl 0x32(%rsp),%edi
  call   <dispchar@plt>
  mov    %eax,0x28(%rsp)
  movsbl 0x31(%rsp),%edi
  call   <dispchar@plt>
  mov    %eax,0x2c(%rsp)
  movsbl 0x30(%rsp),%edi
  call   <dispchar@plt>
  mov    %eax,%esi
  sub    $0x8,%rsp
  push   %r12
  push   %r15
  push   %r14
  push   %r13
  mov    0x2c(%rsp),%edi
  push   %rdi
  mov    0x38(%rsp),%edi
  push   %rdi
  mov    0x44(%rsp),%edi
  push   %rdi
  mov    0x50(%rsp),%edi
  push   %rdi
  mov    0x5c(%rsp),%edi
  push   %rdi
  mov    0x68(%rsp),%edi
  push   %rdi
  mov    0x74(%rsp),%edi
  push   %rdi
  mov    0x80(%rsp),%r9d
  mov    0x84(%rsp),%r8d
  mov    0x88(%rsp),%ecx
  mov    0x8c(%rsp),%edx
  lea    D21(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  add    $0x60,%rsp
L179:
  lea    0x30(%rsp),%rdi
  mov    $0x8,%edx
  lea    D46(%rip),%rsi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L226
  lea    D24(%rip),%rdi
  call   <puts@plt>
L194:
  mov    %rbx,%rdi
  call   <ferror@plt>
  test   %rax,%rax
  jne    L214
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    $0x0,%eax
L129:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L62
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L87:
  lea    D10(%rip),%rdi
  call   <puts@plt>
  mov    $0xffffffff,%eax
  jmp    L129
L136:
  lea    D59(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L129
L226:
  lea    0x30(%rsp),%rdi
  mov    $0x5,%edx
  lea    D39(%rip),%rsi
  call   <memcmp@plt>
  test   %rax,%rax
  jne    L12
  movzbl 0x35(%rsp),%esi
  lea    -0x31(%rsi),%eax
  cmp    $0x8,%al
  ja     L12
  cmpb   $0x2e,0x36(%rsp)
  jne    L12
  movzbl 0x37(%rsp),%eax
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L12
  shl    $0x4,%esi
  add    %eax,%esi
  cmp    $0x16,%sil
  jg     L122
  cmpb   $0x0,0x0(%rbp)
  jne    L138
  mov    %rbx,%rdi
  call   <fs_load_pre17@plt>
  test   %rax,%rax
  js     L155
  mov    $0x10,%esi
  mov    %rbx,%rdi
  call   <chunk_load@plt>
  test   %rax,%rax
  jns    L194
  lea    D88(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L129
L138:
  lea    D35(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L129
L155:
  lea    D33(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L129
L122:
  movsbl %sil,%esi
  mov    %rbp,%rdx
  mov    %rbx,%rdi
  call   <fs_load@plt>
  test   %rax,%rax
  jns    L194
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L129
L12:
  lea    D26(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L129
L214:
  lea    D1(%rip),%rdi
  call   <puts@plt>
  mov    %rbx,%rdi
  call   <fclose@plt>
  mov    $0xffffffff,%eax
  jmp    L129
L62:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D125
type: string
name: retrieve_data
arguments: label: D77
type: string
name: retrieve_data
arguments: label: D21
type: string
name: retrieve_data
arguments: label: D46
type: string
name: retrieve_data
arguments: label: D24
type: string
name: retrieve_data
arguments: label: D10
type: string
name: retrieve_data
arguments: label: D59
type: string
name: retrieve_data
arguments: label: D39
type: string
name: retrieve_data
arguments: label: D88
type: string
name: retrieve_data
arguments: label: D35
type: string
name: retrieve_data
arguments: label: D33
type: string
name: retrieve_data
arguments: label: D26
type: string
name: retrieve_data
arguments: label: D1
type: string

tool: D125: r

tool: D77: HEAD

tool: D21: # header: %c%c%c%c%c%c%c%c (%02X%02X%02X%02X%02X%02X%02X%02X)


tool: D46: MFSM NEW

tool: D24: empty file

tool: D10: can't open metadata file

tool: D59: can't read metadata header

tool: D39: MFSM 

tool: D88: error reading metadata (chunks)

tool: D35: old format detected - can't dump sections separatelly

tool: D33: error reading metadata (structure)

tool: D26: wrong metadata header (old version ?)

tool: D1: error reading metadata

assistant: ```c
int fs_loadall(const char *fname, const char section[4]) {
  FILE *fd;
  uint8_t hdr[8];
  uint8_t fver;
  fd = fopen(fname, "r");
  if (fd == NULL) {
    printf("can't open metadata file\n");
    return -1;
  }
  if (fread(hdr, 1, 8, fd) != 8) {
    printf("can't read metadata header\n");
    fclose(fd);
    return -1;
  }
  if (memcmp(section, "HEAD", 4) == 0 || section[0] == 0) {
    printf("# header: %c%c%c%c%c%c%c%c (%02X%02X%02X%02X%02X%02X%02X%02X)\n", dispchar(hdr[0]), dispchar(hdr[1]), dispchar(hdr[2]), dispchar(hdr[3]), dispchar(hdr[4]), dispchar(hdr[5]), dispchar(hdr[6]), dispchar(hdr[7]), hdr[0], hdr[1], hdr[2], hdr[3], hdr[4], hdr[5], hdr[6], hdr[7]);
  }
  if (memcmp(hdr, "MFSM NEW", 8) == 0) {
    printf("empty file\n");
  } else if (memcmp(hdr,
                    "MFS"
                    "M ",
                    5) == 0 &&
             hdr[5] >= '1' && hdr[5] <= '9' && hdr[6] == '.' && hdr[7] >= '0' && hdr[7] <= '9') {
    fver = ((hdr[5] - '0') << 4) + (hdr[7] - '0');
    if (fver < 0x17) {
      if (section[0] != 0) {
        printf("old format detected - can't dump sections separatelly");
        fclose(fd);
        return -1;
      }
      if (fs_load_pre17(fd) < 0) {
        printf("error reading metadata (structure)\n");
        fclose(fd);
        return -1;
      }
      if (chunk_load(fd, 0x10) < 0) {
        printf("error reading metadata (chunks)\n");
        fclose(fd);
        return -1;
      }
    } else {
      if (fs_load(fd, fver, section) < 0) {
        fclose(fd);
        return -1;
      }
    }
  } else {
    printf("wrong metadata header (old version ?)\n");
    fclose(fd);
    return -1;
  }
  if (ferror(fd) != 0) {
    printf("error reading metadata\n");
    fclose(fd);
    return -1;
  }
  fclose(fd);
  return 0;
}
```