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
  sub    $0x98,%rsp
  mov    %rdx,%r12
  mov    %r8,(%rsp)
  mov    %r9,0x8(%rsp)
  mov    0xd0(%rsp),%r14
  mov    0xd8(%rsp),%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  movq   $0x0,0x28(%rsp)
  mov    D185(%rip),%rax
  mov    %rax,0x30(%rsp)
  mov    D277(%rip),%rax
  mov    %rax,0x38(%rsp)
  movl   $0x0,(%r14)
  movq   $0x0,(%r15)
  mov    (%rdi),%eax
  lea    -0x1(%rax),%edx
  cmp    $0x3,%edx
  jbe    L212
  movsd  D72(%rip),%xmm0
  test   %eax,%eax
  jle    L288
L220:
  movsd  %xmm0,(%r15)
  movl   $0xffffffff,(%r14)
L508:
  mov    0x88(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L616
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L212:
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %rcx,%r13
  cmp    $0x1,%eax
  je     L180
  movsd  (%rsi),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  ja     L81
  comisd D36(%rip),%xmm0
  jbe    L515
  comisd %xmm0,%xmm1
  ja     L164
  movsd  D36(%rip),%xmm0
L42:
  movsd  %xmm0,(%r15)
  movl   $0xfffffffe,(%r14)
  jmp    L508
L288:
  movsd  D36(%rip),%xmm0
  jmp    L220
L81:
  pxor   %xmm0,%xmm0
  jmp    L42
L164:
  pxor   %xmm0,%xmm0
  jmp    L42
L515:
  movsd  (%r12),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm0,%xmm1
  jae    L407
  comisd D36(%rip),%xmm0
  jbe    L383
  comisd %xmm0,%xmm1
  jae    L315
  movsd  D36(%rip),%xmm0
L325:
  movsd  %xmm0,(%r15)
  movl   $0xfffffffd,(%r14)
  jmp    L508
L407:
  pxor   %xmm0,%xmm0
  jmp    L325
L315:
  pxor   %xmm0,%xmm0
  jmp    L325
L383:
  cmp    $0x2,%eax
  jne    L436
  pxor   %xmm0,%xmm0
  mov    (%rsp),%rdi
  comisd (%rdi),%xmm0
  jae    L244
L544:
  pxor   %xmm0,%xmm0
  mov    0x8(%rsp),%rsi
  comisd (%rsi),%xmm0
  jae    L421
  cmp    $0x1,%eax
  jne    L336
L440:
  mov    %r12,%r8
  mov    %rbp,%rcx
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <cdflib_cumf@plt>
  movl   $0x0,(%r14)
  jmp    L508
L436:
  pxor   %xmm0,%xmm0
  comisd (%rcx),%xmm0
  ja     L506
  cmp    $0x3,%eax
  jne    L242
  pxor   %xmm0,%xmm0
  mov    0x8(%rsp),%rax
  comisd (%rax),%xmm0
  jb     L336
L421:
  movl   $0xfffffffa,(%r14)
  jmp    L508
L242:
  pxor   %xmm0,%xmm0
  mov    (%rsp),%rsi
  comisd (%rsi),%xmm0
  jb     L246
L244:
  movl   $0xfffffffb,(%r14)
  jmp    L508
L246:
  cmp    $0x4,%eax
  jne    L544
L336:
  movsd  0x0(%rbp),%xmm0
  addsd  (%r12),%xmm0
  movsd  %xmm0,0x10(%rsp)
  mov    $0x1,%edi
  mov    $0x0,%eax
  call   <dpmpar@plt>
  movsd  D185(%rip),%xmm1
  movsd  0x10(%rsp),%xmm3
  movapd %xmm3,%xmm0
  subsd  %xmm1,%xmm0
  subsd  %xmm1,%xmm0
  andpd  D160(%rip),%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  mulsd  D190(%rip),%xmm1
  comisd %xmm1,%xmm0
  jbe    L527
  pxor   %xmm0,%xmm0
  comisd %xmm3,%xmm0
  ja     L609
  movsd  D36(%rip),%xmm0
L609:
  movsd  %xmm0,(%r15)
  movl   $0x3,(%r14)
  jmp    L508
L527:
  mov    (%rbx),%eax
  cmp    $0x1,%eax
  je     L440
  movsd  0x0(%rbp),%xmm4
  movsd  %xmm4,0x10(%rsp)
  movsd  (%r12),%xmm5
  movsd  %xmm5,0x18(%rsp)
  cmp    $0x2,%eax
  je     L349
  cmp    $0x3,%eax
  je     L56
  cmp    $0x4,%eax
  jne    L508
  mov    D36(%rip),%rax
  mov    %rax,0x68(%rsp)
  mov    D154(%rip),%rax
  mov    %rax,0x70(%rsp)
  mov    D63(%rip),%rax
  mov    %rax,0x78(%rsp)
  mov    D33(%rip),%rax
  mov    %rax,0x80(%rsp)
  lea    0x30(%rsp),%rdx
  lea    0x70(%rsp),%rsi
  lea    0x68(%rsp),%rdi
  sub    $0x8,%rsp
  lea    0x88(%rsp),%rax
  push   %rax
  lea    0x88(%rsp),%r9
  lea    0x48(%rsp),%r8
  mov    %rdx,%rcx
  mov    $0x0,%eax
  call   <cdflib_dstinv@plt>
  movl   $0x0,(%r14)
  mov    0x18(%rsp),%rsi
  mov    D277(%rip),%rax
  mov    %rax,(%rsi)
  movq   $0x0,0x50(%rsp)
  lea    0x70(%rsp),%rcx
  lea    0x50(%rsp),%rdx
  lea    0x68(%rsp),%r8
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  add    $0x10,%rsp
  cmp    $0x1,%eax
  jne    L302
  lea    0x50(%rsp),%rbx
  jmp    L96
L349:
  mov    D277(%rip),%rax
  mov    %rax,0x0(%r13)
  mov    D154(%rip),%rax
  mov    %rax,0x70(%rsp)
  mov    D63(%rip),%rax
  mov    %rax,0x78(%rsp)
  mov    D33(%rip),%rax
  mov    %rax,0x80(%rsp)
  lea    0x30(%rsp),%rdx
  lea    0x70(%rsp),%rsi
  lea    0x28(%rsp),%rdi
  sub    $0x8,%rsp
  lea    0x88(%rsp),%rax
  push   %rax
  lea    0x88(%rsp),%r9
  lea    0x48(%rsp),%r8
  mov    %rdx,%rcx
  mov    $0x0,%eax
  call   <cdflib_dstinv@plt>
  movl   $0x0,(%r14)
  lea    0x70(%rsp),%rcx
  lea    0x50(%rsp),%rdx
  lea    0x68(%rsp),%r8
  mov    %r13,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  add    $0x10,%rsp
  lea    0x50(%rsp),%rbx
  cmp    $0x1,%eax
  je     L481
L44:
  cmp    $0xffffffff,%eax
  jne    L508
  cmpq   $0x0,0x60(%rsp)
  jne    L493
  movl   $0x2,(%r14)
  mov    D154(%rip),%rax
  mov    %rax,(%r15)
  jmp    L508
L307:
  movsd  0x48(%rsp),%xmm0
  subsd  0x0(%rbp),%xmm0
L529:
  movsd  %xmm0,0x40(%rsp)
  lea    0x60(%rsp),%rcx
  lea    0x40(%rsp),%rdx
  lea    0x58(%rsp),%r8
  mov    %r13,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  cmp    $0x1,%eax
  jne    L44
L481:
  lea    0x48(%rsp),%rcx
  mov    %rbx,%r8
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <cdflib_cumf@plt>
  movsd  0x18(%rsp),%xmm6
  comisd 0x10(%rsp),%xmm6
  jae    L307
  movsd  0x50(%rsp),%xmm0
  subsd  (%r12),%xmm0
  jmp    L529
L493:
  movl   $0x1,(%r14)
  movq   $0x0,(%r15)
  jmp    L508
L56:
  mov    D36(%rip),%rax
  mov    %rax,0x68(%rsp)
  mov    D154(%rip),%rax
  mov    %rax,0x70(%rsp)
  mov    D63(%rip),%rax
  mov    %rax,0x78(%rsp)
  mov    D33(%rip),%rax
  mov    %rax,0x80(%rsp)
  lea    0x30(%rsp),%rdx
  lea    0x70(%rsp),%rsi
  lea    0x68(%rsp),%rdi
  sub    $0x8,%rsp
  lea    0x88(%rsp),%rax
  push   %rax
  lea    0x88(%rsp),%r9
  lea    0x48(%rsp),%r8
  mov    %rdx,%rcx
  mov    $0x0,%eax
  call   <cdflib_dstinv@plt>
  movl   $0x0,(%r14)
  mov    0x10(%rsp),%rax
  mov    D277(%rip),%rbx
  mov    %rbx,(%rax)
  movq   $0x0,0x50(%rsp)
  lea    0x70(%rsp),%rcx
  lea    0x50(%rsp),%rdx
  lea    0x68(%rsp),%r8
  mov    %rax,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  add    $0x10,%rsp
  cmp    $0x1,%eax
  jne    L89
  lea    0x50(%rsp),%rbx
  mov    %r15,0x10(%rsp)
  mov    (%rsp),%r15
  jmp    L599
L637:
  movsd  0x50(%rsp),%xmm0
  subsd  %xmm1,%xmm0
L65:
  movsd  %xmm0,0x40(%rsp)
  lea    0x60(%rsp),%rcx
  lea    0x40(%rsp),%rdx
  lea    0x58(%rsp),%r8
  mov    %r15,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  cmp    $0x1,%eax
  jne    L332
L599:
  lea    0x48(%rsp),%rcx
  mov    %rbx,%r8
  mov    0x8(%rsp),%rdx
  mov    %r15,%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <cdflib_cumf@plt>
  movsd  0x0(%rbp),%xmm2
  movsd  (%r12),%xmm1
  comisd %xmm2,%xmm1
  jb     L637
  movsd  0x48(%rsp),%xmm0
  subsd  %xmm2,%xmm0
  jmp    L65
L332:
  mov    0x10(%rsp),%r15
L89:
  cmp    $0xffffffff,%eax
  jne    L508
  cmpq   $0x0,0x60(%rsp)
  je     L35
  movl   $0x1,(%r14)
  mov    D36(%rip),%rax
  mov    %rax,(%r15)
  jmp    L508
L35:
  movl   $0x2,(%r14)
  mov    D154(%rip),%rax
  mov    %rax,(%r15)
  jmp    L508
L134:
  movsd  0x50(%rsp),%xmm0
  subsd  %xmm1,%xmm0
L190:
  movsd  %xmm0,0x40(%rsp)
  lea    0x60(%rsp),%rcx
  lea    0x40(%rsp),%rdx
  lea    0x58(%rsp),%r8
  mov    0x8(%rsp),%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
  mov    (%r14),%eax
  cmp    $0x1,%eax
  jne    L302
L96:
  lea    0x48(%rsp),%rcx
  mov    %rbx,%r8
  mov    0x8(%rsp),%rdx
  mov    (%rsp),%rsi
  mov    %r13,%rdi
  mov    $0x0,%eax
  call   <cdflib_cumf@plt>
  movsd  0x0(%rbp),%xmm2
  movsd  (%r12),%xmm1
  comisd %xmm2,%xmm1
  jb     L134
  movsd  0x48(%rsp),%xmm0
  subsd  %xmm2,%xmm0
  jmp    L190
L302:
  cmp    $0xffffffff,%eax
  jne    L508
  cmpq   $0x0,0x60(%rsp)
  je     L135
  movl   $0x1,(%r14)
  mov    D36(%rip),%rax
  mov    %rax,(%r15)
  jmp    L508
L135:
  movl   $0x2,(%r14)
  mov    D154(%rip),%rax
  mov    %rax,(%r15)
  jmp    L508
L180:
  pxor   %xmm0,%xmm0
  comisd (%rcx),%xmm0
  jbe    L242
L506:
  movl   $0xfffffffc,(%r14)
  jmp    L508
L616:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D185
type_guessed: f64
name: retrieve_data
arguments: data_tag: D277
type_guessed: f64
name: retrieve_data
arguments: data_tag: D72
type_guessed: f64
name: retrieve_data
arguments: data_tag: D36
type_guessed: f64[2]
name: retrieve_data
arguments: data_tag: D160
type_guessed: qword[2]
name: retrieve_data
arguments: data_tag: D190
type_guessed: f64
name: retrieve_data
arguments: data_tag: D154
type_guessed: f64
name: retrieve_data
arguments: data_tag: D63
type_guessed: byte[8]
name: retrieve_data
arguments: data_tag: D33
type_guessed: byte[8]

tool: D185: 0.5

tool: D277: 5

tool: D72: 4

tool: {"D36": [1.0,4.0]}

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

tool: D190: 3

tool: D154: 1e+300

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

tool: {"D33": [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;
}
```