user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %edi,%ebp
  lea    D45(%rip),%rdi
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x78,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  call   <puts@plt>
  lea    D44(%rip),%rdi
  call   <puts@plt>
  cmp    $0x1,%ebp
  jle    L66
  mov    0x8(%rbx),%rdx
  lea    0x10(%rsp),%rbp
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rsi
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D17(%rip),%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L49
L46:
  mov    0x8(%rbx),%rdx
  lea    0x40(%rsp),%rbp
  lea    D98(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rsi
  lea    D48(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D29(%rip),%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L5
L74:
  xor    %ebp,%ebp
  lea    0xc(%rsp),%rbx
  jmp    L40
  nopl   (%rax)
L64:
  mov    0xc(%rsp),%eax
  mov    %r13,%rcx
  mov    $0x4,%edx
  mov    %rbx,%rdi
  mov    $0x1,%esi
  add    $0x1,%rbp
  bswap  %eax
  mov    %eax,0xc(%rsp)
  call   <fwrite@plt>
L40:
  mov    %r12,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  mov    %rbx,%rdi
  call   <fread@plt>
  test   %rax,%rax
  jne    L64
  mov    %rbp,%rsi
  lea    D102(%rip),%rdi
  call   <printf@plt>
  mov    %r12,%rdi
  call   <fclose@plt>
  mov    %r13,%rdi
  call   <fclose@plt>
  xor    %edi,%edi
  call   <exit@plt>
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L2
  add    $0x78,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L66:
  lea    D101(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D109(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L74
L5:
  mov    %rbp,%rsi
  lea    D91(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L74
L49:
  mov    %rbp,%rsi
  lea    D54(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x1,%edi
  call   <exit@plt>
  jmp    L46
L2:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D45
datatype: string
name: extract_symbolic_data
arguments: label: D44
datatype: string
name: extract_symbolic_data
arguments: label: D58
datatype: string
name: extract_symbolic_data
arguments: label: D12
datatype: string
name: extract_symbolic_data
arguments: label: D17
datatype: string
name: extract_symbolic_data
arguments: label: D98
datatype: string
name: extract_symbolic_data
arguments: label: D48
datatype: string
name: extract_symbolic_data
arguments: label: D29
datatype: string
name: extract_symbolic_data
arguments: label: D102
datatype: string
name: extract_symbolic_data
arguments: label: D101
datatype: string
name: extract_symbolic_data
arguments: label: D109
datatype: string
name: extract_symbolic_data
arguments: label: D91
datatype: string
name: extract_symbolic_data
arguments: label: D54
datatype: string

tool: D45: 

Swap a Big-Endian Data file to Little Endian

tool: D44:           or vise-versa.  (32 bit data only)

tool: D58: %s

tool: D12: 
Reading data from "%s".


tool: D17: r+b

tool: D98: %s_swapped

tool: D48: Writing data to "%s".



tool: D29: w+b

tool: D102: Converted %ld points.



tool: D101: 

Please enter a filename for the input data file

tool: D109:  after "readdata".

tool: D91: 
Can't open %s, exiting.


tool: D54: 
Can't open "%s", exiting.


assistant: ```c
int main(int argc, char *argv[]) {
  unsigned char buffer[4];
  int tmp;
  long ct = 0;
  char innm[40], outnm[40];
  FILE *infile, *outfile;
  printf("\n\nSwap a Big-Endian Data file to Little Endian\n");
  printf("          or vise-versa.  (32 bit data only)\n");
  if (argc > 1) {
    sprintf(innm, "%s", argv[1]);
    printf("\nReading data from \"%s\".\n", innm);
    if (NULL == (infile = fopen(innm, "r+b"))) {
      printf("\nCan't open \"%s\", exiting.\n", innm);
      exit(1);
    }
    sprintf(outnm, "%s_swapped", argv[1]);
    printf("Writing data to \"%s\".\n\n", outnm);
    if (NULL == (outfile = fopen(outnm, "w+b"))) {
      printf("\nCan't open %s, exiting.\n", outnm);
      exit(1);
    }
  } else {
    printf("\n\nPlease enter a filename for the input data file");
    printf(" after \"readdata\".\n");
    exit(1);
  }
  ct = 0;
  while (fread(buffer, sizeof(unsigned char), 4, infile)) {
    tmp = buffer[0];
    buffer[0] = buffer[3];
    buffer[3] = tmp;
    tmp = buffer[1];
    buffer[1] = buffer[2];
    buffer[2] = tmp;
    fwrite(buffer, sizeof(unsigned char), 4, outfile);
    ct++;
  }
  printf("Converted %ld points.\n\n", ct);
  fclose(infile);
  fclose(outfile);
  exit(0);
}
```