user: Translate the below assembly code into C programming language:

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  lea    -0x8000(%rsp),%r11
L132:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L132
  sub    $0x2e8,%rsp
  lea    D101(%rip),%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x82d8(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  jle    L247
  mov    0x8(%rsi),%rdi
  mov    %rbp,%rdx
  lea    D152(%rip),%rsi
  call   <sscanf@plt>
L247:
  lea    D227(%rip),%rsi
  mov    %rbp,%rdi
  call   <fopen@plt>
  mov    %rax,%r14
  test   %rax,%rax
  je     L156
  lea    D128(%rip),%rdi
  lea    0x1d0(%rsp),%rsi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x2d0(%rsp),%rbx
  movl   $0x0,0x14(%rsp)
  lea    D253(%rip),%rbp
  lea    D196(%rip),%r13
  jmp    L154
  nopl   0x0(%rax)
L265:
  movzbl 0x2d0(%rsp),%eax
  and    $0xffffffdf,%eax
  cmp    $0xa,%al
  jne    L287
L154:
  mov    %r14,%rdx
  mov    $0x8000,%esi
  mov    %rbx,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L265
  mov    %r14,%rdi
  xor    %r12d,%r12d
  lea    D295(%rip),%r13
  call   <fclose@plt>
  mov    0x14(%rsp),%eax
  movsd  D155(%rip),%xmm6
  lea    D252(%rip),%rbp
  movsd  D175(%rip),%xmm5
  lea    D196(%rip),%rbx
  pxor   %xmm4,%xmm4
  lea    -0x1(%rax),%r15d
  lea    0x70(%rsp),%rax
  mov    %rax,0x18(%rsp)
  lea    0x120(%rsp),%rax
  lea    0x8(,%r15,8),%r14
  mov    %rax,0x20(%rsp)
  nopl   0x0(%rax,%rax,1)
L102:
  mov    0x14(%rsp),%eax
  test   %eax,%eax
  je     L185
  xor    %esi,%esi
  mov    %rbp,%rdi
  mov    %r14,%rdx
  movsd  %xmm6,0x8(%rsp)
  call   <memset@plt>
  mov    D175(%rip),%rcx
  xor    %eax,%eax
  xor    %edi,%edi
  pxor   %xmm4,%xmm4
  movsd  D217(%rip),%xmm3
  movsd  0x8(%rsp),%xmm6
  lea    D157(%rip),%rsi
  movq   D63(%rip),%xmm7
  movapd %xmm4,%xmm1
  movapd %xmm4,%xmm2
  movq   %rcx,%xmm5
  jmp    L213
  nopw   0x0(%rax,%rax,1)
L4:
  mov    %rdx,%rax
L213:
  movsd  (%rsi,%rax,8),%xmm0
  subsd  %xmm6,%xmm0
  andpd  %xmm7,%xmm0
  comisd %xmm0,%xmm3
  jbe    L89
  addsd  (%rbx,%rax,8),%xmm1
  addsd  %xmm5,%xmm2
  movsd  %xmm5,0x0(%rbp,%rax,8)
  mov    $0x1,%edi
L89:
  lea    0x1(%rax),%rdx
  cmp    %rax,%r15
  jne    L4
  test   %dil,%dil
  jne    L258
  movapd %xmm4,%xmm1
L258:
  divsd  %xmm2,%xmm1
  movapd %xmm4,%xmm0
  movapd %xmm4,%xmm3
  xor    %eax,%eax
  movsd  %xmm1,0x60(%rsp)
  jmp    L14
  nopw   0x0(%rax,%rax,1)
L183:
  mov    %rdx,%rax
L14:
  ucomisd 0x0(%rbp,%rax,8),%xmm4
  jp     L277
  je     L285
L277:
  movsd  (%rbx,%rax,8),%xmm2
  addsd  %xmm5,%xmm3
  subsd  %xmm1,%xmm2
  mulsd  %xmm2,%xmm2
  addsd  %xmm2,%xmm0
L285:
  lea    0x1(%rax),%rdx
  cmp    %rax,%r15
  jne    L183
  divsd  %xmm3,%xmm0
L11:
  ucomisd %xmm0,%xmm4
  ja     L209
  sqrtsd %xmm0,%xmm0
L100:
  movsd  D286(%rip),%xmm2
  mulsd  %xmm0,%xmm2
  movapd %xmm3,%xmm0
  subsd  %xmm5,%xmm0
  ucomisd %xmm0,%xmm4
  ja     L16
  sqrtsd %xmm0,%xmm0
  divsd  %xmm0,%xmm2
  movsd  %xmm2,0x68(%rsp)
L289:
  movapd %xmm6,%xmm0
  mov    %r13,%rdi
  mov    $0x4,%eax
  add    $0x8,%r12
  movsd  %xmm6,0x8(%rsp)
  call   <printf@plt>
  movsd  0x60(%rsp),%xmm0
  mov    0x18(%rsp),%rax
  pxor   %xmm4,%xmm4
  movsd  0x8(%rsp),%xmm6
  addsd  D122(%rip),%xmm6
  movsd  %xmm0,-0x8(%r12,%rax,1)
  mov    0x20(%rsp),%rax
  movsd  0x68(%rsp),%xmm0
  movsd  %xmm0,-0x8(%r12,%rax,1)
  mov    D175(%rip),%rax
  cmp    $0xa8,%r12
  movq   %rax,%xmm5
  jne    L102
  lea    D246(%rip),%r14
  lea    D193(%rip),%rdi
  mov    %r14,%rsi
  lea    0x118(%rsp),%r15
  lea    D127(%rip),%r12
  call   <fopen@plt>
  mov    0x18(%rsp),%rbp
  mov    %rax,%r13
  nopl   0x0(%rax,%rax,1)
L5:
  movsd  0x0(%rbp),%xmm0
  mov    %r12,%rsi
  mov    %r13,%rdi
  add    $0x8,%rbp
  call   <fprintf@plt>
  cmp    %r15,%rbp
  jne    L5
  mov    %r13,%rdi
  lea    0x1c8(%rsp),%r13
  call   <fclose@plt>
  mov    %r14,%rsi
  lea    D66(%rip),%rdi
  call   <fopen@plt>
  mov    0x20(%rsp),%rbx
  mov    %rax,%rbp
L173:
  movsd  (%rbx),%xmm0
  mov    %r12,%rsi
  mov    %rbp,%rdi
  add    $0x8,%rbx
  call   <fprintf@plt>
  cmp    %rbx,%r13
  jne    L173
  mov    %rbp,%rdi
  call   <fclose@plt>
L196:
  mov    0x82d8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L84
  add    $0x82e8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L185:
  movapd %xmm4,%xmm1
  movapd %xmm4,%xmm3
  divsd  %xmm4,%xmm1
  movsd  %xmm1,0x60(%rsp)
  movapd %xmm1,%xmm0
  jmp    L11
L287:
  lea    0x4c(%rsp),%rcx
  lea    0x50(%rsp),%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  movq   $0x0,0x68(%rsp)
  sub    $0x8,%rsp
  lea    0x64(%rsp),%rax
  push   %rax
  lea    0x68(%rsp),%rax
  push   %rax
  lea    0x5c(%rsp),%rax
  push   %rax
  lea    0x80(%rsp),%rax
  push   %rax
  lea    0x70(%rsp),%rax
  push   %rax
  xor    %eax,%eax
  lea    0x98(%rsp),%r9
  lea    0x84(%rsp),%r8
  call   <sscanf@plt>
  add    $0x30,%rsp
  pxor   %xmm4,%xmm4
  ucomisd 0x68(%rsp),%xmm4
  jp     L77
  je     L154
L77:
  movsd  0x60(%rsp),%xmm0
  movsd  D137(%rip),%xmm7
  movapd %xmm0,%xmm1
  andpd  D63(%rip),%xmm1
  comisd %xmm1,%xmm7
  jbe    L154
  pxor   %xmm1,%xmm1
  movslq 0x14(%rsp),%rax
  lea    D157(%rip),%rsi
  cvtsi2sdl 0x4c(%rsp),%xmm1
  movsd  %xmm0,0x0(%r13,%rax,8)
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x50(%rsp),%xmm0
  divsd  D56(%rip),%xmm0
  addsd  %xmm1,%xmm0
  subsd  D261(%rip),%xmm0
  movsd  D150(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L204
  subsd  %xmm1,%xmm0
L204:
  addl   $0x1,0x14(%rsp)
  movsd  %xmm0,(%rsi,%rax,8)
  jmp    L154
L156:
  mov    %rbp,%rsi
  lea    D218(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L196
L209:
  movsd  %xmm6,0x30(%rsp)
  movsd  %xmm3,0x28(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <sqrt@plt>
  mov    D175(%rip),%rax
  pxor   %xmm4,%xmm4
  movsd  0x30(%rsp),%xmm6
  movsd  0x28(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm1
  movq   %rax,%xmm5
  jmp    L100
L16:
  movsd  %xmm6,0x38(%rsp)
  movsd  %xmm3,0x30(%rsp)
  movsd  %xmm2,0x28(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x28(%rsp),%xmm2
  movsd  0x30(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm1
  movsd  0x38(%rsp),%xmm6
  divsd  %xmm0,%xmm2
  movsd  %xmm2,0x68(%rsp)
  jmp    L289
L84:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D101
data_type: string
name: unpack_data
arguments: data_label: D152
data_type: string
name: unpack_data
arguments: data_label: D227
data_type: string
name: unpack_data
arguments: data_label: D128
data_type: string
name: unpack_data
arguments: data_label: D253
data_type: string
name: unpack_data
arguments: data_label: D295
data_type: string
name: unpack_data
arguments: data_label: D155
data_type: byte[8]
name: unpack_data
arguments: data_label: D175
data_type: byte[8]
name: unpack_data
arguments: data_label: D217
data_type: byte[8]
name: unpack_data
arguments: data_label: D63
data_type: qword[2]
name: unpack_data
arguments: data_label: D286
data_type: f64
name: unpack_data
arguments: data_label: D122
data_type: f64
name: unpack_data
arguments: data_label: D246
data_type: string
name: unpack_data
arguments: data_label: D193
data_type: string
name: unpack_data
arguments: data_label: D127
data_type: string
name: unpack_data
arguments: data_label: D66
data_type: string
name: unpack_data
arguments: data_label: D137
data_type: byte[8]
name: unpack_data
arguments: data_label: D56
data_type: f64
name: unpack_data
arguments: data_label: D261
data_type: f64
name: unpack_data
arguments: data_label: D150
data_type: byte[8]
name: unpack_data
arguments: data_label: D218
data_type: string

tool: D101: data.txt

tool: D152: %s

tool: D227: r

tool: D128: file %s


tool: D253: %d %d %d %lf %d %lf %d %d %d

tool: D295: hr %4.1f vvel %5.2f err %5.2f num %4.0f


tool: {"D155": [0x00,0x00,0x00,0x00,0x00,0x00,0x14,0xc0]}

tool: {"D175": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D217": [0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x3f]}

tool: {"D63": [0x7fffffffffffffff,0x0000000000000000]}

tool: D286: 3

tool: D122: 0.5

tool: D246: wb

tool: D193: out_half.txt

tool: D127: %5.2f


tool: D66: out_err_half.txt

tool: {"D137": [0x00,0x00,0x00,0x00,0x00,0x00,0x69,0x40]}

tool: D56: 60

tool: D261: 4

tool: {"D150": [0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x40]}

tool: D218: cannot open file:%s


assistant: ```c
int main(int argc, char *argv[]) {
  char buf[32768];
  char fname[256];
  int line, j, np, yr, dy, hr, mn, sc, mon, qual;
  double vvel, velerr, sum1, sum2, h, dt;
  double plotvel[21], ploterr[21];
  static double tim[100000], vel[100000], verr[100000], wt[100000];
  FILE *file1;
  if (argc > 1)
    sscanf(argv[1], "%s", "data.txt");
  if ((file1 = fopen("data.txt", "r")) == NULL) {
    printf("cannot open file:%s\n", "data.txt");
    return 0;
  }
  line = j = np = 0;
  printf("file %s\n", fname);
  while (fgets(buf, 32768, file1) != 0) {
    if (buf[0] != '*' && buf[0] != '\n') {
      velerr = 0;
      sscanf(buf, "%d %d %d %lf %d %lf %d %d %d", &mn, &hr, &sc, &velerr, &dy, &vvel, &yr, &mon, &qual);
      if (velerr && fabs(vvel) < 200) {
        vel[j] = vvel;
        verr[j] = velerr;
        tim[j] = hr + mn / 60.0 - 4.0;
        if (tim[j] > 12)
          tim[j] += -12;
        j++;
      }
      line++;
    }
  }
  np = j;
  fclose(file1);
  dt = 0.5;
  int i = 0;
  for (h = -5; h <= 5; h += dt) {
    vvel = sum1 = 0;
    for (j = 0; j < np; j++) {
      wt[j] = 0;
      if (fabs(tim[j] - h) < dt / 2.0) {
        vvel += vel[j];
        wt[j] = 1;
        sum1++;
      }
    }
    vvel = vvel / sum1;
    sum1 = sum2 = 0;
    for (j = 0; j < np; j++) {
      if (wt[j]) {
        sum2 += (vel[j] - vvel) * (vel[j] - vvel);
        sum1++;
      }
    }
    velerr = 3.0 * sqrt(sum2 / sum1) / sqrt(sum1 - 1);
    printf("hr %4.1f vvel %5.2f err %5.2f num %4.0f\n", h, vvel, velerr, sum1);
    plotvel[i] = vvel;
    ploterr[i] = velerr;
    i++;
  }
  FILE *f = fopen("out_half.txt", "wb");
  for (int k = 0; k < sizeof(plotvel) / sizeof(plotvel[0]); k++) {
    fprintf(f, "%5.2f\n", plotvel[k]);
  }
  fclose(f);
  FILE *f2 = fopen("out_err_half.txt", "wb");
  for (int k = 0; k < sizeof(ploterr) / sizeof(ploterr[0]); k++) {
    fprintf(f2, "%5.2f\n", ploterr[k]);
  }
  fclose(f2);
  return 0;
}
```