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

```asm
<ks_prob>:
  endbr64
  push   %r15
  push   %r14
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,%ebx
  movq   %xmm0,%r14
  movq   %xmm1,%r15
  mov    %rsi,%r12
  mov    %rdx,%rbp
  test   %edi,%edi
  jle    L117
L116:
  pxor   %xmm5,%xmm5
  cvtsi2sd %ebx,%xmm5
  movsd  %xmm5,(%rsp)
  pxor   %xmm0,%xmm0
  movsd  D123(%rip),%xmm1
  movq   %r14,%xmm3
  comisd %xmm3,%xmm1
  ja     L84
  movsd  D142(%rip),%xmm0
  comisd D15(%rip),%xmm3
  jbe    L10
L84:
  movsd  %xmm0,(%r12)
  pxor   %xmm1,%xmm1
  movsd  D123(%rip),%xmm0
  movq   %r15,%xmm4
  comisd %xmm4,%xmm0
  ja     L12
  movsd  D142(%rip),%xmm1
  comisd D15(%rip),%xmm4
  jbe    L6
L12:
  movsd  %xmm1,0x0(%rbp)
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r14
  pop    %r15
  ret
L117:
  lea    D152(%rip),%rdi
  call   <printf@plt>
  lea    D84(%rip),%rdi
  call   <printf@plt>
  mov    $0x0,%edi
  call   <exit@plt>
  jmp    L116
L10:
  movq   %r14,%xmm0
  movq   %r14,%xmm6
  mulsd  D109(%rip),%xmm6
  movsd  %xmm6,0x8(%rsp)
  mulsd  %xmm6,%xmm0
  call   <exp@plt>
  movq   %xmm0,%r14
  movsd  0x8(%rsp),%xmm6
  xorpd  D74(%rip),%xmm6
  movq   %xmm6,%rbx
  pxor   %xmm0,%xmm0
  movsd  (%rsp),%xmm2
  ucomisd %xmm2,%xmm0
  ja     L19
  sqrtsd %xmm2,%xmm2
  movapd %xmm2,%xmm0
L67:
  mulsd  D42(%rip),%xmm0
  movq   %rbx,%xmm2
  divsd  %xmm0,%xmm2
  movsd  D142(%rip),%xmm0
  movapd %xmm0,%xmm1
  subsd  %xmm2,%xmm1
  movq   %r14,%xmm7
  mulsd  %xmm7,%xmm1
  subsd  %xmm1,%xmm0
  jmp    L84
L19:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  jmp    L67
L6:
  movq   %r15,%xmm0
  movq   %r15,%xmm7
  mulsd  D109(%rip),%xmm7
  movsd  %xmm7,0x8(%rsp)
  mulsd  %xmm7,%xmm0
  call   <exp@plt>
  movq   %xmm0,%r12
  movsd  0x8(%rsp),%xmm7
  xorpd  D74(%rip),%xmm7
  movq   %xmm7,%rbx
  pxor   %xmm0,%xmm0
  movsd  (%rsp),%xmm6
  ucomisd %xmm6,%xmm0
  ja     L119
  sqrtsd %xmm6,%xmm6
  movapd %xmm6,%xmm0
L102:
  mulsd  D42(%rip),%xmm0
  movq   %rbx,%xmm2
  divsd  %xmm0,%xmm2
  movsd  D142(%rip),%xmm1
  movapd %xmm1,%xmm0
  subsd  %xmm2,%xmm0
  movq   %r12,%xmm7
  mulsd  %xmm7,%xmm0
  subsd  %xmm0,%xmm1
  jmp    L12
L119:
  movsd  (%rsp),%xmm0
  call   <sqrt@plt>
  jmp    L102
```

tool_calls: name: read_data
arguments: tag: D123
type: byte[8]
name: read_data
arguments: tag: D142
type: f64
name: read_data
arguments: tag: D15
type: f64[2]
name: read_data
arguments: tag: D152
type: string
name: read_data
arguments: tag: D84
type: string
name: read_data
arguments: tag: D109
type: f32[2]
name: read_data
arguments: tag: D74
type: f32[4]
name: read_data
arguments: tag: D42
type: f64

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

tool: D142: 1

tool: {"D15": [3.5,-2.0]}

tool: D152: Error in ks_prob: argument out of range


tool: D84: Program aborted



tool: {"D109": [0.0,-2.0]}

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

tool: D42: 3

assistant: ```c
void ks_prob(int n, double kp, double km, double *pp, double *pm) {
  double xn;
  if (n <= 0) {
    printf("Error in ks_prob: argument out of range\n");
    printf("Program aborted\n\n");
    exit(0);
  }
  xn = (double)n;
  if (kp < 1e-8)
    *pp = 0.0;
  else if (kp > 3.5)
    *pp = 1.0;
  else
    *pp = 1.0 - exp(-2.0 * kp * kp) * (1.0 - 2.0 * kp / (3.0 * sqrt(xn)));
  if (km < 1e-8)
    *pm = 0.0;
  else if (km > 3.5)
    *pm = 1.0;
  else
    *pm = 1.0 - exp(-2.0 * km * km) * (1.0 - 2.0 * km / (3.0 * sqrt(xn)));
}
```