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

```asm
<TwoAssetBarrier>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xf0,%rsp
  mov    %edi,-0x84(%rbp)
  movsd  %xmm0,-0x90(%rbp)
  movsd  %xmm1,-0x98(%rbp)
  movsd  %xmm2,-0xa0(%rbp)
  movsd  %xmm3,-0xa8(%rbp)
  movsd  %xmm4,-0xb0(%rbp)
  movsd  %xmm5,-0xb8(%rbp)
  movsd  %xmm6,-0xc0(%rbp)
  movsd  %xmm7,-0xc8(%rbp)
  movsd  -0x90(%rbp),%xmm0
  ucomisd -0x90(%rbp),%xmm0
  jp     L10
  movsd  -0x90(%rbp),%xmm0
  comisd D35(%rip),%xmm0
  jb     L10
  movsd  D233(%rip),%xmm0
  comisd -0x90(%rbp),%xmm0
  jb     L10
  mov    $0x1,%eax
  jmp    L528
L10:
  mov    $0x0,%eax
L528:
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  movsd  -0x98(%rbp),%xmm0
  ucomisd -0x98(%rbp),%xmm0
  jp     L549
  movsd  -0x98(%rbp),%xmm0
  comisd D35(%rip),%xmm0
  jb     L549
  movsd  D233(%rip),%xmm0
  comisd -0x98(%rbp),%xmm0
  jb     L549
  mov    $0x1,%eax
  jmp    L414
L549:
  mov    $0x0,%eax
L414:
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  movsd  -0xa0(%rbp),%xmm0
  ucomisd -0xa0(%rbp),%xmm0
  jp     L63
  movsd  -0xa0(%rbp),%xmm0
  comisd D35(%rip),%xmm0
  jb     L63
  movsd  D233(%rip),%xmm0
  comisd -0xa0(%rbp),%xmm0
  jb     L63
  mov    $0x1,%eax
  jmp    L30
L63:
  mov    $0x0,%eax
L30:
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  movsd  -0xb0(%rbp),%xmm0
  ucomisd -0xb0(%rbp),%xmm0
  jp     L252
  movsd  -0xb0(%rbp),%xmm0
  comisd D131(%rip),%xmm0
  jb     L252
  movsd  D230(%rip),%xmm0
  comisd -0xb0(%rbp),%xmm0
  jb     L252
  mov    $0x1,%eax
  jmp    L342
L252:
  mov    $0x0,%eax
L342:
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  movsd  -0xb8(%rbp),%xmm0
  ucomisd -0xb8(%rbp),%xmm0
  jp     L439
  movsd  -0xb8(%rbp),%xmm0
  pxor   %xmm1,%xmm1
  comisd %xmm1,%xmm0
  jb     L439
  movsd  D209(%rip),%xmm0
  comisd -0xb8(%rbp),%xmm0
  jb     L439
  mov    $0x1,%eax
  jmp    L332
L439:
  mov    $0x0,%eax
L332:
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  movsd  -0xc0(%rbp),%xmm0
  ucomisd -0xc0(%rbp),%xmm0
  jp     L256
  movsd  -0xc0(%rbp),%xmm0
  comisd D0(%rip),%xmm0
  jb     L256
  movsd  D209(%rip),%xmm0
  comisd -0xc0(%rbp),%xmm0
  jb     L256
  mov    $0x1,%eax
  jmp    L146
L256:
  mov    $0x0,%eax
L146:
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  movsd  -0xc8(%rbp),%xmm0
  ucomisd -0xc8(%rbp),%xmm0
  jp     L93
  movsd  -0xc8(%rbp),%xmm0
  comisd D0(%rip),%xmm0
  jb     L93
  movsd  D209(%rip),%xmm0
  comisd -0xc8(%rbp),%xmm0
  jb     L93
  mov    $0x1,%eax
  jmp    L3
L93:
  mov    $0x0,%eax
L3:
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  movsd  0x10(%rbp),%xmm0
  ucomisd 0x10(%rbp),%xmm0
  jp     L498
  movsd  0x10(%rbp),%xmm0
  comisd D122(%rip),%xmm0
  jb     L498
  movsd  D71(%rip),%xmm0
  comisd 0x10(%rbp),%xmm0
  jb     L498
  mov    $0x1,%eax
  jmp    L541
L498:
  mov    $0x0,%eax
L541:
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  movsd  0x18(%rbp),%xmm0
  ucomisd 0x18(%rbp),%xmm0
  jp     L391
  movsd  0x18(%rbp),%xmm0
  comisd D122(%rip),%xmm0
  jb     L391
  movsd  D71(%rip),%xmm0
  comisd 0x18(%rbp),%xmm0
  jb     L391
  mov    $0x1,%eax
  jmp    L72
L391:
  mov    $0x0,%eax
L72:
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  mov    -0xb0(%rbp),%rax
  movq   %rax,%xmm0
  call   <sqrt@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x70(%rbp)
  movsd  0x18(%rbp),%xmm0
  mulsd  -0x70(%rbp),%xmm0
  movsd  %xmm0,-0x68(%rbp)
  movsd  -0xa8(%rbp),%xmm0
  divsd  -0x98(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movq   %xmm0,%rax
  mov    %rax,-0x60(%rbp)
  movsd  0x10(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  D278(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0xc0(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x58(%rbp)
  movsd  0x18(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  D278(%rip),%xmm2
  movapd %xmm0,%xmm1
  divsd  %xmm2,%xmm1
  movsd  -0xc8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0x90(%rbp),%xmm0
  divsd  -0xa0(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  call   <log@plt>
  movapd %xmm0,%xmm1
  movsd  0x10(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  -0x58(%rbp),%xmm0
  mulsd  -0xb0(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  0x10(%rbp),%xmm1
  mulsd  -0x70(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  0x10(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x70(%rbp),%xmm1
  movsd  -0x48(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  0x20(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  mulsd  -0x60(%rbp),%xmm0
  divsd  -0x68(%rbp),%xmm0
  movsd  -0x48(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  0x20(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  mulsd  -0x60(%rbp),%xmm0
  divsd  -0x68(%rbp),%xmm0
  movsd  -0x40(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  0x20(%rbp),%xmm0
  mulsd  0x10(%rbp),%xmm0
  mulsd  0x18(%rbp),%xmm0
  addsd  -0x50(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0xb0(%rbp),%xmm1
  movsd  -0x60(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  divsd  -0x68(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  0x20(%rbp),%xmm0
  mulsd  0x10(%rbp),%xmm0
  mulsd  -0x70(%rbp),%xmm0
  movsd  -0x28(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x60(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movapd %xmm0,%xmm1
  divsd  -0x68(%rbp),%xmm1
  movsd  -0x28(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x60(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movapd %xmm0,%xmm1
  divsd  -0x68(%rbp),%xmm1
  movsd  -0x20(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  cmpl   $0x8,-0x84(%rbp)
  jg     L90
  cmpl   $0x7,-0x84(%rbp)
  jge    L423
  cmpl   $0x6,-0x84(%rbp)
  jg     L90
  cmpl   $0x5,-0x84(%rbp)
  jge    L153
  cmpl   $0x2,-0x84(%rbp)
  jg     L519
  cmpl   $0x0,-0x84(%rbp)
  jg     L265
  jmp    L90
L519:
  mov    -0x84(%rbp),%eax
  sub    $0x3,%eax
  cmp    $0x1,%eax
  ja     L90
  movsd  D133(%rip),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movsd  -0x78(%rbp),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  jmp    L448
L265:
  movsd  D133(%rip),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  D123(%rip),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  jmp    L448
L423:
  movsd  D123(%rip),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  D133(%rip),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  jmp    L448
L153:
  movsd  D123(%rip),%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  -0x80(%rbp),%xmm0
  movsd  %xmm0,-0x78(%rbp)
  jmp    L448
L90:
  mov    $0x0,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  call   <abort@plt>
L448:
  movsd  -0x80(%rbp),%xmm0
  mulsd  -0x90(%rbp),%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  movsd  -0xc0(%rbp),%xmm0
  subsd  -0xb8(%rbp),%xmm0
  movapd %xmm0,%xmm4
  mulsd  -0xb0(%rbp),%xmm4
  movq   %xmm4,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm5
  mulsd  -0xd0(%rbp),%xmm5
  movsd  %xmm5,-0xd0(%rbp)
  movsd  -0x80(%rbp),%xmm0
  movq   D160(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mulsd  -0x78(%rbp),%xmm0
  movapd %xmm0,%xmm2
  mulsd  0x20(%rbp),%xmm2
  movsd  -0x78(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x28(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm0
  mulsd  -0x48(%rbp),%xmm0
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  mov    $0x3,%eax
  call   <cbnd@plt>
  pxor   %xmm7,%xmm7
  cvtsi2sd %eax,%xmm7
  movsd  %xmm7,-0xd8(%rbp)
  movsd  0x20(%rbp),%xmm0
  mulsd  0x10(%rbp),%xmm0
  mulsd  0x18(%rbp),%xmm0
  addsd  -0x50(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x60(%rbp),%xmm1
  movsd  0x18(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  divsd  %xmm0,%xmm1
  movq   %xmm1,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movsd  %xmm0,-0xe0(%rbp)
  movsd  -0x80(%rbp),%xmm0
  movq   D160(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mulsd  -0x78(%rbp),%xmm0
  movapd %xmm0,%xmm2
  mulsd  0x20(%rbp),%xmm2
  movsd  -0x78(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x18(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm6
  mulsd  -0x38(%rbp),%xmm6
  movq   %xmm6,%rax
  movq   %rax,%xmm0
  mov    $0x3,%eax
  call   <cbnd@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0xe0(%rbp),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0xd8(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  mulsd  -0xd0(%rbp),%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  movsd  -0xb8(%rbp),%xmm0
  movq   D160(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movapd %xmm0,%xmm7
  mulsd  -0xb0(%rbp),%xmm7
  movq   %xmm7,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movq   %xmm0,%rax
  movq   %rax,%xmm4
  mulsd  -0x80(%rbp),%xmm4
  movapd %xmm4,%xmm0
  movapd %xmm0,%xmm6
  mulsd  -0xa0(%rbp),%xmm6
  movsd  %xmm6,-0xd8(%rbp)
  movsd  -0x80(%rbp),%xmm0
  movq   D160(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mulsd  -0x78(%rbp),%xmm0
  movapd %xmm0,%xmm2
  mulsd  0x20(%rbp),%xmm2
  movsd  -0x78(%rbp),%xmm0
  movapd %xmm0,%xmm3
  mulsd  -0x20(%rbp),%xmm3
  movapd %xmm3,%xmm1
  movsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm5
  mulsd  -0x40(%rbp),%xmm5
  movq   %xmm5,%rax
  movq   %rax,%xmm0
  mov    $0x3,%eax
  call   <cbnd@plt>
  pxor   %xmm7,%xmm7
  cvtsi2sd %eax,%xmm7
  movsd  %xmm7,-0xe0(%rbp)
  movsd  -0x50(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  movapd %xmm0,%xmm4
  mulsd  -0x60(%rbp),%xmm4
  movapd %xmm4,%xmm1
  movsd  0x18(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movapd %xmm1,%xmm3
  divsd  %xmm0,%xmm3
  movq   %xmm3,%rax
  movq   %rax,%xmm0
  call   <exp@plt>
  movsd  %xmm0,-0xe8(%rbp)
  movsd  -0x80(%rbp),%xmm0
  movq   D160(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mulsd  -0x78(%rbp),%xmm0
  movapd %xmm0,%xmm2
  mulsd  0x20(%rbp),%xmm2
  movsd  -0x78(%rbp),%xmm0
  movapd %xmm0,%xmm5
  mulsd  -0x10(%rbp),%xmm5
  movapd %xmm5,%xmm1
  movsd  -0x80(%rbp),%xmm0
  movapd %xmm0,%xmm4
  mulsd  -0x30(%rbp),%xmm4
  movq   %xmm4,%rax
  movq   %rax,%xmm0
  mov    $0x3,%eax
  call   <cbnd@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  -0xe8(%rbp),%xmm3
  mulsd  %xmm0,%xmm3
  movapd %xmm3,%xmm1
  movsd  -0xe0(%rbp),%xmm7
  subsd  %xmm1,%xmm7
  movapd %xmm7,%xmm0
  movsd  -0xd8(%rbp),%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0xd0(%rbp),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x84(%rbp),%eax
  cmp    $0x8,%eax
  seta   %dl
  test   %dl,%dl
  jne    L65
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  mov    %rdx,%rax
  mov    %rax,%rdx
  and    $0x154,%edx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L406
  mov    %rax,%rdx
  and    $0xa0,%edx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L257
  and    $0xa,%eax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  jne    L89
  jmp    L65
L406:
  movsd  -0x8(%rbp),%xmm0
  jmp    L149
L89:
  movsd  -0xc0(%rbp),%xmm3
  movsd  -0xb8(%rbp),%xmm2
  movsd  -0xb0(%rbp),%xmm1
  movsd  -0xa0(%rbp),%xmm0
  mov    -0x90(%rbp),%rax
  movsd  0x10(%rbp),%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    $0x6,%eax
  call   <gbs_call@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  subsd  -0x8(%rbp),%xmm0
  jmp    L149
L257:
  movsd  -0xc0(%rbp),%xmm3
  movsd  -0xb8(%rbp),%xmm2
  movsd  -0xb0(%rbp),%xmm1
  movsd  -0xa0(%rbp),%xmm0
  mov    -0x90(%rbp),%rax
  movsd  0x10(%rbp),%xmm5
  movapd %xmm3,%xmm4
  movapd %xmm2,%xmm3
  movapd %xmm1,%xmm2
  movapd %xmm0,%xmm1
  movq   %rax,%xmm0
  mov    $0x6,%eax
  call   <gbs_put@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  subsd  -0x8(%rbp),%xmm0
  jmp    L149
L65:
  call   <abort@plt>
L149:
  movq   %xmm0,%rax
  movq   %rax,%xmm0
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D35
data_type: f64[2]
name: extract_symbolic_data
arguments: tag: D233
data_type: f64
name: extract_symbolic_data
arguments: tag: D131
data_type: byte[16]
name: extract_symbolic_data
arguments: tag: D230
data_type: f64
name: extract_symbolic_data
arguments: tag: D209
data_type: f64
name: extract_symbolic_data
arguments: tag: D0
data_type: f32[4]
name: extract_symbolic_data
arguments: tag: D122
data_type: f64[2]
name: extract_symbolic_data
arguments: tag: D71
data_type: f64
name: extract_symbolic_data
arguments: tag: D278
data_type: f64
name: extract_symbolic_data
arguments: tag: D133
data_type: f64
name: extract_symbolic_data
arguments: tag: D123
data_type: f32[2]
name: extract_symbolic_data
arguments: tag: D160
data_type: f32[2]

tool: {"D35": [1e-6,1000000000000.0]}

tool: D233: 1000000000000

tool: {"D131": [0xce,0xd2,0x29,0x9c,0x17,0x96,0x25,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x40]}

tool: D230: 20

tool: D209: 1000

tool: {"D0": [0.0,-4.4765625,-7.803815971229722e-23,0.2449643909931183]}

tool: {"D122": [1e-7,100.99999]}

tool: D71: 100.99999

tool: D278: 2

tool: D133: 1

tool: {"D123": [0.0,-1.875]}

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

assistant: ```c
double TwoAssetBarrier(int typeflag, double S1, double S2, double X, double H, double T, double r, double b1, double b2, double v1, double v2, double Rho) {
  double sT, v2sT, logHS2, mu1, mu2, d1, d2, d3, d4, e1, e2, e3, e4, w;
  double eta;
  double phi;
  assert(((S1) == (S1)) && (S1) >= 0.000001 && (S1) <= 1000000000000.0);
  assert(((S2) == (S2)) && (S2) >= 0.000001 && (S2) <= 1000000000000.0);
  assert(((X) == (X)) && (X) >= 0.000001 && (X) <= 1000000000000.0);
  assert(((T) == (T)) && (T) >= (1.0 / (253.0 * 24.0)) && (T) <= (20.0));
  assert(((r) == (r)) && (r) >= 0.0 && (r) <= 1000.0);
  assert(((b1) == (b1)) && (b1) >= -1000.0 && (b1) <= 1000.0);
  assert(((b2) == (b2)) && (b2) >= -1000.0 && (b2) <= 1000.0);
  assert(((v1) == (v1)) && (v1) >= 0.0000001 && v1 <= 100.99999);
  assert(((v2) == (v2)) && (v2) >= 0.0000001 && v2 <= 100.99999);
  sT = sqrt(T);
  v2sT = v2 * sT;
  logHS2 = log(H / S2);
  mu1 = b1 - ((v1) * (v1)) / 2.0;
  mu2 = b2 - ((v2) * (v2)) / 2.0;
  d1 = (log(S1 / X) + (mu1 + ((v1) * (v1))) * T) / (v1 * sT);
  d2 = d1 - v1 * sT;
  d3 = d1 + 2.0 * Rho * logHS2 / v2sT;
  d4 = d2 + 2.0 * Rho * logHS2 / v2sT;
  e1 = (logHS2 - (mu2 + Rho * v1 * v2) * T) / v2sT;
  e2 = e1 + Rho * v1 * sT;
  e3 = e1 - 2.0 * logHS2 / v2sT;
  e4 = e2 - 2.0 * logHS2 / v2sT;
  switch (typeflag) {
  case 4:
  case 3:
    eta = phi = 1;
    break;
  case 2:
  case 1:
    eta = 1;
    phi = -1;
    break;
  case 8:
  case 7:
    eta = -1;
    phi = 1;
    break;
  case 6:
  case 5:
    phi = eta = -1;
    break;
  default:
    assert(0);
    abort();
  }
  w = eta * S1 * exp((b1 - r) * T) * (cbnd(eta * d1, phi * e1, -eta * phi * Rho) - exp(2.0 * (mu2 + Rho * v1 * v2) * logHS2 / ((v2) * (v2))) * cbnd(eta * d3, phi * e3, -eta * phi * Rho)) - eta * exp(-r * T) * X * (cbnd(eta * d2, phi * e2, -eta * phi * Rho) - exp(2.0 * mu2 * logHS2 / ((v2) * (v2))) * cbnd(eta * d4, phi * e4, -eta * phi * Rho));
  switch (typeflag) {
  case 4:
  case 2:
  case 8:
  case 6:
    return w;
  case 3:
  case 1:
    return gbs_call(S1, X, T, r, b1, v1) - w;
  case 7:
  case 5:
    return gbs_put(S1, X, T, r, b1, v1) - w;
  default:
    abort();
  }
}
```