user: Translate the below assembly code into C programming language:

```asm
<initGeneric>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %edi,%r15d
  mov    %edi,0x3c(%rsp)
  mov    %rsi,0xa8(%rsp)
  mov    %edx,0x8c(%rsp)
  mov    %rcx,0x8(%rsp)
  mov    %r8,0xb0(%rsp)
  mov    %r9,0x90(%rsp)
  movslq %edi,%r12
  shl    $0x3,%r12
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  mov    %eax,%ebx
  mov    %eax,0x5c(%rsp)
  cltq
  mov    %rax,0x80(%rsp)
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  mov    %eax,%r13d
  mov    %eax,0x58(%rsp)
  cltq
  mov    %rax,0x98(%rsp)
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  mov    %eax,%esi
  mov    %eax,0xa0(%rsp)
  cltq
  mov    %rax,0x70(%rsp)
  test   %r15d,%r15d
  jle    L61
  mov    %r15d,%eax
  movslq %esi,%r15
  mov    %eax,%eax
  shl    $0x3,%rax
  mov    %rax,(%rsp)
  lea    (%rax,%r15,1),%r14
  mov    %r15,%rbp
  movslq %r13d,%r13
  sub    %r15,%r13
L31:
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  cltq
  mov    %rax,0x0(%rbp)
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  cltq
  mov    %rax,0x0(%r13,%rbp,1)
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  movslq %ebx,%rdx
  mov    %rdx,%rcx
  sub    %r15,%rcx
  cltq
  mov    %rax,(%rcx,%rbp,1)
  add    $0x8,%rbp
  cmp    %r14,%rbp
  jne    L31
  mov    %rdx,%rbx
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  movslq %eax,%r14
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  cltq
  mov    %rax,0x78(%rsp)
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  cltq
  mov    %rax,0x50(%rsp)
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  cltq
  mov    %rax,0x68(%rsp)
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  cltq
  mov    %rax,0x60(%rsp)
  mov    (%rsp),%rax
  lea    (%rax,%r14,1),%rcx
  mov    %r14,%rax
  mov    0x108(%rsp),%rdx
  sub    %r14,%rdx
L584:
  movsd  (%rdx,%rax,1),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L584
  mov    (%rsp),%rdi
  add    %rbx,%rdi
  mov    0x3c(%rsp),%esi
  shl    $0x3,%rsi
L548:
  mov    %rbx,%rcx
  mov    $0x0,%eax
L436:
  mov    (%rcx),%rdx
  movq   $0x0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L436
  add    $0x8,%rbx
  cmp    %rdi,%rbx
  jne    L548
  mov    0x3c(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0xa4(%rsp)
  test   %eax,%eax
  jle    L4
  mov    0x3c(%rsp),%eax
  lea    -0x1(%rax),%ebx
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    $0x0,%r11d
  mov    $0x0,%r10d
  movslq 0x5c(%rsp),%r13
  mov    $0x8,%r15d
  lea    -0x2(%rax),%r12d
  mov    %r14,(%rsp)
  mov    %eax,%r14d
L198:
  add    $0x1,%r11d
  cmp    %r11d,%r14d
  jle    L143
  mov    %r13,%rdi
  sub    %r9,%rdi
  mov    %r15,%rax
  sub    %r9,%rax
  mov    %r8d,%ebp
  mov    %r12d,%edx
  sub    %r8d,%edx
  lea    0x2(%r8,%rdx,1),%rsi
  shl    $0x3,%rsi
  movslq %r10d,%rdx
  lea    (%r9,%rdx,8),%rcx
  add    0x110(%rsp),%rcx
L544:
  movsd  -0x8(%rcx,%rax,1),%xmm0
  mov    (%rdi),%rdx
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L544
  add    %ebx,%r10d
  sub    %ebp,%r10d
L143:
  add    $0x1,%r8
  sub    $0x8,%r9
  cmp    %ebx,%r11d
  jne    L198
  mov    (%rsp),%r14
L115:
  cmpl   $0x0,0x3c(%rsp)
  jle    L352
L4:
  mov    0x80(%rsp),%rax
  mov    (%rax),%rax
  movq   $0x0,(%rax)
  mov    $0x8,%edx
  mov    $0x0,%eax
  movslq 0x5c(%rsp),%rdi
  mov    0x3c(%rsp),%r9d
  jmp    L221
L147:
  lea    (%rdx,%rdi,1),%rsi
  mov    (%rsi),%rax
  movq   $0x0,(%rax,%rdx,1)
  test   %r8d,%r8d
  jle    L2
  mov    $0x0,%eax
L93:
  mov    (%rax,%rdi,1),%rcx
  movsd  (%rcx,%rdx,1),%xmm0
  mov    (%rsi),%rcx
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L93
L2:
  add    $0x8,%rdx
  mov    %r8d,%eax
L221:
  lea    0x1(%rax),%r8d
  cmp    %r8d,%r9d
  jne    L147
  mov    %r8d,0x88(%rsp)
  mov    %eax,0x48(%rsp)
  movslq 0x120(%rsp),%rax
  mov    0x8(%rsp),%rsi
  lea    (%rsi,%rax,8),%rdx
  movq   $0x0,(%rdx)
  mov    %r14,%rbp
  mov    0x48(%rsp),%eax
  mov    %eax,0x4c(%rsp)
  mov    %eax,%eax
  mov    %rax,0x40(%rsp)
  lea    0x8(,%rax,8),%r13
  lea    0x0(%r13,%r14,1),%r8
  mov    %r14,%rcx
  movslq 0x5c(%rsp),%rdi
  sub    %r14,%rdi
L467:
  lea    (%rdi,%rcx,1),%r9
  mov    $0x0,%eax
L507:
  mov    (%r9),%rsi
  movsd  (%rsi,%rax,1),%xmm0
  mulsd  (%rcx),%xmm0
  mulsd  (%r14,%rax,1),%xmm0
  addsd  (%rdx),%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x8,%rax
  cmp    %r13,%rax
  jne    L507
  add    $0x8,%rcx
  cmp    %r8,%rcx
  jne    L467
  mov    $0x0,%eax
  movslq 0xa0(%rsp),%r15
L630:
  mov    (%rax,%r15,1),%rdx
  movq   $0x0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %r13,%rax
  jne    L630
  movq   $0x0,0x30(%rsp)
  movq   $0x0,0x28(%rsp)
  movl   $0x0,0x24(%rsp)
  mov    %r14,%r12
  mov    %r13,0xb8(%rsp)
  mov    %r15,0x8(%rsp)
L481:
  mov    0x28(%rsp),%rdi
  mov    %edi,0x38(%rsp)
  mov    0x40(%rsp),%rax
  cmp    %rax,%rdi
  je     L566
  lea    0x0(,%rdi,8),%r14
  mov    0x8(%rsp),%r13
  mov    0x30(%rsp),%rsi
  sub    %rsi,%r13
  mov    $0x8,%ebx
  sub    %rsi,%rbx
  mov    0x48(%rsp),%eax
  sub    $0x1,%eax
  sub    %edi,%eax
  lea    0x2(%rdi,%rax,1),%rax
  shl    $0x3,%rax
  mov    %rax,0x18(%rsp)
  movslq 0x24(%rsp),%rax
  lea    (%rsi,%rax,8),%rax
  add    0x110(%rsp),%rax
  mov    %rax,0x10(%rsp)
L225:
  mov    0x10(%rsp),%rax
  movsd  -0x8(%rax,%rbx,1),%xmm4
  movsd  %xmm4,(%rsp)
  mov    %rbp,%r15
  movsd  0x0(%rbp),%xmm0
  mulsd  (%r12,%rbx,1),%xmm0
  pxor   %xmm5,%xmm5
  ucomisd %xmm0,%xmm5
  ja     L247
  sqrtsd %xmm0,%xmm0
L588:
  mov    0x8(%rsp),%rax
  add    %rbx,%rax
  movsd  (%rsp),%xmm3
  mulsd  %xmm3,%xmm0
  mov    (%rax),%rdx
  movsd  %xmm0,(%rdx,%r14,1)
  mov    0x0(%r13),%rdx
  movsd  %xmm0,(%rdx,%rbx,1)
  mov    %r14,%rdx
  add    0x0(%r13),%rdx
  movapd %xmm3,%xmm1
  mulsd  (%r12,%rbx,1),%xmm1
  movsd  (%rdx),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  mov    %rbx,%rdi
  add    (%rax),%rdi
  mulsd  (%r15),%xmm3
  movsd  (%rdi),%xmm1
  subsd  %xmm3,%xmm1
  movsd  %xmm1,(%rdi)
  add    $0x8,%rbx
  cmp    0x18(%rsp),%rbx
  jne    L225
  mov    0x24(%rsp),%eax
  add    0x4c(%rsp),%eax
  sub    0x38(%rsp),%eax
  mov    %eax,0x24(%rsp)
  addq   $0x1,0x28(%rsp)
  add    $0x8,%rbp
  subq   $0x8,0x30(%rsp)
  jmp    L481
L247:
  call   <sqrt@plt>
  jmp    L588
L310:
  call   <sqrt@plt>
  jmp    L427
L106:
  mov    %rcx,%rax
L453:
  lea    0x0(,%rax,8),%rcx
  movsd  (%rdx),%xmm0
  comisd %xmm1,%xmm0
  ja     L545
  lea    0x1(%rax),%rcx
  add    $0x8,%rdx
  cmp    %r8,%rax
  jne    L106
L610:
  movslq 0x58(%rsp),%rsi
  mov    $0x0,%ecx
  movq   D17(%rip),%xmm2
  movsd  D34(%rip),%xmm1
  mov    0x60(%rsp),%rdi
  mov    0x68(%rsp),%r8
  mov    0x50(%rsp),%r9
L568:
  movsd  (%r9,%rcx,1),%xmm0
  xorpd  %xmm2,%xmm0
  movsd  %xmm0,(%rdi,%rcx,1)
  mov    $0x0,%eax
  mov    %rsi,%r10
L431:
  mov    (%rax,%r15,1),%rdx
  movsd  (%rdx,%rcx,1),%xmm0
  mov    (%rsi),%rdx
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %r13,%rax
  jne    L431
  mov    (%r10),%rax
  movapd %xmm1,%xmm0
  divsd  (%rax),%xmm0
  movsd  %xmm0,(%r8,%rcx,1)
  add    $0x8,%rsi
  add    $0x8,%rcx
  cmp    %r13,%rcx
  jne    L568
  cmpl   $0x1,0x88(%rsp)
  jle    L483
  mov    $0x1,%ebx
  mov    0x60(%rsp),%rbp
  mov    0x3c(%rsp),%r12d
  mov    0xb0(%rsp),%r13
L432:
  movsd  0x0(%rbp,%rbx,8),%xmm0
  movsd  %xmm0,-0x8(%r13,%rbx,8)
  pxor   %xmm7,%xmm7
  comisd %xmm7,%xmm0
  seta   %dil
  movzbl %dil,%edi
  mov    $0x0,%eax
  call   <assert@plt>
  add    $0x1,%rbx
  cmp    %ebx,%r12d
  jg     L432
L483:
  movslq 0x58(%rsp),%r8
  mov    0x3c(%rsp),%esi
  lea    -0x1(%rsi),%eax
  lea    0x8(,%rax,8),%r9
  test   %esi,%esi
  mov    $0x8,%eax
  cmovle %rax,%r9
  mov    0x90(%rsp),%rcx
  mov    $0x0,%edi
L295:
  mov    %r8,%r10
  mov    $0x0,%eax
L604:
  mov    (%r10),%rdx
  movsd  (%rdx,%rax,8),%xmm0
  movsd  %xmm0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L604
  add    %r9,%rcx
  add    $0x1,%edi
  add    $0x8,%r8
  cmp    %edi,%esi
  jg     L295
  mov    0x68(%rsp),%rdx
  mov    0xa4(%rsp),%r11d
  mov    $0x0,%r10d
  mov    $0x0,%r9d
  mov    $0x0,%r8d
  mov    0x3c(%rsp),%ebx
  lea    -0x2(%rbx),%edi
  add    $0x2,%rdi
  mov    0x90(%rsp),%rbp
  mov    0x100(%rsp),%r12
  jmp    L378
L545:
  test   %eax,%eax
  je     L610
  mov    0x50(%rsp),%rax
  movsd  (%rax),%xmm1
  movsd  %xmm1,(%rdx)
  movsd  %xmm0,(%rax)
  mov    $0x0,%eax
  pxor   %xmm1,%xmm1
  mov    0x70(%rsp),%rdx
  mov    0x88(%rsp),%r8d
L527:
  mov    (%rdx,%rcx,1),%rsi
  lea    (%rsi,%rax,8),%rsi
  movsd  (%rsi),%xmm0
  mov    (%rdx),%rdi
  movsd  (%rdi,%rax,8),%xmm2
  movsd  %xmm2,(%rsi)
  mov    (%rdx),%rsi
  movsd  %xmm0,(%rsi,%rax,8)
  addsd  %xmm0,%xmm1
  add    $0x1,%rax
  cmp    %eax,%r8d
  jg     L527
  mov    $0x0,%eax
  mov    0x70(%rsp),%rcx
  mov    0x88(%rsp),%esi
L454:
  mov    (%rcx),%rdx
  lea    (%rdx,%rax,8),%rdx
  movsd  (%rdx),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L454
  jmp    L610
L73:
  movslq %r9d,%rax
  lea    0x0(%rbp,%rax,8),%rsi
  movslq %r10d,%rax
  lea    (%r12,%rax,8),%rcx
  mov    $0x1,%eax
L11:
  movsd  (%rsi,%rax,8),%xmm0
  mulsd  (%rdx),%xmm0
  movsd  %xmm0,-0x8(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdi
  jne    L11
L441:
  add    $0x1,%r8d
  add    %ebx,%r9d
  add    $0x8,%rdx
  add    %r11d,%r10d
  cmp    %r8d,%ebx
  jle    L412
L378:
  cmp    $0x1,%ebx
  jg     L73
  jmp    L441
L608:
  add    $0x1,%ecx
  add    $0x8,%r13
  cmp    %ecx,%esi
  jle    L173
L294:
  bt     %ecx,%r8d
  jae    L608
  mov    %r13,%rdi
  mov    $0x0,%eax
L455:
  mov    (%rdi),%r15
  movsd  (%rdx,%rax,8),%xmm0
  addsd  (%r15,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %eax,%esi
  jg     L455
  jmp    L608
L173:
  add    $0x4,%r9
  add    %esi,%r11d
  cmp    %rbx,%r9
  je     L647
L447:
  mov    (%r9),%r8d
  test   %esi,%esi
  jle    L173
  movslq %r11d,%rdx
  lea    (%r10,%rdx,8),%rax
  add    %r12,%rdx
  lea    0x0(%rbp,%rdx,8),%rdx
L388:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rax,%rdx
  jne    L388
  test   %r8d,%r8d
  je     L173
  movslq 0x58(%rsp),%r13
  movslq %r11d,%rax
  lea    (%r10,%rax,8),%rdx
  mov    $0x0,%ecx
  jmp    L294
L647:
  mov    $0x0,%esi
  mov    $0x0,%ecx
  mov    0x3c(%rsp),%r9d
  lea    -0x1(%r9),%r8d
  mov    0x118(%rsp),%rax
  lea    0x8(%rax),%rdi
  movsd  D1(%rip),%xmm1
  movapd %xmm1,%xmm2
  mov    0x8c(%rsp),%r10d
  mov    %rax,%r11
  jmp    L65
L191:
  add    $0x8,%rax
  cmp    %rdx,%rax
  je     L632
L592:
  movsd  (%rax),%xmm0
  comisd %xmm1,%xmm0
  jbe    L191
  movsd  %xmm2,(%rax)
  jmp    L191
L632:
  add    $0x1,%ecx
  add    %r9d,%esi
  cmp    %ecx,%r10d
  je     L200
L65:
  test   %r9d,%r9d
  jle    L632
  movslq %esi,%rdx
  lea    (%r11,%rdx,8),%rax
  add    %r8,%rdx
  lea    (%rdi,%rdx,8),%rdx
  jmp    L592
L200:
  mov    0x3c(%rsp),%esi
  test   %esi,%esi
  jle    L63
  movslq 0x58(%rsp),%rax
  mov    %esi,%edx
  lea    (%rax,%rdx,8),%r13
  mov    %rax,%rbx
  movslq 0xa0(%rsp),%r12
  sub    %rax,%r12
  movslq 0x5c(%rsp),%rbp
  sub    %rax,%rbp
L554:
  mov    (%rbx),%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  mov    (%r12,%rbx,1),%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  mov    0x0(%rbp,%rbx,1),%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L554
L63:
  mov    0x80(%rsp),%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  mov    0x70(%rsp),%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  mov    0x98(%rsp),%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  mov    %r14,%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  mov    0x78(%rsp),%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  mov    0x50(%rsp),%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  mov    0x68(%rsp),%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  mov    0x60(%rsp),%rdi
  mov    $0x0,%eax
  call   <rax_free@plt>
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L566:
  mov    %r12,%r14
  mov    0xb8(%rsp),%r13
  mov    0x8(%rsp),%r15
  mov    0x78(%rsp),%rcx
  mov    0x50(%rsp),%rdx
  mov    0x88(%rsp),%esi
  mov    0x70(%rsp),%rdi
  mov    $0x0,%eax
  call   <makeEigen@plt>
  lea    0x0(%r13,%r15,1),%rax
  mov    %r15,%r12
  mov    %r15,(%rsp)
  mov    %rax,%r15
L375:
  mov    %r12,%rbp
  mov    $0x0,%ebx
L571:
  movsd  (%r14,%rbx,1),%xmm0
  pxor   %xmm6,%xmm6
  ucomisd %xmm0,%xmm6
  ja     L310
  sqrtsd %xmm0,%xmm0
L427:
  mov    %rbx,%rax
  add    0x0(%rbp),%rax
  mulsd  (%rax),%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rbx
  cmp    %r13,%rbx
  jne    L571
  add    $0x8,%r12
  cmp    %r15,%r12
  jne    L375
  mov    (%rsp),%r15
  mov    0x50(%rsp),%rdx
  mov    $0x0,%eax
  movsd  D9(%rip),%xmm1
  mov    0x40(%rsp),%r8
  jmp    L453
L352:
  movslq 0x120(%rsp),%rax
  mov    0x8(%rsp),%rsi
  movq   $0x0,(%rsi,%rax,8)
  mov    0x78(%rsp),%rcx
  mov    0x50(%rsp),%rdx
  mov    0x3c(%rsp),%esi
  mov    0x70(%rsp),%rdi
  mov    $0x0,%eax
  call   <makeEigen@plt>
L412:
  mov    0x8c(%rsp),%eax
  test   %eax,%eax
  jle    L200
  mov    0xa8(%rsp),%rsi
  mov    %rsi,%r9
  lea    -0x1(%rax),%eax
  lea    0x4(%rsi,%rax,4),%rbx
  mov    $0x0,%r11d
  mov    0x3c(%rsp),%esi
  lea    -0x1(%rsi),%r12d
  mov    0x118(%rsp),%rax
  lea    0x8(%rax),%rbp
  mov    %rax,%r10
  jmp    L447
L61:
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  movslq %eax,%r14
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  cltq
  mov    %rax,0x78(%rsp)
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  cltq
  mov    %rax,0x50(%rsp)
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  cltq
  mov    %rax,0x68(%rsp)
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <rax_malloc@plt>
  cltq
  mov    %rax,0x60(%rsp)
  mov    0x3c(%rsp),%eax
  sub    $0x1,%eax
  mov    %eax,0xa4(%rsp)
  jmp    L115
```

