user: What is the c source code of the assembly code below?

```asm
<doalarm>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x44(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  fldz
  fstpt  -0x20(%rbp)
  fldz
  fstpt  -0x10(%rbp)
  movl   $0x0,-0x38(%rbp)
  jmp    L148
L53:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L123
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L123
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L123
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  fldl   -0x60(%rbp)
  fldt   -0x20(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x20(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  D0(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  fldl   -0x60(%rbp)
  fldt   -0x10(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x10(%rbp)
L123:
  addl   $0x1,-0x38(%rbp)
L148:
  mov    -0x38(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L53
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  cmpl   $0x0,-0x44(%rbp)
  jle    L63
  fldt   -0x20(%rbp)
  fldt   -0x10(%rbp)
  fdivrp %st,%st(1)
  fstpl  -0x28(%rbp)
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm0
  subsd  -0x28(%rbp),%xmm0
  mov    -0x50(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x58(%rbp),%rax
  movsd  (%rax),%xmm2
  mov    -0x58(%rbp),%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  fldl   -0x60(%rbp)
  fstpt  -0x20(%rbp)
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x58(%rbp),%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  fldl   -0x60(%rbp)
  fstpt  -0x10(%rbp)
  movl   $0x1,-0x34(%rbp)
  mov    -0x50(%rbp),%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jb     L46
  mov    $0x1,%eax
  jmp    L139
L46:
  mov    $0xffffffff,%eax
L139:
  mov    %eax,-0x3c(%rbp)
  movl   $0x1,-0x38(%rbp)
  jmp    L16
L70:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  ucomisd %xmm0,%xmm0
  jp     L138
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  subsd  -0x28(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jb     L155
  mov    $0x1,%eax
  jmp    L142
L155:
  mov    $0xffffffff,%eax
L142:
  cmp    -0x3c(%rbp),%eax
  je     L8
  fldl   -0x30(%rbp)
  fldt   -0x10(%rbp)
  fmul   %st(0),%st
  faddp  %st,%st(1)
  fstpl  -0x30(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  fldl   -0x60(%rbp)
  fstpt  -0x10(%rbp)
  movl   $0x1,-0x34(%rbp)
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jb     L130
  mov    $0x1,%eax
  jmp    L141
L130:
  mov    $0xffffffff,%eax
L141:
  mov    %eax,-0x3c(%rbp)
  jmp    L60
L8:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  fldl   -0x60(%rbp)
  fldt   -0x10(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x10(%rbp)
  addl   $0x1,-0x34(%rbp)
L60:
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x38(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x58(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  fldl   -0x60(%rbp)
  fldt   -0x20(%rbp)
  faddp  %st,%st(1)
  fstpt  -0x20(%rbp)
L138:
  addl   $0x1,-0x38(%rbp)
L16:
  mov    -0x38(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jl     L70
  fldl   -0x30(%rbp)
  fldt   -0x10(%rbp)
  fmul   %st(0),%st
  faddp  %st,%st(1)
  fstpl  -0x30(%rbp)
  fldl   -0x30(%rbp)
  fldt   -0x20(%rbp)
  fdivrp %st,%st(1)
  fldt   0xb04(%rip)        # 2010 <_fini+0xaec>
  fsubrp %st,%st(1)
  fstpl  -0x30(%rbp)
L63:
  movsd  -0x30(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: label: D0
data_type: f64

tool: D0: 1

assistant: ```c
double doalarm(int N, double *resid, double *err) {
  double a, ave;
  long double sum1, sum2;
  int sign, i, n;
  sum1 = 0.;
  sum2 = 0.;
  for (i = 0; i < N; i++) {
    if (!isnan(resid[i]) && !isnan(err[i]) && err[i] > 0.) {
      sum1 += (long double)(resid[i] / (err[i] * err[i]));
      sum2 += (long double)(1. / (err[i] * err[i]));
    }
  }
  a = 0.;
  if (N > 0) {
    ave = sum1 / sum2;
    resid[0] -= ave;
    sum1 = resid[0] * resid[0] / (err[0] * err[0]);
    sum2 = resid[0] / err[0];
    n = 1;
    sign = ((resid[0]) >= 0 ? (1) : (-1));
    for (i = 1; i < N; i++) {
      if (!isnan(resid[i])) {
        resid[i] -= ave;
        if (((resid[i]) >= 0 ? (1) : (-1)) != sign) {
          a += (sum2 * sum2);
          sum2 = resid[i] / err[i];
          n = 1;
          sign = ((resid[i]) >= 0 ? (1) : (-1));
        } else {
          sum2 += resid[i] / err[i];
          n++;
        }
        sum1 += resid[i] * resid[i] / (err[i] * err[i]);
      }
    }
    a += (sum2 * sum2);
    a = (a / sum1) - 2.2732395;
  }
  return (a);
}
```