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

```asm
<rq_pricing_compound>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x58,%rsp
  mov    %edi,%ebp
  mov    %esi,%ebx
  movq   %xmm0,%r15
  movq   %xmm1,%r12
  movapd %xmm2,%xmm0
  movsd  %xmm2,0x38(%rsp)
  movapd %xmm3,%xmm8
  movapd %xmm4,%xmm1
  movq   %xmm5,%r13
  movsd  %xmm7,0x8(%rsp)
  movapd %xmm5,%xmm4
  subsd  %xmm6,%xmm4
  movsd  %xmm4,0x20(%rsp)
  movapd %xmm7,%xmm5
  movq   %r13,%xmm3
  movsd  %xmm1,0x10(%rsp)
  movapd %xmm1,%xmm7
  movsd  %xmm8,0x18(%rsp)
  subsd  %xmm8,%xmm7
  movapd %xmm7,%xmm2
  movq   %r12,%xmm1
  mov    %esi,%edi
  call   <critical_value@plt>
  movsd  %xmm0,0x28(%rsp)
  movsd  0x18(%rsp),%xmm0
  divsd  0x10(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L103
  sqrtsd %xmm0,%xmm0
  movq   %xmm0,%r14
L26:
  movq   %r15,%xmm0
  divsd  0x28(%rsp),%xmm0
  call   <log@plt>
  movapd %xmm0,%xmm1
  movsd  0x8(%rsp),%xmm6
  movapd %xmm6,%xmm0
  mulsd  %xmm6,%xmm0
  mulsd  D115(%rip),%xmm0
  addsd  0x20(%rsp),%xmm0
  movsd  %xmm0,0x28(%rsp)
  movsd  0x18(%rsp),%xmm3
  mulsd  %xmm3,%xmm0
  movapd %xmm0,%xmm4
  addsd  %xmm1,%xmm4
  movsd  %xmm4,0x30(%rsp)
  pxor   %xmm0,%xmm0
  ucomisd %xmm3,%xmm0
  ja     L132
  sqrtsd %xmm3,%xmm3
  movapd %xmm3,%xmm0
  mulsd  %xmm3,%xmm6
  divsd  %xmm6,%xmm4
  movsd  %xmm4,0x30(%rsp)
L29:
  mulsd  0x8(%rsp),%xmm0
  movsd  0x30(%rsp),%xmm6
  subsd  %xmm0,%xmm6
  movsd  %xmm6,0x40(%rsp)
  movq   %r15,%xmm0
  divsd  0x38(%rsp),%xmm0
  call   <log@plt>
  movapd %xmm0,%xmm1
  movsd  0x28(%rsp),%xmm0
  movsd  0x10(%rsp),%xmm5
  mulsd  %xmm5,%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm1,%xmm2
  movsd  %xmm2,0x28(%rsp)
  pxor   %xmm0,%xmm0
  ucomisd %xmm5,%xmm0
  ja     L20
  sqrtsd %xmm5,%xmm5
  movapd %xmm5,%xmm0
  movsd  0x8(%rsp),%xmm1
  mulsd  %xmm5,%xmm1
  divsd  %xmm1,%xmm2
  movsd  %xmm2,0x28(%rsp)
L52:
  mulsd  0x8(%rsp),%xmm0
  movsd  0x28(%rsp),%xmm7
  subsd  %xmm0,%xmm7
  movsd  %xmm7,0x8(%rsp)
  test   %ebp,%ebp
  setne  %al
  test   %ebx,%ebx
  setne  %dl
  test   %al,%al
  je     L6
  test   %dl,%dl
  jne    L138
L6:
  test   %ebp,%ebp
  jne    L98
  test   %dl,%dl
  jne    L39
L98:
  test   %ebx,%ebx
  jne    L53
  test   %al,%al
  je     L53
  movq   %r13,%xmm0
  xorpd  D134(%rip),%xmm0
  movsd  %xmm0,0x48(%rsp)
  mulsd  0x10(%rsp),%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm6
  mulsd  0x38(%rsp),%xmm6
  movsd  %xmm6,0x38(%rsp)
  movsd  0x40(%rsp),%xmm3
  xorpd  D134(%rip),%xmm3
  movq   %xmm3,%rbx
  movsd  0x8(%rsp),%xmm5
  xorpd  D134(%rip),%xmm5
  movapd %xmm5,%xmm0
  movq   %r14,%xmm2
  movapd %xmm3,%xmm1
  call   <rq_pricing_cumul_bivar_norm_dist@plt>
  movapd %xmm0,%xmm3
  mulsd  0x38(%rsp),%xmm3
  movq   %xmm3,%rbp
  movsd  0x20(%rsp),%xmm6
  movq   %r13,%xmm7
  subsd  %xmm7,%xmm6
  movapd %xmm6,%xmm0
  mulsd  0x10(%rsp),%xmm0
  call   <exp@plt>
  movq   %r15,%xmm4
  mulsd  %xmm0,%xmm4
  movsd  %xmm4,0x8(%rsp)
  movsd  0x30(%rsp),%xmm1
  xorpd  D134(%rip),%xmm1
  movsd  0x28(%rsp),%xmm2
  xorpd  D134(%rip),%xmm2
  movapd %xmm2,%xmm0
  movq   %r14,%xmm2
  call   <rq_pricing_cumul_bivar_norm_dist@plt>
  mulsd  0x8(%rsp),%xmm0
  movq   %rbp,%xmm7
  subsd  %xmm0,%xmm7
  movq   %xmm7,%rbp
  movsd  0x48(%rsp),%xmm0
  mulsd  0x18(%rsp),%xmm0
  call   <exp@plt>
  movq   %r12,%xmm5
  mulsd  %xmm0,%xmm5
  movsd  %xmm5,0x8(%rsp)
  movq   %rbx,%xmm0
  call   <rq_pricing_cumul_norm_dist@plt>
  movsd  0x8(%rsp),%xmm1
  mulsd  %xmm0,%xmm1
  movq   %rbp,%xmm0
  subsd  %xmm1,%xmm0
  jmp    L93
L103:
  call   <sqrt@plt>
  movq   %xmm0,%r14
  jmp    L26
L132:
  movsd  0x18(%rsp),%xmm0
  call   <sqrt@plt>
  mulsd  0x8(%rsp),%xmm0
  movsd  0x30(%rsp),%xmm5
  divsd  %xmm0,%xmm5
  movsd  %xmm5,0x30(%rsp)
  movsd  0x18(%rsp),%xmm0
  call   <sqrt@plt>
  jmp    L29
L20:
  movsd  0x10(%rsp),%xmm0
  call   <sqrt@plt>
  mulsd  0x8(%rsp),%xmm0
  movsd  0x28(%rsp),%xmm5
  divsd  %xmm0,%xmm5
  movsd  %xmm5,0x28(%rsp)
  movsd  0x10(%rsp),%xmm0
  call   <sqrt@plt>
  jmp    L52
L138:
  movsd  0x20(%rsp),%xmm2
  movq   %r13,%xmm3
  subsd  %xmm3,%xmm2
  movapd %xmm2,%xmm0
  mulsd  0x10(%rsp),%xmm0
  call   <exp@plt>
  movq   %r15,%xmm3
  mulsd  %xmm0,%xmm3
  movsd  %xmm3,0x20(%rsp)
  movq   %r14,%xmm2
  movsd  0x30(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm0
  call   <rq_pricing_cumul_bivar_norm_dist@plt>
  movapd %xmm0,%xmm4
  mulsd  0x20(%rsp),%xmm4
  movq   %xmm4,%rbp
  movq   %r13,%xmm5
  xorpd  D134(%rip),%xmm5
  movsd  0x10(%rsp),%xmm6
  movsd  %xmm5,0x10(%rsp)
  mulsd  %xmm5,%xmm6
  movapd %xmm6,%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm2
  mulsd  0x38(%rsp),%xmm2
  movsd  %xmm2,0x20(%rsp)
  movq   %r14,%xmm2
  movsd  0x40(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  call   <rq_pricing_cumul_bivar_norm_dist@plt>
  mulsd  0x20(%rsp),%xmm0
  movq   %rbp,%xmm7
  subsd  %xmm0,%xmm7
  movq   %xmm7,%rbp
  movsd  0x10(%rsp),%xmm0
  mulsd  0x18(%rsp),%xmm0
  call   <exp@plt>
  movq   %r12,%xmm7
  mulsd  %xmm0,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  0x40(%rsp),%xmm0
  call   <rq_pricing_cumul_norm_dist@plt>
  movsd  0x8(%rsp),%xmm1
  mulsd  %xmm0,%xmm1
  movq   %rbp,%xmm0
  subsd  %xmm1,%xmm0
L93:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L39:
  movq   %r13,%xmm0
  xorpd  D134(%rip),%xmm0
  movsd  %xmm0,0x48(%rsp)
  mulsd  0x10(%rsp),%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm5
  mulsd  0x38(%rsp),%xmm5
  movsd  %xmm5,0x38(%rsp)
  movq   %r14,%xmm2
  xorpd  D134(%rip),%xmm2
  movq   %xmm2,%r14
  movsd  0x40(%rsp),%xmm3
  xorpd  D134(%rip),%xmm3
  movq   %xmm3,%rbx
  movapd %xmm3,%xmm1
  movsd  0x8(%rsp),%xmm0
  call   <rq_pricing_cumul_bivar_norm_dist@plt>
  movapd %xmm0,%xmm7
  mulsd  0x38(%rsp),%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  0x20(%rsp),%xmm6
  movq   %r13,%xmm3
  subsd  %xmm3,%xmm6
  movapd %xmm6,%xmm0
  mulsd  0x10(%rsp),%xmm0
  call   <exp@plt>
  movq   %r15,%xmm4
  mulsd  %xmm0,%xmm4
  movsd  %xmm4,0x10(%rsp)
  movsd  0x30(%rsp),%xmm1
  xorpd  D134(%rip),%xmm1
  movq   %r14,%xmm2
  movsd  0x28(%rsp),%xmm0
  call   <rq_pricing_cumul_bivar_norm_dist@plt>
  mulsd  0x10(%rsp),%xmm0
  movsd  0x8(%rsp),%xmm7
  subsd  %xmm0,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  0x48(%rsp),%xmm0
  mulsd  0x18(%rsp),%xmm0
  call   <exp@plt>
  movq   %r12,%xmm2
  mulsd  %xmm0,%xmm2
  movsd  %xmm2,0x10(%rsp)
  movq   %rbx,%xmm0
  call   <rq_pricing_cumul_norm_dist@plt>
  mulsd  0x10(%rsp),%xmm0
  addsd  0x8(%rsp),%xmm0
  jmp    L93
L53:
  movsd  0x20(%rsp),%xmm0
  movq   %r13,%xmm5
  subsd  %xmm5,%xmm0
  mulsd  0x10(%rsp),%xmm0
  call   <exp@plt>
  movq   %r15,%xmm3
  mulsd  %xmm0,%xmm3
  movsd  %xmm3,0x20(%rsp)
  movq   %r14,%xmm4
  xorpd  D134(%rip),%xmm4
  movq   %xmm4,%rbx
  movsd  0x28(%rsp),%xmm0
  xorpd  D134(%rip),%xmm0
  movapd %xmm4,%xmm2
  movsd  0x30(%rsp),%xmm1
  call   <rq_pricing_cumul_bivar_norm_dist@plt>
  mulsd  0x20(%rsp),%xmm0
  movq   %xmm0,%rbp
  movq   %r13,%xmm6
  xorpd  D134(%rip),%xmm6
  movsd  0x10(%rsp),%xmm5
  movsd  %xmm6,0x10(%rsp)
  mulsd  %xmm6,%xmm5
  movapd %xmm5,%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm5
  mulsd  0x38(%rsp),%xmm5
  movsd  %xmm5,0x20(%rsp)
  movsd  0x8(%rsp),%xmm2
  xorpd  D134(%rip),%xmm2
  movapd %xmm2,%xmm0
  movq   %rbx,%xmm2
  movsd  0x40(%rsp),%xmm1
  call   <rq_pricing_cumul_bivar_norm_dist@plt>
  mulsd  0x20(%rsp),%xmm0
  movq   %rbp,%xmm7
  subsd  %xmm0,%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  0x10(%rsp),%xmm0
  mulsd  0x18(%rsp),%xmm0
  call   <exp@plt>
  movq   %r12,%xmm6
  mulsd  %xmm0,%xmm6
  movsd  %xmm6,0x10(%rsp)
  movsd  0x40(%rsp),%xmm0
  call   <rq_pricing_cumul_norm_dist@plt>
  mulsd  0x10(%rsp),%xmm0
  addsd  0x8(%rsp),%xmm0
  jmp    L93
```

