user: 请从给定的汇编指令推导出C源代码：

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0xe0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0xffffffff,-0xd8(%rbp)
  movl   $0xffffffff,-0xd4(%rbp)
  movl   $0x1,-0xd0(%rbp)
  lea    -0x7f(%rbp),%rax
  mov    $0xf,%edx
  lea    D156(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  lea    -0x7f(%rbp),%rax
  mov    %rax,-0xb8(%rbp)
  movq   $0x0,-0x70(%rbp)
  movq   $0x0,-0x68(%rbp)
  movq   $0x0,-0x60(%rbp)
  movq   $0x0,-0x58(%rbp)
  movq   $0x0,-0x50(%rbp)
  movq   $0x0,-0x48(%rbp)
  movq   $0x0,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  movq   $0x0,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  cmpl   $0x0,-0xd0(%rbp)
  je     L36
  lea    D164(%rip),%rax
  mov    %rax,%rsi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0xc8(%rbp)
L36:
  cmpl   $0x0,-0xd0(%rbp)
  je     L47
  lea    D164(%rip),%rax
  mov    %rax,%rsi
  lea    D149(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0xc0(%rbp)
L47:
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xec(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xe8(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xe4(%rbp)
  movq   $0x0,-0xa4(%rbp)
  movl   $0x0,-0x9c(%rbp)
  movq   $0x0,-0x98(%rbp)
  movl   $0x0,-0x90(%rbp)
  movq   $0x0,-0x8c(%rbp)
  movl   $0x0,-0x84(%rbp)
  pxor   %xmm0,%xmm0
  movss  %xmm0,-0xe0(%rbp)
  movl   $0x0,-0xdc(%rbp)
  movl   $0x0,-0xcc(%rbp)
  lea    -0xa4(%rbp),%rax
  mov    $0xc,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x98(%rbp),%rax
  mov    $0xc,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x8c(%rbp),%rax
  mov    $0xc,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0xb8(%rbp),%rax
  mov    %rax,%rsi
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0xb8(%rbp),%rax
  mov    $0x9600,%esi
  mov    %rax,%rdi
  call   <mstrain_setup@plt>
  mov    %eax,-0xd8(%rbp)
  mov    -0xd8(%rbp),%eax
  mov    %eax,%esi
  lea    D4(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  cmpl   $0x0,-0xd8(%rbp)
  jns    L56
  lea    D169(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L74
  jmp    L8
L56:
  lea    -0xe0(%rbp),%rdx
  mov    -0xd8(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <mstrain_temperature@plt>
  mov    %eax,-0xd4(%rbp)
  lea    -0xdc(%rbp),%rdx
  mov    -0xd8(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <mstrain_serial_number@plt>
  mov    %eax,-0xd4(%rbp)
  mov    -0xdc(%rbp),%edx
  movss  -0xe0(%rbp),%xmm0
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm0,%xmm3
  movq   %xmm3,%rax
  mov    %edx,%esi
  movq   %rax,%xmm0
  lea    D181(%rip),%rax
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <printf@plt>
L22:
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x98(%rbp),%rdi
  lea    -0xa4(%rbp),%rcx
  lea    -0x8c(%rbp),%rdx
  mov    -0xcc(%rbp),%esi
  mov    -0xd8(%rbp),%eax
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <mstrain_vectors@plt>
  mov    %eax,-0xd4(%rbp)
  movss  -0x84(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movss  -0x88(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movss  -0x8c(%rbp),%xmm2
  pxor   %xmm5,%xmm5
  cvtss2sd %xmm2,%xmm5
  movq   %xmm5,%rax
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D77(%rip),%rax
  mov    %rax,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  movss  -0x9c(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movss  -0xa0(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movss  -0xa4(%rbp),%xmm2
  pxor   %xmm6,%xmm6
  cvtss2sd %xmm2,%xmm6
  movq   %xmm6,%rax
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D11(%rip),%rax
  mov    %rax,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  movss  -0x90(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movss  -0x94(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movss  -0x98(%rbp),%xmm2
  pxor   %xmm7,%xmm7
  cvtss2sd %xmm2,%xmm7
  movq   %xmm7,%rax
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D204(%rip),%rax
  mov    %rax,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  lea    D119(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0xe4(%rbp),%rcx
  lea    -0xec(%rbp),%rdx
  lea    -0xe8(%rbp),%rsi
  mov    -0xd8(%rbp),%eax
  mov    %eax,%edi
  call   <mstrain_euler_angles@plt>
  mov    %eax,-0xd4(%rbp)
  movss  -0xe4(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movss  -0xec(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movss  -0xe8(%rbp),%xmm2
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm2,%xmm3
  movq   %xmm3,%rax
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D115(%rip),%rax
  mov    %rax,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  lea    D157(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x98(%rbp),%r8
  lea    -0xa4(%rbp),%rdi
  lea    -0xe4(%rbp),%rcx
  lea    -0xec(%rbp),%rdx
  lea    -0xe8(%rbp),%rsi
  mov    -0xd8(%rbp),%eax
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <mstrain_euler_vectors@plt>
  mov    %eax,-0xd4(%rbp)
  cmpl   $0x0,-0xd4(%rbp)
  jns    L40
  mov    -0xd8(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    $0x11170,%edi
  call   <usleep@plt>
  mov    -0xb8(%rbp),%rax
  mov    $0x9600,%esi
  mov    %rax,%rdi
  call   <mstrain_setup@plt>
  mov    %eax,-0xd8(%rbp)
  cmpl   $0x0,-0xd0(%rbp)
  je     L40
  lea    -0xac(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  lea    -0xac(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,%rdi
  call   <localtime@plt>
  mov    (%rax),%eax
  mov    %eax,-0xf0(%rbp)
  lea    -0xf0(%rbp),%rdx
  lea    -0x70(%rbp),%rax
  mov    %rdx,%rcx
  lea    D132(%rip),%rdx
  mov    $0x50,%esi
  mov    %rax,%rdi
  call   <strftime@plt>
  mov    -0xac(%rbp),%ebx
  lea    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%r12d
  lea    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x70(%rbp),%rdx
  add    %rdx,%rax
  mov    %ebx,%ecx
  lea    D25(%rip),%rdx
  mov    %r12d,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  pxor   %xmm5,%xmm5
  cvtsi2ssl -0xd4(%rbp),%xmm5
  movd   %xmm5,%ecx
  lea    -0x70(%rbp),%rdx
  mov    -0xc0(%rbp),%rax
  movd   %ecx,%xmm0
  lea    D20(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x1,%eax
  call   <fprintf@plt>
L40:
  movss  -0xe4(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movss  -0xe8(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movss  -0xec(%rbp),%xmm2
  pxor   %xmm6,%xmm6
  cvtss2sd %xmm2,%xmm6
  movq   %xmm6,%rax
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  mov    $0x3,%eax
  call   <printf@plt>
  cmpl   $0x0,-0xd0(%rbp)
  je     L22
  lea    -0xac(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <gettimeofday@plt>
  lea    -0xac(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,%rdi
  call   <localtime@plt>
  mov    (%rax),%eax
  mov    %eax,-0xf0(%rbp)
  lea    -0xf0(%rbp),%rdx
  lea    -0x70(%rbp),%rax
  mov    %rdx,%rcx
  lea    D132(%rip),%rdx
  mov    $0x50,%esi
  mov    %rax,%rdi
  call   <strftime@plt>
  mov    -0xac(%rbp),%ebx
  lea    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%r12d
  lea    -0x70(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  lea    -0x70(%rbp),%rdx
  add    %rdx,%rax
  mov    %ebx,%ecx
  lea    D25(%rip),%rdx
  mov    %r12d,%esi
  mov    %rax,%rdi
  call   <snprintf@plt>
  movss  -0x90(%rbp),%xmm0
  pxor   %xmm3,%xmm3
  cvtss2sd %xmm0,%xmm3
  movss  -0x94(%rbp),%xmm0
  pxor   %xmm2,%xmm2
  cvtss2sd %xmm0,%xmm2
  movss  -0x98(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm1
  movss  -0x9c(%rbp),%xmm0
  cvtss2sd %xmm0,%xmm0
  movss  -0xa0(%rbp),%xmm4
  pxor   %xmm7,%xmm7
  cvtss2sd %xmm4,%xmm7
  movss  -0xa4(%rbp),%xmm4
  pxor   %xmm6,%xmm6
  cvtss2sd %xmm4,%xmm6
  movss  -0x84(%rbp),%xmm4
  pxor   %xmm5,%xmm5
  cvtss2sd %xmm4,%xmm5
  movss  -0x88(%rbp),%xmm4
  cvtss2sd %xmm4,%xmm4
  movss  -0x8c(%rbp),%xmm8
  pxor   %xmm10,%xmm10
  cvtss2sd %xmm8,%xmm10
  movss  -0xe4(%rbp),%xmm8
  pxor   %xmm9,%xmm9
  cvtss2sd %xmm8,%xmm9
  movss  -0xe8(%rbp),%xmm8
  cvtss2sd %xmm8,%xmm8
  mov    -0xec(%rbp),%ecx
  lea    -0x70(%rbp),%rdx
  mov    -0xc8(%rbp),%rax
  lea    -0x8(%rsp),%rsp
  movsd  %xmm3,(%rsp)
  lea    -0x8(%rsp),%rsp
  movsd  %xmm2,(%rsp)
  lea    -0x8(%rsp),%rsp
  movsd  %xmm1,(%rsp)
  lea    -0x8(%rsp),%rsp
  movsd  %xmm0,(%rsp)
  movapd %xmm10,%xmm3
  movapd %xmm9,%xmm2
  movapd %xmm8,%xmm1
  movd   %ecx,%xmm0
  lea    D159(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x8,%eax
  call   <fprintf@plt>
  add    $0x20,%rsp
  jmp    L22
L8:
  call   <__stack_chk_fail@plt>
L74:
  lea    -0x10(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: tag: D156
type_infered: string
name: unpack_data
arguments: tag: D164
type_infered: string
name: unpack_data
arguments: tag: D48
type_infered: string
name: unpack_data
arguments: tag: D149
type_infered: string
name: unpack_data
arguments: tag: D30
type_infered: string
name: unpack_data
arguments: tag: D4
type_infered: string
name: unpack_data
arguments: tag: D169
type_infered: string
name: unpack_data
arguments: tag: D181
type_infered: string
name: unpack_data
arguments: tag: D8
type_infered: string
name: unpack_data
arguments: tag: D77
type_infered: string
name: unpack_data
arguments: tag: D11
type_infered: string
name: unpack_data
arguments: tag: D204
type_infered: string
name: unpack_data
arguments: tag: D119
type_infered: string
name: unpack_data
arguments: tag: D115
type_infered: string
name: unpack_data
arguments: tag: D157
type_infered: string
name: unpack_data
arguments: tag: D132
type_infered: string
name: unpack_data
arguments: tag: D25
type_infered: string
name: unpack_data
arguments: tag: D20
type_infered: string
name: unpack_data
arguments: tag: D26
type_infered: string
name: unpack_data
arguments: tag: D159
type_infered: string

tool: D156: /dev/ttyUSB0

tool: D164: w

tool: D48: imu_data.csv

tool: D149: imu_errors.txt

tool: D30: MAIN: Trying IMU at %s with 38400.


tool: D4: imu_fd = %d


tool: D169: MAIN: No IMU, quitting...

tool: D181: MAIN: Temp: %f		SN: %d


tool: D8: MAIN: Trying mstrain_vectors()...

tool: D77: Mag Vector: %f %f %f


tool: D11: Accel Vector: %f %f %f


tool: D204: Ang Rate Vector: %f %f %f



tool: D119: MAIN: Trying mstrain_euler_angles()...

tool: D115: Roll: %f
Pitch: %f
Yaw: %f



tool: D157: MAIN: Trying mstrain_euler_vectors()...

tool: D132: 20%y%m%d_%H%M%S

tool: D25: .%03ld

tool: D20: %s %d


tool: D26: Pitch: %f
Roll: %f
Yaw: %f



tool: D159: %s, %.04f, %.04f, %.04f, %.04f, %.04f, %.04f %.04f, %.04f, %.04f, %.04f, %.04f, %.04f


assistant: ```c
int main() {
  int imu_fd = -1;
  int status = -1;
  int enable_log = 1;
  char port_name[15];
  char *imu_port;
  strncpy(port_name, "/dev/ttyUSB0", 15);
  imu_port = port_name;
  struct timeval ctime;
  struct tm ct;
  char write_time[80] = {0};
  FILE *f_log;
  FILE *f_errors;
  if (enable_log) {
    f_log = fopen("imu_data.csv", "w");
  }
  if (enable_log) {
    f_errors = fopen("imu_errors.txt", "w");
  }
  float pitch = 0;
  float roll = 0;
  float yaw = 0;
  float accel[3] = {0};
  float ang_rate[3] = {0};
  float mag[3] = {0};
  float temp = 0;
  int serial_num = 0;
  int gyro_stab = 0;
  memset(&accel, '\0', sizeof(accel));
  memset(&ang_rate, '\0', sizeof(ang_rate));
  memset(&mag, '\0', sizeof(mag));
  printf("MAIN: Trying IMU at %s with 38400.\n", imu_port);
  imu_fd = mstrain_setup(imu_port, 38400);
  printf("imu_fd = %d\n", imu_fd);
  if (imu_fd < 0) {
    printf("MAIN: No IMU, quitting...\n");
    return 0;
  }
  status = mstrain_temperature(imu_fd, &temp);
  status = mstrain_serial_number(imu_fd, &serial_num);
  printf("MAIN: Temp: %f\t\tSN: %d\n", temp, serial_num);
  while (1) {
    printf("MAIN: Trying mstrain_vectors()...\n");
    status = mstrain_vectors(imu_fd, gyro_stab, mag, accel, ang_rate);
    printf("Mag Vector: %f %f %f\n", mag[0], mag[1], mag[2]);
    printf("Accel Vector: %f %f %f\n", accel[0], accel[1], accel[2]);
    printf("Ang Rate Vector: %f %f %f\n\n", ang_rate[0], ang_rate[1], ang_rate[2]);
    printf("MAIN: Trying mstrain_euler_angles()...\n");
    status = mstrain_euler_angles(imu_fd, &roll, &pitch, &yaw);
    printf("Roll: %f\nPitch: %f\nYaw: %f\n\n", roll, pitch, yaw);
    printf("MAIN: Trying mstrain_euler_vectors()...\n");
    status = mstrain_euler_vectors(imu_fd, &roll, &pitch, &yaw, accel, ang_rate);
    if (status < 0) {
      close(imu_fd);
      usleep(7000 * 10);
      imu_fd = mstrain_setup(imu_port, 38400);
      if (enable_log) {
        gettimeofday(&ctime, NULL);
        ct = *(localtime((const time_t *)&ctime.tv_sec));
        strftime(write_time, sizeof(write_time), "20%y%m%d_%H%M%S", &ct);
        snprintf(write_time + strlen(write_time), strlen(write_time), ".%03ld", ctime.tv_usec);
        fprintf(f_errors, "%s %d\n", write_time, status);
      }
    }
    printf("Pitch: %f\nRoll: %f\nYaw: %f\n\n", pitch, roll, yaw);
    if (enable_log) {
      gettimeofday(&ctime, NULL);
      ct = *(localtime((const time_t *)&ctime.tv_sec));
      strftime(write_time, sizeof(write_time), "20%y%m%d_%H%M%S", &ct);
      snprintf(write_time + strlen(write_time), strlen(write_time), ".%03ld", ctime.tv_usec);
      fprintf(f_log,
              "%s, %.04f, %.04f, %.04f, %.04f, %.04f, %.04f "
              "%.04f, %.04f, %.04f, %.04f, %.04f, %.04f\n",
              write_time, pitch, roll, yaw, mag[0], mag[1], mag[2], accel[0], accel[1], accel[2], ang_rate[0], ang_rate[1], ang_rate[2]);
    }
  }
  close(imu_fd);
  return 0;
}
```