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

```asm
<Pomeranz>:
  endbr64
  pxor   %xmm8,%xmm8
  push   %r15
  mov    $0x8,%esi
  mov    %edi,%r15d
  cvtsi2sd %edi,%xmm8
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  lea    (%rdi,%rdi,1),%ebp
  mulsd  %xmm8,%xmm0
  push   %rbx
  lea    0x3(%rbp),%r12d
  movslq %r12d,%r12
  sub    $0xa8,%rsp
  mov    %edi,0x88(%rsp)
  mov    %r12,%rdi
  movsd  %xmm8,0x8(%rsp)
  movsd  %xmm0,(%rsp)
  call   <calloc@plt>
  mov    %r12,%rdi
  mov    $0x8,%esi
  mov    %rax,%r13
  mov    %rax,0x80(%rsp)
  call   <calloc@plt>
  mov    %r12,%rdi
  mov    $0x8,%esi
  lea    0x2(%r15),%r12d
  mov    %rax,0x90(%rsp)
  call   <calloc@plt>
  mov    %r12d,%esi
  mov    $0x2,%edi
  mov    %rax,0x98(%rsp)
  call   <CreateMatrixD@plt>
  mov    %r12d,%esi
  mov    $0x4,%edi
  mov    %r13,%r12
  mov    %rax,0x58(%rsp)
  mov    %rax,%rbx
  call   <CreateMatrixD@plt>
  movsd  (%rsp),%xmm0
  mov    %r13,%rsi
  mov    %r15d,%edi
  mov    0x98(%rsp),%rcx
  mov    0x90(%rsp),%rdx
  lea    0x1(%r15),%r13d
  mov    %rax,%r14
  mov    %rax,0x60(%rsp)
  call   <CalcFloorCeil@plt>
  test   %r13d,%r13d
  mov    %r13d,0x6c(%rsp)
  movsd  0x8(%rsp),%xmm8
  jle    L293
  mov    %r15d,%eax
  xor    %esi,%esi
  lea    0x8(,%rax,8),%rdx
  mov    (%rbx),%rax
  lea    0x8(%rax),%rdi
  mov    %rax,(%rsp)
  call   <memset@plt>
  mov    0x18(%r14),%rdi
  mov    (%r14),%rax
  cmp    $0x1,%r13d
  mov    0x8(%rbx),%rbx
  movsd  0x8(%rsp),%xmm8
  mov    %rdi,0x70(%rsp)
  mov    0x10(%r14),%rdi
  mov    %rax,0x40(%rsp)
  mov    %rdi,0x50(%rsp)
  mov    0x8(%r14),%rdi
  mov    %rdi,0x48(%rsp)
  jle    L20
  lea    -0x1(%r15),%eax
  lea    0x10(%rbx),%rdi
  xor    %esi,%esi
  movsd  %xmm8,(%rsp)
  lea    0x8(,%rax,8),%rdx
  call   <memset@plt>
  mov    0x40(%rsp),%rax
  movsd  D61(%rip),%xmm7
  movsd  D88(%rip),%xmm10
  movsd  (%rsp),%xmm8
  movsd  %xmm7,0x8(%rbx)
  mov    %rax,%rcx
  movsd  %xmm10,(%rax)
  movsd  0x10(%r12),%xmm2
  addsd  %xmm2,%xmm2
  divsd  %xmm8,%xmm2
L174:
  movsd  (%rcx),%xmm0
  mov    0x88(%rsp),%esi
  mov    $0x1,%eax
  nopl   0x0(%rax,%rax,1)
L281:
  mulsd  %xmm2,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  lea    -0x1(%rax),%edx
  cmp    %edx,%esi
  jge    L281
  mov    0x80(%rsp),%rax
  mov    0x48(%rsp),%rcx
  movapd %xmm10,%xmm2
  mov    0x88(%rsp),%esi
  movsd  %xmm10,(%rcx)
  movsd  0x10(%rax),%xmm0
  mov    $0x1,%eax
  addsd  %xmm0,%xmm0
  subsd  %xmm0,%xmm2
  movapd %xmm10,%xmm0
  divsd  %xmm8,%xmm2
  nopw   0x0(%rax,%rax,1)
L169:
  mulsd  %xmm2,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  lea    -0x1(%rax),%edx
  cmp    %edx,%esi
  jge    L169
  mov    0x80(%rsp),%rax
  mov    0x50(%rsp),%rcx
  movapd %xmm10,%xmm0
  mov    0x88(%rsp),%esi
  movsd  %xmm10,(%rcx)
  movsd  0x10(%rax),%xmm2
  mov    $0x1,%eax
  divsd  %xmm8,%xmm2
  nopl   (%rax)
L284:
  mulsd  %xmm2,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  lea    -0x1(%rax),%edx
  cmp    %edx,%esi
  jge    L284
  mov    0x88(%rsp),%ebx
  xor    %edx,%edx
  mov    0x70(%rsp),%rax
  movsd  %xmm7,0x10(%rsp)
  movsd  %xmm8,0x8(%rsp)
  test   %ebx,%ebx
  movsd  %xmm10,(%rax)
  lea    0x8(%rax),%rdi
  cmovns %ebx,%edx
  xor    %esi,%esi
  movsd  %xmm10,(%rsp)
  add    $0x1,%edx
  movslq %edx,%rdx
  shl    $0x3,%rdx
  call   <memset@plt>
  lea    0x2(%rbp),%eax
  movsd  (%rsp),%xmm10
  movsd  0x8(%rsp),%xmm8
  movsd  0x10(%rsp),%xmm7
  cmp    $0x1,%eax
  jle    L199
L254:
  mov    0x90(%rsp),%rbx
  pxor   %xmm4,%xmm4
  movl   $0x1,0x18(%rsp)
  movl   $0x0,0x24(%rsp)
  movq   D42(%rip),%xmm6
  lea    0x10(%rbx),%rax
  movl   $0x1,0x8c(%rsp)
  movsd  D2(%rip),%xmm5
  movsd  D40(%rip),%xmm11
  mov    %rax,0x10(%rsp)
  mov    0x98(%rsp),%rax
  movapd D61(%rip),%xmm9
  add    $0x10,%rax
  mov    %rax,0x30(%rsp)
  mov    0x80(%rsp),%rax
  add    $0x10,%rax
  mov    %rax,0x38(%rsp)
  mov    %ebp,%eax
  lea    0x18(%rbx,%rax,8),%rax
  mov    %rax,0x78(%rsp)
  nop
L253:
  mov    0x10(%rsp),%rbx
  mov    0x6c(%rsp),%esi
  cvttsd2si (%rbx),%eax
  cvttsd2si -0x8(%rbx),%ebp
  lea    0x2(%rax),%edi
  mov    $0x1,%eax
  test   %edi,%edi
  cmovg  %edi,%eax
  mov    0x30(%rsp),%rdi
  mov    %eax,0x68(%rsp)
  cvttsd2si (%rdi),%eax
  cvttsd2si -0x8(%rdi),%r12d
  cmp    %esi,%eax
  cmovg  %esi,%eax
  add    $0x2,%ebp
  test   %ebp,%ebp
  mov    %eax,%r15d
  mov    $0x1,%eax
  cmovle %eax,%ebp
  mov    0x38(%rsp),%rax
  movsd  (%rax),%xmm0
  subsd  -0x8(%rax),%xmm0
  mov    0x40(%rsp),%rax
  divsd  %xmm8,%xmm0
  movapd %xmm0,%xmm1
  subsd  0x8(%rax),%xmm1
  andpd  %xmm6,%xmm1
  comisd %xmm1,%xmm5
  jae    L146
  mov    0x48(%rsp),%rax
  movapd %xmm0,%xmm1
  subsd  0x8(%rax),%xmm1
  andpd  %xmm6,%xmm1
  comisd %xmm1,%xmm5
  jae    L128
  mov    0x50(%rsp),%rax
  movapd %xmm0,%xmm1
  subsd  0x8(%rax),%xmm1
  andpd  %xmm6,%xmm1
  comisd %xmm1,%xmm5
  jae    L186
  mov    0x70(%rsp),%rax
  subsd  0x8(%rax),%xmm0
  andpd  %xmm6,%xmm0
  comisd %xmm0,%xmm5
  sbb    %r13,%r13
  and    $0xffffffffffffffe0,%r13
  add    $0x18,%r13
L323:
  mov    0x68(%rsp),%edi
  xorl   $0x1,0x24(%rsp)
  xorl   $0x1,0x18(%rsp)
  movslq 0x24(%rsp),%rax
  mov    0x18(%rsp),%ebx
  cmp    %edi,%r15d
  jl     L132
  mov    0x58(%rsp),%rsi
  add    0x60(%rsp),%r13
  movapd %xmm7,%xmm3
  lea    (%rsi,%rax,8),%rax
  mov    %rax,(%rsp)
  movslq %ebx,%rax
  mov    (%rsi,%rax,8),%r14
  movslq %edi,%rax
  mov    %rax,0x28(%rsp)
  mov    %rax,%r11
  mov    $0x1,%eax
  sub    %ebp,%eax
  mov    %eax,0x8(%rsp)
  xchg   %ax,%ax
L242:
  mov    %r11d,%eax
  cmp    %r11d,%r12d
  mov    %r11d,%edx
  cmovle %r12d,%eax
  cmp    %ebp,%eax
  jl     L149
  mov    (%rsp),%rbx
  mov    0x0(%r13),%r10
  mov    (%rbx),%r9
  mov    0x8(%rsp),%ebx
  add    %eax,%ebx
  cmp    %ebp,%eax
  je     L321
  movslq %eax,%rcx
  mov    %r11,%rsi
  movapd %xmm4,%xmm0
  sub    %rcx,%rsi
  lea    (%r10,%rsi,8),%rdi
  lea    -0x8(%r9,%rcx,8),%rsi
  mov    %ebx,%ecx
  shr    %ecx
  lea    -0x1(%rcx),%r8d
  lea    0x10(%rdi),%rcx
  shl    $0x4,%r8
  add    %rcx,%r8
  jmp    L103
  nopl   0x0(%rax)
L35:
  add    $0x10,%rcx
L103:
  movupd (%rdi),%xmm2
  movupd (%rsi),%xmm1
  mov    %rcx,%rdi
  sub    $0x10,%rsi
  shufpd $0x1,%xmm1,%xmm1
  mulpd  %xmm1,%xmm2
  addsd  %xmm2,%xmm0
  unpckhpd %xmm2,%xmm2
  addsd  %xmm2,%xmm0
  cmp    %r8,%rcx
  jne    L35
  mov    %ebx,%ecx
  and    $0xfffffffe,%ecx
  sub    %ecx,%eax
  cmp    %ebx,%ecx
  je     L245
L152:
  sub    %eax,%edx
  cltq
  movslq %edx,%rdx
  movsd  (%r10,%rdx,8),%xmm1
  mulsd  (%r9,%rax,8),%xmm1
  addsd  %xmm1,%xmm0
L245:
  movsd  %xmm0,(%r14,%r11,8)
  minsd  %xmm3,%xmm0
  add    $0x1,%r11
  movapd %xmm0,%xmm3
  cmp    %r11d,%r15d
  jge    L242
  comisd %xmm0,%xmm11
  ja     L262
L132:
  addq   $0x8,0x10(%rsp)
  mov    0x10(%rsp),%rax
  addq   $0x8,0x30(%rsp)
  addq   $0x8,0x38(%rsp)
  cmp    %rax,0x78(%rsp)
  jne    L253
  imul   $0x15e,0x8c(%rsp),%ebx
  movslq 0x18(%rsp),%rax
  shl    $0x3,%rax
L191:
  mov    0x58(%rsp),%r15
  movslq 0x88(%rsp),%rdx
  movsd  %xmm4,0x18(%rsp)
  mov    0x80(%rsp),%rdi
  movsd  %xmm10,0x10(%rsp)
  mov    (%r15,%rax,1),%rax
  mov    %rdx,%r14
  movsd  0x8(%rax,%rdx,8),%xmm1
  movsd  %xmm1,0x8(%rsp)
  call   <free@plt>
  mov    0x90(%rsp),%rdi
  call   <free@plt>
  mov    0x98(%rsp),%rdi
  call   <free@plt>
  mov    0x60(%rsp),%rdi
  call   <DeleteMatrixD@plt>
  mov    %r15,%rdi
  call   <DeleteMatrixD@plt>
  mov    %r14d,%edi
  call   <getLogFactorial@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  movsd  0x8(%rsp),%xmm1
  cvtsi2sd %ebx,%xmm0
  mulsd  D26(%rip),%xmm0
  cvtsi2sd %eax,%xmm2
  subsd  %xmm0,%xmm2
  movapd %xmm1,%xmm0
  movsd  %xmm2,(%rsp)
  call   <log@plt>
  pxor   %xmm0,%xmm0
  movsd  0x18(%rsp),%xmm4
  movsd  0x10(%rsp),%xmm10
  cvtsi2sd %eax,%xmm0
  addsd  (%rsp),%xmm0
  comisd %xmm4,%xmm0
  jb     L291
  add    $0xa8,%rsp
  movapd %xmm10,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L149:
  movapd %xmm4,%xmm0
  jmp    L245
L321:
  mov    %ebp,%eax
  movapd %xmm4,%xmm0
  jmp    L152
L262:
  mov    0x68(%rsp),%ebx
  lea    0x1(%r15),%eax
  sub    %ebx,%eax
  mov    %eax,%esi
  cmp    %ebx,%r15d
  je     L164
  mov    0x28(%rsp),%rax
  lea    (%r14,%rax,8),%rdx
  mov    %esi,%eax
  shr    %eax
  lea    -0x1(%rax),%ecx
  lea    0x10(%rdx),%rax
  shl    $0x4,%rcx
  add    %rax,%rcx
  jmp    L273
  nopw   0x0(%rax,%rax,1)
L286:
  add    $0x10,%rax
L273:
  movupd (%rdx),%xmm0
  mulpd  %xmm9,%xmm0
  movups %xmm0,(%rdx)
  mov    %rax,%rdx
  cmp    %rax,%rcx
  jne    L286
  mov    %esi,%eax
  and    $0xfffffffe,%eax
  add    %eax,0x68(%rsp)
  mov    0x68(%rsp),%ebx
  cmp    %eax,%esi
  je     L171
  movslq %ebx,%rax
  mov    %rax,0x28(%rsp)
L164:
  mov    0x28(%rsp),%rax
  lea    (%r14,%rax,8),%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm7,%xmm0
  movsd  %xmm0,(%rax)
L171:
  addl   $0x1,0x8c(%rsp)
  jmp    L132
L146:
  xor    %r13d,%r13d
  jmp    L323
L291:
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1140 <exp@plt>
L186:
  mov    $0x10,%r13d
  jmp    L323
L128:
  mov    $0x8,%r13d
  jmp    L323
L293:
  mov    0x58(%rsp),%rax
  mov    0x8(%rax),%rbx
  mov    0x60(%rsp),%rax
  mov    (%rax),%rdi
  mov    %rdi,0x40(%rsp)
  mov    0x18(%rax),%rdi
  mov    %rdi,0x70(%rsp)
  mov    0x10(%rax),%rdi
  mov    0x8(%rax),%rax
  mov    %rdi,0x50(%rsp)
  mov    %rax,0x48(%rsp)
L20:
  mov    0x40(%rsp),%rax
  movsd  D61(%rip),%xmm7
  movsd  D88(%rip),%xmm10
  cmpl   $0x1,0x6c(%rsp)
  movsd  %xmm7,0x8(%rbx)
  movsd  %xmm10,(%rax)
  mov    0x80(%rsp),%rax
  movsd  0x10(%rax),%xmm2
  je     L82
  mov    0x48(%rsp),%rax
  movsd  %xmm10,(%rax)
  mov    0x50(%rsp),%rax
  movsd  %xmm10,(%rax)
  mov    0x70(%rsp),%rax
  movsd  %xmm10,(%rax)
  lea    0x2(%rbp),%eax
  cmp    $0x1,%eax
  jg     L254
L199:
  mov    $0x15e,%ebx
  mov    $0x8,%eax
  pxor   %xmm4,%xmm4
  jmp    L191
L82:
  addsd  %xmm2,%xmm2
  mov    0x40(%rsp),%rcx
  divsd  %xmm8,%xmm2
  jmp    L174
```

