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

```asm
<rq_pricing_average_rate_levy>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x40,%rsp
  mov    %edi,%r12d
  movsd  %xmm0,0x28(%rsp)
  movq   %xmm1,%r14
  movq   %xmm2,%rbp
  movq   %xmm3,%rbx
  movsd  %xmm5,0x30(%rsp)
  movsd  %xmm6,0x8(%rsp)
  subsd  %xmm4,%xmm3
  movsd  %xmm3,(%rsp)
  movapd %xmm3,%xmm4
  movq   %rbx,%xmm12
  subsd  %xmm12,%xmm4
  movapd %xmm4,%xmm0
  movsd  %xmm7,0x10(%rsp)
  mulsd  %xmm7,%xmm0
  call   <exp@plt>
  movq   %xmm0,%r13
  movq   %rbx,%xmm0
  xorpd  D12(%rip),%xmm0
  mulsd  0x10(%rsp),%xmm0
  movsd  %xmm0,0x18(%rsp)
  call   <exp@plt>
  movsd  (%rsp),%xmm3
  movapd %xmm3,%xmm4
  mulsd  0x8(%rsp),%xmm4
  movsd  0x28(%rsp),%xmm1
  divsd  %xmm4,%xmm1
  movq   %r13,%xmm10
  subsd  %xmm0,%xmm10
  mulsd  %xmm10,%xmm1
  movsd  %xmm1,0x20(%rsp)
  movsd  0x30(%rsp),%xmm6
  mulsd  %xmm6,%xmm6
  movapd %xmm3,%xmm5
  addsd  %xmm3,%xmm5
  movapd %xmm5,%xmm8
  movsd  %xmm6,0x30(%rsp)
  addsd  %xmm6,%xmm8
  movsd  %xmm8,0x38(%rsp)
  movapd %xmm8,%xmm9
  mulsd  0x10(%rsp),%xmm9
  movapd %xmm9,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rbx
  movsd  (%rsp),%xmm6
  mulsd  0x10(%rsp),%xmm6
  movapd %xmm6,%xmm0
  call   <exp@plt>
  movsd  D34(%rip),%xmm2
  movq   %rbx,%xmm11
  subsd  %xmm2,%xmm11
  movapd %xmm11,%xmm1
  divsd  0x38(%rsp),%xmm1
  subsd  %xmm2,%xmm0
  movsd  (%rsp),%xmm3
  divsd  %xmm3,%xmm0
  subsd  %xmm0,%xmm1
  movsd  0x28(%rsp),%xmm4
  mulsd  %xmm4,%xmm4
  movapd %xmm4,%xmm0
  addsd  %xmm4,%xmm0
  movsd  0x30(%rsp),%xmm6
  addsd  %xmm3,%xmm6
  divsd  %xmm6,%xmm0
  mulsd  %xmm0,%xmm1
  movsd  0x8(%rsp),%xmm7
  movapd %xmm7,%xmm5
  mulsd  %xmm7,%xmm5
  movapd %xmm1,%xmm3
  divsd  %xmm5,%xmm3
  movq   %xmm3,%r13
  movapd %xmm3,%xmm0
  call   <log@plt>
  mov    %eax,%ebx
  movsd  0x20(%rsp),%xmm0
  call   <log@plt>
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebx,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  subsd  0x18(%rsp),%xmm0
  addsd  %xmm0,%xmm0
  movapd %xmm1,%xmm6
  subsd  %xmm0,%xmm6
  movsd  %xmm6,0x28(%rsp)
  movsd  0x8(%rsp),%xmm7
  movapd %xmm7,%xmm0
  subsd  0x10(%rsp),%xmm0
  divsd  %xmm7,%xmm0
  movq   %r14,%xmm5
  mulsd  %xmm5,%xmm0
  movq   %rbp,%xmm5
  subsd  %xmm0,%xmm5
  movsd  %xmm5,(%rsp)
  pxor   %xmm0,%xmm0
  ucomisd %xmm6,%xmm0
  ja     L31
  sqrtsd %xmm6,%xmm6
  movsd  %xmm6,0x8(%rsp)
  movq   %r13,%xmm0
  call   <log@plt>
  mov    %eax,%ebx
  movsd  (%rsp),%xmm0
  call   <log@plt>
  mov    %eax,%edx
  mov    %ebx,%eax
  shr    $0x1f,%eax
  add    %ebx,%eax
  sar    %eax
  sub    %edx,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  D34(%rip),%xmm1
  divsd  0x8(%rsp),%xmm1
  mulsd  %xmm1,%xmm0
  movq   %xmm0,%rbx
L33:
  movq   %rbx,%xmm5
  subsd  0x8(%rsp),%xmm5
  movq   %xmm5,%rbp
  test   %r12w,%r12w
  je     L9
  movq   %rbx,%xmm0
  call   <rq_pricing_cumul_norm_dist@plt>
  mulsd  0x20(%rsp),%xmm0
  movq   %xmm0,%rbx
  movsd  0x18(%rsp),%xmm0
  call   <exp@plt>
  mulsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  movq   %rbp,%xmm0
  call   <rq_pricing_cumul_norm_dist@plt>
  movsd  (%rsp),%xmm1
  mulsd  %xmm0,%xmm1
  movq   %rbx,%xmm0
  subsd  %xmm1,%xmm0
L11:
  add    $0x40,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L31:
  movsd  0x28(%rsp),%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rbp
  movq   %r13,%xmm0
  call   <log@plt>
  mov    %eax,%ebx
  movsd  (%rsp),%xmm0
  call   <log@plt>
  mov    %eax,%esi
  mov    $0x2,%ecx
  mov    %ebx,%eax
  cltd
  idiv   %ecx
  sub    %esi,%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  D34(%rip),%xmm1
  movq   %rbp,%xmm5
  divsd  %xmm5,%xmm1
  movapd %xmm0,%xmm5
  mulsd  %xmm1,%xmm5
  movq   %xmm5,%rbx
  movsd  0x28(%rsp),%xmm0
  call   <sqrt@plt>
  movsd  %xmm0,0x8(%rsp)
  jmp    L33
L9:
  movq   %rbx,%xmm0
  call   <rq_pricing_cumul_norm_dist@plt>
  mulsd  0x20(%rsp),%xmm0
  movq   %xmm0,%rbx
  movsd  0x18(%rsp),%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm7
  mulsd  (%rsp),%xmm7
  movsd  %xmm7,0x8(%rsp)
  movq   %rbp,%xmm0
  call   <rq_pricing_cumul_norm_dist@plt>
  movq   %xmm0,%rbp
  movsd  0x18(%rsp),%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm1
  movq   %rbp,%xmm2
  mulsd  0x8(%rsp),%xmm2
  movq   %rbx,%xmm0
  subsd  %xmm2,%xmm0
  subsd  0x20(%rsp),%xmm0
  mulsd  (%rsp),%xmm1
  addsd  %xmm1,%xmm0
  jmp    L11
```

