user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  lea    -0x9e000(%rsp),%r11
L35:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L35
  sub    $0x148,%rsp
  mov    %edi,-0x9e144(%rbp)
  mov    %rsi,-0x9e150(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x9e134(%rbp)
  movq   $0x0,-0x9e130(%rbp)
  movq   $0x0,-0x9e128(%rbp)
  cmpl   $0x2,-0x9e144(%rbp)
  je     L24
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
L24:
  mov    -0x9e150(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    -0x9e128(%rbp),%rdx
  lea    -0x9e130(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <split_root_suffix@plt>
  mov    -0x9e128(%rbp),%rax
  test   %rax,%rax
  je     L108
  mov    -0x9e130(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    -0x9e128(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    %rbx,%rax
  add    $0x5,%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x9e120(%rbp)
  jmp    L40
L108:
  mov    -0x9e130(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  add    $0x5,%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <calloc@plt>
  mov    %rax,-0x9e120(%rbp)
L40:
  movl   $0x0,-0x9e138(%rbp)
  jmp    L127
L76:
  mov    -0x9e128(%rbp),%rax
  test   %rax,%rax
  je     L107
  mov    -0x9e128(%rbp),%rsi
  mov    -0x9e138(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x9e130(%rbp),%rdx
  mov    -0x9e120(%rbp),%rax
  mov    %rsi,%r8
  lea    D0(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L121
L107:
  mov    -0x9e138(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    -0x9e130(%rbp),%rdx
  mov    -0x9e120(%rbp),%rax
  lea    D24(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L121:
  mov    -0x9e120(%rbp),%rax
  lea    D38(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    -0x9e138(%rbp),%edx
  movslq %edx,%rdx
  mov    %rax,-0x9e110(%rbp,%rdx,8)
  addl   $0x1,-0x9e138(%rbp)
L127:
  cmpl   $0xc,-0x9e138(%rbp)
  jle    L76
  mov    -0x9e120(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x9e130(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x9e128(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x9e150(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D48(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x9e118(%rbp)
  jmp    L68
L7:
  movl   $0x0,-0x9e138(%rbp)
  jmp    L116
L36:
  mov    -0x9e138(%rbp),%eax
  cltq
  mov    -0x9e110(%rbp,%rax,8),%rax
  mov    -0x9e138(%rbp),%edx
  imul   $0xc280,%edx,%edx
  movslq %edx,%rdx
  lea    -0x9e0a0(%rbp),%rcx
  lea    (%rcx,%rdx,1),%rdi
  mov    %rax,%rcx
  mov    $0x1,%edx
  mov    $0xc280,%esi
  call   <fwrite@plt>
  addl   $0x1,-0x9e138(%rbp)
L116:
  cmpl   $0xc,-0x9e138(%rbp)
  jle    L36
  addl   $0x1,-0x9e134(%rbp)
L68:
  mov    -0x9e118(%rbp),%rdx
  lea    -0x9e0a0(%rbp),%rax
  mov    %rdx,%rcx
  mov    $0x1,%edx
  mov    $0x9e080,%esi
  mov    %rax,%rdi
  call   <fread@plt>
  test   %rax,%rax
  jne    L7
  mov    -0x9e118(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  movl   $0x0,-0x9e138(%rbp)
  jmp    L2
L87:
  mov    -0x9e138(%rbp),%eax
  cltq
  mov    -0x9e110(%rbp,%rax,8),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  addl   $0x1,-0x9e138(%rbp)
L2:
  cmpl   $0xc,-0x9e138(%rbp)
  jle    L87
  mov    -0x9e134(%rbp),%eax
  mov    %eax,%esi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  mov    $0x0,%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L145
  call   <__stack_chk_fail@plt>
L145:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D21
type_guessed: string
name: unpack_data
arguments: tag: D23
type_guessed: string
name: unpack_data
arguments: tag: D0
type_guessed: string
name: unpack_data
arguments: tag: D24
type_guessed: string
name: unpack_data
arguments: tag: D38
type_guessed: string
name: unpack_data
arguments: tag: D48
type_guessed: string
name: unpack_data
arguments: tag: D36
type_guessed: string

tool: D21: 
  Usage:  split_parkes_beams infilename


tool: D23:   This routine splits all 13 beams from a Parkes Multibeam raw data file.


tool: D0: %s_%02d.%s

tool: D24: %s_%02d

tool: D38: wb

tool: D48: rb

tool: D36: 
Done.  Split %d records.


assistant: ```c
int main(int argc, char *argv[]) {
  FILE *infile, *outfiles[13];
  int ii, numrec = 0;
  char *outname, *root = NULL, *suffix = NULL;
  unsigned char buffer[49792 * 13];
  if (argc != 2) {
    printf("\n  Usage:  split_parkes_beams infilename\n\n");
    printf("  This routine splits all 13 beams from a Parkes Multibeam raw data file.\n\n");
    exit(0);
  }
  split_root_suffix(argv[1], &root, &suffix);
  if (suffix)
    outname = calloc(strlen(root) + strlen(suffix) + 5, 1);
  else
    outname = calloc(strlen(root) + 5, 1);
  for (ii = 0; ii < 13; ii++) {
    if (suffix)
      sprintf(outname, "%s_%02d.%s", root, ii + 1, suffix);
    else
      sprintf(outname, "%s_%02d", root, ii + 1);
    outfiles[ii] = fopen(outname, "wb");
  }
  free(outname);
  free(root);
  free(suffix);
  infile = fopen(argv[1], "rb");
  while (fread(buffer, 49792 * 13, 1, infile)) {
    for (ii = 0; ii < 13; ii++)
      fwrite(buffer + ii * 49792, 49792, 1, outfiles[ii]);
    numrec++;
  }
  fclose(infile);
  for (ii = 0; ii < 13; ii++)
    fclose(outfiles[ii]);
  printf("\nDone.  Split %d records.\n", numrec);
  exit(0);
}
```