user: 请将以下的汇编代码转换成C语言代码:

```asm
<invgamma>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xa0,%rsp
  mov    %edi,-0x74(%rbp)
  movsd  %xmm0,-0x80(%rbp)
  movsd  %xmm1,-0x88(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %rdx,-0x98(%rbp)
  movl   $0x2710,-0x64(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  mov    -0x64(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x64(%rbp),%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  movsd  -0x88(%rbp),%xmm1
  movsd  D51(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x80(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x88(%rbp),%xmm1
  movsd  D28(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x80(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x80(%rbp),%xmm1
  movsd  D10(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  comisd -0x50(%rbp),%xmm0
  jbe    L38
  movsd  -0x80(%rbp),%xmm1
  movsd  D10(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
L38:
  movsd  -0x18(%rbp),%xmm0
  subsd  -0x50(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x64(%rbp),%xmm1
  movsd  D21(%rip),%xmm2
  subsd  %xmm2,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x80(%rbp),%xmm0
  subsd  -0x50(%rbp),%xmm0
  divsd  -0x10(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,-0x6c(%rbp)
  mov    -0x6c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x68(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x6c(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movsd  -0x50(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x68(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movsd  -0x50(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x74(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <pow@plt>
  movsd  %xmm0,-0xa0(%rbp)
  mov    -0x74(%rbp),%eax
  neg    %eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x80(%rbp),%xmm1
  movsd  -0x48(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  mulsd  -0x48(%rbp),%xmm0
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %eax,%edi
  call   <exp@plt>
  mulsd  -0xa0(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x74(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <pow@plt>
  movsd  %xmm0,-0xa0(%rbp)
  mov    -0x74(%rbp),%eax
  neg    %eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x80(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  mulsd  -0x40(%rbp),%xmm0
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %eax,%edi
  call   <exp@plt>
  mulsd  -0xa0(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x70(%rbp)
  jmp    L42
L137:
  cmpl   $0x0,-0x6c(%rbp)
  js     L141
  mov    -0x68(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jge    L141
  movsd  -0x38(%rbp),%xmm0
  comisd -0x30(%rbp),%xmm0
  jbe    L208
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x38(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x48(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  subl   $0x1,-0x6c(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x6c(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movsd  -0x50(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  mov    -0x74(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x48(%rbp),%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <pow@plt>
  movsd  %xmm0,-0xa0(%rbp)
  mov    -0x74(%rbp),%eax
  neg    %eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x80(%rbp),%xmm1
  movsd  -0x48(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  mulsd  -0x48(%rbp),%xmm0
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %eax,%edi
  call   <exp@plt>
  mulsd  -0xa0(%rbp),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  jmp    L207
L208:
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x68(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x68(%rbp),%xmm0
  mulsd  -0x10(%rbp),%xmm0
  movsd  -0x50(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  mov    -0x74(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <pow@plt>
  movsd  %xmm0,-0xa0(%rbp)
  mov    -0x74(%rbp),%eax
  neg    %eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x80(%rbp),%xmm1
  movsd  -0x40(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  mulsd  -0x40(%rbp),%xmm0
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %eax,%edi
  call   <exp@plt>
  mulsd  -0xa0(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
L207:
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x60(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  addl   $0x1,-0x70(%rbp)
L42:
  mov    -0x70(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L137
  jmp    L141
L118:
  cmpl   $0x0,-0x6c(%rbp)
  jns    L33
  mov    -0x68(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x68(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L183
L33:
  mov    -0x6c(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    %edx,-0x6c(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x10(%rbp),%xmm0
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x50(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L183:
  mov    -0x74(%rbp),%eax
  neg    %eax
  mov    %eax,%edx
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    %edx,%edi
  movq   %rax,%xmm0
  call   <pow@plt>
  movsd  %xmm0,-0xa0(%rbp)
  mov    -0x74(%rbp),%eax
  neg    %eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x80(%rbp),%xmm1
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  divsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %eax,%edi
  call   <exp@plt>
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0xa0(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x70(%rbp)
L141:
  mov    -0x70(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L118
  movl   $0x0,-0x70(%rbp)
  jmp    L182
L27:
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x60(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x70(%rbp)
L182:
  mov    -0x70(%rbp),%eax
  cmp    -0x64(%rbp),%eax
  jl     L27
  movl   $0x0,-0x70(%rbp)
  jmp    L8
L12:
  mov    -0x70(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x70(%rbp)
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  -0x58(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x58(%rbp)
L8:
  movsd  D20(%rip),%xmm0
  comisd -0x58(%rbp),%xmm0
  ja     L12
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x90(%rbp),%rax
  movsd  %xmm0,(%rax)
  subl   $0x1,-0x70(%rbp)
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x98(%rbp),%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm1
  comisd %xmm1,%xmm0
  jbe    L3
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm0
  mov    -0x98(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x90(%rbp),%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
L3:
  subl   $0x1,-0x70(%rbp)
  mov    -0x70(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  movsd  -0x8(%rbp),%xmm0
  comisd %xmm1,%xmm0
  jbe    L36
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm0
  comisd -0x8(%rbp),%xmm0
  ja     L32
L36:
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm0
  comisd -0x8(%rbp),%xmm0
  jbe    L29
  mov    -0x90(%rbp),%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L3
L29:
  mov    -0x98(%rbp),%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L3
L32:
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  movsd  -0x80(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  mov    -0x90(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm0
  subsd  -0x80(%rbp),%xmm0
  mov    -0x98(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D51
type: f64
name: retrieve_data
arguments: data_tag: D28
type: f64
name: retrieve_data
arguments: data_tag: D10
type: f64
name: retrieve_data
arguments: data_tag: D21
type: f64
name: retrieve_data
arguments: data_tag: D20
type: f64

tool: D51: 50

tool: D28: 4

tool: D10: 0.01

tool: D21: 1

tool: D20: 0.683

assistant: ```c
void invgamma(int M, double s, double ds, double *low, double *high) {
  int i, ilo, ihi, n = 10000;
  double psum = 0.0, cdf = 0.0;
  double xmin, xmax, dx, xlo, xhi, plo, phi, tmp;
  double *x, *posterior;
  x = (double *)malloc(n * sizeof(double));
  posterior = (double *)malloc(n * sizeof(double));
  xmax = s + 50.0 * ds;
  xmin = s - 4.0 * ds;
  if (xmin < 0.01 * s)
    xmin = 0.01 * s;
  dx = (xmax - xmin) / (n - 1.0);
  ilo = (int)((s - xmin) / dx);
  ihi = ilo + 1;
  xlo = xmin + ilo * dx;
  xhi = xmin + ihi * dx;
  plo = pow(xlo, -M) * exp(-M * s * s / (2 * xlo * xlo));
  phi = pow(xhi, -M) * exp(-M * s * s / (2 * xhi * xhi));
  for (i = 0; i < n; i++) {
    if (ilo < 0 || ihi >= n)
      break;
    if (plo > phi) {
      posterior[i] = plo;
      x[i] = xlo;
      xlo = xmin + (--ilo) * dx;
      plo = pow(xlo, -M) * exp(-M * s * s / (2 * xlo * xlo));
    } else {
      posterior[i] = phi;
      x[i] = xhi;
      xhi = xmin + (++ihi) * dx;
      phi = pow(xhi, -M) * exp(-M * s * s / (2 * xhi * xhi));
    }
    psum += posterior[i];
  }
  for (; i < n; i++) {
    if (ilo < 0)
      x[i] = xmin + (ihi++) * dx;
    else
      x[i] = xmin + (ilo--) * dx;
    posterior[i] = pow(x[i], -M) * exp(-M * s * s / (2 * x[i] * x[i]));
  }
  for (i = 0; i < n; i++) {
    posterior[i] = posterior[i] / psum;
  }
  i = 0;
  while (cdf < 0.683) {
    cdf += posterior[i++];
  }
  *low = x[i];
  *high = tmp = x[--i];
  if (*low > *high) {
    *high = *low;
    *low = tmp;
  }
  while (1) {
    tmp = x[--i];
    if (*low < tmp && tmp < *high)
      break;
    else if (tmp < *low)
      *low = tmp;
    else
      *high = tmp;
  }
  *low = (s - *low);
  *high = (*high - s);
  free(x);
  free(posterior);
}
```