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

```asm
<Si>:
  endbr64
  push   %r14
  pxor   %xmm1,%xmm1
  push   %r13
  push   %r12
  cvttsd2si %xmm0,%r12d
  push   %rbp
  push   %rbx
  xor    %ebx,%ebx
  sub    $0x40,%rsp
  comisd D3(%rip),%xmm0
  movsd  %xmm0,0x28(%rsp)
  jae    L24
  lea    0x1(%rbx),%ebp
  test   %ebx,%ebx
  jne    L23
  cs nopw 0x0(%rax,%rax,1)
L39:
  addsd  0x28(%rsp),%xmm1
L25:
  mov    %ebp,%ebx
  lea    0x1(%rbx),%ebp
  test   %ebx,%ebx
  je     L39
L23:
  lea    -0x1(%rbp,%rbp,1),%r13d
  mov    %r12d,%edi
  movsd  %xmm1,0x20(%rsp)
  mov    %r13d,%esi
  call   <pow@plt>
  mov    %ebx,%esi
  mov    $0xffffffff,%edi
  movsd  %xmm0,0x8(%rsp)
  call   <pow@plt>
  mov    %r13d,%edi
  movsd  %xmm0,0x10(%rsp)
  fldl   0x10(%rsp)
  fmull  0x8(%rsp)
  fstpt  0x10(%rsp)
  call   <factorial@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  movsd  0x20(%rsp),%xmm1
  cvtsi2sd %ebx,%xmm0
  fldt   0x10(%rsp)
  cvtsi2sd %rax,%xmm2
  addsd  %xmm0,%xmm0
  addsd  D15(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,0x8(%rsp)
  fdivl  0x8(%rsp)
  movsd  %xmm1,0x8(%rsp)
  fldl   0x8(%rsp)
  faddp  %st,%st(1)
  fstpl  0x8(%rsp)
  movsd  0x8(%rsp),%xmm1
  cmp    $0x6,%ebp
  jne    L25
L50:
  add    $0x40,%rsp
  movapd %xmm1,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  cs nopw 0x0(%rax,%rax,1)
L24:
  pxor   %xmm3,%xmm3
  xor    %ebx,%ebx
  movsd  %xmm3,0x8(%rsp)
  movsd  %xmm3,0x10(%rsp)
L9:
  mov    %ebx,%esi
  lea    (%rbx,%rbx,1),%r13d
  mov    $0xffffffff,%edi
  call   <pow@plt>
  mov    %r13d,%edi
  lea    0x1(%r13),%r14d
  movsd  %xmm0,0x20(%rsp)
  call   <factorial@plt>
  pxor   %xmm0,%xmm0
  mov    %r14d,%esi
  mov    %r12d,%edi
  cvtsi2sd %rax,%xmm0
  movsd  0x20(%rsp),%xmm3
  mulsd  %xmm0,%xmm3
  movq   %xmm3,%rbp
  call   <pow@plt>
  mov    %ebx,%esi
  mov    $0xffffffff,%edi
  add    $0x1,%ebx
  movapd %xmm0,%xmm1
  movq   %rbp,%xmm0
  divsd  %xmm1,%xmm0
  addsd  0x8(%rsp),%xmm0
  movsd  %xmm0,0x8(%rsp)
  call   <pow@plt>
  mov    %r14d,%edi
  movsd  %xmm0,0x20(%rsp)
  call   <factorial@plt>
  pxor   %xmm0,%xmm0
  lea    0x2(%r13),%esi
  mov    %r12d,%edi
  cvtsi2sd %rax,%xmm0
  movsd  0x20(%rsp),%xmm4
  mulsd  %xmm0,%xmm4
  movq   %xmm4,%rbp
  call   <pow@plt>
  movapd %xmm0,%xmm1
  movq   %rbp,%xmm0
  divsd  %xmm1,%xmm0
  addsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x10(%rsp)
  cmp    $0x4,%ebx
  jne    L9
  movsd  0x28(%rsp),%xmm0
  lea    0x38(%rsp),%rdi
  lea    0x30(%rsp),%rsi
  call   <sincos@plt>
  movsd  0x8(%rsp),%xmm0
  mulsd  0x30(%rsp),%xmm0
  movsd  D20(%rip),%xmm1
  subsd  %xmm0,%xmm1
  movsd  0x10(%rsp),%xmm0
  mulsd  0x38(%rsp),%xmm0
  subsd  %xmm0,%xmm1
  jmp    L50
```

tool_calls: name: extract_symbolic_data
arguments: label: D3
type_guessed: byte[16]
name: extract_symbolic_data
arguments: label: D15
type_guessed: f64
name: extract_symbolic_data
arguments: label: D20
type_guessed: byte[8]

tool: {"D3": [0x59,0x09,0xe8,0xfa,0x55,0x7a,0x13,0x40,0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0x3f]}

tool: D15: 1

tool: {"D20": [0x18,0x2d,0x44,0x54,0xfb,0x21,0xf9,0x3f]}

assistant: ```c
double Si(double x) {
  int i;
  int nmax = 6;
  double out;
  long double power;
  double pi = 4.0 * atan(1.0);
  if (x >= pi * 6.2 / 4.0) {
    double out_sin = 0.0;
    double out_cos = 0.0;
    out = pi / 2.0;
    for (i = 0; i < nmax - 2; i += 1) {
      out_cos += pow(-1.0, i) * (double)factorial(2 * i) / pow(x, 2 * i + 1);
      out_sin += pow(-1.0, i) * (double)factorial(2 * i + 1) / pow(x, 2 * i + 2);
    }
    out -= cos(x) * out_cos;
    out -= sin(x) * out_sin;
    return out;
  }
  out = 0.0;
  for (i = 0; i < nmax; i += 1) {
    if (i == 0) {
      out += x;
      continue;
    }
    power = pow(x, (2 * i + 1));
    out += (double)pow(-1, i) * power / ((2.0 * (double)i + 1.0) * (double)factorial(2 * i + 1));
  }
  return out;
}
```