user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<rpmva>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r14
  mov    %esi,0xc(%rsp)
  mov    %rdx,0x10(%rsp)
  mov    %ecx,0x2c(%rsp)
  mov    %r8,0x18(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sd %esi,%xmm0
  subsd  D48(%rip),%xmm0
  call   <log@plt>
  divsd  D47(%rip),%xmm0
  addsd  D55(%rip),%xmm0
  cvttsd2si %xmm0,%ebp
  test   %ebp,%ebp
  jle    L4
  mov    $0x1,%edx
  mov    $0x0,%eax
L66:
  add    %edx,%edx
  add    $0x1,%eax
  cmp    %eax,%ebp
  jne    L66
  mov    %edx,0x28(%rsp)
L135:
  movslq 0xc(%rsp),%rax
  mov    %rax,0x20(%rsp)
  lea    0x0(,%rax,8),%r13
  movsd  -0x8(%r14,%r13,1),%xmm4
  movsd  %xmm4,(%rsp)
  movsd  D55(%rip),%xmm1
  movapd %xmm4,%xmm0
  addsd  %xmm1,%xmm0
  ucomisd %xmm1,%xmm0
  jp     L94
  je     L147
L94:
  mov    0x28(%rsp),%eax
  mov    %eax,%ebx
  sar    %ebx
  movslq %eax,%rdi
  shl    $0x3,%rdi
  call   <malloc@plt>
  mov    %rax,%r15
  movslq %ebx,%rdi
  shl    $0x3,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L70
  mov    %eax,%edx
  mov    $0x0,%eax
L112:
  movsd  (%r14,%rax,8),%xmm0
  divsd  (%rsp),%xmm0
  movsd  %xmm0,(%r15,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L112
L70:
  mov    0xc(%rsp),%edi
  mov    0x28(%rsp),%eax
  cmp    %eax,%edi
  jge    L214
  add    %r15,%r13
  sub    %edi,%eax
  lea    -0x1(%rax),%eax
  mov    0x20(%rsp),%rdi
  lea    0x1(%rdi,%rax,1),%rax
  lea    (%r15,%rax,8),%rax
L118:
  movq   $0x0,0x0(%r13)
  add    $0x8,%r13
  cmp    %rax,%r13
  jne    L118
L214:
  cmp    $0x1,%ebp
  jle    L236
  mov    %ebx,%r10d
  mov    $0x1,%r11d
  mov    $0x1,%r13d
  lea    -0x8(%r15),%r14
  movsd  D55(%rip),%xmm2
L275:
  lea    -0x1(%r10),%eax
  test   %r11d,%r11d
  jle    L266
  lea    (%r10,%r10,1),%r9d
  movslq %r9d,%r9
  shl    $0x3,%r9
  cltq
  shl    $0x3,%rax
  lea    (%r15,%rax,1),%rdi
  lea    (%r14,%rax,1),%rdx
  lea    -0x2(%r10),%eax
  shl    $0x3,%rax
  sub    %rax,%rdx
  mov    $0x0,%r8d
  movslq %r10d,%rsi
L41:
  mov    %rdi,%rcx
  movsd  (%rdi),%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,(%rdi)
  cmp    $0x1,%r10d
  jle    L132
  mov    %rdi,%rax
L51:
  movsd  (%rcx),%xmm1
  mulsd  -0x8(%rax,%rsi,8),%xmm1
  movsd  -0x8(%rax),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rax)
  sub    $0x8,%rax
  cmp    %rdx,%rax
  jne    L51
L132:
  add    $0x1,%r8d
  add    %r9,%rdi
  add    %r9,%rdx
  cmp    %r11d,%r8d
  jne    L41
L266:
  sar    %r10d
  add    %r11d,%r11d
  add    $0x1,%r13d
  cmp    %r13d,%ebp
  jne    L275
L236:
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  jle    L105
  mov    %eax,%eax
  mov    %rax,0x20(%rsp)
  lea    -0x1(%rbx),%r13d
  add    $0x1,%r13
  shl    $0x4,%r13
  add    %r15,%r13
  mov    $0x0,%r14d
  jmp    L23
L4:
  movl   $0x1,0x28(%rsp)
  jmp    L135
L147:
  lea    D30(%rip),%rdi
  call   <puts@plt>
  mov    $0x0,%eax
  jmp    L172
L171:
  movapd %xmm2,%xmm1
  jmp    L215
L12:
  movsd  (%rsp),%xmm0
  mulsd  (%r12),%xmm0
  mov    0x18(%rsp),%rax
  movsd  %xmm0,(%rax,%r14,8)
  add    $0x1,%r14
  cmp    %r14,0x20(%rsp)
  je     L105
L23:
  mov    0x10(%rsp),%rax
  movsd  (%rax,%r14,8),%xmm2
  test   %ebx,%ebx
  jle    L126
  mov    %r12,%rdx
  mov    %r15,%rax
L123:
  movapd %xmm2,%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x10,%rax
  add    $0x8,%rdx
  cmp    %r13,%rax
  jne    L123
L126:
  cmp    $0x1,%ebp
  jle    L171
  movapd %xmm2,%xmm1
  mov    $0x1,%r10d
  mov    $0x2,%edi
  mov    $0x1,%r11d
L218:
  mulsd  %xmm1,%xmm1
  test   %ebx,%ebx
  jle    L72
  movslq %edi,%r8
  shl    $0x3,%r8
  mov    %r12,%rax
  lea    (%rdi,%rdi,1),%esi
  movslq %esi,%rsi
  shl    $0x3,%rsi
  lea    (%r10,%r10,1),%edx
  movslq %edx,%rdx
  lea    -0x8(%r15,%rdx,8),%rcx
  mov    $0x0,%edx
  movslq %r10d,%r9
L230:
  movapd %xmm1,%xmm0
  addsd  (%rcx),%xmm0
  mulsd  (%rax,%r9,8),%xmm0
  addsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    %edi,%edx
  add    %r8,%rax
  add    %rsi,%rcx
  cmp    %edx,%ebx
  jg     L230
L72:
  add    %r10d,%r10d
  add    %edi,%edi
  add    $0x1,%r11d
  cmp    %r11d,%ebp
  jne    L218
L215:
  mov    0x28(%rsp),%edi
  cmp    %edi,0xc(%rsp)
  je     L12
  mulsd  %xmm1,%xmm1
  divsd  %xmm2,%xmm1
  movsd  (%r12),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12)
  jmp    L12