tool_calls: name: unpack_data
arguments: tag: D12
data_type: f32[4]
name: unpack_data
arguments: tag: D34
data_type: f64

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

tool: D34: 1

assistant: ```c
double rq_pricing_average_rate_levy(short call, double S, double SA, double X, double r, double rf, double v, double T, double T2) {
  double b = r - rf;
  double ret = 0.0;
  double SE = S / (T * b) * (exp((b - r) * T2) - exp(-r * T2));
  double m = 2 * (S * S) / (b + (v * v)) * ((exp((2 * b + (v * v)) * T2) - 1) / (2 * b + (v * v)) - (exp(b * T2) - 1) / b);
  double d = m / (T * T);
  double Sv = log(d) - 2 * (r * T2 + log(SE));
  double XStar = X - (T - T2) / T * SA;
  double d1 = 1 / sqrt(Sv) * (log(d) / 2 - log(XStar));
  double d2 = d1 - sqrt(Sv);
  if (call)
    ret = SE * rq_pricing_cumul_norm_dist(d1) - XStar * exp(-r * T2) * rq_pricing_cumul_norm_dist(d2);
  else
    ret = (SE * rq_pricing_cumul_norm_dist(d1) - XStar * exp(-r * T2) * rq_pricing_cumul_norm_dist(d2)) - SE + XStar * exp(-r * T2);
  return ret;
}
```