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

```asm
<TetShapeAndDrv>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x160,%rsp
  mov    %edi,-0x144(%rbp)
  mov    %rsi,-0x150(%rbp)
  mov    %rdx,-0x158(%rbp)
  mov    %rcx,-0x160(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x130(%rbp)
  cmpl   $0x0,-0x144(%rbp)
  jg     L236
  mov    -0x130(%rbp),%eax
  jmp    L251
L236:
  mov    -0x150(%rbp),%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x60(%rbp)
  mov    -0x150(%rbp),%rax
  movsd  0x8(%rax),%xmm0
  movsd  %xmm0,-0x58(%rbp)
  mov    -0x150(%rbp),%rax
  movsd  0x10(%rax),%xmm0
  movsd  %xmm0,-0x50(%rbp)
  mov    -0x150(%rbp),%rax
  movsd  (%rax),%xmm1
  movsd  D149(%rip),%xmm0
  subsd  %xmm1,%xmm0
  mov    -0x150(%rbp),%rax
  add    $0x8,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x150(%rbp),%rax
  add    $0x10,%rax
  movsd  (%rax),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movl   $0x0,-0x13c(%rbp)
  jmp    L70
L272:
  mov    -0x13c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x158(%rbp),%rax
  add    %rax,%rdx
  mov    -0x13c(%rbp),%eax
  cltq
  movsd  -0x60(%rbp,%rax,8),%xmm0
  movsd  %xmm0,(%rdx)
  cmpl   $0x3,-0x13c(%rbp)
  jne    L222
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  movsd  D169(%rip),%xmm0
  movsd  %xmm0,0x10(%rcx)
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rax,%rdx
  movsd  0x10(%rcx),%xmm0
  movsd  %xmm0,0x8(%rdx)
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x3,%rax
  mov    %rax,%rcx
  mov    -0x160(%rbp),%rax
  add    %rcx,%rax
  movsd  0x8(%rdx),%xmm0
  movsd  %xmm0,(%rax)
  jmp    L204
L222:
  movl   $0x0,-0x138(%rbp)
  jmp    L160
L196:
  mov    -0x13c(%rbp),%eax
  cmp    -0x138(%rbp),%eax
  jne    L144
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rax,%rdx
  mov    -0x138(%rbp),%eax
  cltq
  movsd  D149(%rip),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  jmp    L112
L144:
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rax,%rdx
  mov    -0x138(%rbp),%eax
  cltq
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
L112:
  addl   $0x1,-0x138(%rbp)
L160:
  cmpl   $0x2,-0x138(%rbp)
  jle    L196
L204:
  addl   $0x1,-0x13c(%rbp)
L70:
  cmpl   $0x3,-0x13c(%rbp)
  jle    L272
  movl   $0x4,-0x130(%rbp)
  cmpl   $0x1,-0x144(%rbp)
  jle    L209
  movl   $0x0,-0x13c(%rbp)
  jmp    L6
L202:
  mov    -0x13c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D131(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  movsd  -0x60(%rbp,%rax,8),%xmm0
  movsd  %xmm0,-0xe0(%rbp)
  mov    -0x13c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D20(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  movsd  -0x60(%rbp,%rax,8),%xmm0
  movsd  %xmm0,-0xd8(%rbp)
  mov    -0x13c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D131(%rip),%rax
  add    %rax,%rdx
  lea    -0x60(%rbp),%rax
  mov    %rax,%rsi
  mov    %rdx,%rdi
  mov    $0x0,%eax
  call   <R_edgeBlendTet@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x120(%rbp)
  mov    -0x13c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D131(%rip),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0xa0(%rbp),%rdx
  lea    -0x60(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <R_edgeBlendTetDrv@plt>
  mov    -0x13c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D20(%rip),%rax
  mov    (%rdx,%rax,1),%esi
  mov    -0x13c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  lea    D131(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  lea    -0x40(%rbp),%rdx
  mov    %rdx,%rcx
  mov    $0x4,%edx
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <E_parDrv@plt>
  movl   $0x2,-0x134(%rbp)
  jmp    L245
L91:
  lea    -0xe0(%rbp),%rdx
  mov    -0x134(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <E_modeShape@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x118(%rbp)
  lea    -0x80(%rbp),%rdx
  lea    -0xe0(%rbp),%rcx
  mov    -0x134(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <E_modeShapeDrv@plt>
  mov    -0x130(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x158(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x120(%rbp),%xmm0
  mulsd  -0x118(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0xa0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x118(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm2
  movsd  -0x40(%rbp),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x78(%rbp),%xmm3
  movsd  -0x38(%rbp),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  mulsd  -0x120(%rbp),%xmm0
  mov    -0x130(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x98(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x118(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm2
  movsd  -0x30(%rbp),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x78(%rbp),%xmm3
  movsd  -0x28(%rbp),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  mulsd  -0x120(%rbp),%xmm0
  mov    -0x130(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rax)
  movsd  -0x90(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x118(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm2
  movsd  -0x20(%rbp),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  -0x78(%rbp),%xmm3
  movsd  -0x18(%rbp),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  mulsd  -0x120(%rbp),%xmm0
  mov    -0x130(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x10(%rax)
  addl   $0x1,-0x130(%rbp)
  addl   $0x1,-0x134(%rbp)
L245:
  mov    -0x134(%rbp),%eax
  cmp    -0x144(%rbp),%eax
  jle    L91
  addl   $0x1,-0x13c(%rbp)
L6:
  cmpl   $0x5,-0x13c(%rbp)
  jle    L202
L209:
  cmpl   $0x2,-0x144(%rbp)
  jle    L199
  movl   $0x0,-0x13c(%rbp)
  jmp    L47
L168:
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  lea    D33(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  movsd  -0x60(%rbp,%rax,8),%xmm0
  movsd  %xmm0,-0xc0(%rbp)
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  lea    D165(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  movsd  -0x60(%rbp,%rax,8),%xmm0
  movsd  %xmm0,-0xb8(%rbp)
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  lea    D65(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  movsd  -0x60(%rbp,%rax,8),%xmm0
  movsd  %xmm0,-0xb0(%rbp)
  movsd  -0xc0(%rbp),%xmm1
  movsd  -0xb8(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0xb0(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x120(%rbp)
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  lea    D33(%rip),%rdx
  lea    (%rax,%rdx,1),%rcx
  lea    -0xa0(%rbp),%rdx
  lea    -0x60(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  mov    $0x0,%eax
  call   <R_faceBlendTetDrv@plt>
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  mov    %rax,%rdx
  lea    D65(%rip),%rax
  mov    (%rdx,%rax,1),%edx
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  mov    %rax,%rcx
  lea    D165(%rip),%rax
  mov    (%rcx,%rax,1),%esi
  mov    -0x13c(%rbp),%eax
  movslq %eax,%rcx
  mov    %rcx,%rax
  add    %rax,%rax
  add    %rcx,%rax
  shl    $0x2,%rax
  mov    %rax,%rcx
  lea    D33(%rip),%rax
  mov    (%rcx,%rax,1),%eax
  lea    -0x128(%rbp),%rcx
  mov    %rcx,%r8
  mov    $0x4,%ecx
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <F_parDrv@plt>
  movl   $0x3,-0x134(%rbp)
  jmp    L246
L87:
  mov    -0x134(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x12c(%rbp)
  movl   $0x0,-0x140(%rbp)
  jmp    L79
L193:
  lea    -0xc0(%rbp),%rdx
  mov    -0x140(%rbp),%ecx
  mov    -0x134(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <F_modeShapeTri@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x118(%rbp)
  mov    -0x130(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x158(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x120(%rbp),%xmm0
  mulsd  -0x118(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  lea    -0xd0(%rbp),%rcx
  lea    -0xc0(%rbp),%rdx
  mov    -0x140(%rbp),%esi
  mov    -0x134(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <F_modeShapeTriDrv@plt>
  movsd  -0xd0(%rbp),%xmm1
  mov    -0x128(%rbp),%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0xc8(%rbp),%xmm2
  mov    -0x128(%rbp),%rax
  mov    0x4(%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x80(%rbp)
  movsd  -0xd0(%rbp),%xmm1
  mov    -0x128(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0xc8(%rbp),%xmm2
  mov    -0x128(%rbp),%rax
  add    $0x8,%rax
  mov    0x4(%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movsd  -0xd0(%rbp),%xmm1
  mov    -0x128(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0xc8(%rbp),%xmm2
  mov    -0x128(%rbp),%rax
  add    $0x10,%rax
  mov    0x4(%rax),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x70(%rbp)
  movsd  -0xa0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x118(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm0
  mulsd  -0x120(%rbp),%xmm0
  mov    -0x130(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x98(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x118(%rbp),%xmm1
  movsd  -0x78(%rbp),%xmm0
  mulsd  -0x120(%rbp),%xmm0
  mov    -0x130(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rax)
  movsd  -0x90(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x118(%rbp),%xmm1
  movsd  -0x70(%rbp),%xmm0
  mulsd  -0x120(%rbp),%xmm0
  mov    -0x130(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x10(%rax)
  addl   $0x1,-0x130(%rbp)
  addl   $0x1,-0x140(%rbp)
L79:
  mov    -0x140(%rbp),%eax
  cmp    -0x12c(%rbp),%eax
  jl     L193
  addl   $0x1,-0x134(%rbp)
L246:
  mov    -0x134(%rbp),%eax
  cmp    -0x144(%rbp),%eax
  jle    L87
  addl   $0x1,-0x13c(%rbp)
L47:
  cmpl   $0x3,-0x13c(%rbp)
  jle    L168
L199:
  cmpl   $0x3,-0x144(%rbp)
  jle    L161
  movl   $0x4,-0x134(%rbp)
  jmp    L58
L57:
  mov    -0x134(%rbp),%eax
  lea    -0x3(%rax),%edx
  mov    -0x134(%rbp),%eax
  sub    $0x2,%eax
  imul   %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,-0x12c(%rbp)
  movsd  -0x60(%rbp),%xmm1
  movsd  -0x58(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x50(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x48(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x120(%rbp)
  movsd  -0x60(%rbp),%xmm1
  movsd  D149(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  -0x58(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movsd  -0x50(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x110(%rbp)
  movsd  -0x60(%rbp),%xmm1
  movsd  -0x58(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x110(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x108(%rbp)
  movsd  -0x58(%rbp),%xmm1
  movsd  -0x50(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x110(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x100(%rbp)
  movsd  -0x60(%rbp),%xmm1
  movsd  -0x50(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x110(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xf8(%rbp)
  movsd  -0x60(%rbp),%xmm1
  movsd  -0x58(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x50(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xf0(%rbp)
  movsd  -0x48(%rbp),%xmm0
  movsd  -0xf0(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xe8(%rbp)
  movl   $0x0,-0x140(%rbp)
  jmp    L135
L197:
  lea    -0x60(%rbp),%rdx
  mov    -0x140(%rbp),%ecx
  mov    -0x134(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <R_modeShapeTet@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0x118(%rbp)
  mov    -0x130(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x158(%rbp),%rax
  add    %rdx,%rax
  movsd  -0x120(%rbp),%xmm0
  mulsd  -0x118(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  lea    -0x80(%rbp),%rcx
  lea    -0x60(%rbp),%rdx
  mov    -0x140(%rbp),%esi
  mov    -0x134(%rbp),%eax
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <R_modeShapeTetDrv@plt>
  movsd  -0x100(%rbp),%xmm0
  subsd  -0xf0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x118(%rbp),%xmm1
  movsd  -0x80(%rbp),%xmm0
  mulsd  -0xe8(%rbp),%xmm0
  mov    -0x130(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0xf8(%rbp),%xmm0
  subsd  -0xf0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x118(%rbp),%xmm1
  movsd  -0x78(%rbp),%xmm0
  mulsd  -0xe8(%rbp),%xmm0
  mov    -0x130(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rax)
  movsd  -0x108(%rbp),%xmm0
  subsd  -0xf0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x118(%rbp),%xmm1
  movsd  -0x70(%rbp),%xmm0
  mulsd  -0xe8(%rbp),%xmm0
  mov    -0x130(%rbp),%eax
  movslq %eax,%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x3,%rax
  mov    %rax,%rdx
  mov    -0x160(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x10(%rax)
  addl   $0x1,-0x130(%rbp)
  addl   $0x1,-0x140(%rbp)
L135:
  mov    -0x140(%rbp),%eax
  cmp    -0x12c(%rbp),%eax
  jl     L197
  addl   $0x1,-0x134(%rbp)
L58:
  mov    -0x134(%rbp),%eax
  cmp    -0x144(%rbp),%eax
  jle    L57
L161:
  mov    -0x130(%rbp),%eax
L251:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L216
  call   <__stack_chk_fail@plt>
L216:
  leave
  ret
```

