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

```asm
<spotbounds>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%r14
  mov    %esi,0x24(%rsp)
  mov    %edx,%r15d
  mov    %rcx,0x28(%rsp)
  mov    %r8,%r13
  movsd  %xmm0,0x30(%rsp)
  movsd  %xmm1,0x38(%rsp)
  movq   $0x0,(%rcx)
  movq   $0x0,(%r8)
  test   %esi,%esi
  jle    L212
  mov    %esi,%eax
  shl    $0x3,%rax
  mov    %rax,0x18(%rsp)
  lea    -0x1(%rdx),%eax
  lea    0x8(%rdi,%rax,8),%rbp
  mov    $0x0,%ecx
  pxor   %xmm3,%xmm3
  movsd  %xmm3,(%rsp)
  movapd %xmm3,%xmm1
  movapd %xmm3,%xmm2
  movsd  D57(%rip),%xmm3
  jmp    L85
L329:
  add    $0x8,%rax
  cmp    %rbp,%rax
  je     L184
L116:
  mov    (%rax),%rdx
  movsd  (%rdx,%rcx,1),%xmm0
  comisd %xmm2,%xmm0
  jbe    L329
  addsd  %xmm0,%xmm1
  movsd  (%rsp),%xmm5
  addsd  %xmm3,%xmm5
  movsd  %xmm5,(%rsp)
  jmp    L329
L184:
  add    $0x8,%rcx
  cmp    0x18(%rsp),%rcx
  je     L332
L85:
  mov    %r14,%rax
  test   %r15d,%r15d
  jg     L116
  jmp    L184
L355:
  add    $0x8,%rbx
  cmp    %rbp,%rbx
  je     L304
L345:
  mov    (%rbx),%rax
  movsd  (%rax,%r12,1),%xmm0
  comisd D7(%rip),%xmm0
  jbe    L355
  subsd  0x10(%rsp),%xmm0
  movsd  D77(%rip),%xmm1
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L355
L304:
  add    $0x8,%r12
  cmp    0x18(%rsp),%r12
  je     L96
L208:
  mov    %r14,%rbx
  test   %r15d,%r15d
  jg     L345
  jmp    L304
L96:
  movsd  (%rsp),%xmm1
  subsd  D57(%rip),%xmm1
  movsd  0x8(%rsp),%xmm0
  divsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L156
L206:
  sqrtsd %xmm0,%xmm0
L186:
  mulsd  0x30(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm2
  subsd  %xmm0,%xmm2
  movsd  %xmm2,0x0(%r13)
  mov    0x24(%rsp),%eax
  test   %eax,%eax
  jle    L204
  mov    %eax,%eax
  shl    $0x3,%rax
  mov    %rax,0x10(%rsp)
  lea    -0x1(%r15),%eax
  lea    0x8(%r14,%rax,8),%rbp
  mov    $0x0,%ecx
  pxor   %xmm3,%xmm3
  movsd  %xmm3,(%rsp)
  movapd %xmm3,%xmm1
  movsd  D57(%rip),%xmm4
  jmp    L375
L156:
  call   <sqrt@plt>
  jmp    L186
L92:
  add    $0x8,%rax
  cmp    %rbp,%rax
  je     L216
L234:
  mov    (%rax),%rdx
  movsd  (%rdx,%rcx,1),%xmm0
  comisd %xmm1,%xmm0
  jbe    L92
  comisd %xmm0,%xmm2
  jb     L92
  addsd  %xmm0,%xmm3
  movsd  (%rsp),%xmm6
  addsd  %xmm4,%xmm6
  movsd  %xmm6,(%rsp)
  jmp    L92
L216:
  add    $0x8,%rcx
  cmp    %rcx,0x10(%rsp)
  je     L57
L375:
  mov    %r14,%rax
  test   %r15d,%r15d
  jg     L234
  jmp    L216
L35:
  add    $0x8,%rbx
  cmp    %rbp,%rbx
  je     L292
L133:
  mov    (%rbx),%rax
  movsd  (%rax,%r12,1),%xmm0
  comisd D7(%rip),%xmm0
  jbe    L35
  movsd  0x0(%r13),%xmm1
  comisd %xmm0,%xmm1
  jb     L35
  subsd  0x18(%rsp),%xmm0
  movsd  D77(%rip),%xmm1
  call   <pow@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L35
L292:
  add    $0x8,%r12
  cmp    0x10(%rsp),%r12
  je     L136
L170:
  mov    %r14,%rbx
  test   %r15d,%r15d
  jg     L133
  jmp    L292
L136:
  movsd  (%rsp),%xmm1
  subsd  D57(%rip),%xmm1
  movsd  0x8(%rsp),%xmm0
  divsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L195
L175:
  sqrtsd %xmm0,%xmm0
L158:
  mulsd  0x38(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  mov    0x28(%rsp),%rax
  movsd  %xmm1,(%rax)
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L195:
  call   <sqrt@plt>
  jmp    L158
L57:
  divsd  (%rsp),%xmm3
  movsd  %xmm3,0x18(%rsp)
  mov    $0x0,%r12d
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x8(%rsp)
  jmp    L170
L204:
  pxor   %xmm0,%xmm0
  divsd  %xmm0,%xmm0
  movsd  %xmm0,0x18(%rsp)
  movsd  D46(%rip),%xmm0
  jmp    L175
L212:
  pxor   %xmm0,%xmm0
  divsd  %xmm0,%xmm0
  movsd  %xmm0,0x10(%rsp)
  movsd  D46(%rip),%xmm0
  jmp    L206
L332:
  divsd  (%rsp),%xmm1
  movsd  %xmm1,0x10(%rsp)
  mov    $0x0,%r12d
  pxor   %xmm3,%xmm3
  movsd  %xmm3,0x8(%rsp)
  jmp    L208
```

