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

```asm
<main>:
  endbr64
  push   %r15
  mov    $0xf,%edx
  lea    D85(%rip),%rsi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    D107(%rip),%rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  lea    0xa1(%rsp),%rbx
  lea    0x7c(%rsp),%r12
  mov    %rbx,%rdi
  mov    %rbx,0x48(%rsp)
  lea    0x88(%rsp),%r13
  call   <strncpy@plt>
  pxor   %xmm0,%xmm0
  mov    %rbp,%rsi
  lea    D191(%rip),%rdi
  movaps %xmm0,0xb0(%rsp)
  movaps %xmm0,0xc0(%rsp)
  movaps %xmm0,0xd0(%rsp)
  movaps %xmm0,0xe0(%rsp)
  movaps %xmm0,0xf0(%rsp)
  call   <fopen@plt>
  mov    %rbp,%rsi
  lea    D80(%rip),%rdi
  mov    %rax,0x30(%rsp)
  call   <fopen@plt>
  xor    %esi,%esi
  mov    $0xc,%edx
  mov    %r12,%rdi
  mov    %rax,0x40(%rsp)
  movl   $0x0,0x60(%rsp)
  movl   $0x0,0x64(%rsp)
  movl   $0x0,0x68(%rsp)
  movq   $0x0,0x7c(%rsp)
  movl   $0x0,0x84(%rsp)
  movq   $0x0,0x88(%rsp)
  movl   $0x0,0x90(%rsp)
  movq   $0x0,0x94(%rsp)
  movl   $0x0,0x9c(%rsp)
  movl   $0x0,0x6c(%rsp)
  movl   $0x0,0x70(%rsp)
  call   <memset@plt>
  xor    %esi,%esi
  mov    $0xc,%edx
  mov    %r13,%rdi
  call   <memset@plt>
  lea    0x94(%rsp),%rax
  mov    $0xc,%edx
  xor    %esi,%esi
  mov    %rax,%rdi
  mov    %rax,0x38(%rsp)
  call   <memset@plt>
  mov    %rbx,%rsi
  lea    D101(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x9600,%esi
  mov    %rbx,%rdi
  call   <mstrain_setup@plt>
  lea    D195(%rip),%rdi
  mov    %eax,%ebp
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  test   %ebp,%ebp
  js     L32
  lea    0x6c(%rsp),%rsi
  mov    %ebp,%edi
  lea    0x68(%rsp),%r15
  call   <mstrain_temperature@plt>
  lea    0x70(%rsp),%rsi
  mov    %ebp,%edi
  lea    0x60(%rsp),%r14
  call   <mstrain_serial_number@plt>
  mov    0x70(%rsp),%esi
  pxor   %xmm0,%xmm0
  lea    D169(%rip),%rdi
  mov    $0x1,%eax
  cvtss2sd 0x6c(%rsp),%xmm0
  lea    0xb0(%rsp),%rbx
  call   <printf@plt>
  lea    0x64(%rsp),%rax
  mov    %rax,(%rsp)
  lea    0x74(%rsp),%rax
  mov    %rax,0x10(%rsp)
  lea    0x78(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x5c(%rsp),%rax
  mov    %rax,0x20(%rsp)
  nopl   (%rax)
L22:
  lea    D3(%rip),%rdi
  call   <puts@plt>
  mov    0x38(%rsp),%rdx
  mov    %r13,%r8
  xor    %esi,%esi
  mov    %r12,%rcx
  mov    %ebp,%edi
  call   <mstrain_vectors@plt>
  lea    D72(%rip),%rdi
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  pxor   %xmm1,%xmm1
  mov    $0x3,%eax
  cvtss2sd 0x94(%rsp),%xmm0
  cvtss2sd 0x9c(%rsp),%xmm2
  cvtss2sd 0x98(%rsp),%xmm1
  call   <printf@plt>
  lea    D127(%rip),%rdi
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  pxor   %xmm1,%xmm1
  mov    $0x3,%eax
  cvtss2sd 0x7c(%rsp),%xmm0
  cvtss2sd 0x84(%rsp),%xmm2
  cvtss2sd 0x80(%rsp),%xmm1
  call   <printf@plt>
  lea    D158(%rip),%rdi
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  pxor   %xmm1,%xmm1
  mov    $0x3,%eax
  cvtss2sd 0x88(%rsp),%xmm0
  cvtss2sd 0x90(%rsp),%xmm2
  cvtss2sd 0x8c(%rsp),%xmm1
  call   <printf@plt>
  lea    D20(%rip),%rdi
  call   <puts@plt>
  mov    (%rsp),%rsi
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %ebp,%edi
  call   <mstrain_euler_angles@plt>
  lea    D114(%rip),%rdi
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  pxor   %xmm1,%xmm1
  mov    $0x3,%eax
  cvtss2sd 0x64(%rsp),%xmm0
  cvtss2sd 0x68(%rsp),%xmm2
  cvtss2sd 0x60(%rsp),%xmm1
  call   <printf@plt>
  lea    D50(%rip),%rdi
  call   <puts@plt>
  mov    (%rsp),%rsi
  mov    %r13,%r9
  mov    %r12,%r8
  mov    %r15,%rcx
  mov    %r14,%rdx
  mov    %ebp,%edi
  call   <mstrain_euler_vectors@plt>
  test   %eax,%eax
  mov    %eax,0xc(%rsp)
  jns    L27
  mov    %ebp,%edi
  call   <close@plt>
  mov    $0x11170,%edi
  call   <usleep@plt>
  mov    0x48(%rsp),%rdi
  mov    $0x9600,%esi
  call   <mstrain_setup@plt>
  mov    0x10(%rsp),%rdi
  xor    %esi,%esi
  mov    %eax,%ebp
  call   <gettimeofday@plt>
  mov    0x18(%rsp),%rdi
  call   <localtime@plt>
  mov    0x20(%rsp),%rcx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  mov    (%rax),%eax
  lea    D32(%rip),%rdx
  mov    %eax,0x5c(%rsp)
  call   <strftime@plt>
  mov    0x74(%rsp),%ecx
  mov    %rbx,%rdi
  mov    %ecx,0x2c(%rsp)
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,0x28(%rsp)
  call   <strlen@plt>
  mov    0x28(%rsp),%esi
  mov    0x2c(%rsp),%ecx
  lea    D168(%rip),%rdx
  movslq %eax,%rdi
  add    %rbx,%rdi
  call   <snprintf@plt>
  mov    0xc(%rsp),%r8d
  pxor   %xmm0,%xmm0
  mov    %rbx,%rdx
  mov    0x40(%rsp),%rdi
  lea    D109(%rip),%rsi
  mov    $0x1,%eax
  cvtsi2ss %r8d,%xmm0
  call   <fprintf@plt>
L27:
  lea    D71(%rip),%rdi
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  mov    $0x3,%eax
  pxor   %xmm1,%xmm1
  cvtss2sd 0x60(%rsp),%xmm0
  cvtss2sd 0x68(%rsp),%xmm2
  cvtss2sd 0x64(%rsp),%xmm1
  call   <printf@plt>
  mov    0x10(%rsp),%rdi
  xor    %esi,%esi
  call   <gettimeofday@plt>
  mov    0x18(%rsp),%rdi
  call   <localtime@plt>
  mov    0x20(%rsp),%rcx
  mov    $0x50,%esi
  mov    %rbx,%rdi
  mov    (%rax),%eax
  lea    D32(%rip),%rdx
  mov    %eax,0x5c(%rsp)
  call   <strftime@plt>
  mov    0x74(%rsp),%ecx
  mov    %rbx,%rdi
  mov    %ecx,0x28(%rsp)
  call   <strlen@plt>
  mov    %rbx,%rdi
  mov    %eax,0xc(%rsp)
  call   <strlen@plt>
  mov    0xc(%rsp),%esi
  mov    0x28(%rsp),%ecx
  lea    D168(%rip),%rdx
  movslq %eax,%rdi
  add    %rbx,%rdi
  call   <snprintf@plt>
  pxor   %xmm0,%xmm0
  sub    $0x20,%rsp
  mov    %rbx,%rdx
  pxor   %xmm7,%xmm7
  pxor   %xmm6,%xmm6
  pxor   %xmm5,%xmm5
  cvtss2sd 0xb0(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  pxor   %xmm0,%xmm0
  pxor   %xmm4,%xmm4
  pxor   %xmm3,%xmm3
  mov    0x50(%rsp),%rdi
  pxor   %xmm2,%xmm2
  pxor   %xmm1,%xmm1
  cvtss2sd 0xac(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  pxor   %xmm0,%xmm0
  lea    D128(%rip),%rsi
  mov    $0x8,%eax
  cvtss2sd 0xa8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  pxor   %xmm0,%xmm0
  cvtss2sd 0xa0(%rsp),%xmm7
  cvtss2sd 0xa4(%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  movss  0x80(%rsp),%xmm0
  cvtss2sd 0x9c(%rsp),%xmm6
  cvtss2sd 0xbc(%rsp),%xmm5
  cvtss2sd 0xb8(%rsp),%xmm4
  cvtss2sd 0xb4(%rsp),%xmm3
  cvtss2sd 0x88(%rsp),%xmm2
  cvtss2sd 0x84(%rsp),%xmm1
  call   <fprintf@plt>
  add    $0x20,%rsp
  jmp    L22
L32:
  lea    D157(%rip),%rdi
  call   <puts@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L31
  add    $0x118,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D85
type_infered: string
name: read_data
arguments: data_tag: D107
type_infered: string
name: read_data
arguments: data_tag: D191
type_infered: string
name: read_data
arguments: data_tag: D80
type_infered: string
name: read_data
arguments: data_tag: D101
type_infered: string
name: read_data
arguments: data_tag: D195
type_infered: string
name: read_data
arguments: data_tag: D169
type_infered: string
name: read_data
arguments: data_tag: D3
type_infered: string
name: read_data
arguments: data_tag: D72
type_infered: string
name: read_data
arguments: data_tag: D127
type_infered: string
name: read_data
arguments: data_tag: D158
type_infered: string
name: read_data
arguments: data_tag: D20
type_infered: string
name: read_data
arguments: data_tag: D114
type_infered: string
name: read_data
arguments: data_tag: D50
type_infered: string
name: read_data
arguments: data_tag: D32
type_infered: string
name: read_data
arguments: data_tag: D168
type_infered: string
name: read_data
arguments: data_tag: D109
type_infered: string
name: read_data
arguments: data_tag: D71
type_infered: string
name: read_data
arguments: data_tag: D128
type_infered: string
name: read_data
arguments: data_tag: D157
type_infered: string

tool: D85: /dev/ttyUSB0

tool: D107: w

tool: D191: imu_data.csv

tool: D80: imu_errors.txt

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


tool: D195: imu_fd = %d


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


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

tool: D72: Mag Vector: %f %f %f


tool: D127: Accel Vector: %f %f %f


tool: D158: Ang Rate Vector: %f %f %f



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

tool: D114: Roll: %f
Pitch: %f
Yaw: %f



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

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

tool: D168: .%03ld

tool: D109: %s %d


tool: D71: Pitch: %f
Roll: %f
Yaw: %f



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


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

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;
}
```