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

```asm
<cdflib_cdff>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0xf8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xe8(%rsp)
  xor    %eax,%eax
  mov    D60(%rip),%rax
  mov    0x130(%rsp),%r14
  movq   $0x0,0x50(%rsp)
  mov    0x138(%rsp),%r11
  mov    %rax,0x58(%rsp)
  mov    D200(%rip),%rax
  movl   $0x0,(%r14)
  mov    %rax,0x60(%rsp)
  mov    (%rdi),%eax
  movq   $0x0,(%r11)
  lea    -0x1(%rax),%edx
  cmp    $0x3,%edx
  jbe    L471
  movsd  D144(%rip),%xmm0
  test   %eax,%eax
  jle    L389
L72:
  movsd  %xmm0,(%r11)
  movl   $0xffffffff,(%r14)
L511:
  mov    0xe8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L429
  add    $0xf8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L389:
  movsd  D83(%rip),%xmm0
  jmp    L72
  nopw   0x0(%rax,%rax,1)
L471:
  mov    %rdi,%r15
  mov    %rsi,%r12
  mov    %rcx,%rbp
  mov    %r8,%r13
  mov    %r9,%r10
  cmp    $0x1,%eax
  je     L118
  movsd  (%rsi),%xmm1
  pxor   %xmm3,%xmm3
  comisd %xmm1,%xmm3
  ja     L19
  movsd  D83(%rip),%xmm0
  comisd %xmm0,%xmm1
  movapd %xmm0,%xmm2
  jbe    L25
L273:
  movsd  %xmm2,(%r11)
  movl   $0xfffffffe,(%r14)
  jmp    L511
  nopl   0x0(%rax)
L19:
  pxor   %xmm2,%xmm2
  jmp    L273
  xchg   %ax,%ax
L25:
  movsd  (%rbx),%xmm2
  pxor   %xmm4,%xmm4
  comisd %xmm2,%xmm4
  jae    L400
  comisd %xmm0,%xmm2
  jbe    L284
L263:
  movsd  %xmm0,(%r11)
  movl   $0xfffffffd,(%r14)
  jmp    L511
  nopl   (%rax)
L284:
  cmp    $0x2,%eax
  jne    L469
  pxor   %xmm7,%xmm7
  comisd (%r8),%xmm7
  jb     L343
L7:
  movl   $0xfffffffb,(%r14)
  jmp    L511
  nopl   0x0(%rax)
L400:
  pxor   %xmm0,%xmm0
  jmp    L263
  cs nopw 0x0(%rax,%rax,1)
L118:
  pxor   %xmm5,%xmm5
  comisd (%rcx),%xmm5
  jbe    L299
L557:
  movl   $0xfffffffc,(%r14)
  jmp    L511
L299:
  pxor   %xmm6,%xmm6
  comisd 0x0(%r13),%xmm6
  jae    L7
  cmp    $0x4,%eax
  jne    L343
L229:
  movsd  (%r12),%xmm1
L527:
  addsd  (%rbx),%xmm1
  xor    %eax,%eax
  mov    $0x1,%edi
  mov    %r11,0x18(%rsp)
  mov    %r10,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <dpmpar@plt>
  pxor   %xmm2,%xmm2
  movsd  0x8(%rsp),%xmm1
  mov    0x10(%rsp),%r10
  cvtsi2sd %eax,%xmm2
  mulsd  D235(%rip),%xmm2
  mov    0x18(%rsp),%r11
  movapd %xmm1,%xmm0
  subsd  D60(%rip),%xmm0
  subsd  D60(%rip),%xmm0
  andpd  D173(%rip),%xmm0
  comisd %xmm2,%xmm0
  jbe    L249
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  ja     L407
  movsd  D83(%rip),%xmm0
L407:
  movsd  %xmm0,(%r11)
  movl   $0x3,(%r14)
  jmp    L511
L343:
  pxor   %xmm7,%xmm7
  comisd (%r10),%xmm7
  jb     L18
L412:
  movl   $0xfffffffa,(%r14)
  jmp    L511
L249:
  mov    (%r15),%eax
  cmp    $0x1,%eax
  je     L481
  movsd  (%r12),%xmm7
  movsd  (%rbx),%xmm6
  movsd  %xmm7,0x28(%rsp)
  movsd  %xmm6,0x30(%rsp)
  cmp    $0x2,%eax
  je     L223
  cmp    $0x3,%eax
  je     L474
  cmp    $0x4,%eax
  jne    L511
  mov    D24(%rip),%rax
  mov    %r11,0x10(%rsp)
  lea    0x58(%rsp),%rdx
  lea    0xd0(%rsp),%rsi
  movsd  D83(%rip),%xmm6
  mov    %r10,0x8(%rsp)
  mov    %rdx,%rcx
  lea    0xc8(%rsp),%rdi
  mov    %rax,0xd8(%rsp)
  movsd  D198(%rip),%xmm7
  mov    D212(%rip),%rax
  movsd  %xmm6,0x30(%rsp)
  movsd  %xmm6,0xc8(%rsp)
  mov    %rax,0xe0(%rsp)
  movsd  %xmm7,0x38(%rsp)
  movsd  %xmm7,0xd0(%rsp)
  push   %rax
  lea    0xe8(%rsp),%rax
  push   %rax
  xor    %eax,%eax
  lea    0xe8(%rsp),%r9
  lea    0x70(%rsp),%r8
  call   <cdflib_dstinv@plt>
  mov    0x18(%rsp),%r10
  mov    %r14,%rdi
  mov    D200(%rip),%rax
  movl   $0x0,(%r14)
  lea    0x98(%rsp),%r15
  lea    0x90(%rsp),%r8
  mov    %rax,(%r10)
  mov    %r15,%rcx
  mov    %r10,%rsi
  lea    0x78(%rsp),%rax
  mov    %rax,0x18(%rsp)
  mov    %rax,%rdx
  xor    %eax,%eax
  movq   $0x0,0x78(%rsp)
  mov    %r8,0x30(%rsp)
  mov    %r10,0x50(%rsp)
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  pop    %rdx
  pop    %rcx
  mov    0x10(%rsp),%r11
  cmp    $0x1,%eax
  jne    L373
  lea    0x78(%rsp),%rax
  mov    %rbx,0x28(%rsp)
  mov    0x40(%rsp),%rbx
  mov    %rax,0x18(%rsp)
  lea    0x70(%rsp),%rax
  mov    %rax,0x10(%rsp)
  mov    %r11,0x40(%rsp)
  jmp    L163
L47:
  movsd  0x70(%rsp),%xmm0
  subsd  %xmm2,%xmm0
L35:
  mov    0x20(%rsp),%r8
  mov    0x8(%rsp),%rdx
  mov    %r15,%rcx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  movsd  %xmm0,0x68(%rsp)
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  cmp    $0x1,%eax
  jne    L265
L163:
  mov    0x18(%rsp),%r8
  mov    0x10(%rsp),%rcx
  xor    %eax,%eax
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <cdflib_cumf@plt>
  mov    0x28(%rsp),%rax
  movsd  (%r12),%xmm2
  movsd  (%rax),%xmm1
  comisd %xmm2,%xmm1
  jae    L47
  movsd  0x78(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  jmp    L35
L18:
  cmp    $0x1,%eax
  jne    L229
L481:
  mov    %rbx,%r8
  mov    %r12,%rcx
  mov    %r10,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <cdflib_cumf@plt>
  movl   $0x0,(%r14)
  jmp    L511
L265:
  mov    0x40(%rsp),%r11
L373:
  add    $0x1,%eax
  jne    L511
  cmpq   $0x0,0x88(%rsp)
  je     L189
  movsd  0x30(%rsp),%xmm6
  movl   $0x1,(%r14)
  movsd  %xmm6,(%r11)
  jmp    L511
L474:
  mov    D24(%rip),%rax
  mov    %r11,0x10(%rsp)
  lea    0x58(%rsp),%rdx
  lea    0xb0(%rsp),%rsi
  movsd  D83(%rip),%xmm6
  mov    %r10,0x40(%rsp)
  mov    %rdx,%rcx
  lea    0xa8(%rsp),%rdi
  mov    %rax,0xb8(%rsp)
  movsd  D198(%rip),%xmm7
  mov    D212(%rip),%rax
  movsd  %xmm6,0x30(%rsp)
  movsd  %xmm6,0xa8(%rsp)
  mov    %rax,0xc0(%rsp)
  movsd  %xmm7,0x38(%rsp)
  movsd  %xmm7,0xb0(%rsp)
  push   %r8
  lea    0xc8(%rsp),%rax
  push   %rax
  xor    %eax,%eax
  lea    0xc8(%rsp),%r9
  lea    0x70(%rsp),%r8
  call   <cdflib_dstinv@plt>
  mov    D200(%rip),%rax
  mov    %r13,%rsi
  movl   $0x0,(%r14)
  lea    0x98(%rsp),%r15
  mov    %r14,%rdi
  lea    0x90(%rsp),%r8
  movq   $0x0,0x78(%rsp)
  mov    %rax,0x0(%r13)
  lea    0x78(%rsp),%rax
  mov    %r15,%rcx
  mov    %rax,0x18(%rsp)
  mov    %rax,%rdx
  xor    %eax,%eax
  mov    %r8,0x30(%rsp)
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  pop    %r9
  pop    %r10
  mov    0x10(%rsp),%r11
  cmp    $0x1,%eax
  jne    L373
  lea    0x78(%rsp),%rax
  mov    %r12,0x28(%rsp)
  mov    0x40(%rsp),%r12
  mov    %rax,0x18(%rsp)
  lea    0x70(%rsp),%rax
  mov    %rax,0x10(%rsp)
  mov    %r11,0x40(%rsp)
  jmp    L402
L446:
  movsd  0x70(%rsp),%xmm0
  subsd  %xmm2,%xmm0
L29:
  mov    0x20(%rsp),%r8
  mov    0x8(%rsp),%rdx
  mov    %r15,%rcx
  mov    %r13,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  movsd  %xmm0,0x68(%rsp)
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  cmp    $0x1,%eax
  jne    L265
L402:
  mov    0x18(%rsp),%r8
  mov    0x10(%rsp),%rcx
  xor    %eax,%eax
  mov    %r12,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <cdflib_cumf@plt>
  mov    0x28(%rsp),%rax
  movsd  (%rbx),%xmm1
  movsd  (%rax),%xmm2
  comisd %xmm2,%xmm1
  jae    L446
  movsd  0x78(%rsp),%xmm0
  subsd  %xmm1,%xmm0
  jmp    L29
L429:
  call   <__stack_chk_fail@plt>
L223:
  mov    %r11,0x48(%rsp)
  lea    0x58(%rsp),%rdx
  mov    D200(%rip),%rax
  lea    0x90(%rsp),%rsi
  movsd  D198(%rip),%xmm7
  mov    %r10,0x40(%rsp)
  lea    0x50(%rsp),%rdi
  mov    %rdx,%rcx
  mov    %rax,0x0(%rbp)
  mov    D24(%rip),%rax
  movsd  %xmm7,0x38(%rsp)
  mov    %rax,0x98(%rsp)
  mov    D212(%rip),%rax
  movsd  %xmm7,0x90(%rsp)
  mov    %rax,0xa0(%rsp)
  push   %r11
  lea    0xa8(%rsp),%rax
  push   %rax
  xor    %eax,%eax
  lea    0xa8(%rsp),%r9
  lea    0x70(%rsp),%r8
  call   <cdflib_dstinv@plt>
  lea    0x78(%rsp),%rax
  mov    %rbp,%rsi
  mov    %r14,%rdi
  lea    0x98(%rsp),%r15
  mov    %rax,0x18(%rsp)
  mov    %rax,%rdx
  xor    %eax,%eax
  movl   $0x0,(%r14)
  lea    0x90(%rsp),%r8
  mov    %r15,%rcx
  mov    %r8,0x30(%rsp)
  call   <cdflib_dinvr@plt>
  pop    %rdx
  mov    (%r14),%eax
  pop    %rcx
  mov    0x40(%rsp),%r10
  lea    0x78(%rsp),%rcx
  cmp    $0x1,%eax
  mov    0x48(%rsp),%r11
  mov    %rcx,0x18(%rsp)
  lea    0x70(%rsp),%rcx
  mov    %rcx,0x10(%rsp)
  jne    L287
  mov    %rbx,0x40(%rsp)
  mov    %r10,%rbx
  mov    %r11,0x48(%rsp)
  jmp    L104
L515:
  mov    0x40(%rsp),%rax
  movsd  0x78(%rsp),%xmm0
  subsd  (%rax),%xmm0
L17:
  mov    0x20(%rsp),%r8
  mov    0x8(%rsp),%rdx
  mov    %r15,%rcx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  xor    %eax,%eax
  movsd  %xmm0,0x68(%rsp)
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  cmp    $0x1,%eax
  jne    L482
L104:
  mov    0x18(%rsp),%r8
  mov    0x10(%rsp),%rcx
  xor    %eax,%eax
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <cdflib_cumf@plt>
  movsd  0x30(%rsp),%xmm7
  comisd 0x28(%rsp),%xmm7
  jb     L515
  movsd  0x70(%rsp),%xmm0
  subsd  (%r12),%xmm0
  jmp    L17
L482:
  mov    0x48(%rsp),%r11
L287:
  add    $0x1,%eax
  jne    L511
  cmpq   $0x0,0x88(%rsp)
  je     L189
  movl   $0x1,(%r14)
  movq   $0x0,(%r11)
  jmp    L511
L189:
  movsd  0x38(%rsp),%xmm6
  movl   $0x2,(%r14)
  movsd  %xmm6,(%r11)
  jmp    L511
L469:
  pxor   %xmm6,%xmm6
  comisd (%rcx),%xmm6
  ja     L557
  cmp    $0x3,%eax
  jne    L299
  pxor   %xmm6,%xmm6
  comisd (%r9),%xmm6
  jae    L412
  jmp    L527
```

