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

```asm
<update_parameters>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %edi,0x14(%rsp)
  mov    %rsi,%r12
  mov    %rdx,0x28(%rsp)
  mov    %rcx,0x20(%rsp)
  mov    %r8,%r15
  mov    %r9,%r13
  mov    0x78(%rsp),%r14
  mov    0x80(%rsp),%rsi
  mov    0x88(%rsp),%rdx
  mov    0x90(%rsp),%rax
  movapd %xmm0,%xmm1
  mov    0xd8(%rsp),%rbp
  mov    0xe8(%rsp),%rbx
  mov    0x98(%rsp),%ecx
  sub    0xa0(%rsp),%ecx
  add    $0x1,%ecx
  mov    %ecx,(%r9)
  mov    0xa8(%rsp),%ecx
  sub    0xb0(%rsp),%ecx
  add    $0x1,%ecx
  mov    0x70(%rsp),%r10
  mov    %ecx,(%r10)
  mov    0xb8(%rsp),%ecx
  sub    0xc0(%rsp),%ecx
  add    $0x1,%ecx
  mov    %ecx,(%r14)
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0xa0(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  (%rsi),%xmm0
  movsd  %xmm0,(%rsi)
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0xb0(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rdx)
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0xc0(%rsp),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  cmp    $0x2,%edi
  je     L31
  cmp    $0x3,%edi
  je     L93
  cmp    $0x1,%edi
  je     L81
L83:
  mov    (%r15),%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  mov    0xc8(%rsp),%rdx
  mov    %eax,(%rdx)
  mov    0x70(%rsp),%rax
  mov    (%rax),%esi
  imul   (%r14),%esi
  imul   0x0(%r13),%esi
  mov    %rsi,(%rbx)
  mov    0xe0(%rsp),%rdi
  call   <calc_min@plt>
  movsd  %xmm0,(%rsp)
  mov    (%rbx),%rsi
  mov    0xe0(%rsp),%rdi
  call   <calc_max@plt>
  addsd  (%rsp),%xmm0
  mulsd  D24(%rip),%xmm0
  mov    0xd0(%rsp),%rax
  movsd  %xmm0,(%rax)
  mov    0x28(%rsp),%rax
  pxor   %xmm0,%xmm0
  cvtsi2sdl (%rax),%xmm0
  divsd  D0(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  call   <ceil@plt>
  mov    %eax,%ebx
  mov    %eax,0x0(%rbp)
  mov    0x20(%rsp),%rax
  pxor   %xmm0,%xmm0
  cvtsi2sdl (%rax),%xmm0
  divsd  D0(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  call   <ceil@plt>
  cmp    %eax,%ebx
  jl     L166
L62:
  cmpl   $0x0,0x0(%rbp)
  jle    L72
L27:
  mov    (%r12),%rdi
  call   <free@plt>
  mov    0x28(%rsp),%rbx
  mov    (%rbx),%esi
  mov    0x20(%rsp),%rax
  imul   (%rax),%esi
  movslq %esi,%rsi
  mov    %r12,%rdi
  call   <do_vect@plt>
  movl   $0x0,(%rsp)
  cmpl   $0x0,(%rbx)
  jg     L63
L122:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L81:
  mov    (%r9),%eax
  mov    0x28(%rsp),%rsi
  mov    %eax,(%rsi)
  mov    (%r10),%eax
  mov    0x20(%rsp),%rsi
  mov    %eax,(%rsi)
  mov    (%r14),%eax
  mov    %eax,(%r8)
  jmp    L83
L31:
  mov    (%r14),%eax
  mov    0x28(%rsp),%rsi
  mov    %eax,(%rsi)
  mov    (%r9),%eax
  mov    0x20(%rsp),%rsi
  mov    %eax,(%rsi)
  mov    0x70(%rsp),%rax
  mov    (%rax),%eax
  mov    %eax,(%r8)
  jmp    L83
L93:
  mov    0x70(%rsp),%rax
  mov    (%rax),%eax
  mov    0x28(%rsp),%rsi
  mov    %eax,(%rsi)
  mov    (%r14),%eax
  mov    0x20(%rsp),%rsi
  mov    %eax,(%rsi)
  mov    (%r9),%eax
  mov    %eax,(%r8)
  jmp    L83
L166:
  mov    0x20(%rsp),%rax
  pxor   %xmm0,%xmm0
  cvtsi2sdl (%rax),%xmm0
  divsd  D0(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  call   <ceil@plt>
  mov    %eax,0x0(%rbp)
  jmp    L62
L72:
  movl   $0x1,0x0(%rbp)
  jmp    L27
L16:
  mov    0x28(%rsp),%rsi
  mov    %ebp,%eax
  imul   (%rsi),%eax
  add    (%rsp),%eax
  movslq %eax,%rdi
  mov    %rdi,0x18(%rsp)
  mov    (%r15),%eax
  test   %eax,%eax
  jle    L54
  lea    0x0(,%rdi,8),%rax
  mov    %rax,0x8(%rsp)
  mov    $0x0,%ebx
L117:
  sub    $0x8,%rsp
  mov    (%r14),%eax
  push   %rax
  mov    0x80(%rsp),%rax
  mov    (%rax),%r9d
  mov    0x0(%r13),%r8d
  mov    %ebx,%ecx
  mov    %ebp,%edx
  mov    0x10(%rsp),%esi
  mov    0x24(%rsp),%edi
  call   <pindex@plt>
  mov    %rax,%rdx
  mov    0x18(%rsp),%rax
  add    (%r12),%rax
  movsd  (%rax),%xmm0
  mov    0xf0(%rsp),%rcx
  addsd  (%rcx,%rdx,8),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x1,%ebx
  mov    (%r15),%eax
  add    $0x10,%rsp
  cmp    %ebx,%eax
  jg     L117
L54:
  mov    (%r12),%rdx
  mov    0x18(%rsp),%rsi
  lea    (%rdx,%rsi,8),%rdx
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  (%rdx),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x1,%ebp
  mov    0x20(%rsp),%rax
  cmp    %ebp,(%rax)
  jg     L16
L48:
  addl   $0x1,(%rsp)
  mov    (%rsp),%eax
  mov    0x28(%rsp),%rsi
  cmp    %eax,(%rsi)
  jle    L122
L63:
  mov    $0x0,%ebp
  mov    0x20(%rsp),%rax
  cmpl   $0x0,(%rax)
  jg     L16
  jmp    L48
```