tool_calls: name: read_data
arguments: data_tag: D149
datatype: f64
name: read_data
arguments: data_tag: D169
datatype: f32[2]

tool: D149: 1

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

assistant: ```c
int TetShapeAndDrv(int p, double par[3], double N[], double dN[][3]) {
  static int TetEMAP[6][2] = {{0, 1}, {1, 2}, {2, 0}, {0, 3}, {1, 3}, {2, 3}};
  static int TetFMAP[4][3] = {{0, 1, 2}, {0, 3, 1}, {1, 3, 2}, {0, 2, 3}};
  int NS, is, i, j, ip, nshp = 0, (*fpdrv)[2];
  double L[4], Le[2], Lf[3], mode, blend, bdrv[3], mdrv[3], epdrv[3][2], mfdrv[2];
  double tmp, rst, rsw, stw, rstw, rtw;
  if (p < 1)
    return nshp;
  L[0] = par[0];
  L[1] = par[1];
  L[2] = par[2];
  L[3] = 1.0e0 - par[0] - par[1] - par[2];
  for (i = 0; i < 4; i++) {
    N[i] = L[i];
    if (i == 3)
      dN[i][0] = dN[i][1] = dN[i][2] = -1.0e0;
    else {
      for (j = 0; j < 3; j++) {
        if (i == j)
          dN[i][j] = 1.0e0;
        else
          dN[i][j] = 0.0e0;
      }
    }
  }
  nshp = 4;
  if (p > 1) {
    for (i = 0; i < 6; i++) {
      Le[0] = L[TetEMAP[i][0]];
      Le[1] = L[TetEMAP[i][1]];
      blend = R_edgeBlendTet(TetEMAP[i], L);
      R_edgeBlendTetDrv(TetEMAP[i], L, bdrv);
      E_parDrv(TetEMAP[i][0], TetEMAP[i][1], 4, epdrv);
      for (ip = 2; ip <= p; ip++) {
        mode = E_modeShape(ip, Le);
        E_modeShapeDrv(ip, Le, mdrv);
        N[nshp] = blend * mode;
        dN[nshp][0] = bdrv[0] * mode + blend * (mdrv[0] * epdrv[0][0] + mdrv[1] * epdrv[0][1]);
        dN[nshp][1] = bdrv[1] * mode + blend * (mdrv[0] * epdrv[1][0] + mdrv[1] * epdrv[1][1]);
        dN[nshp][2] = bdrv[2] * mode + blend * (mdrv[0] * epdrv[2][0] + mdrv[1] * epdrv[2][1]);
        nshp++;
      }
    }
  }
  if (p > 2) {
    for (i = 0; i < 4; i++) {
      Lf[0] = L[TetFMAP[i][0]];
      Lf[1] = L[TetFMAP[i][1]];
      Lf[2] = L[TetFMAP[i][2]];
      blend = Lf[0] * Lf[1] * Lf[2];
      R_faceBlendTetDrv(TetFMAP[i], L, bdrv);
      F_parDrv(TetFMAP[i][0], TetFMAP[i][1], TetFMAP[i][2], 4, &fpdrv);
      for (ip = 3; ip <= p; ip++) {
        NS = ip - 2;
        for (is = 0; is < NS; is++) {
          mode = F_modeShapeTri(ip, is, Lf);
          N[nshp] = blend * mode;
          F_modeShapeTriDrv(ip, is, Lf, mfdrv);
          mdrv[0] = mfdrv[0] * (double)fpdrv[0][0] + mfdrv[1] * (double)fpdrv[0][1];
          mdrv[1] = mfdrv[0] * (double)fpdrv[1][0] + mfdrv[1] * (double)fpdrv[1][1];
          mdrv[2] = mfdrv[0] * (double)fpdrv[2][0] + mfdrv[1] * (double)fpdrv[2][1];
          dN[nshp][0] = bdrv[0] * mode + blend * mdrv[0];
          dN[nshp][1] = bdrv[1] * mode + blend * mdrv[1];
          dN[nshp][2] = bdrv[2] * mode + blend * mdrv[2];
          nshp++;
        }
      }
    }
  }
  if (p > 3) {
    for (ip = 4; ip <= p; ip++) {
      NS = (ip - 3) * (ip - 2) / 2;
      blend = L[0] * L[1] * L[2] * L[3];
      tmp = 1.0e0 - L[0] - L[1] - L[2];
      rsw = L[0] * L[1] * tmp;
      stw = L[1] * L[2] * tmp;
      rtw = L[0] * L[2] * tmp;
      rst = L[0] * L[1] * L[2];
      rstw = rst * L[3];
      for (is = 0; is < NS; is++) {
        mode = R_modeShapeTet(ip, is, L);
        N[nshp] = blend * mode;
        R_modeShapeTetDrv(ip, is, L, mdrv);
        dN[nshp][0] = mode * (stw - rst) + rstw * mdrv[0];
        dN[nshp][1] = mode * (rtw - rst) + rstw * mdrv[1];
        dN[nshp][2] = mode * (rsw - rst) + rstw * mdrv[2];
        nshp++;
      }
    }
  }
  return nshp;
}
```