L105:
  mov    %r15,%rdi
  call   <free@plt>
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0x1,%eax
L172:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D48
type_guessed: f64
name: retrieve_data
arguments: data_tag: D47
type_guessed: byte[8]
name: retrieve_data
arguments: data_tag: D55
type_guessed: f64
name: retrieve_data
arguments: data_tag: D30
type_guessed: string

tool: D48: 0.5

tool: {"D47": [0xef,0x39,0xfa,0xfe,0x42,0x2e,0xe6,0x3f]}

tool: D55: 1

tool: D30: (rpmva)coefficient too small,please check.

assistant: ```c
int rpmva(a, n, x, m, y)
int n, m;
double *a, *x, *y;
{
  int i, j, k, nn, nk, kk, l, count, tail;
  double *ax, *b;
  double a1, t1, t2;
  k = log(n - 0.5) / log(2.0) + 1;
  nn = 1;
  for (i = 0; i < k; i++)
    nn = nn << 1;
  nk = nn >> 1;
  a1 = a[n - 1];
  if (a1 + 1.0 == 1.0) {
    printf("(rpmva)coefficient too small,please check.\n");
    return (0);
  }
  b = (double *)malloc(nn * sizeof(double));
  ax = (double *)malloc(nk * sizeof(double));
  for (i = 0; i < n; i++)
    b[i] = a[i] / a1;
  for (i = n; i < nn; i++)
    b[i] = 0.0;
  l = nn >> 1;
  count = 1;
  for (i = 1; i < k; i++) {
    tail = l - 1;
    for (j = 0; j < count; j++) {
      b[tail] = b[tail] - 1.0;
      for (kk = 1; kk < l; kk++)
        b[tail - kk] = b[tail - kk] - b[tail] * b[tail - kk + l];
      tail = tail + 2 * l;
    }
    l = l >> 1;
    count = count << 1;
  }
  for (kk = 0; kk < m; kk++) {
    t1 = x[kk];
    for (i = 0; i < nk; i++)
      ax[i] = t1 + b[2 * i];
    tail = 1;
    l = 2;
    t2 = t1;
    for (i = 1; i < k; i++) {
      t2 = t2 * t2;
      for (j = 0; j < nk; j = j + l)
        ax[j] = ax[j] + ax[j + tail] * (t2 + b[2 * (j + tail) - 1]);
      tail = tail << 1;
      l = l << 1;
    }
    t2 = t2 * t2 / t1;
    if (nn != n)
      ax[0] -= t2;
    y[kk] = ax[0] * a1;
  }
  free(b);
  free(ax);
  return (1);
}
```