tool_calls: name: parse_data
arguments: label: D17
type_infered: f32[2]
name: parse_data
arguments: label: D34
type_infered: f32[2]
name: parse_data
arguments: label: D1
type_infered: f64
name: parse_data
arguments: label: D9
type_infered: byte[8]

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

tool: {"D34": [0.0,1.875]}

tool: D1: 0.999999999

tool: {"D9": [0x3a,0x8c,0x30,0xe2,0x8e,0x79,0x45,0xbe]}

assistant: ```c
void initGeneric(const int n, const unsigned int *valueVector, int valueVectorLength, double *fracchanges, double *ext_EIGN, double *EV, double *EI, double *frequencies, double *ext_initialRates, double *tipVector, int model) {
  double **r, **a, **EIGV, *initialRates = ext_initialRates, *f, *e, *d, *invfreq, *EIGN, *eptr;
  int i, j, k, m, l;
  r = (double **)rax_malloc(n * sizeof(double *));
  EIGV = (double **)rax_malloc(n * sizeof(double *));
  a = (double **)rax_malloc(n * sizeof(double *));
  for (i = 0; i < n; i++) {
    a[i] = (double *)rax_malloc(n * sizeof(double));
    EIGV[i] = (double *)rax_malloc(n * sizeof(double));
    r[i] = (double *)rax_malloc(n * sizeof(double));
  }
  f = (double *)rax_malloc(n * sizeof(double));
  e = (double *)rax_malloc(n * sizeof(double));
  d = (double *)rax_malloc(n * sizeof(double));
  invfreq = (double *)rax_malloc(n * sizeof(double));
  EIGN = (double *)rax_malloc(n * sizeof(double));
  for (l = 0; l < n; l++)
    f[l] = frequencies[l];
  i = 0;
  for (j = 0; j < n; j++)
    for (k = 0; k < n; k++)
      r[j][k] = 0.0;
  for (j = 0; j < n - 1; j++)
    for (k = j + 1; k < n; k++)
      r[j][k] = initialRates[i++];
  for (j = 0; j < n; j++) {
    r[j][j] = 0.0;
    for (k = 0; k < j; k++)
      r[j][k] = r[k][j];
  }
  fracchanges[model] = 0.0;
  for (j = 0; j < n; j++)
    for (k = 0; k < n; k++)
      fracchanges[model] += f[j] * r[j][k] * f[k];
  m = 0;
  for (i = 0; i < n; i++)
    a[i][i] = 0;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      double factor = initialRates[m++];
      a[i][j] = a[j][i] = factor * sqrt(f[i] * f[j]);
      a[i][i] -= factor * f[j];
      a[j][j] -= factor * f[i];
    }
  }
  makeEigen(a, n, d, e);
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++)
      a[i][j] *= sqrt(f[j]);
  for (i = 0; i < n; i++) {
    if (d[i] > -1e-8) {
      if (i != 0) {
        double tmp = d[i], sum = 0;
        d[i] = d[0];
        d[0] = tmp;
        for (j = 0; j < n; j++) {
          tmp = a[i][j];
          a[i][j] = a[0][j];
          sum += (a[0][j] = tmp);
        }
        for (j = 0; j < n; j++)
          a[0][j] /= sum;
      }
      break;
    }
  }
  for (i = 0; i < n; i++) {
    EIGN[i] = -d[i];
    for (j = 0; j < n; j++)
      EIGV[i][j] = a[j][i];
    invfreq[i] = 1 / EIGV[i][0];
  }
  for (l = 1; l < n; l++) {
    ext_EIGN[(l - 1)] = EIGN[l];
    assert(ext_EIGN[(l - 1)] > 0.0);
  }
  eptr = EV;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) {
      *eptr++ = EIGV[i][j];
    }
  for (i = 0; i < n; i++)
    for (j = 1; j < n; j++)
      EI[i * (n - 1) + (j - 1)] = EV[i * n + j] * invfreq[i];
  for (i = 0; i < valueVectorLength; i++) {
    unsigned int value = valueVector[i];
    for (j = 0; j < n; j++)
      tipVector[i * n + j] = 0;
    if (value > 0) {
      for (j = 0; j < n; j++) {
        if ((value >> j) & 1) {
          int l;
          for (l = 0; l < n; l++)
            tipVector[i * n + l] += EIGV[j][l];
        }
      }
    }
  }
  for (i = 0; i < valueVectorLength; i++) {
    for (j = 0; j < n; j++)
      if (tipVector[i * n + j] > 0.999999999)
        tipVector[i * n + j] = 0.999999999;
  }
  for (i = 0; i < n; i++) {
    rax_free(EIGV[i]);
    rax_free(a[i]);
    rax_free(r[i]);
  }
  rax_free(r);
  rax_free(a);
  rax_free(EIGV);
  rax_free(f);
  rax_free(e);
  rax_free(d);
  rax_free(invfreq);
  rax_free(EIGN);
}
```