user: Translate the below assembly code into C programming language:

```asm
<sympoly>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x28,%rsp
  mov    D28(%rip),%rax
  movq   $0x0,(%r8)
  mov    %rax,(%rcx)
  test   %edi,%edi
  jle    L89
  movslq %edi,%r13
  mov    %edi,0x8(%rsp)
  mov    %esi,%r15d
  lea    0x8(%rcx),%rdi
  xor    %esi,%esi
  add    $0x1,%r15d
  lea    0x0(,%r13,8),%rdx
  mov    $0x1,%r14d
  call   <memset@plt>
  mov    0x8(%rsp),%r9d
  mov    $0x2,%eax
  movsd  0x0(%rbp),%xmm0
  cmp    %r9d,%r15d
  movsd  %xmm0,0x8(%rbx)
  cmovg  %r9d,%r15d
  cmp    %eax,%r15d
  cmovl  %eax,%r15d
  mov    D28(%rip),%rax
  movq   %rax,%xmm3
  cmp    $0x1,%r9d
  je     L108
  nop
L50:
  movsd  0x0(%rbp,%r14,8),%xmm2
  movapd %xmm3,%xmm1
  comisd D28(%rip),%xmm2
  mov    $0x2,%eax
  ja     L87
  nopw   0x0(%rax,%rax,1)
L74:
  movapd %xmm1,%xmm0
  movsd  -0x8(%rbx,%rax,8),%xmm1
  movslq %eax,%rdx
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %r14d,%edx
  jg     L11
  cmp    %r15d,%edx
  jl     L74
L11:
  mulsd  %xmm1,%xmm2
  movsd  %xmm2,(%rbx,%rdx,8)
L101:
  add    $0x1,%r14
  cmp    %r14,%r13
  jne    L50
L108:
  movsd  (%r12),%xmm0
  movsd  D0(%rip),%xmm1
  comisd %xmm0,%xmm1
  ja     L25
L53:
  add    $0x28,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L87:
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm0
  movsd  %xmm3,0x18(%rsp)
  divsd  %xmm2,%xmm4
  movsd  %xmm2,0x8(%rsp)
  movsd  %xmm4,0x10(%rsp)
  call   <log@plt>
  pxor   %xmm0,%xmm0
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm4
  cvtsi2sd %rax,%xmm0
  addsd  (%r12),%xmm0
  movsd  0x8(%rsp),%xmm2
  mov    $0x2,%eax
  movsd  %xmm0,(%r12)
  nopw   0x0(%rax,%rax,1)
L71:
  movapd %xmm3,%xmm1
  movsd  -0x8(%rbx,%rax,8),%xmm3
  movslq %eax,%rdx
  movapd %xmm3,%xmm0
  divsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbx,%rax,8)
  add    $0x1,%rax
  cmp    %r14d,%edx
  jg     L32
  cmp    %edx,%r15d
  jg     L71
L32:
  movsd  %xmm3,(%rbx,%rdx,8)
  movapd %xmm4,%xmm3
  jmp    L101
L25:
  call   <exp@plt>
  lea    -0x1(%r15),%edx
  lea    0x8(%rbx),%rax
  lea    0x10(%rbx,%rdx,8),%rdx
  nopl   (%rax)
L132:
  movsd  (%rax),%xmm1
  add    $0x8,%rax
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x8(%rax)
  cmp    %rax,%rdx
  jne    L132
  movq   $0x0,(%r12)
  jmp    L53
L89:
  je     L53
  movsd  (%rdx),%xmm0
  mov    $0x2,%r15d
  movsd  %xmm0,0x8(%rcx)
  jmp    L108
```

tool_calls: name: unpack_data
arguments: label: D28
type_infered: f64[2]
name: unpack_data
arguments: label: D0
type_infered: byte[8]

tool: {"D28": [1.0,15.0]}

tool: {"D0": [0x00,0x00,0x00,0x00,0x00,0x00,0x2e,0x40]}

assistant: ```c
int sympoly(int K, int BK, double *val, double *res, double *overflow) {
  int h, k;
  double mult = 1;
  BK++;
  if (BK > K)
    BK = K;
  if (BK <= 1)
    BK = 2;
  *overflow = 0;
  res[0] = 1;
  for (k = 1; k <= K; k++)
    res[k] = 0;
  if (K == 0)
    return 0;
  res[1] = val[0];
  for (k = 1; k < K; k++) {
    double vk = val[k];
    if (vk > 1) {
      double lastv = mult;
      mult /= vk;
      *overflow += log(vk);
      for (h = 1; h <= k && h < BK; h++) {
        double thisv = res[h];
        res[h] = thisv / vk + lastv;
        lastv = thisv;
      }
      res[h] = lastv;
    } else {
      double lastv = mult;
      for (h = 1; h <= k && h < BK; h++) {
        double thisv = res[h];
        res[h] += vk * lastv;
        lastv = thisv;
      }
      res[h] = vk * lastv;
    }
  }
  if (*overflow < 15) {
    double eo = exp(*overflow);
    for (h = 1; h <= BK; h++)
      res[h] *= eo;
    *overflow = 0;
  }
  return 0;
}
```