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

```asm
<cdflib_cdft>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %r9,%rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  mov    D163(%rip),%rax
  movl   $0x0,(%r9)
  mov    0xe0(%rsp),%r11
  mov    %rax,0x40(%rsp)
  mov    D64(%rip),%rax
  movq   $0x0,(%r11)
  mov    %rax,0x48(%rsp)
  mov    (%rdi),%eax
  lea    -0x1(%rax),%edx
  cmp    $0x2,%edx
  jbe    L128
  movsd  D114(%rip),%xmm0
  test   %eax,%eax
  jle    L44
L323:
  movsd  %xmm0,(%r11)
  movl   $0xffffffff,(%rbx)
L230:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L287
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L44:
  movsd  D35(%rip),%xmm0
  jmp    L323
  nopw   0x0(%rax,%rax,1)
L128:
  mov    %rsi,%r12
  mov    %rcx,%r15
  mov    %r8,%rbp
  cmp    $0x1,%eax
  je     L96
  movsd  (%rsi),%xmm0
  pxor   %xmm4,%xmm4
  comisd %xmm0,%xmm4
  jae    L315
  movsd  D35(%rip),%xmm1
  comisd %xmm1,%xmm0
  movapd %xmm1,%xmm2
  jbe    L134
L352:
  movsd  %xmm2,(%r11)
  movl   $0xfffffffe,(%rbx)
  jmp    L230
  nopw   0x0(%rax,%rax,1)
L315:
  pxor   %xmm2,%xmm2
  jmp    L352
  xchg   %ax,%ax
L134:
  movsd  0x0(%r13),%xmm2
  pxor   %xmm5,%xmm5
  comisd %xmm2,%xmm5
  jae    L131
  comisd %xmm1,%xmm2
  movapd %xmm1,%xmm3
  jbe    L174
L244:
  movsd  %xmm3,(%r11)
  movl   $0xfffffffd,(%rbx)
  jmp    L230
  xchg   %ax,%ax
L174:
  mov    %rdi,%r14
  cmp    $0x3,%eax
  jne    L347
L225:
  addsd  %xmm2,%xmm0
  xor    %eax,%eax
  mov    $0x1,%edi
  mov    %r11,0x8(%rsp)
  movsd  %xmm0,(%rsp)
  call   <dpmpar@plt>
  pxor   %xmm3,%xmm3
  movsd  (%rsp),%xmm0
  mov    0x8(%rsp),%r11
  cvtsi2sd %eax,%xmm3
  mulsd  D114(%rip),%xmm3
  movapd %xmm0,%xmm2
  subsd  D163(%rip),%xmm2
  subsd  D163(%rip),%xmm2
  andpd  D147(%rip),%xmm2
  comisd %xmm3,%xmm2
  jbe    L150
  pxor   %xmm7,%xmm7
  mov    D35(%rip),%rax
  cmpltsd %xmm7,%xmm0
  movq   %rax,%xmm1
  andnpd %xmm1,%xmm0
  movsd  %xmm0,(%r11)
  movl   $0x3,(%rbx)
  jmp    L230
  nopl   0x0(%rax,%rax,1)
L131:
  pxor   %xmm3,%xmm3
  jmp    L244
  nopl   0x0(%rax)
L96:
  pxor   %xmm6,%xmm6
  comisd (%r8),%xmm6
  jb     L362
L126:
  movl   $0xfffffffb,(%rbx)
  jmp    L230
L150:
  mov    (%r14),%eax
  cmp    $0x1,%eax
  je     L362
  movsd  (%r12),%xmm7
  movsd  %xmm7,(%rsp)
  movsd  0x0(%r13),%xmm7
  movsd  %xmm7,0x8(%rsp)
  cmp    $0x2,%eax
  je     L414
  cmp    $0x3,%eax
  jne    L230
  mov    %r11,0x20(%rsp)
  mov    D64(%rip),%rax
  lea    0x40(%rsp),%rdx
  lea    0x80(%rsp),%rsi
  lea    0x78(%rsp),%rdi
  mov    %rdx,%rcx
  mov    %rax,0x0(%rbp)
  mov    D153(%rip),%rax
  mov    %rax,0x78(%rsp)
  mov    D226(%rip),%rax
  mov    %rax,0x80(%rsp)
  mov    D197(%rip),%rax
  mov    %rax,0x88(%rsp)
  mov    D192(%rip),%rax
  mov    %rax,0x90(%rsp)
  push   %rax
  lea    0x98(%rsp),%rax
  push   %rax
  xor    %eax,%eax
  lea    0x98(%rsp),%r9
  lea    0x58(%rsp),%r8
  call   <cdflib_dstinv@plt>
  lea    0x60(%rsp),%rax
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  movl   $0x0,(%rbx)
  lea    0x80(%rsp),%r14
  lea    0x78(%rsp),%r8
  mov    %rax,%rdx
  mov    %rax,0x20(%rsp)
  mov    %r14,%rcx
  xor    %eax,%eax
  mov    %r8,0x40(%rsp)
  call   <cdflib_dinvr@plt>
  mov    (%rbx),%eax
  pop    %rdx
  pop    %rcx
  mov    0x20(%rsp),%r11
  lea    0x58(%rsp),%rsi
  cmp    $0x1,%eax
  lea    0x60(%rsp),%rcx
  mov    %rsi,0x18(%rsp)
  jne    L167
  mov    %r12,0x20(%rsp)
  mov    %rcx,%r12
  mov    %r13,0x28(%rsp)
  mov    0x30(%rsp),%r13
  mov    %r11,0x38(%rsp)
  jmp    L100
L193:
  mov    0x28(%rsp),%rax
  movsd  0x60(%rsp),%xmm0
  subsd  (%rax),%xmm0
L335:
  mov    0x10(%rsp),%rdx
  mov    %r13,%r8
  mov    %r14,%rcx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  movsd  %xmm0,0x50(%rsp)
  call   <cdflib_dinvr@plt>
  mov    (%rbx),%eax
  cmp    $0x1,%eax
  jne    L58
L100:
  mov    0x18(%rsp),%rdx
  xor    %eax,%eax
  mov    %r12,%rcx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <cdflib_cumt@plt>
  movsd  0x8(%rsp),%xmm7
  comisd (%rsp),%xmm7
  jb     L193
  mov    0x20(%rsp),%rax
  movsd  0x58(%rsp),%xmm0
  subsd  (%rax),%xmm0
  jmp    L335
L362:
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <cdflib_cumt@plt>
  movl   $0x0,(%rbx)
  jmp    L230
L414:
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    %r12,%rdi
  xor    %eax,%eax
  mov    %r11,0x20(%rsp)
  call   <cdflib_dt1@plt>
  pxor   %xmm0,%xmm0
  lea    0x40(%rsp),%rdx
  lea    0x80(%rsp),%rsi
  cvtsi2sd %eax,%xmm0
  mov    D228(%rip),%rax
  lea    0x78(%rsp),%rdi
  sub    $0x8,%rsp
  mov    %rdx,%rcx
  mov    %rax,0x80(%rsp)
  mov    D210(%rip),%rax
  mov    %rax,0x88(%rsp)
  mov    D197(%rip),%rax
  movsd  %xmm0,(%r15)
  mov    %rax,0x90(%rsp)
  mov    D192(%rip),%rax
  mov    %rax,0x98(%rsp)
  lea    0x98(%rsp),%rax
  push   %rax
  xor    %eax,%eax
  lea    0x98(%rsp),%r9
  lea    0x58(%rsp),%r8
  call   <cdflib_dstinv@plt>
  lea    0x60(%rsp),%rax
  mov    %r15,%rsi
  mov    %rbx,%rdi
  movl   $0x0,(%rbx)
  lea    0x80(%rsp),%r14
  lea    0x78(%rsp),%r8
  mov    %rax,%rdx
  mov    %rax,0x20(%rsp)
  mov    %r14,%rcx
  xor    %eax,%eax
  mov    %r8,0x40(%rsp)
  call   <cdflib_dinvr@plt>
  pop    %rsi
  mov    (%rbx),%eax
  pop    %rdi
  mov    0x20(%rsp),%r11
  lea    0x60(%rsp),%rcx
  cmp    $0x1,%eax
  mov    %rcx,%rdi
  lea    0x58(%rsp),%rcx
  mov    %rcx,0x18(%rsp)
  jne    L329
  mov    %r12,0x20(%rsp)
  mov    %rdi,%r12
  mov    %r13,0x28(%rsp)
  mov    0x30(%rsp),%r13
  mov    %r11,0x38(%rsp)
  jmp    L240
L188:
  mov    0x28(%rsp),%rax
  movsd  0x60(%rsp),%xmm0
  subsd  (%rax),%xmm0
L242:
  mov    0x10(%rsp),%rdx
  mov    %r13,%r8
  mov    %r14,%rcx
  mov    %r15,%rsi
  mov    %rbx,%rdi
  xor    %eax,%eax
  movsd  %xmm0,0x50(%rsp)
  call   <cdflib_dinvr@plt>
  mov    (%rbx),%eax
  cmp    $0x1,%eax
  jne    L312
L240:
  mov    0x18(%rsp),%rdx
  xor    %eax,%eax
  mov    %r12,%rcx
  mov    %rbp,%rsi
  mov    %r15,%rdi
  call   <cdflib_cumt@plt>
  movsd  0x8(%rsp),%xmm7
  comisd (%rsp),%xmm7
  jb     L188
  mov    0x20(%rsp),%rax
  movsd  0x58(%rsp),%xmm0
  subsd  (%rax),%xmm0
  jmp    L242
L312:
  mov    0x38(%rsp),%r11
L329:
  cmp    $0xffffffff,%eax
  jne    L230
  cmpq   $0x0,0x70(%rsp)
  jne    L360
  mov    D210(%rip),%rax
  movl   $0x2,(%rbx)
  mov    %rax,(%r11)
  jmp    L230
L58:
  mov    0x38(%rsp),%r11
L167:
  add    $0x1,%eax
  jne    L230
  cmpq   $0x0,0x70(%rsp)
  jne    L289
  mov    D226(%rip),%rax
  movl   $0x2,(%rbx)
  mov    %rax,(%r11)
  jmp    L230
L287:
  call   <__stack_chk_fail@plt>
L360:
  mov    D228(%rip),%rax
  movl   $0x1,(%rbx)
  mov    %rax,(%r11)
  jmp    L230
L289:
  mov    D153(%rip),%rax
  movl   $0x1,(%rbx)
  mov    %rax,(%r11)
  jmp    L230
L347:
  pxor   %xmm7,%xmm7
  comisd (%r8),%xmm7
  jae    L126
  jmp    L225
```