tool_calls: name: parse_data
arguments: data_tag: D61
data_type: f32[4]
name: parse_data
arguments: data_tag: D88
data_type: f64
name: parse_data
arguments: data_tag: D42
data_type: qword
name: parse_data
arguments: data_tag: D2
data_type: byte[8]
name: parse_data
arguments: data_tag: D40
data_type: byte[8]
name: parse_data
arguments: data_tag: D26
data_type: f64

tool: {"D61": [0.0,28587302322176.0,0.0,28587302322176.0]}

tool: D88: 1

tool: D42: 9223372036854775807

tool: {"D2": [0x16,0x56,0xe7,0x9e,0xaf,0x03,0xd2,0x3c]}

tool: {"D40": [0x84,0xeb,0x91,0xa4,0x15,0x0b,0xcd,0x05]}

tool: D26: 0.6931471805599453

assistant: ```c
double Pomeranz(int n, double x) {
  const double EPS = 1.0e-15;
  const int ENO = 350;
  const double RENO = ldexp(1.0, ENO);
  int coreno;
  const double t = n * x;
  double w, sum, minsum;
  int i, j, k, s;
  int r1, r2;
  int jlow, jup, klow, kup, kup0;
  double *A;
  double *Atflo;
  double *Atcei;
  double **V;
  double **H;
  A = (double *)calloc((size_t)(2 * n + 3), sizeof(double));
  Atflo = (double *)calloc((size_t)(2 * n + 3), sizeof(double));
  Atcei = (double *)calloc((size_t)(2 * n + 3), sizeof(double));
  V = (double **)CreateMatrixD(2, n + 2);
  H = (double **)CreateMatrixD(4, n + 2);
  CalcFloorCeil(n, t, A, Atflo, Atcei);
  for (j = 1; j <= n + 1; j++)
    V[0][j] = 0;
  for (j = 2; j <= n + 1; j++)
    V[1][j] = 0;
  V[1][1] = RENO;
  coreno = 1;
  H[0][0] = 1;
  w = 2.0 * A[2] / n;
  for (j = 1; j <= n + 1; j++)
    H[0][j] = w * H[0][j - 1] / j;
  H[1][0] = 1;
  w = (1.0 - 2.0 * A[2]) / n;
  for (j = 1; j <= n + 1; j++)
    H[1][j] = w * H[1][j - 1] / j;
  H[2][0] = 1;
  w = A[2] / n;
  for (j = 1; j <= n + 1; j++)
    H[2][j] = w * H[2][j - 1] / j;
  H[3][0] = 1;
  for (j = 1; j <= n + 1; j++)
    H[3][j] = 0;
  r1 = 0;
  r2 = 1;
  for (i = 2; i <= 2 * n + 2; i++) {
    jlow = 2 + (int)Atflo[i];
    if (jlow < 1)
      jlow = 1;
    jup = (int)Atcei[i];
    if (jup > n + 1)
      jup = n + 1;
    klow = 2 + (int)Atflo[i - 1];
    if (klow < 1)
      klow = 1;
    kup0 = (int)Atcei[i - 1];
    w = (A[i] - A[i - 1]) / n;
    s = -1;
    for (j = 0; j < 4; j++) {
      if (fabs(w - H[j][1]) <= EPS) {
        s = j;
        break;
      }
    }
    minsum = RENO;
    r1 = (r1 + 1) & 1;
    r2 = (r2 + 1) & 1;
    for (j = jlow; j <= jup; j++) {
      kup = kup0;
      if (kup > j)
        kup = j;
      sum = 0;
      for (k = kup; k >= klow; k--)
        sum += V[r1][k] * H[s][j - k];
      V[r2][j] = sum;
      if (sum < minsum)
        minsum = sum;
    }
    if (minsum < 1.0e-280) {
      for (j = jlow; j <= jup; j++)
        V[r2][j] *= RENO;
      coreno++;
    }
  }
  sum = V[r2][n + 1];
  free(A);
  free(Atflo);
  free(Atcei);
  DeleteMatrixD(H);
  DeleteMatrixD(V);
  w = getLogFactorial(n) - coreno * ENO * 0.69314718055994530941 + log(sum);
  if (w >= 0.)
    return 1.;
  return exp(w);
}
```