tool_calls: name: parse_data
arguments: data_tag: D57
type_guessed: f64
name: parse_data
arguments: data_tag: D7
type_guessed: f64[2]
name: parse_data
arguments: data_tag: D77
type_guessed: f64
name: parse_data
arguments: data_tag: D46
type_guessed: byte[8]

tool: D57: 1

tool: {"D7": [0.0,-0.0]}

tool: D77: 2

tool: {"D46": [0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80]}

assistant: ```c
void spotbounds(double **cdat, int naxis1, int naxis2, double *umb, double *pen, double umb_sig, double pen_sig) {
  double mean, stdev;
  double smean, sstdev;
  int i, j;
  double counter;
  counter = 0.0;
  mean = smean = 0.0;
  stdev = sstdev = 0.0;
  *umb = 0.0;
  *pen = 0.0;
  for (i = 0; i < naxis1; i++) {
    for (j = 0; j < naxis2; j++) {
      if (cdat[j][i] > 0) {
        mean += cdat[j][i];
        counter++;
      }
    }
  }
  mean /= counter;
  for (i = 0; i < naxis1; i++) {
    for (j = 0; j < naxis2; j++) {
      if (cdat[j][i] > 0) {
        stdev += pow(cdat[j][i] - mean, 2.0);
      }
    }
  }
  stdev = sqrt(stdev / (counter - 1.0));
  *pen = mean - umb_sig * stdev;
  counter = 0.0;
  for (i = 0; i < naxis1; i++) {
    for (j = 0; j < naxis2; j++) {
      if ((cdat[j][i] > 0) && (cdat[j][i] <= *pen)) {
        smean += cdat[j][i];
        counter++;
      }
    }
  }
  smean /= counter;
  for (i = 0; i < naxis1; i++) {
    for (j = 0; j < naxis2; j++) {
      if ((cdat[j][i] > 0) && (cdat[j][i] <= *pen)) {
        sstdev += pow(cdat[j][i] - smean, 2.0);
      }
    }
  }
  sstdev = sqrt(sstdev / (counter - 1.0));
  *umb = smean - pen_sig * sstdev;
  return;
}
```