user: What is the c source code of the assembly code below?

```asm
<ks_test>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %rcx,0x18(%rsp)
  test   %edi,%edi
  jle    L135
  lea    0x1(%rdi),%r12d
  mov    %edi,%ebx
  movslq %r12d,%r15
  lea    0x0(,%r15,4),%rdi
  shl    $0x3,%r15
  call   <malloc@plt>
  mov    %r15,%rdi
  mov    %rax,%r13
  call   <malloc@plt>
  mov    %r15,%rdi
  mov    %rax,%r14
  call   <malloc@plt>
  pxor   %xmm1,%xmm1
  test   %r13,%r13
  cvtsi2sd %ebx,%xmm1
  setne  %dl
  test   %r14,%r14
  mov    %rax,%r15
  setne  %al
  movsd  %xmm1,0x28(%rsp)
  test   %al,%dl
  je     L1
  test   %r15,%r15
  je     L1
  movslq %ebx,%rbp
  xor    %esi,%esi
  mov    %r13,%rdi
  lea    0x1(%rbp),%r9
  lea    0x0(,%r9,4),%rdx
  mov    %r9,0x20(%rsp)
  call   <memset@plt>
  mov    %r12d,%edx
  mov    0x20(%rsp),%r9
  mov    %r14,%rax
  movsd  0x28(%rsp),%xmm1
  shr    %edx
  shl    $0x4,%rdx
  movapd %xmm1,%xmm0
  add    %r14,%rdx
  unpcklpd %xmm0,%xmm0
  nopw   0x0(%rax,%rax,1)
L37:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L37
  mov    %r12d,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%r12d
  je     L28
  cltq
  movsd  %xmm1,(%r14,%rax,8)
L28:
  xor    %esi,%esi
  mov    %r15,%rdi
  lea    0x0(,%r9,8),%rdx
  movsd  %xmm1,0x20(%rsp)
  call   <memset@plt>
  mov    0x8(%rsp),%r12
  lea    -0x1(%rbx),%eax
  pxor   %xmm3,%xmm3
  movsd  0x20(%rsp),%xmm1
  lea    0x8(%r12,%rax,8),%rsi
  nop
L55:
  movsd  (%r12),%xmm0
  mulsd  %xmm1,%xmm0
  comisd %xmm0,%xmm3
  ja     L135
  comisd %xmm1,%xmm0
  ja     L135
  cvttsd2si %xmm0,%eax
  cltq
  addl   $0x1,0x0(%r13,%rax,4)
  shl    $0x3,%rax
  lea    (%r14,%rax,1),%rdx
  movsd  (%rdx),%xmm2
  comisd %xmm0,%xmm2
  jbe    L49
  movsd  %xmm0,(%rdx)
L49:
  add    %r15,%rax
  comisd (%rax),%xmm0
  jbe    L16
  movsd  %xmm0,(%rax)
L16:
  add    $0x8,%r12
  cmp    %rsi,%r12
  jne    L55
  movapd %xmm3,%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm3,%xmm0
  xor    %eax,%eax
  jmp    L14
  cs nopw 0x0(%rax,%rax,1)
L67:
  mov    %rdx,%rax
L14:
  mov    0x0(%r13,%rax,4),%edx
  test   %edx,%edx
  jle    L136
  movsd  (%r14,%rax,8),%xmm2
  subsd  %xmm0,%xmm2
  maxsd  %xmm5,%xmm2
  movapd %xmm2,%xmm5
  pxor   %xmm2,%xmm2
  cvtsi2sd %edx,%xmm2
  addsd  %xmm2,%xmm0
  movapd %xmm0,%xmm2
  subsd  (%r15,%rax,8),%xmm2
  maxsd  %xmm4,%xmm2
  movapd %xmm2,%xmm4
L136:
  lea    0x1(%rax),%rdx
  cmp    %rbp,%rax
  jne    L67
  ucomisd %xmm1,%xmm3
  ja     L18
  sqrtsd %xmm1,%xmm1
  mov    0x10(%rsp),%rax
  divsd  %xmm1,%xmm4
  movsd  %xmm4,(%rax)
L156:
  divsd  %xmm1,%xmm5
  mov    0x18(%rsp),%rax
  mov    %r13,%rdi
  movsd  %xmm5,(%rax)
  call   <free@plt>
  mov    %r14,%rdi
  call   <free@plt>
  add    $0x38,%rsp
  mov    %r15,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10a0 <free@plt>
  nop
L135:
  lea    D19(%rip),%rdi
L82:
  call   <puts@plt>
  lea    D26(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
L1:
  lea    D3(%rip),%rdi
  jmp    L82
L18:
  movapd %xmm1,%xmm0
  movsd  %xmm5,0x28(%rsp)
  movsd  %xmm4,0x20(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  0x8(%rsp),%xmm1
  mov    0x10(%rsp),%rax
  divsd  %xmm0,%xmm4
  movapd %xmm1,%xmm0
  movsd  %xmm4,(%rax)
  call   <sqrt@plt>
  movsd  0x28(%rsp),%xmm5
  movapd %xmm0,%xmm1
  jmp    L156
```

tool_calls: name: parse_data
arguments: data_label: D19
data_type: string
name: parse_data
arguments: data_label: D26
data_type: string
name: parse_data
arguments: data_label: D3
data_type: string

tool: D19: Error in ks_test: argument out of range

tool: D26: Program aborted


tool: D3: Error in ks_test: could not allocate auxiliary arrays

assistant: ```c
void ks_test(int n, double f[], double *pkp, double *pkm) {
  int *pn, k, i;
  double *pu, *pv, xn, sn, x, kp, km;
  if (n <= 0) {
    printf("Error in ks_test: argument out of range\n");
    printf("Program aborted\n\n");
    exit(0);
  }
  pn = malloc((n + 1) * sizeof(int));
  pu = malloc((n + 1) * sizeof(double));
  pv = malloc((n + 1) * sizeof(double));
  xn = (double)n;
  if (pn && pu && pv) {
    for (k = 0; k <= n; k++) {
      pn[k] = 0;
      pu[k] = xn;
      pv[k] = 0.0;
    }
  } else {
    printf("Error in ks_test: could not allocate auxiliary arrays\n");
    printf("Program aborted\n\n");
    exit(0);
  }
  for (i = 0; i < n; i++) {
    x = xn * f[i];
    if ((x < 0) || (x > xn)) {
      printf("Error in ks_test: argument out of range\n");
      printf("Program aborted\n\n");
      exit(0);
    }
    k = (int)x;
    pn[k] += 1;
    if (x < pu[k])
      pu[k] = x;
    if (x > pv[k])
      pv[k] = x;
  }
  sn = 0.0;
  kp = 0.0;
  km = 0.0;
  for (k = 0; k <= n; k++) {
    if (pn[k] > 0) {
      x = pu[k] - sn;
      if (x > km)
        km = x;
      sn += (double)pn[k];
      x = sn - pv[k];
      if (x > kp)
        kp = x;
    }
  }
  *pkp = kp / sqrt(xn);
  *pkm = km / sqrt(xn);
  free(pn);
  free(pu);
  free(pv);
}
```