user: 请将以下的汇编代码转换成C语言代码：

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x9e000(%rsp),%r11
L129:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L129
  sub    $0x128,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x9e118(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x10(%rsp)
  movq   $0x0,0x18(%rsp)
  cmp    $0x2,%edi
  je     L36
  lea    D27(%rip),%rdi
  call   <puts@plt>
  lea    D62(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
L36:
  mov    0x8(%rsp),%rax
  lea    0x18(%rsp),%rdx
  lea    0x10(%rsp),%rsi
  mov    0x8(%rax),%rdi
  call   <split_root_suffix@plt>
  mov    0x18(%rsp),%rbp
  mov    0x10(%rsp),%rdi
  test   %rbp,%rbp
  je     L5
  call   <strlen@plt>
  mov    %rbp,%rdi
  mov    %rax,%rbx
  call   <strlen@plt>
  mov    $0x1,%esi
  lea    0x5(%rbx,%rax,1),%rdi
  call   <calloc@plt>
  mov    %rax,%r15
L16:
  mov    $0x1,%ebx
  lea    D18(%rip),%rbp
  lea    0x20(%rsp),%r12
  lea    D59(%rip),%r14
  lea    D45(%rip),%r13
  jmp    L2
  nopw   0x0(%rax,%rax,1)
L117:
  mov    %r13,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
L48:
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <fopen@plt>
  mov    %rax,-0x8(%r12,%rbx,8)
  add    $0x1,%rbx
  cmp    $0xe,%rbx
  je     L33
L2:
  mov    0x18(%rsp),%r8
  mov    0x10(%rsp),%rdx
  mov    %ebx,%ecx
  test   %r8,%r8
  jne    L117
  mov    %r14,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L48
L33:
  mov    %r15,%rdi
  lea    0x90(%rsp),%r13
  lea    0x9e110(%rsp),%rbp
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x18(%rsp),%rdi
  call   <free@plt>
  mov    0x8(%rsp),%rax
  lea    D26(%rip),%rsi
  mov    0x8(%rax),%rdi
  call   <fopen@plt>
  movl   $0x0,0x8(%rsp)
  mov    %rax,%r15
  nopl   0x0(%rax,%rax,1)
L75:
  mov    %r15,%rcx
  mov    $0x1,%edx
  mov    $0x9e080,%esi
  mov    %r13,%rdi
  call   <fread@plt>
  test   %rax,%rax
  je     L15
  mov    %r12,%r14
  mov    %r13,%rbx
  nopl   0x0(%rax,%rax,1)
L49:
  mov    (%r14),%rcx
  mov    %rbx,%rdi
  mov    $0x1,%edx
  mov    $0xc280,%esi
  add    $0xc280,%rbx
  add    $0x8,%r14
  call   <fwrite@plt>
  cmp    %rbp,%rbx
  jne    L49
  addl   $0x1,0x8(%rsp)
  jmp    L75
L15:
  mov    %r15,%rdi
  lea    0x88(%rsp),%rbx
  call   <fclose@plt>
  nopl   0x0(%rax)
L46:
  mov    (%r12),%rdi
  add    $0x8,%r12
  call   <fclose@plt>
  cmp    %r12,%rbx
  jne    L46
  mov    0x8(%rsp),%esi
  lea    D20(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %edi,%edi
  call   <exit@plt>
  mov    0x9e118(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L44
  add    $0x9e128,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L5:
  call   <strlen@plt>
  mov    $0x1,%esi
  lea    0x5(%rax),%rdi
  call   <calloc@plt>
  mov    %rax,%r15
  jmp    L16
L44:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D27
type: string
name: unpack_data
arguments: data_tag: D62
type: string
name: unpack_data
arguments: data_tag: D18
type: string
name: unpack_data
arguments: data_tag: D59
type: string
name: unpack_data
arguments: data_tag: D45
type: string
name: unpack_data
arguments: data_tag: D26
type: string
name: unpack_data
arguments: data_tag: D20
type: string

tool: D27: 
  Usage:  split_parkes_beams infilename


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


tool: D18: wb

tool: D59: %s_%02d

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

tool: D26: rb

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