user: Demonstrate the C code that generates the assembly output below:

```asm
<invgammp>:
  endbr64
  push   %rbx
  sub    $0x40,%rsp
  movsd  %xmm0,0x10(%rsp)
  movapd %xmm1,%xmm0
  movsd  %xmm1,(%rsp)
  call   <gammln@plt>
  pxor   %xmm7,%xmm7
  comisd (%rsp),%xmm7
  movsd  %xmm0,0x28(%rsp)
  jae    L141
L97:
  movsd  0x10(%rsp),%xmm6
  comisd D146(%rip),%xmm6
  jae    L121
  pxor   %xmm5,%xmm5
  comisd 0x10(%rsp),%xmm5
  jae    L91
  movsd  (%rsp),%xmm6
  comisd D146(%rip),%xmm6
  movapd %xmm6,%xmm5
  subsd  D146(%rip),%xmm5
  movsd  %xmm5,0x8(%rsp)
  ja     L4
  movsd  (%rsp),%xmm5
  movsd  D296(%rip),%xmm0
  movsd  D146(%rip),%xmm1
  movsd  0x10(%rsp),%xmm6
  mulsd  %xmm5,%xmm0
  addsd  D324(%rip),%xmm0
  mulsd  %xmm5,%xmm0
  subsd  %xmm0,%xmm1
  comisd %xmm6,%xmm1
  ja     L81
  movsd  0x10(%rsp),%xmm0
  movsd  D146(%rip),%xmm2
  subsd  %xmm1,%xmm0
  subsd  %xmm1,%xmm2
  movsd  D146(%rip),%xmm1
  divsd  %xmm2,%xmm0
  subsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  call   <log@plt>
  movsd  D146(%rip),%xmm1
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x30(%rsp)
  subsd  %xmm0,%xmm1
L84:
  mov    $0xc,%ebx
  jmp    L118
  nopl   0x0(%rax,%rax,1)
L85:
  call   <log@plt>
  subsd  0x38(%rsp),%xmm0
  movsd  0x8(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm1
  mulsd  %xmm4,%xmm0
  movapd %xmm1,%xmm3
  subsd  %xmm4,%xmm3
  subsd  %xmm3,%xmm0
  call   <exp@plt>
  mulsd  0x30(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm1
  movsd  0x20(%rsp),%xmm2
L55:
  divsd  %xmm0,%xmm2
  movsd  0x8(%rsp),%xmm0
  mov    $0x1,%edi
  movsd  %xmm1,0x20(%rsp)
  divsd  %xmm1,%xmm0
  movsd  %xmm2,0x18(%rsp)
  subsd  D146(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  call   <dmin@plt>
  movsd  0x18(%rsp),%xmm2
  pxor   %xmm7,%xmm7
  movsd  D146(%rip),%xmm3
  mulsd  D358(%rip),%xmm0
  movsd  0x20(%rsp),%xmm1
  subsd  %xmm0,%xmm3
  divsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm1
  movapd %xmm2,%xmm0
  comisd %xmm1,%xmm7
  jb     L37
  addsd  %xmm2,%xmm1
  mulsd  D358(%rip),%xmm1
L37:
  movsd  D304(%rip),%xmm2
  andpd  D124(%rip),%xmm0
  mulsd  %xmm1,%xmm2
  comisd %xmm0,%xmm2
  ja     L58
  sub    $0x1,%ebx
  je     L58
L118:
  pxor   %xmm5,%xmm5
  comisd %xmm1,%xmm5
  jae    L91
  movsd  (%rsp),%xmm0
  movsd  %xmm1,0x18(%rsp)
  call   <gammp@plt>
  movsd  (%rsp),%xmm4
  movsd  0x18(%rsp),%xmm1
  movapd %xmm0,%xmm2
  comisd D146(%rip),%xmm4
  subsd  0x10(%rsp),%xmm2
  movapd %xmm1,%xmm0
  movsd  %xmm2,0x20(%rsp)
  ja     L85
  movsd  %xmm1,0x18(%rsp)
  call   <log@plt>
  mulsd  0x8(%rsp),%xmm0
  movsd  0x18(%rsp),%xmm1
  subsd  %xmm1,%xmm0
  subsd  0x28(%rsp),%xmm0
  call   <exp@plt>
  movsd  0x20(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm1
  jmp    L55
  nopl   0x0(%rax)
L4:
  movapd %xmm5,%xmm0
  call   <log@plt>
  movapd %xmm0,%xmm7
  subsd  D146(%rip),%xmm7
  movsd  %xmm0,0x38(%rsp)
  movsd  0x8(%rsp),%xmm0
  mulsd  %xmm7,%xmm0
  subsd  0x28(%rsp),%xmm0
  call   <exp@plt>
  movsd  0x10(%rsp),%xmm6
  movsd  %xmm0,0x30(%rsp)
  movsd  D358(%rip),%xmm0
  comisd %xmm6,%xmm0
  ja     L57
  movsd  D146(%rip),%xmm0
  subsd  %xmm6,%xmm0
  call   <log@plt>
  mulsd  D274(%rip),%xmm0
  call   <sqrt@plt>
  pxor   %xmm2,%xmm2
  movsd  D161(%rip),%xmm0
  movsd  D188(%rip),%xmm1
  cvtsi2sd %eax,%xmm2
  mulsd  %xmm2,%xmm0
  addsd  D38(%rip),%xmm0
  mulsd  %xmm2,%xmm1
  addsd  D316(%rip),%xmm1
  mulsd  %xmm2,%xmm0
  addsd  D146(%rip),%xmm0
  divsd  %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movq   %xmm1,%rbx
L87:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  movsd  (%rsp),%xmm0
  mulsd  D139(%rip),%xmm0
  pxor   %xmm2,%xmm2
  movsd  D146(%rip),%xmm1
  cvtsi2sd %eax,%xmm2
  mov    $0x3,%edi
  movsd  D146(%rip),%xmm5
  mulsd  D114(%rip),%xmm2
  divsd  %xmm0,%xmm1
  subsd  %xmm1,%xmm5
  movq   %rbx,%xmm1
  divsd  %xmm2,%xmm1
  movapd %xmm5,%xmm0
  subsd  %xmm1,%xmm0
  call   <pow@plt>
  movsd  (%rsp),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D166(%rip),%xmm0
  call   <dmax@plt>
  movapd %xmm0,%xmm1
  jmp    L84
  xchg   %ax,%ax
L91:
  pxor   %xmm1,%xmm1
L58:
  add    $0x40,%rsp
  movapd %xmm1,%xmm0
  pop    %rbx
  ret
  xchg   %ax,%ax
L121:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  pxor   %xmm1,%xmm1
  movsd  D258(%rip),%xmm0
  cvtsi2sd %eax,%xmm1
  mulsd  %xmm0,%xmm1
  addsd  (%rsp),%xmm1
  add    $0x40,%rsp
  pop    %rbx
  jmp    1100 <dmax@plt>
  nopl   (%rax)
L141:
  lea    D349(%rip),%rdi
  call   <error@plt>
  jmp    L97
  nopl   0x0(%rax)
L81:
  movsd  D146(%rip),%xmm0
  divsd  %xmm1,%xmm6
  divsd  %xmm5,%xmm0
  cvttsd2si %xmm0,%edi
  movapd %xmm6,%xmm0
  call   <pow@plt>
  movq   $0x0,0x38(%rsp)
  movq   $0x0,0x30(%rsp)
  movapd %xmm0,%xmm1
  jmp    L84
L57:
  movsd  0x10(%rsp),%xmm0
  call   <log@plt>
  mulsd  D274(%rip),%xmm0
  call   <sqrt@plt>
  pxor   %xmm2,%xmm2
  movsd  D161(%rip),%xmm0
  movsd  D188(%rip),%xmm1
  cvtsi2sd %eax,%xmm2
  mulsd  %xmm2,%xmm0
  addsd  D38(%rip),%xmm0
  mulsd  %xmm2,%xmm1
  addsd  D316(%rip),%xmm1
  mulsd  %xmm2,%xmm0
  addsd  D146(%rip),%xmm0
  divsd  %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  xorpd  D388(%rip),%xmm1
  movq   %xmm1,%rbx
  jmp    L87
```

