user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x9e000(%rsp),%r11
L18:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L18
  sub    $0x118,%rsp
  mov    %rsi,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x9e108(%rsp)
  xor    %eax,%eax
  movq   $0x0,(%rsp)
  movq   $0x0,0x8(%rsp)
  cmp    $0x2,%edi
  jne    L103
L90:
  lea    0x8(%rsp),%rdx
  mov    %rsp,%rsi
  mov    0x8(%r15),%rdi
  call   <split_root_suffix@plt>
  mov    0x8(%rsp),%rbp
  test   %rbp,%rbp
  je     L42
  mov    (%rsp),%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    0x5(%rbx,%rax,1),%rdi
  mov    $0x1,%esi
  call   <calloc@plt>
  mov    %rax,%rbp
L58:
  mov    $0x1,%ebx
  lea    D45(%rip),%r14
  lea    D61(%rip),%r13
  lea    D23(%rip),%r12
  jmp    L31
L103:
  lea    D44(%rip),%rdi
  call   <puts@plt>
  lea    D53(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L90
L42:
  mov    (%rsp),%rdi
  call   <strlen@plt>
  lea    0x5(%rax),%rdi
  mov    $0x1,%esi
  call   <calloc@plt>
  mov    %rax,%rbp
  jmp    L58
L81:
  mov    %ebx,%ecx
  mov    (%rsp),%rdx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
L69:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  mov    %rax,0x8(%rsp,%rbx,8)
  add    $0x1,%rbx
  cmp    $0xe,%rbx
  je     L61
L31:
  mov    0x8(%rsp),%r8
  test   %r8,%r8
  je     L81
  mov    %ebx,%ecx
  mov    (%rsp),%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L69
L61:
  mov    %rbp,%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rdi
  call   <free@plt>
  mov    0x8(%r15),%rdi
  lea    D0(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r14
  mov    $0x0,%r13d
  lea    0x80(%rsp),%r15
  jmp    L67
L95:
  add    $0x1,%r13d
L67:
  mov    %r14,%rcx
  mov    $0x1,%edx
  mov    $0x9e080,%esi
  mov    %r15,%rdi
  call   <fread@plt>
  test   %rax,%rax
  je     L110
  lea    0x10(%rsp),%rbp
  lea    0x80(%rsp),%rbx
  lea    0x9e100(%rsp),%r12
L89:
  mov    0x0(%rbp),%rcx
  mov    $0x1,%edx
  mov    $0xc280,%esi
  mov    %rbx,%rdi
  call   <fwrite@plt>
  add    $0x8,%rbp
  add    $0xc280,%rbx
  cmp    %r12,%rbx
  jne    L89
  jmp    L95
L110:
  mov    %r14,%rdi
  call   <fclose@plt>
  lea    0x10(%rsp),%rbx
  lea    0x78(%rsp),%rbp
L132:
  mov    (%rbx),%rdi
  call   <fclose@plt>
  add    $0x8,%rbx
  cmp    %rbp,%rbx
  jne    L132
  mov    %r13d,%esi
  lea    D7(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  mov    0x9e108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L53
  mov    $0x0,%eax
  add    $0x9e118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L53:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D45
type_infered: string
name: read_data
arguments: tag: D61
type_infered: string
name: read_data
arguments: tag: D23
type_infered: string
name: read_data
arguments: tag: D44
type_infered: string
name: read_data
arguments: tag: D53
type_infered: string
name: read_data
arguments: tag: D0
type_infered: string
name: read_data
arguments: tag: D7
type_infered: string

tool: D45: %s_%02d

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

tool: D23: wb

tool: D44: 
  Usage:  split_parkes_beams infilename


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


tool: D0: rb

tool: D7: 
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);
}
```