user: Converte this assembly snippet into its equivalent C code:

```asm
<cdflib_cdff>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xd0,%rsp
  mov    %rdi,-0x88(%rbp)
  mov    %rsi,-0x90(%rbp)
  mov    %rdx,-0x98(%rbp)
  mov    %rcx,-0xa0(%rbp)
  mov    %r8,-0xa8(%rbp)
  mov    %r9,-0xb0(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0xb8(%rbp)
  mov    0x18(%rbp),%rax
  mov    %rax,-0xc0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movsd  D166(%rip),%xmm0
  movsd  %xmm0,-0x70(%rbp)
  movsd  D289(%rip),%xmm0
  movsd  %xmm0,-0x68(%rbp)
  mov    -0xb8(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0xc0(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jle    L417
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x4,%eax
  jle    L665
L417:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jg     L301
  mov    -0xc0(%rbp),%rax
  movsd  D70(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L0
L301:
  nop
  mov    -0xc0(%rbp),%rax
  movsd  D117(%rip),%xmm0
  movsd  %xmm0,(%rax)
L0:
  mov    -0xb8(%rbp),%rax
  movl   $0xffffffff,(%rax)
  jmp    L108
L665:
  nop
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L522
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  seta   %al
  xor    $0x1,%eax
  test   %al,%al
  je     L250
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  D70(%rip),%xmm1
  comisd %xmm1,%xmm0
  seta   %al
  xor    $0x1,%eax
  test   %al,%al
  jne    L469
L250:
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  seta   %al
  xor    $0x1,%eax
  test   %al,%al
  jne    L262
  mov    -0xc0(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L385
L262:
  nop
  mov    -0xc0(%rbp),%rax
  movsd  D70(%rip),%xmm0
  movsd  %xmm0,(%rax)
L385:
  mov    -0xb8(%rbp),%rax
  movl   $0xfffffffe,(%rax)
  jmp    L108
L522:
  nop
  jmp    L588
L469:
  nop
L588:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L653
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  setae  %al
  xor    $0x1,%eax
  test   %al,%al
  je     L235
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  D70(%rip),%xmm1
  comisd %xmm1,%xmm0
  seta   %al
  xor    $0x1,%eax
  test   %al,%al
  jne    L222
L235:
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  setae  %al
  xor    $0x1,%eax
  test   %al,%al
  jne    L488
  mov    -0xc0(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L62
L488:
  nop
  mov    -0xc0(%rbp),%rax
  movsd  D70(%rip),%xmm0
  movsd  %xmm0,(%rax)
L62:
  mov    -0xb8(%rbp),%rax
  movl   $0xfffffffd,(%rax)
  jmp    L108
L653:
  nop
  jmp    L505
L222:
  nop
L505:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  je     L95
  mov    -0xa0(%rbp),%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  seta   %al
  xor    $0x1,%eax
  test   %al,%al
  jne    L28
  mov    -0xc0(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xb8(%rbp),%rax
  movl   $0xfffffffc,(%rax)
  jmp    L108
L95:
  nop
  jmp    L40
L28:
  nop
L40:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x3,%eax
  je     L486
  mov    -0xa8(%rbp),%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  setae  %al
  xor    $0x1,%eax
  test   %al,%al
  jne    L676
  mov    -0xc0(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xb8(%rbp),%rax
  movl   $0xfffffffb,(%rax)
  jmp    L108
L486:
  nop
  jmp    L355
L676:
  nop
L355:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x4,%eax
  je     L343
  mov    -0xb0(%rbp),%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  setae  %al
  xor    $0x1,%eax
  test   %al,%al
  jne    L502
  mov    -0xc0(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xb8(%rbp),%rax
  movl   $0xfffffffa,(%rax)
  jmp    L108
L343:
  nop
  jmp    L388
L502:
  nop
L388:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L272
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  movsd  -0x10(%rbp),%xmm0
  movsd  D166(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  D166(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   D213(%rip),%xmm1
  andpd  %xmm1,%xmm0
  movsd  %xmm0,-0xc8(%rbp)
  mov    D37(%rip),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <dpmpar@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  D284(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0xc8(%rbp),%xmm2
  comisd %xmm0,%xmm2
  seta   %al
  xor    $0x1,%eax
  test   %al,%al
  jne    L607
  pxor   %xmm0,%xmm0
  comisd -0x10(%rbp),%xmm0
  seta   %al
  xor    $0x1,%eax
  test   %al,%al
  jne    L520
  mov    -0xc0(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L645
L520:
  nop
  mov    -0xc0(%rbp),%rax
  movsd  D70(%rip),%xmm0
  movsd  %xmm0,(%rax)
L645:
  mov    -0xb8(%rbp),%rax
  movl   $0x3,(%rax)
  jmp    L108
L272:
  nop
  jmp    L244
L607:
  nop
L244:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L10
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  setae  %al
  movzbl %al,%eax
  mov    %rax,-0x18(%rbp)
L10:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L164
  mov    -0x98(%rbp),%rdi
  mov    -0x90(%rbp),%rcx
  mov    -0xb0(%rbp),%rdx
  mov    -0xa8(%rbp),%rsi
  mov    -0xa0(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_cumf@plt>
  mov    -0xb8(%rbp),%rax
  movl   $0x0,(%rax)
  jmp    L383
L164:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L371
  mov    -0xa0(%rbp),%rax
  movsd  D289(%rip),%xmm0
  movsd  %xmm0,(%rax)
  movsd  D6(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  D87(%rip),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  D90(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  lea    -0x28(%rbp),%r9
  lea    -0x68(%rbp),%r8
  lea    -0x70(%rbp),%rcx
  lea    -0x70(%rbp),%rdx
  lea    -0x30(%rbp),%rsi
  lea    -0x78(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x20(%rbp),%rdi
  push   %rdi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_dstinv@plt>
  add    $0x10,%rsp
  mov    -0xb8(%rbp),%rax
  movl   $0x0,(%rax)
  lea    -0x48(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  mov    -0xa0(%rbp),%rsi
  mov    -0xb8(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
L151:
  mov    -0xb8(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L82
  lea    -0x50(%rbp),%rdi
  lea    -0x58(%rbp),%rcx
  mov    -0xb0(%rbp),%rdx
  mov    -0xa8(%rbp),%rsi
  mov    -0xa0(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_cumf@plt>
  cmpq   $0x0,-0x18(%rbp)
  je     L206
  movsd  -0x58(%rbp),%xmm0
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  jmp    L564
L206:
  nop
  movsd  -0x50(%rbp),%xmm0
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
L564:
  lea    -0x48(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  mov    -0xa0(%rbp),%rsi
  mov    -0xb8(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
  jmp    L151
L82:
  nop
  mov    -0xb8(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0xffffffff,%eax
  jne    L637
  mov    -0x40(%rbp),%rax
  test   %rax,%rax
  je     L157
  mov    -0xb8(%rbp),%rax
  movl   $0x1,(%rax)
  mov    -0xc0(%rbp),%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  jmp    L383
L157:
  nop
  mov    -0xb8(%rbp),%rax
  movl   $0x2,(%rax)
  movsd  D6(%rip),%xmm0
  mov    -0xc0(%rbp),%rax
  movsd  %xmm0,(%rax)
  jmp    L383
L371:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x3,%eax
  jne    L525
  movsd  D70(%rip),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  D6(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  D87(%rip),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  D90(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  lea    -0x28(%rbp),%r9
  lea    -0x68(%rbp),%r8
  lea    -0x70(%rbp),%rcx
  lea    -0x70(%rbp),%rdx
  lea    -0x30(%rbp),%rsi
  lea    -0x38(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x20(%rbp),%rdi
  push   %rdi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_dstinv@plt>
  add    $0x10,%rsp
  mov    -0xb8(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0xa8(%rbp),%rax
  movsd  D289(%rip),%xmm0
  movsd  %xmm0,(%rax)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  lea    -0x48(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  mov    -0xa8(%rbp),%rsi
  mov    -0xb8(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
  jmp    L492
L11:
  lea    -0x50(%rbp),%rdi
  lea    -0x58(%rbp),%rcx
  mov    -0xb0(%rbp),%rdx
  mov    -0xa8(%rbp),%rsi
  mov    -0xa0(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_cumf@plt>
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  jb     L303
  movsd  -0x58(%rbp),%xmm0
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  jmp    L610
L303:
  movsd  -0x50(%rbp),%xmm0
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
L610:
  lea    -0x48(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  mov    -0xa8(%rbp),%rsi
  mov    -0xb8(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
L492:
  mov    -0xb8(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L11
  mov    -0xb8(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0xffffffff,%eax
  jne    L383
  mov    -0x40(%rbp),%rax
  test   %rax,%rax
  je     L423
  mov    -0xb8(%rbp),%rax
  movl   $0x1,(%rax)
  mov    -0xc0(%rbp),%rax
  movsd  D70(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L383
L423:
  mov    -0xb8(%rbp),%rax
  movl   $0x2,(%rax)
  movsd  D6(%rip),%xmm0
  mov    -0xc0(%rbp),%rax
  movsd  %xmm0,(%rax)
  jmp    L383
L525:
  mov    -0x88(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x4,%eax
  jne    L383
  movsd  D70(%rip),%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  D6(%rip),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  D87(%rip),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  D90(%rip),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  lea    -0x28(%rbp),%r9
  lea    -0x68(%rbp),%r8
  lea    -0x70(%rbp),%rcx
  lea    -0x70(%rbp),%rdx
  lea    -0x30(%rbp),%rsi
  lea    -0x38(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x20(%rbp),%rdi
  push   %rdi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_dstinv@plt>
  add    $0x10,%rsp
  mov    -0xb8(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0xb0(%rbp),%rax
  movsd  D289(%rip),%xmm0
  movsd  %xmm0,(%rax)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  lea    -0x48(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  mov    -0xb0(%rbp),%rsi
  mov    -0xb8(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
  jmp    L635
L307:
  lea    -0x50(%rbp),%rdi
  lea    -0x58(%rbp),%rcx
  mov    -0xb0(%rbp),%rdx
  mov    -0xa8(%rbp),%rsi
  mov    -0xa0(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_cumf@plt>
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  jb     L196
  movsd  -0x58(%rbp),%xmm0
  mov    -0x90(%rbp),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  jmp    L192
L196:
  movsd  -0x50(%rbp),%xmm0
  mov    -0x98(%rbp),%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
L192:
  lea    -0x48(%rbp),%rdi
  lea    -0x40(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  mov    -0xb0(%rbp),%rsi
  mov    -0xb8(%rbp),%rax
  mov    %rdi,%r8
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <cdflib_dinvr@plt>
L635:
  mov    -0xb8(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L307
  mov    -0xb8(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0xffffffff,%eax
  jne    L383
  mov    -0x40(%rbp),%rax
  test   %rax,%rax
  je     L348
  mov    -0xb8(%rbp),%rax
  movl   $0x1,(%rax)
  mov    -0xc0(%rbp),%rax
  movsd  D70(%rip),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L383
L348:
  mov    -0xb8(%rbp),%rax
  movl   $0x2,(%rax)
  movsd  D6(%rip),%xmm0
  mov    -0xc0(%rbp),%rax
  movsd  %xmm0,(%rax)
  jmp    L383
L637:
  nop
L383:
  nop
L108:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L659
  call   <__stack_chk_fail@plt>
L659:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D166
type: f64
name: extract_symbolic_data
arguments: tag: D289
type: f64
name: extract_symbolic_data
arguments: tag: D70
type: f64
name: extract_symbolic_data
arguments: tag: D117
type: f64
name: extract_symbolic_data
arguments: tag: D213
type: qword
name: extract_symbolic_data
arguments: tag: D37
type: byte[4]
name: extract_symbolic_data
arguments: tag: D284
type: f64
name: extract_symbolic_data
arguments: tag: D6
type: f64
name: extract_symbolic_data
arguments: tag: D87
type: byte[8]
name: extract_symbolic_data
arguments: tag: D90
type: byte[8]

tool: D166: 0.5

tool: D289: 5

tool: D70: 1

tool: D117: 4

tool: D213: 9223372036854775807

tool: {"D37": [0x01,0x00,0x00,0x00]}

tool: D284: 3

tool: D6: 1e+300

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

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