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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x278,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x268(%rsp)
  xor    %eax,%eax
  cmp    $0x2,%edi
  je     L117
  lea    D14(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
L117:
  mov    0x8(%rbx),%rdi
  lea    D59(%rip),%rsi
  call   <fopen@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L106
L22:
  movb   $0x0,0xf(%rsp)
  lea    D46(%rip),%rbx
  jmp    L152
  nopl   (%rax)
L120:
  lea    0x160(%rsp),%rbp
  mov    %r15,%rdx
  mov    $0x100,%esi
  mov    %rbp,%rdi
  lea    0x60(%rsp),%r12
  lea    0x1c(%rsp),%r13
  call   <fgets@plt>
  lea    0x18(%rsp),%r14
  xor    %eax,%eax
  mov    %r12,%r8
  mov    %r13,%rcx
  mov    %r14,%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <sscanf@plt>
  test   %rax,%rax
  jne    L118
L152:
  mov    %r15,%rdi
  call   <feof@plt>
  test   %eax,%eax
  je     L120
  mov    %r15,%rdi
  call   <fclose@plt>
  mov    0x268(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L121
  add    $0x278,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L118:
  movabs $0x495441474956414e,%rax
  cmp    %rax,0x60(%rsp)
  je     L131
L96:
  cmpl   $0x535047,0x60(%rsp)
  jne    L85
  push   %rcx
  mov    %r12,%r8
  mov    %r13,%rcx
  mov    %r14,%rdx
  lea    D19(%rip),%rsi
  mov    %rbp,%rdi
  lea    0x4c(%rsp),%rax
  push   %rax
  lea    0x50(%rsp),%rax
  push   %rax
  lea    0x54(%rsp),%rax
  push   %rax
  lea    0x58(%rsp),%rax
  push   %rax
  lea    0x5c(%rsp),%rax
  push   %rax
  lea    0x60(%rsp),%rax
  push   %rax
  lea    0x64(%rsp),%rax
  push   %rax
  lea    0x68(%rsp),%rax
  push   %rax
  lea    0x6c(%rsp),%rax
  push   %rax
  xor    %eax,%eax
  lea    0x70(%rsp),%r9
  call   <sscanf@plt>
  add    $0x50,%rsp
L85:
  mov    %r12,%rsi
  lea    D73(%rip),%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L152
  lea    0x50(%rsp),%rax
  mov    %r14,%rdx
  mov    %r12,%r8
  mov    %r13,%rcx
  push   %rax
  lea    D5(%rip),%rsi
  mov    %rbp,%rdi
  lea    0x54(%rsp),%rax
  push   %rax
  xor    %eax,%eax
  lea    0x58(%rsp),%r9
  call   <sscanf@plt>
  pop    %rax
  pop    %rdx
  cmpb   $0x0,0xf(%rsp)
  je     L152
  mov    0x30(%rsp),%eax
  mov    $0x64,%esi
  mov    0x48(%rsp),%r8d
  lea    D50(%rip),%rdi
  cltd
  idiv   %esi
  mov    %eax,%ecx
  mov    0x28(%rsp),%eax
  cltd
  idiv   %esi
  sub    0x58(%rsp),%eax
  mov    %eax,%r9d
  mov    0x24(%rsp),%eax
  cltd
  idiv   %esi
  mov    %r9d,%edx
  sub    0x54(%rsp),%eax
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L152
L131:
  cmpl   $0x525f4e4f,0x68(%rsp)
  jne    L96
  cmpw   $0x4645,0x6c(%rsp)
  jne    L96
  cmpb   $0x0,0x6e(%rsp)
  jne    L96
  lea    0x5c(%rsp),%rax
  mov    %rbp,%rdi
  mov    %r12,%r8
  mov    %r13,%rcx
  push   %rax
  lea    D5(%rip),%rsi
  mov    %r14,%rdx
  lea    0x60(%rsp),%rax
  push   %rax
  xor    %eax,%eax
  lea    0x64(%rsp),%r9
  call   <sscanf@plt>
  pop    %rsi
  pop    %rdi
  movb   $0x1,0xf(%rsp)
  jmp    L96
L106:
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L22
L121:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D14
datatype: string
name: unpack_data
arguments: data_label: D59
datatype: string
name: unpack_data
arguments: data_label: D46
datatype: string
name: unpack_data
arguments: data_label: D19
datatype: string
name: unpack_data
arguments: data_label: D73
datatype: string
name: unpack_data
arguments: data_label: D5
datatype: string
name: unpack_data
arguments: data_label: D50
datatype: string

tool: D14: plot3dparse 'flight_file.data' > output.dat

tool: D59: r

tool: D46: %e %i %s

tool: D19: %e %i %s %i %i %i %i %i %i %i %i %i %i


tool: D73: ATTITUDE

tool: D5: %e %i %s %i %i %i


tool: D50: %i %i %i %i



assistant: ```c
int main(int argc, char *argv[]) {
  char line_in[256];
  float rtime;
  char id_name[255];
  unsigned int ac_id;
  unsigned int byte_mask;
  int utm_east;
  int utm_north;
  int course;
  int alt;
  int speed;
  int climb;
  unsigned int itow;
  unsigned int utm_zone;
  unsigned int gps_nb_err;
  unsigned int phi;
  unsigned int psi;
  unsigned int theta;
  unsigned int nr_utm_east;
  unsigned int nr_utm_north;
  unsigned int nr_utm_zone;
  unsigned int humid;
  unsigned int temp;
  char got_navref = 0;
  FILE *fd;
  if (argc != 2) {
    printf("plot3dparse 'flight_file.data' > output.dat\n");
    exit(0);
  }
  fd = fopen(argv[1], "r");
  if (!fd)
    exit(0);
  while (!feof(fd)) {
    fgets(line_in, 256, fd);
    if (sscanf(line_in, "%e %i %s", &rtime, &ac_id, id_name)) {
      if (!strcmp("NAVIGATION_REF", id_name)) {
        sscanf(line_in, "%e %i %s %i %i %i\n", &rtime, &ac_id, id_name, &nr_utm_east, &nr_utm_north, &nr_utm_zone);
        got_navref = 1;
      }
      if (!strcmp("GPS", id_name)) {
        sscanf(line_in, "%e %i %s %i %i %i %i %i %i %i %i %i %i\n", &rtime, &ac_id, id_name, &byte_mask, &utm_east, &utm_north, &course, &alt, &speed, &climb, &itow, &utm_zone, &gps_nb_err);
      }
      if (!strcmp("ATTITUDE", id_name)) {
        sscanf(line_in, "%e %i %s %i %i %i\n", &rtime, &ac_id, id_name, &phi, &psi, &theta);
        if (got_navref)
          printf("%i %i %i %i\n\n", utm_east / 100 - nr_utm_east, utm_north / 100 - nr_utm_north, alt / 100, phi);
      }
    }
  }
  fclose(fd);
  return (0);
}
```