user: What would the C source look like for the assembly code provided here:

```asm
<getfrac_onenight>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xb0,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %rcx,-0x80(%rbp)
  mov    %r8,-0x88(%rbp)
  movsd  %xmm0,-0x90(%rbp)
  movsd  %xmm1,-0x98(%rbp)
  movsd  %xmm2,-0xa0(%rbp)
  movsd  %xmm3,-0xa8(%rbp)
  movsd  %xmm4,-0xb0(%rbp)
  movsd  D28(%rip),%xmm0
  divsd  -0x90(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0xb0(%rbp),%xmm0
  movsd  D29(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  D3(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0xb0(%rbp)
  mov    -0x70(%rbp),%rax
  movsd  (%rax),%xmm0
  addsd  -0xb0(%rbp),%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x30(%rbp)
  mov    -0x64(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  -0xb0(%rbp),%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  add    $0x1,%eax
  mov    %eax,-0x4c(%rbp)
  cmpl   $0x1,-0x4c(%rbp)
  jg     L73
  movl   $0x2,-0x4c(%rbp)
L73:
  mov    -0x4c(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movl   $0x0,-0x54(%rbp)
  jmp    L19
L4:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x54(%rbp)
L19:
  mov    -0x54(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L4
  movl   $0x0,-0x54(%rbp)
  jmp    L97
L32:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  subsd  -0xa8(%rbp),%xmm0
  movsd  -0x38(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movq   %rax,%xmm0
  call   <floor@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %rax,%xmm1
  movsd  -0x10(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0xa0(%rbp),%xmm0
  comisd -0x10(%rbp),%xmm0
  jb     L18
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  addsd  -0xb0(%rbp),%xmm0
  cvttsd2si %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %eax,%edx
  mov    -0x30(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x50(%rbp)
  cmpl   $0x0,-0x50(%rbp)
  jns    L35
  movl   $0x0,-0x50(%rbp)
L35:
  mov    -0x50(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L79
  mov    -0x4c(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0x50(%rbp)
L79:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm2
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x40(%rbp),%xmm0
  addsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
L18:
  addl   $0x1,-0x54(%rbp)
L97:
  mov    -0x54(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L32
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L48
L41:
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  divsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x18(%rbp),%xmm0
  comisd -0x48(%rbp),%xmm0
  jbe    L15
  movsd  -0x18(%rbp),%xmm0
  movsd  %xmm0,-0x48(%rbp)
L15:
  addl   $0x1,-0x50(%rbp)
L48:
  mov    -0x50(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jl     L41
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movsd  -0x48(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: read_data
arguments: tag: D28
type_infered: f64
name: read_data
arguments: tag: D29
type_infered: f64
name: read_data
arguments: tag: D3
type_infered: f64

tool: D28: 1

tool: D29: 24

tool: D3: 0.5

assistant: ```c
double getfrac_onenight(int n, double *t, double *u, double *v, double *err, double bper, double depth, double qtran, double bt0, double timezone) {
  int i, j, k, nnights;
  long night, night0, night1;
  double ph, f0, maxfrac;
  double *chisqrnights, chisqrtot, val;
  f0 = 1. / bper;
  timezone = timezone / 24.0 + 0.5;
  night0 = (long)(t[0] + timezone);
  night1 = (long)(t[n - 1] + timezone);
  nnights = (int)((night1 - night0) + 1);
  if (nnights < 2)
    nnights = 2;
  chisqrnights = (double *)malloc(nnights * sizeof(double));
  chisqrtot = 0.;
  for (i = 0; i < nnights; i++)
    chisqrnights[i] = 0.;
  for (i = 0; i < n; i++) {
    ph = (t[i] - bt0) * f0;
    ph -= floor(ph);
    if (ph <= qtran) {
      night = (long)(t[i] + timezone);
      k = (int)(night - night0);
      if (k < 0)
        k = 0;
      if (k >= nnights)
        k = nnights - 1;
      val = v[i] * v[i] / (err[i] * err[i]);
      chisqrnights[k] += val;
      chisqrtot += val;
    }
  }
  maxfrac = 0.;
  for (k = 0; k < nnights; k++) {
    val = chisqrnights[k] / chisqrtot;
    if (val > maxfrac)
      maxfrac = val;
  }
  free(chisqrnights);
  return (maxfrac);
}
```