tool_calls: name: extract_symbolic_data
arguments: label: D163
datatype: f64
name: extract_symbolic_data
arguments: label: D64
datatype: f64
name: extract_symbolic_data
arguments: label: D114
datatype: f64
name: extract_symbolic_data
arguments: label: D35
datatype: f64
name: extract_symbolic_data
arguments: label: D147
datatype: qword[2]
name: extract_symbolic_data
arguments: label: D153
datatype: byte[8]
name: extract_symbolic_data
arguments: label: D226
datatype: f64
name: extract_symbolic_data
arguments: label: D197
datatype: byte[8]
name: extract_symbolic_data
arguments: label: D192
datatype: byte[8]
name: extract_symbolic_data
arguments: label: D228
datatype: byte[8]
name: extract_symbolic_data
arguments: label: D210
datatype: f64

tool: D163: 0.5

tool: D64: 5

tool: D114: 3

tool: D35: 1

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

tool: {"D153": [0x59,0xf3,0xf8,0xc2,0x1f,0x6e,0xa5,0x01]}

tool: D226: 10000000000

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

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

tool: {"D228": [0xea,0x8c,0xa0,0x39,0x59,0x3e,0x29,0xc6]}

tool: D210: 1e+30

assistant: ```c
void cdflib_cdft(const int *which, double *p, double *q, double *t, double *df, int *status, double *bound) {
  static const double tol = 1.0e-8;
  static const double atol = 1.0e-50;
  static const double zero = 1.0e-300;
  static const double inf = 1.0e30;
  static const double maxdf = 1.0e10;
  static const int K1 = 1;
  double K4 = 0.5e0;
  double K5 = 5.0e0;
  double fx, cum, ccum, pq;
  unsigned long qhi, qleft, qporq;
  double T2, T3, T6, T7, T8, T9, T10, T11;
  *status = 0;
  *bound = 0.0;
  if (!(*which < 1 || *which > 3)) {
    goto S30;
  }
  if (!(*which < 1)) {
    goto S10;
  }
  *bound = 1.0e0;
  goto S20;
S10:
  *bound = 3.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 == 3) {
    goto S130;
  }
  if (!(*df <= 0.0e0)) {
    goto S120;
  }
  *bound = 0.0e0;
  *status = -5;
  return;
S130:
S120:
  if (*which == 1) {
    goto S170;
  }
  pq = *p + *q;
  if (!(fabs(pq - 0.5e0 - 0.5e0) > 3.0e0 * dpmpar(K1))) {
    goto S160;
  }
  if (!(pq < 0.0e0)) {
    goto S140;
  }
  *bound = 0.0e0;
  goto S150;
S140:
  *bound = 1.0e0;
S150:
  *status = 3;
  return;
S170:
S160:
  if (!(*which == 1)) {
    qporq = *p <= *q;
  }
  if (1 == *which) {
    cdflib_cumt(t, df, p, q);
    *status = 0;
  } else if (2 == *which) {
    *t = cdflib_dt1(p, q, df);
    T2 = -inf;
    T3 = inf;
    T6 = atol;
    T7 = tol;
    cdflib_dstinv(&T2, &T3, &K4, &K4, &K5, &T6, &T7);
    *status = 0;
    cdflib_dinvr(status, t, &fx, &qleft, &qhi);
  S180:
    if (!(*status == 1)) {
      goto S210;
    }
    cdflib_cumt(t, df, &cum, &ccum);
    if (!qporq) {
      goto S190;
    }
    fx = cum - *p;
    goto S200;
  S190:
    fx = ccum - *q;
  S200:
    cdflib_dinvr(status, t, &fx, &qleft, &qhi);
    goto S180;
  S210:
    if (!(*status == -1)) {
      goto S240;
    }
    if (!qleft) {
      goto S220;
    }
    *status = 1;
    *bound = -inf;
    goto S230;
  S220:
    *status = 2;
    *bound = inf;
  S240:
  S230:;
  } else if (3 == *which) {
    *df = 5.0e0;
    T8 = zero;
    T9 = maxdf;
    T10 = atol;
    T11 = tol;
    cdflib_dstinv(&T8, &T9, &K4, &K4, &K5, &T10, &T11);
    *status = 0;
    cdflib_dinvr(status, df, &fx, &qleft, &qhi);
  S250:
    if (!(*status == 1)) {
      goto S280;
    }
    cdflib_cumt(t, df, &cum, &ccum);
    if (!qporq) {
      goto S260;
    }
    fx = cum - *p;
    goto S270;
  S260:
    fx = ccum - *q;
  S270:
    cdflib_dinvr(status, df, &fx, &qleft, &qhi);
    goto S250;
  S280:
    if (!(*status == -1)) {
      goto S310;
    }
    if (!qleft) {
      goto S290;
    }
    *status = 1;
    *bound = zero;
    goto S300;
  S290:
    *status = 2;
    *bound = maxdf;
  S300:;
  }
S310:
  return;
}
```