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

```asm
<f_ha_prime>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  movsd  %xmm0,-0x8(%rbp)
  movsd  %xmm1,-0x10(%rbp)
  mov    %edi,-0x14(%rbp)
  mov    -0x8(%rbp),%rax
  movq   %rax,%xmm0
  call   <fabs@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0x10(%rbp),%xmm1
  movsd  D40(%rip),%xmm3
  movapd %xmm1,%xmm2
  subsd  %xmm3,%xmm2
  movsd  D40(%rip),%xmm1
  divsd  %xmm2,%xmm1
  comisd %xmm1,%xmm0
  jbe    L17
  pxor   %xmm0,%xmm0
  jmp    L77
L17:
  cmpl   $0x1,-0x14(%rbp)
  jne    L13
  movsd  -0x8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L64
  movsd  -0x10(%rbp),%xmm0
  movq   D18(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x10(%rbp),%xmm1
  movsd  D109(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x20(%rbp)
  movsd  -0x10(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movsd  D40(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movsd  -0x10(%rbp),%xmm0
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <f_ha@plt>
  mulsd  -0x20(%rbp),%xmm0
  jmp    L77
L64:
  movsd  -0x10(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D109(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x20(%rbp)
  movsd  -0x10(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  movsd  D40(%rip),%xmm0
  movapd %xmm1,%xmm4
  addsd  %xmm0,%xmm4
  movq   %xmm4,%rax
  movsd  -0x10(%rbp),%xmm0
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <f_ha@plt>
  mulsd  -0x20(%rbp),%xmm0
  jmp    L77
L13:
  movsd  -0x8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jbe    L57
  movsd  -0x10(%rbp),%xmm0
  movq   D18(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x10(%rbp),%xmm1
  movsd  D109(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x20(%rbp)
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  movsd  -0x10(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movsd  D40(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movq   %xmm0,%rax
  movsd  -0x10(%rbp),%xmm0
  mov    %edx,%edi
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <f_ha_prime>
  mulsd  -0x20(%rbp),%xmm0
  jmp    L77
L57:
  movsd  -0x10(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  D109(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x20(%rbp)
  mov    -0x14(%rbp),%eax
  lea    -0x1(%rax),%edx
  movsd  -0x10(%rbp),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  movsd  D40(%rip),%xmm0
  movapd %xmm1,%xmm5
  addsd  %xmm0,%xmm5
  movq   %xmm5,%rax
  movsd  -0x10(%rbp),%xmm0
  mov    %edx,%edi
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  call   <f_ha_prime>
  mulsd  -0x20(%rbp),%xmm0
L77:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D40
type_infered: f64
name: read_data
arguments: data_label: D18
type_infered: f32[2]
name: read_data
arguments: data_label: D109
type_infered: f64

tool: D40: 1

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

tool: D109: 0.5

assistant: ```c
double f_ha_prime(double x, double a, int k) {
  if (fabs(x) > 1. / (a - 1.))
    return 0.;
  if (k == 1) {
    if (x > 0.)
      return -a * a * 0.5 * f_ha(a * x - 1., a);
    else
      return a * a * 0.5 * f_ha(a * x + 1., a);
  } else {
    if (x > 0.)
      return -a * a * 0.5 * f_ha_prime(a * x - 1., a, k - 1);
    else
      return a * a * 0.5 * f_ha_prime(a * x + 1., a, k - 1);
  }
}
```