tool_calls: name: parse_data
arguments: tag: D24
type_guessed: f64
name: parse_data
arguments: tag: D0
type_guessed: f64

tool: D24: 0.5

tool: D0: 100

assistant: ```c
void update_parameters(int slicemode, double **ppro, int *rangea, int *rangeb, int *rangec, unsigned *extx, unsigned *exty, unsigned *extz, double *origx, double *origy, double *origz, int maxx, int minx, int maxy, int miny, int maxz, int minz, double width, int *k, double *cutoff, int *stride, double *pphi, unsigned long *nvox) {
  double maxdensity, mindensity;
  int i, j, l;
  unsigned long ind1, ind2;
  *extx = maxx - minx + 1;
  *exty = maxy - miny + 1;
  *extz = maxz - minz + 1;
  *origx += minx * width;
  *origy += miny * width;
  *origz += minz * width;
  switch (slicemode) {
  case 1:
    *rangea = *extx;
    *rangeb = *exty;
    *rangec = *extz;
    break;
  case 2:
    *rangea = *extz;
    *rangeb = *extx;
    *rangec = *exty;
    break;
  case 3:
    *rangea = *exty;
    *rangeb = *extz;
    *rangec = *extx;
    break;
  }
  *k = (*rangec) / 2;
  *nvox = (*extx) * (*exty) * (*extz);
  mindensity = calc_min(pphi, *nvox);
  maxdensity = calc_max(pphi, *nvox);
  *cutoff = 0.5 * (maxdensity + mindensity);
  *stride = ceil(*rangea / 100.0);
  if (*stride < ceil(*rangeb / 100.0))
    *stride = ceil(*rangeb / 100.0);
  if (*stride < 1)
    *stride = 1;
  free(*ppro);
  do_vect(ppro, (unsigned long)(*rangea * *rangeb));
  for (i = 0; i < *rangea; i++)
    for (j = 0; j < *rangeb; j++) {
      ind2 = i + j * *rangea;
      for (l = 0; l < *rangec; l++) {
        ind1 = pindex(slicemode, i, j, l, *extx, *exty, *extz);
        *(*ppro + ind2) += *(pphi + ind1);
      }
      *(*ppro + ind2) /= ((double)*rangec);
    }
}
```