tool_calls: name: extract_symbolic_data
arguments: tag: D146
data_type: f64[2]
name: extract_symbolic_data
arguments: tag: D296
data_type: f64
name: extract_symbolic_data
arguments: tag: D324
data_type: f64
name: extract_symbolic_data
arguments: tag: D358
data_type: f64
name: extract_symbolic_data
arguments: tag: D304
data_type: byte[8]
name: extract_symbolic_data
arguments: tag: D124
data_type: qword[2]
name: extract_symbolic_data
arguments: tag: D274
data_type: f32[2]
name: extract_symbolic_data
arguments: tag: D161
data_type: f64
name: extract_symbolic_data
arguments: tag: D188
data_type: f64
name: extract_symbolic_data
arguments: tag: D38
data_type: f64
name: extract_symbolic_data
arguments: tag: D316
data_type: f64
name: extract_symbolic_data
arguments: tag: D139
data_type: f64
name: extract_symbolic_data
arguments: tag: D114
data_type: f64
name: extract_symbolic_data
arguments: tag: D166
data_type: byte[8]
name: extract_symbolic_data
arguments: tag: D258
data_type: f64
name: extract_symbolic_data
arguments: tag: D349
data_type: string
name: extract_symbolic_data
arguments: tag: D388
data_type: f32[4]