tool_calls: name: read_data
arguments: data_tag: D115
datatype: f32[2]
name: read_data
arguments: data_tag: D134
datatype: f32[4]

tool: {"D115": [0.0,1.75]}

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

assistant: ```c
double rq_pricing_compound(int outer_call, int inner_call, double S, double X_outer, double X_inner, double T_outer, double T_inner, double r, double rf, double v) {
  double y1;
  double y2;
  double z1;
  double z2;
  double I;
  double rho;
  double b = r - rf;
  double ret = 0.0;
  I = critical_value(inner_call, X_inner, X_outer, T_inner - T_outer, r, b, v);
  rho = sqrt(T_outer / T_inner);
  y1 = (log(S / I) + (b + (v * v) / 2) * T_outer) / (v * sqrt(T_outer));
  y2 = y1 - v * sqrt(T_outer);
  z1 = (log(S / X_inner) + (b + (v * v) / 2) * T_inner) / (v * sqrt(T_inner));
  z2 = z1 - v * sqrt(T_inner);
  if (outer_call && inner_call)
    ret = S * exp((b - r) * T_inner) * rq_pricing_cumul_bivar_norm_dist(z1, y1, rho) - X_inner * exp(-r * T_inner) * rq_pricing_cumul_bivar_norm_dist(z2, y2, rho) - X_outer * exp(-r * T_outer) * rq_pricing_cumul_norm_dist(y2);
  else if (!outer_call && inner_call)
    ret = X_inner * exp(-r * T_inner) * rq_pricing_cumul_bivar_norm_dist(z2, -y2, -rho) - S * exp((b - r) * T_inner) * rq_pricing_cumul_bivar_norm_dist(z1, -y1, -rho) + X_outer * exp(-r * T_outer) * rq_pricing_cumul_norm_dist(-y2);
  else if (outer_call && !inner_call)
    ret = X_inner * exp(-r * T_inner) * rq_pricing_cumul_bivar_norm_dist(-z2, -y2, rho) - S * exp((b - r) * T_inner) * rq_pricing_cumul_bivar_norm_dist(-z1, -y1, rho) - X_outer * exp(-r * T_outer) * rq_pricing_cumul_norm_dist(-y2);
  else
    ret = S * exp((b - r) * T_inner) * rq_pricing_cumul_bivar_norm_dist(-z1, y1, -rho) - X_inner * exp(-r * T_inner) * rq_pricing_cumul_bivar_norm_dist(-z2, y2, -rho) + exp(-r * T_outer) * X_outer * rq_pricing_cumul_norm_dist(y2);
  return ret;
}
```