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

```asm
<newviewFlexGamma_Ancestral>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x90,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %rcx,-0x80(%rbp)
  mov    %r8,-0x88(%rbp)
  mov    %r9,-0x90(%rbp)
  mov    0x30(%rbp),%eax
  cltq
  shl    $0x5,%eax
  mov    %eax,%edi
  call   <rax_malloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    0x30(%rbp),%eax
  imul   %eax,%eax
  mov    %eax,-0x40(%rbp)
  mov    0x30(%rbp),%eax
  shl    $0x2,%eax
  mov    %eax,-0x3c(%rbp)
  cmpl   $0x2,-0x64(%rbp)
  je     L529
  cmpl   $0x2,-0x64(%rbp)
  jg     L303
  cmpl   $0x0,-0x64(%rbp)
  je     L341
  cmpl   $0x1,-0x64(%rbp)
  je     L117
  jmp    L303
L341:
  movl   $0x0,-0x54(%rbp)
  jmp    L51
L572:
  movl   $0x0,-0x48(%rbp)
  jmp    L377
L367:
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  imul   0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  mov    0x10(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  imul   0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    0x30(%rbp),%eax
  imul   -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L259
L147:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x4c(%rbp)
L259:
  mov    -0x4c(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L147
  movl   $0x0,-0x4c(%rbp)
  jmp    L261
L160:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L474
L131:
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  imul   0x30(%rbp),%eax
  add    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  imul   0x30(%rbp),%eax
  add    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  addl   $0x1,-0x50(%rbp)
L474:
  mov    -0x50(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L131
  movsd  -0x38(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L583
L23:
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    0x30(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x50(%rbp)
L583:
  mov    -0x50(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L23
  addl   $0x1,-0x4c(%rbp)
L261:
  mov    -0x4c(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L160
  addl   $0x1,-0x48(%rbp)
L377:
  cmpl   $0x3,-0x48(%rbp)
  jle    L367
  mov    -0x3c(%rbp),%r8d
  mov    0x30(%rbp),%edi
  mov    -0x54(%rbp),%ecx
  mov    0x38(%rbp),%rdx
  mov    0x40(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <ancestralGamma@plt>
  addl   $0x1,-0x54(%rbp)
L51:
  mov    -0x54(%rbp),%eax
  cmp    0x18(%rbp),%eax
  jl     L572
  jmp    L313
L117:
  movl   $0x0,-0x54(%rbp)
  jmp    L499
L37:
  movl   $0x0,-0x48(%rbp)
  jmp    L571
L129:
  mov    -0x54(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x90(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  imul   0x30(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x88(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x3c(%rbp),%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,%edx
  mov    0x30(%rbp),%eax
  imul   -0x48(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    0x30(%rbp),%eax
  imul   -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L43
L514:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x4c(%rbp)
L43:
  mov    -0x4c(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L514
  movl   $0x0,-0x4c(%rbp)
  jmp    L541
L388:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L276
L40:
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  imul   0x30(%rbp),%eax
  add    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  imul   0x30(%rbp),%eax
  add    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  addl   $0x1,-0x50(%rbp)
L276:
  mov    -0x50(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L40
  movsd  -0x38(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L579
L38:
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    0x30(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x50(%rbp)
L579:
  mov    -0x50(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L38
  addl   $0x1,-0x4c(%rbp)
L541:
  mov    -0x4c(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L388
  addl   $0x1,-0x48(%rbp)
L571:
  cmpl   $0x3,-0x48(%rbp)
  jle    L129
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x1,-0x44(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L4
L274:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L449
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd D20(%rip),%xmm0
  seta   %al
  movzbl %al,%eax
  jmp    L386
L449:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  D37(%rip),%xmm0
  comisd %xmm1,%xmm0
  seta   %al
  movzbl %al,%eax
L386:
  mov    %eax,-0x44(%rbp)
  addl   $0x1,-0x4c(%rbp)
L4:
  cmpl   $0x0,-0x44(%rbp)
  je     L441
  mov    -0x4c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L274
L441:
  cmpl   $0x0,-0x44(%rbp)
  je     L511
  movl   $0x0,-0x4c(%rbp)
  jmp    L473
L595:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  D9(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x4c(%rbp)
L473:
  mov    -0x4c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L595
L511:
  mov    -0x3c(%rbp),%r8d
  mov    0x30(%rbp),%edi
  mov    -0x54(%rbp),%ecx
  mov    0x38(%rbp),%rdx
  mov    0x40(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <ancestralGamma@plt>
  addl   $0x1,-0x54(%rbp)
L499:
  mov    -0x54(%rbp),%eax
  cmp    0x18(%rbp),%eax
  jl     L37
  jmp    L313
L529:
  movl   $0x0,-0x54(%rbp)
  jmp    L331
L81:
  movl   $0x0,-0x48(%rbp)
  jmp    L109
L199:
  mov    -0x3c(%rbp),%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,%edx
  mov    0x30(%rbp),%eax
  imul   -0x48(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x70(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x3c(%rbp),%eax
  imul   -0x54(%rbp),%eax
  mov    %eax,%edx
  mov    0x30(%rbp),%eax
  imul   -0x48(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  mov    0x30(%rbp),%eax
  imul   -0x48(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L191
L392:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x4c(%rbp)
L191:
  mov    -0x4c(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L392
  movl   $0x0,-0x4c(%rbp)
  jmp    L466
L516:
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  pxor   %xmm0,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L323
L93:
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  imul   0x30(%rbp),%eax
  add    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x38(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x48(%rbp),%eax
  imul   -0x40(%rbp),%eax
  mov    %eax,%edx
  mov    -0x4c(%rbp),%eax
  imul   0x30(%rbp),%eax
  add    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    0x28(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  -0x30(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x30(%rbp)
  addl   $0x1,-0x50(%rbp)
L323:
  mov    -0x50(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L93
  movsd  -0x38(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x50(%rbp)
  jmp    L353
L290:
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    0x30(%rbp),%eax
  imul   -0x4c(%rbp),%eax
  mov    %eax,%edx
  mov    -0x50(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x80(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  -0x8(%rbp),%xmm0
  mov    -0x50(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x50(%rbp)
L353:
  mov    -0x50(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L290
  addl   $0x1,-0x4c(%rbp)
L466:
  mov    -0x4c(%rbp),%eax
  cmp    0x30(%rbp),%eax
  jl     L516
  addl   $0x1,-0x48(%rbp)
L109:
  cmpl   $0x3,-0x48(%rbp)
  jle    L199
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  movl   $0x1,-0x44(%rbp)
  movl   $0x0,-0x4c(%rbp)
  jmp    L565
L190:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  pxor   %xmm0,%xmm0
  comisd %xmm1,%xmm0
  jbe    L179
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  comisd D20(%rip),%xmm0
  seta   %al
  movzbl %al,%eax
  jmp    L16
L179:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  movsd  D37(%rip),%xmm0
  comisd %xmm1,%xmm0
  seta   %al
  movzbl %al,%eax
L16:
  mov    %eax,-0x44(%rbp)
  addl   $0x1,-0x4c(%rbp)
L565:
  cmpl   $0x0,-0x44(%rbp)
  je     L272
  mov    -0x4c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L190
L272:
  cmpl   $0x0,-0x44(%rbp)
  je     L264
  movl   $0x0,-0x4c(%rbp)
  jmp    L78
L500:
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x4c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  D9(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x4c(%rbp)
L78:
  mov    -0x4c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L500
L264:
  mov    -0x3c(%rbp),%r8d
  mov    0x30(%rbp),%edi
  mov    -0x54(%rbp),%ecx
  mov    0x38(%rbp),%rdx
  mov    0x40(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <ancestralGamma@plt>
  addl   $0x1,-0x54(%rbp)
L331:
  mov    -0x54(%rbp),%eax
  cmp    0x18(%rbp),%eax
  jl     L81
  jmp    L313
L303:
  mov    $0x0,%edi
  call   <assert@plt>
L313:
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <rax_free@plt>
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D20
datatype: f32[4]
name: read_data
arguments: data_label: D37
datatype: f32[2]
name: read_data
arguments: data_label: D9
datatype: f64

tool: {"D20": [0.0,-4.3655745685100555e-10,0.0,4.3655745685100555e-10]}

tool: {"D37": [0.0,4.3655745685100555e-10]}

tool: D9: 1.157920892373162e+77

assistant: ```c
void newviewFlexGamma_Ancestral(int tipCase, double *x1, double *x2, double *extEV, double *tipVector, unsigned char *tipX1, unsigned char *tipX2, int n, double *left, double *right, const int numStates, double *diagptable, double *sumBuffer) {
  double *v, *x3 = (double *)rax_malloc(sizeof(double) * 4 * numStates);
  double x1px2;
  int i, j, l, k, scale;
  double *vl, *vr, al, ar;
  const int statesSquare = numStates * numStates, gammaStates = 4 * numStates;
  switch (tipCase) {
  case 0: {
    for (i = 0; i < n; i++) {
      for (k = 0; k < 4; k++) {
        vl = &(tipVector[numStates * tipX1[i]]);
        vr = &(tipVector[numStates * tipX2[i]]);
        v = &(x3[numStates * k]);
        for (l = 0; l < numStates; l++)
          v[l] = 0;
        for (l = 0; l < numStates; l++) {
          al = 0.0;
          ar = 0.0;
          for (j = 0; j < numStates; j++) {
            al += vl[j] * left[k * statesSquare + l * numStates + j];
            ar += vr[j] * right[k * statesSquare + l * numStates + j];
          }
          x1px2 = al * ar;
          for (j = 0; j < numStates; j++)
            v[j] += x1px2 * extEV[numStates * l + j];
        }
      }
      ancestralGamma(x3, sumBuffer, diagptable, i, numStates, gammaStates);
    }
  } break;
  case 1: {
    for (i = 0; i < n; i++) {
      for (k = 0; k < 4; k++) {
        vl = &(tipVector[numStates * tipX1[i]]);
        vr = &(x2[gammaStates * i + numStates * k]);
        v = &(x3[numStates * k]);
        for (l = 0; l < numStates; l++)
          v[l] = 0;
        for (l = 0; l < numStates; l++) {
          al = 0.0;
          ar = 0.0;
          for (j = 0; j < numStates; j++) {
            al += vl[j] * left[k * statesSquare + l * numStates + j];
            ar += vr[j] * right[k * statesSquare + l * numStates + j];
          }
          x1px2 = al * ar;
          for (j = 0; j < numStates; j++)
            v[j] += x1px2 * extEV[numStates * l + j];
        }
      }
      v = x3;
      scale = 1;
      for (l = 0; scale && (l < gammaStates); l++)
        scale = ((((v[l]) < 0) ? (-(v[l])) : (v[l])) < (1.0 / 115792089237316195423570985008687907853269984665640564039457584007913129639936.0));
      if (scale) {
        for (l = 0; l < gammaStates; l++)
          v[l] *= 115792089237316195423570985008687907853269984665640564039457584007913129639936.0;
      }
      ancestralGamma(x3, sumBuffer, diagptable, i, numStates, gammaStates);
    }
  } break;
  case 2:
    for (i = 0; i < n; i++) {
      for (k = 0; k < 4; k++) {
        vl = &(x1[gammaStates * i + numStates * k]);
        vr = &(x2[gammaStates * i + numStates * k]);
        v = &(x3[numStates * k]);
        for (l = 0; l < numStates; l++)
          v[l] = 0;
        for (l = 0; l < numStates; l++) {
          al = 0.0;
          ar = 0.0;
          for (j = 0; j < numStates; j++) {
            al += vl[j] * left[k * statesSquare + l * numStates + j];
            ar += vr[j] * right[k * statesSquare + l * numStates + j];
          }
          x1px2 = al * ar;
          for (j = 0; j < numStates; j++)
            v[j] += x1px2 * extEV[numStates * l + j];
        }
      }
      v = x3;
      scale = 1;
      for (l = 0; scale && (l < gammaStates); l++)
        scale = (((((v[l]) < 0) ? (-(v[l])) : (v[l])) < (1.0 / 115792089237316195423570985008687907853269984665640564039457584007913129639936.0)));
      if (scale) {
        for (l = 0; l < gammaStates; l++)
          v[l] *= 115792089237316195423570985008687907853269984665640564039457584007913129639936.0;
      }
      ancestralGamma(x3, sumBuffer, diagptable, i, numStates, gammaStates);
    }
    break;
  default:
    assert(0);
  }
  rax_free(x3);
}
```