tool: {"D146": [1.0,100.0]}

tool: D296: 0.12

tool: D324: 0.253

tool: D358: 0.5

tool: {"D304": [0x3a,0x8c,0x30,0xe2,0x8e,0x79,0x45,0x3e]}

tool: {"D124": [0x7fffffffffffffff,0x0000000000000000]}

tool: {"D274": [0.0,-2.0]}

tool: D161: 0.04481

tool: D188: 0.27061

tool: D38: 0.99229

tool: D316: 2.30753

tool: D139: 9

tool: D114: 3

tool: {"D166": [0xfc,0xa9,0xf1,0xd2,0x4d,0x62,0x50,0x3f]}

tool: D258: 100

tool: D349: a must be pos in invgammap

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

assistant: ```c
double invgammp(const double p, const double a) {
  int j;
  double x, err, t, u, pp, a1 = a - 1;
  double afac = 0;
  double lna1 = 0;
  double eps = 1.e-8;
  double gln = gammln(a);
  if (a <= 0.)
    error("a must be pos in invgammap");
  if (p >= 1.)
    return dmax(100., a + 100. * sqrt(a));
  if (p <= 0.)
    return 0.0;
  if (a > 1.) {
    lna1 = log(a1);
    afac = exp(a1 * (lna1 - 1.) - gln);
    pp = (p < 0.5) ? p : 1. - p;
    t = sqrt(-2. * log(pp));
    x = (2.30753 + t * 0.27061) / (1. + t * (0.99229 + t * 0.04481)) - t;
    if (p < 0.5)
      x = -x;
    x = dmax(1.e-3, a * pow(1. - 1. / (9. * a) - x / (3. * sqrt(a)), 3));
  } else {
    t = 1.0 - a * (0.253 + a * 0.12);
    if (p < t)
      x = pow(p / t, 1. / a);
    else
      x = 1. - log(1. - (p - t) / (1. - t));
  }
  for (j = 0; j < 12; j++) {
    if (x <= 0.0)
      return 0.0;
    err = gammp(a, x) - p;
    if (a > 1.)
      t = afac * exp(-(x - a1) + a1 * (log(x) - lna1));
    else
      t = exp(-x + a1 * log(x) - gln);
    u = err / t;
    x -= (t = u / (1. - 0.5 * dmin(1., u * ((a - 1.) / x - 1))));
    if (x <= 0.)
      x = 0.5 * (x + t);
    if (fabs(t) < eps * x)
      break;
  }
  return x;
}
```