tool_calls: name: disassemble_data
arguments: label: D60
datatype: f64
name: disassemble_data
arguments: label: D200
datatype: f64
name: disassemble_data
arguments: label: D144
datatype: f64
name: disassemble_data
arguments: label: D83
datatype: f64
name: disassemble_data
arguments: label: D235
datatype: f64
name: disassemble_data
arguments: label: D173
datatype: qword[2]
name: disassemble_data
arguments: label: D24
datatype: byte[8]
name: disassemble_data
arguments: label: D198
datatype: f64
name: disassemble_data
arguments: label: D212
datatype: byte[8]

tool: D60: 0.5

tool: D200: 5

tool: D144: 4

tool: D83: 1

tool: D235: 3

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

tool: {"D24": [0x1f,0xb8,0xd4,0x4a,0x7a,0xee,0x8d,0x35]}

tool: D198: 1e+300

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

assistant: ```c
void cdflib_cdff(const int *which, double *p, double *q, double *f, double *dfn, double *dfd, int *status, double *bound) {
  static const double tol = 1.0e-8;
  static const double atol = 1.0e-50;
  static const double inf = 1.0e300;
  static const int K1 = 1;
  double K2 = 0.0e0;
  double K4 = 0.5e0;
  double K5 = 5.0e0;
  double pq, fx, cum, ccum;
  unsigned long qhi, qleft, qporq;
  double T3, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15;
  *status = 0;
  *bound = 0.0;
  if (!(*which < 1 || *which > 4)) {
    goto S30;
  }
  if (!(*which < 1)) {
    goto S10;
  }
  *bound = 1.0e0;
  goto S20;
S10:
  *bound = 4.0e0;
S20:
  *status = -1;
  return;
S30:
  if (*which == 1) {
    goto S70;
  }
  if (!(*p < 0.0e0 || *p > 1.0e0)) {
    goto S60;
  }
  if (!(*p < 0.0e0)) {
    goto S40;
  }
  *bound = 0.0e0;
  goto S50;
S40:
  *bound = 1.0e0;
S50:
  *status = -2;
  return;
S70:
S60:
  if (*which == 1) {
    goto S110;
  }
  if (!(*q <= 0.0e0 || *q > 1.0e0)) {
    goto S100;
  }
  if (!(*q <= 0.0e0)) {
    goto S80;
  }
  *bound = 0.0e0;
  goto S90;
S80:
  *bound = 1.0e0;
S90:
  *status = -3;
  return;
S110:
S100:
  if (*which == 2) {
    goto S130;
  }
  if (!(*f < 0.0e0)) {
    goto S120;
  }
  *bound = 0.0e0;
  *status = -4;
  return;
S130:
S120:
  if (*which == 3) {
    goto S150;
  }
  if (!(*dfn <= 0.0e0)) {
    goto S140;
  }
  *bound = 0.0e0;
  *status = -5;
  return;
S150:
S140:
  if (*which == 4) {
    goto S170;
  }
  if (!(*dfd <= 0.0e0)) {
    goto S160;
  }
  *bound = 0.0e0;
  *status = -6;
  return;
S170:
S160:
  if (*which == 1) {
    goto S210;
  }
  pq = *p + *q;
  if (!(fabs(pq - 0.5e0 - 0.5e0) > 3.0e0 * dpmpar(K1))) {
    goto S200;
  }
  if (!(pq < 0.0e0)) {
    goto S180;
  }
  *bound = 0.0e0;
  goto S190;
S180:
  *bound = 1.0e0;
S190:
  *status = 3;
  return;
S210:
S200:
  if (!(*which == 1)) {
    qporq = *p <= *q;
  }
  if (1 == *which) {
    cdflib_cumf(f, dfn, dfd, p, q);
    *status = 0;
  } else if (2 == *which) {
    *f = 5.0e0;
    T3 = inf;
    T6 = atol;
    T7 = tol;
    cdflib_dstinv(&K2, &T3, &K4, &K4, &K5, &T6, &T7);
    *status = 0;
    cdflib_dinvr(status, f, &fx, &qleft, &qhi);
  S220:
    if (!(*status == 1)) {
      goto S250;
    }
    cdflib_cumf(f, dfn, dfd, &cum, &ccum);
    if (!qporq) {
      goto S230;
    }
    fx = cum - *p;
    goto S240;
  S230:
    fx = ccum - *q;
  S240:
    cdflib_dinvr(status, f, &fx, &qleft, &qhi);
    goto S220;
  S250:
    if (!(*status == -1)) {
      goto S280;
    }
    if (!qleft) {
      goto S260;
    }
    *status = 1;
    *bound = 0.0e0;
    goto S270;
  S260:
    *status = 2;
    *bound = inf;
  S280:
  S270:;
  } else if (3 == *which) {
    T8 = 1.0;
    T9 = inf;
    T10 = atol;
    T11 = tol;
    cdflib_dstinv(&T8, &T9, &K4, &K4, &K5, &T10, &T11);
    *status = 0;
    *dfn = 5.0;
    fx = 0.0;
    cdflib_dinvr(status, dfn, &fx, &qleft, &qhi);
    while (*status == 1) {
      cdflib_cumf(f, dfn, dfd, &cum, &ccum);
      if (*p <= *q) {
        fx = cum - *p;
      } else {
        fx = ccum - *q;
      }
      cdflib_dinvr(status, dfn, &fx, &qleft, &qhi);
    }
    if (*status == -1) {
      if (qleft) {
        *status = 1;
        *bound = 1.0;
      } else {
        *status = 2;
        *bound = inf;
      }
    }
  } else if (4 == *which) {
    T12 = 1.0;
    T13 = inf;
    T14 = atol;
    T15 = tol;
    cdflib_dstinv(&T12, &T13, &K4, &K4, &K5, &T14, &T15);
    *status = 0;
    *dfd = 5.0;
    fx = 0.0;
    cdflib_dinvr(status, dfd, &fx, &qleft, &qhi);
    while (*status == 1) {
      cdflib_cumf(f, dfn, dfd, &cum, &ccum);
      if (*p <= *q) {
        fx = cum - *p;
      } else {
        fx = ccum - *q;
      }
      cdflib_dinvr(status, dfd, &fx, &qleft, &qhi);
    }
    if (*status == -1) {
      if (qleft) {
        *status = 1;
        *bound = 1.0;
      } else {
        *status = 2;
        *bound = inf;
      }
    }
  }
  return;
}
```