user: Demonstrate the C code that generates the assembly output below:

```asm
<TetShapeAndDrv>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x158,%rsp
  mov    %edi,0x58(%rsp)
  mov    %rdx,0x50(%rsp)
  mov    %rcx,0x48(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x148(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x24(%rsp)
  test   %edi,%edi
  jle    L149
  movsd  (%rsi),%xmm1
  movsd  %xmm1,0xf0(%rsp)
  movsd  0x8(%rsi),%xmm3
  movsd  %xmm3,0xf8(%rsp)
  movsd  0x10(%rsi),%xmm2
  movsd  %xmm2,0x100(%rsp)
  movsd  D8(%rip),%xmm0
  subsd  %xmm1,%xmm0
  subsd  %xmm3,%xmm0
  subsd  %xmm2,%xmm0
  movsd  %xmm0,0x108(%rsp)
  movsd  %xmm1,(%rdx)
  mov    %rcx,%rsi
  mov    $0x0,%ecx
  movsd  D8(%rip),%xmm1
  mov    %rdx,%r8
L42:
  mov    %ecx,%edi
  mov    %rsi,%rdx
  mov    $0x0,%eax
L173:
  cmp    %eax,%edi
  je     L148
  movq   $0x0,(%rdx)
L158:
  add    $0x1,%eax
  add    $0x8,%rdx
  cmp    $0x3,%eax
  jne    L173
  add    $0x1,%rcx
  movsd  0xf0(%rsp,%rcx,8),%xmm0
  movsd  %xmm0,(%r8,%rcx,8)
  add    $0x18,%rsi
  cmp    $0x3,%rcx
  jne    L42
  movsd  D41(%rip),%xmm0
  mov    0x48(%rsp),%rax
  movsd  %xmm0,0x58(%rax)
  movsd  %xmm0,0x50(%rax)
  movsd  %xmm0,0x48(%rax)
  lea    D67(%rip),%r14
  movl   $0x4,0x24(%rsp)
  lea    0xf0(%rsp),%r15
  cmpl   $0x1,0x58(%rsp)
  jle    L22
  mov    %r15,0x18(%rsp)
  mov    0x50(%rsp),%r15
L174:
  movslq (%r14),%rax
  movsd  0xf0(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x70(%rsp)
  movslq 0x4(%r14),%rax
  movsd  0xf0(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x78(%rsp)
  mov    0x18(%rsp),%rbx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <R_edgeBlendTet@plt>
  pxor   %xmm7,%xmm7
  cvtsi2sd %eax,%xmm7
  movsd  %xmm7,0x10(%rsp)
  lea    0xb0(%rsp),%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <R_edgeBlendTetDrv@plt>
  lea    0x110(%rsp),%rcx
  mov    0x4(%r14),%esi
  mov    $0x4,%edx
  mov    (%r14),%edi
  mov    $0x0,%eax
  call   <E_parDrv@plt>
  mov    0x24(%rsp),%eax
  lea    0x1(%rax),%r12d
  movslq %r12d,%r12
  cltq
  lea    (%rax,%rax,2),%rax
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rax,8),%rbp
  mov    $0x2,%ebx
  lea    0x70(%rsp),%r13
L178:
  mov    %r13,%rsi
  mov    %ebx,%edi
  mov    $0x0,%eax
  call   <E_modeShape@plt>
  pxor   %xmm7,%xmm7
  cvtsi2sd %eax,%xmm7
  movsd  %xmm7,0x8(%rsp)
  lea    0xd0(%rsp),%rdx
  mov    %r13,%rsi
  mov    %ebx,%edi
  mov    $0x0,%eax
  call   <E_modeShapeDrv@plt>
  movsd  0x10(%rsp),%xmm4
  movapd %xmm4,%xmm0
  movsd  0x8(%rsp),%xmm7
  mulsd  %xmm7,%xmm0
  movsd  %xmm0,-0x8(%r15,%r12,8)
  movsd  0xd0(%rsp),%xmm0
  movsd  0xd8(%rsp),%xmm2
  movapd %xmm0,%xmm1
  mulsd  0x110(%rsp),%xmm1
  movapd %xmm2,%xmm3
  mulsd  0x118(%rsp),%xmm3
  addsd  %xmm3,%xmm1
  mulsd  %xmm4,%xmm1
  movapd %xmm7,%xmm3
  mulsd  0xb0(%rsp),%xmm3
  addsd  %xmm3,%xmm1
  movsd  %xmm1,0x0(%rbp)
  movapd %xmm0,%xmm1
  mulsd  0x120(%rsp),%xmm1
  movapd %xmm2,%xmm3
  mulsd  0x128(%rsp),%xmm3
  addsd  %xmm3,%xmm1
  mulsd  %xmm4,%xmm1
  movapd %xmm7,%xmm3
  mulsd  0xb8(%rsp),%xmm3
  addsd  %xmm3,%xmm1
  movsd  %xmm1,0x8(%rbp)
  mulsd  0x130(%rsp),%xmm0
  mulsd  0x138(%rsp),%xmm2
  addsd  %xmm2,%xmm0
  mulsd  %xmm4,%xmm0
  mulsd  0xc0(%rsp),%xmm7
  addsd  %xmm7,%xmm0
  movsd  %xmm0,0x10(%rbp)
  mov    %r12d,0x24(%rsp)
  add    $0x1,%ebx
  add    $0x1,%r12
  add    $0x18,%rbp
  cmp    %ebx,0x58(%rsp)
  jge    L178
  add    $0x8,%r14
  lea    D46(%rip),%rax
  cmp    %rax,%r14
  jne    L174
L22:
  cmpl   $0x2,0x58(%rsp)
  jle    L30
  lea    D50(%rip),%rax
  mov    %rax,0x28(%rsp)
  lea    0xb0(%rsp),%rax
  mov    %rax,0x30(%rsp)
  lea    0xf0(%rsp),%rax
  mov    %rax,0x38(%rsp)
  lea    0x90(%rsp),%r15
L76:
  mov    0x28(%rsp),%rbx
  mov    %rbx,%rdi
  movslq (%rbx),%rax
  movsd  0xf0(%rsp,%rax,8),%xmm2
  movsd  %xmm2,0x90(%rsp)
  movslq 0x4(%rbx),%rax
  movsd  0xf0(%rsp,%rax,8),%xmm0
  movsd  %xmm0,0x98(%rsp)
  movslq 0x8(%rbx),%rax
  movsd  0xf0(%rsp,%rax,8),%xmm1
  movsd  %xmm1,0xa0(%rsp)
  mulsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rsp)
  mov    0x30(%rsp),%rdx
  mov    0x38(%rsp),%rsi
  mov    $0x0,%eax
  call   <R_faceBlendTetDrv@plt>
  mov    0x8(%rbx),%edx
  mov    0x4(%rbx),%esi
  lea    0x68(%rsp),%r8
  mov    $0x4,%ecx
  mov    (%rbx),%edi
  mov    $0x0,%eax
  call   <F_parDrv@plt>
  mov    $0x1,%r14d
L40:
  lea    0x2(%r14),%r13d
  test   %r14d,%r14d
  jle    L8
  movslq 0x24(%rsp),%rax
  lea    (%rax,%rax,2),%rdx
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rdx,8),%rbp
  mov    0x50(%rsp),%rdi
  lea    (%rdi,%rax,8),%rax
  mov    %rax,0x18(%rsp)
  mov    $0x0,%ebx
L44:
  mov    %r15,%rdx
  mov    %ebx,%esi
  mov    %r13d,%edi
  mov    $0x0,%eax
  call   <F_modeShapeTri@plt>
  pxor   %xmm5,%xmm5
  cvtsi2sd %eax,%xmm5
  movsd  0x8(%rsp),%xmm0
  movsd  %xmm5,0x10(%rsp)
  mulsd  %xmm5,%xmm0
  mov    0x18(%rsp),%rax
  movsd  %xmm0,(%rax,%rbx,8)
  lea    0x80(%rsp),%rcx
  mov    %r15,%rdx
  mov    %ebx,%esi
  mov    %r13d,%edi
  mov    $0x0,%eax
  call   <F_modeShapeTriDrv@plt>
  movsd  0x80(%rsp),%xmm3
  mov    0x68(%rsp),%rax
  movsd  0x88(%rsp),%xmm4
  pxor   %xmm2,%xmm2
  cvtsi2sdl (%rax),%xmm2
  mulsd  %xmm3,%xmm2
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x4(%rax),%xmm0
  mulsd  %xmm4,%xmm0
  addsd  %xmm0,%xmm2
  movsd  %xmm2,0xd0(%rsp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x8(%rax),%xmm0
  mulsd  %xmm3,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0xc(%rax),%xmm1
  mulsd  %xmm4,%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0xd8(%rsp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl 0x10(%rax),%xmm1
  mulsd  %xmm3,%xmm1
  pxor   %xmm3,%xmm3
  cvtsi2sdl 0x14(%rax),%xmm3
  mulsd  %xmm4,%xmm3
  addsd  %xmm3,%xmm1
  movsd  %xmm1,0xe0(%rsp)
  movsd  0x10(%rsp),%xmm5
  movapd %xmm5,%xmm3
  mulsd  0xb0(%rsp),%xmm3
  movsd  0x8(%rsp),%xmm6
  mulsd  %xmm6,%xmm2
  addsd  %xmm3,%xmm2
  movsd  %xmm2,0x0(%rbp)
  movapd %xmm5,%xmm2
  mulsd  0xb8(%rsp),%xmm2
  mulsd  %xmm6,%xmm0
  addsd  %xmm2,%xmm0
  movsd  %xmm0,0x8(%rbp)
  mulsd  0xc0(%rsp),%xmm5
  movapd %xmm5,%xmm0
  mulsd  %xmm6,%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x10(%rbp)
  add    $0x1,%rbx
  add    $0x18,%rbp
  cmp    %r14,%rbx
  jne    L44
  mov    0x24(%rsp),%eax
  lea    -0x2(%r13,%rax,1),%eax
  mov    %eax,0x24(%rsp)
L8:
  add    $0x1,%r14
  lea    0x2(%r14),%eax
  cmp    %eax,0x58(%rsp)
  jge    L40
  addq   $0xc,0x28(%rsp)
  mov    0x28(%rsp),%rax
  lea    D16(%rip),%rcx
  cmp    %rcx,%rax
  jne    L76
L30:
  cmpl   $0x3,0x58(%rsp)
  jle    L149
  mov    $0x4,%r15d
L156:
  lea    -0x2(%r15),%edx
  lea    -0x3(%r15),%eax
  imul   %eax,%edx
  mov    %edx,0x5c(%rsp)
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  mov    %eax,0x18(%rsp)
  movsd  0xf0(%rsp),%xmm1
  movsd  0xf8(%rsp),%xmm2
  movapd %xmm1,%xmm4
  mulsd  %xmm2,%xmm4
  movsd  0x100(%rsp),%xmm3
  movapd %xmm4,%xmm7
  mulsd  %xmm3,%xmm7
  movsd  %xmm7,0x28(%rsp)
  mulsd  0x108(%rsp),%xmm7
  movsd  %xmm7,0x8(%rsp)
  movsd  D8(%rip),%xmm0
  subsd  %xmm1,%xmm0
  subsd  %xmm2,%xmm0
  subsd  %xmm3,%xmm0
  mulsd  %xmm0,%xmm4
  movsd  %xmm4,0x30(%rsp)
  mulsd  %xmm3,%xmm2
  mulsd  %xmm0,%xmm2
  movsd  %xmm2,0x38(%rsp)
  mulsd  %xmm3,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x40(%rsp)
  cmp    $0x1,%edx
  jle    L108
  movslq 0x24(%rsp),%rax
  lea    (%rax,%rax,2),%rdx
  mov    0x48(%rsp),%rsi
  lea    (%rsi,%rdx,8),%rbp
  mov    0x50(%rsp),%rsi
  lea    (%rsi,%rax,8),%r14
  mov    $0x0,%ebx
  lea    0xf0(%rsp),%r13
L45:
  mov    %r13,%rdx
  mov    %ebx,%esi
  mov    %r15d,%edi
  mov    $0x0,%eax
  call   <R_modeShapeTet@plt>
  pxor   %xmm4,%xmm4
  cvtsi2sd %eax,%xmm4
  movsd  0x8(%rsp),%xmm0
  movsd  %xmm4,0x10(%rsp)
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,(%r14,%rbx,8)
  lea    0xd0(%rsp),%rcx
  mov    %r13,%rdx
  mov    %ebx,%esi
  mov    %r15d,%edi
  mov    $0x0,%eax
  call   <R_modeShapeTetDrv@plt>
  movsd  0x38(%rsp),%xmm5
  movsd  0x28(%rsp),%xmm6
  subsd  %xmm6,%xmm5
  movapd %xmm5,%xmm0
  movsd  0x10(%rsp),%xmm4
  mulsd  %xmm4,%xmm0
  movsd  0x8(%rsp),%xmm7
  movapd %xmm7,%xmm1
  mulsd  0xd0(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x0(%rbp)
  movsd  0x40(%rsp),%xmm0
  subsd  %xmm6,%xmm0
  mulsd  %xmm4,%xmm0
  movapd %xmm7,%xmm1
  mulsd  0xd8(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,0x8(%rbp)
  movsd  0x30(%rsp),%xmm0
  subsd  %xmm6,%xmm0
  mulsd  %xmm4,%xmm0
  mulsd  0xe0(%rsp),%xmm7
  addsd  %xmm7,%xmm0
  movsd  %xmm0,0x10(%rbp)
  add    $0x1,%rbx
  add    $0x18,%rbp
  cmp    %ebx,0x18(%rsp)
  jg     L45
  mov    0x18(%rsp),%eax
  sub    $0x1,%eax
  cmpl   $0x1,0x5c(%rsp)
  mov    $0x0,%edx
  cmovle %edx,%eax
  mov    0x24(%rsp),%esi
  lea    0x1(%rsi,%rax,1),%eax
  mov    %eax,0x24(%rsp)
L108:
  add    $0x1,%r15d
  cmp    %r15d,0x58(%rsp)
  jge    L156
L149:
  mov    0x148(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L172
  mov    0x24(%rsp),%eax
  add    $0x158,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L148:
  movsd  %xmm1,(%rdx)
  jmp    L158
L172:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D8
data_type: f64
name: read_data
arguments: data_tag: D41
data_type: f32[2]

tool: D8: 1

tool: {"D41": [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;
}
```