user: Please show me the C implementation that matches the assembly code listed below:

```asm
<sample_quad>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  movsd  %xmm0,0x8(%rsp)
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x10(%rsp)
  addsd  %xmm0,%xmm2
  comisd %xmm1,%xmm2
  jb     L31
  divsd  %xmm1,%xmm2
  movq   %xmm2,%r14
  addsd  %xmm4,%xmm3
  movsd  D56(%rip),%xmm0
  subsd  %xmm0,%xmm3
  movq   %xmm3,%r15
  addsd  %xmm7,%xmm5
  subsd  %xmm0,%xmm5
  movq   %xmm5,%r12
  addsd  0x70(%rsp),%xmm6
  subsd  %xmm0,%xmm6
  movq   %xmm6,%r13
L41:
  movq   %r14,%xmm0
  subsd  D56(%rip),%xmm0
  call   <is_positive@plt>
  test   %rax,%rax
  jne    L25
L107:
  movsd  0x8(%rsp),%xmm0
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L31:
  movsd  0x10(%rsp),%xmm1
  divsd  %xmm2,%xmm1
  movq   %xmm1,%r14
  addsd  %xmm4,%xmm3
  movsd  D56(%rip),%xmm0
  subsd  %xmm0,%xmm3
  movq   %xmm3,%r15
  addsd  0x70(%rsp),%xmm6
  subsd  %xmm0,%xmm6
  movq   %xmm6,%r12
  addsd  %xmm7,%xmm5
  subsd  %xmm0,%xmm5
  movq   %xmm5,%r13
  movsd  %xmm2,0x10(%rsp)
  jmp    L41
L25:
  movq   %r13,%xmm3
  movq   %r12,%xmm2
  movq   %r15,%xmm1
  movq   %r14,%xmm0
  call   <maximum_point@plt>
  movq   %xmm0,%rbx
  movq   %r13,%xmm4
  movq   %r12,%xmm3
  movq   %r15,%xmm2
  movq   %r14,%xmm1
  call   <DF@plt>
  movq   %xmm0,%rbp
  movsd  0x10(%rsp),%xmm7
  subsd  0x8(%rsp),%xmm7
  movsd  %xmm7,0x18(%rsp)
  movapd %xmm7,%xmm0
  call   <is_positive@plt>
  test   %rax,%rax
  je     L107
  movq   %rbp,%xmm0
  xorpd  D59(%rip),%xmm0
  movapd %xmm0,%xmm4
  movq   %rbx,%xmm7
  mulsd  %xmm7,%xmm4
  movsd  %xmm4,0x20(%rsp)
  mulsd  %xmm4,%xmm7
  movq   %xmm7,%rbx
  movapd %xmm7,%xmm0
  call   <is_positive@plt>
  test   %rax,%rax
  je     L107
  movsd  D56(%rip),%xmm0
  divsd  0x20(%rsp),%xmm0
  movsd  %xmm0,0x28(%rsp)
  call   <is_positive@plt>
  test   %rax,%rax
  je     L107
  movq   %rbx,%xmm0
  call   <sgamma@plt>
  mulsd  0x28(%rsp),%xmm0
  movsd  %xmm0,0x28(%rsp)
  call   <is_positive@plt>
  test   %rax,%rax
  je     L107
  movsd  0x8(%rsp),%xmm4
  divsd  0x18(%rsp),%xmm4
  movq   %xmm4,%rbp
  movapd %xmm4,%xmm0
  call   <is_positive@plt>
  test   %rax,%rax
  jne    L37
  movsd  0x10(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm4
  mulsd  %xmm4,%xmm1
  addsd  D56(%rip),%xmm4
  divsd  %xmm4,%xmm1
  movsd  %xmm1,0x8(%rsp)
  jmp    L107
L37:
  movsd  0x20(%rsp),%xmm7
  movq   %rbx,%xmm6
  movq   %r13,%xmm5
  movq   %r12,%xmm4
  movq   %r15,%xmm3
  movq   %r14,%xmm2
  movq   %rbp,%xmm1
  movsd  0x28(%rsp),%xmm0
  call   <qacc@plt>
  movq   %xmm0,%rbp
  movsd  D56(%rip),%xmm1
  pxor   %xmm0,%xmm0
  call   <genunf@plt>
  call   <log@plt>
  mov    %rax,%rbx
  movq   %rbp,%xmm1
  pxor   %xmm0,%xmm0
  call   <my_fmin@plt>
  cmp    %rax,%rbx
  jge    L107
  movsd  0x10(%rsp),%xmm0
  movsd  0x28(%rsp),%xmm4
  mulsd  %xmm4,%xmm0
  addsd  D56(%rip),%xmm4
  divsd  %xmm4,%xmm0
  movsd  %xmm0,0x8(%rsp)
  jmp    L107
```

tool_calls: name: disassemble_data
arguments: data_tag: D56
type: f64
name: disassemble_data
arguments: data_tag: D59
type: f32[4]

tool: D56: 1

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

assistant: ```c
double sample_quad(double xkl, double xkk, double xll, double ckl, double clk, double ckk, double cll, double bk, double bl) {
  double xlk, skl, slk, s2, s3, s, a1, a2, a3;
  double vbar, alpha, beta, v, w;
  double q, U;
  xlk = xkl;
  skl = xkk + xkl;
  slk = xll + xlk;
  if (skl <= slk) {
    s2 = skl;
    s3 = slk;
    s = s3 / s2;
    a1 = ckl + clk - 1.0;
    a2 = ckk + bk - 1.0;
    a3 = cll + bl - 1.0;
  } else {
    s2 = slk;
    s3 = skl;
    s = s3 / s2;
    a1 = ckl + clk - 1.0;
    a2 = cll + bl - 1.0;
    a3 = ckk + bk - 1.0;
  }
  if (is_positive(s - 1.0)) {
    vbar = maximum_point(s, a1, a2, a3);
    beta = -1.0 * DF(vbar, s, a1, a2, a3) * vbar;
    alpha = beta * vbar;
    if (is_positive(s2 - xkl)) {
      v = xkl / (s2 - xkl);
      if (is_positive(alpha) && is_positive(1.0 / beta)) {
        w = 1.0 / beta * sgamma(alpha);
        if (is_positive(w)) {
          if (!is_positive(v)) {
            return s2 * w / (1.0 + w);
          } else {
            q = qacc(w, v, s, a1, a2, a3, alpha, beta);
            U = genunf(0.0, 1.0);
            if (log(U) < my_fmin(0.0, q)) {
              return s2 * w / (1.0 + w);
            }
          }
        }
      }
    }
  }
  return xkl;
}
```