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

```asm
<eigenQREV>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %r8,%rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rcx,0x60(%rsp)
  mov    0xb0(%rsp),%rbx
  mov    %r9,0x50(%rsp)
  test   %edx,%edx
  jle    L568
  lea    -0x1(%rdx),%eax
  mov    %edx,%r13d
  movsd  D46(%rip),%xmm1
  xor    %edx,%edx
  mov    %eax,0x28(%rsp)
  mov    %rdi,%r14
  mov    %rsi,%r12
  mov    %rsi,%r15
  lea    0x8(%rsi,%rax,8),%rax
  pxor   %xmm2,%xmm2
  jmp    L434
  nopw   0x0(%rax,%rax,1)
L151:
  add    $0x8,%r15
  cmp    %rax,%r15
  je     L21
L434:
  movsd  (%r15),%xmm0
  comisd %xmm1,%xmm0
  jbe    L151
  ucomisd %xmm0,%xmm2
  lea    0x1(%rdx),%ecx
  lea    (%rbx,%rdx,8),%rdx
  ja     L405
  sqrtsd %xmm0,%xmm0
L319:
  add    $0x8,%r15
  movsd  %xmm0,(%rdx)
  movslq %ecx,%rdx
  cmp    %rax,%r15
  jne    L434
L21:
  mov    %edx,(%rsp)
  cmp    %r13d,%edx
  je     L509
  movsd  (%r12),%xmm0
  xor    %r9d,%r9d
  lea    -0x1(%rdx),%eax
  lea    0x1(%r13),%r10d
  mov    %eax,0x8(%rsp)
  comisd %xmm1,%xmm0
  ja     L36
L415:
  cmp    $0x1,%r13d
  jle    L675
  mov    %r13d,%edi
  mov    %r10d,%r8d
  mov    $0x1,%edx
  jmp    L131
  nopw   0x0(%rax,%rax,1)
L381:
  add    $0x1,%rdx
  add    %r10d,%r8d
  add    %r13d,%edi
  cmp    %edx,%r13d
  jle    L675
L131:
  movsd  (%r12,%rdx,8),%xmm0
  comisd %xmm1,%xmm0
  jbe    L381
  mov    (%rsp),%r11d
  movslq %r9d,%rax
  xor    %esi,%esi
  lea    (%rbx,%rax,8),%r15
  xor    %eax,%eax
  imul   %r9d,%r11d
  nopw   0x0(%rax,%rax,1)
L352:
  movsd  (%r12,%rax,8),%xmm0
  comisd %xmm1,%xmm0
  jbe    L560
  lea    (%rdi,%rax,1),%ecx
  movslq %ecx,%rcx
  movsd  (%r14,%rcx,8),%xmm0
  mulsd  (%r15),%xmm0
  movslq %esi,%rcx
  divsd  (%rbx,%rcx,8),%xmm0
  mov    (%rsp),%ecx
  imul   %esi,%ecx
  add    %r9d,%ecx
  movslq %ecx,%rcx
  movsd  %xmm0,0x0(%rbp,%rcx,8)
  lea    (%rsi,%r11,1),%ecx
  add    $0x1,%esi
  movslq %ecx,%rcx
  movsd  %xmm0,0x0(%rbp,%rcx,8)
L560:
  add    $0x1,%rax
  cmp    %edx,%eax
  jl     L352
  movslq %r8d,%rax
  add    $0x1,%rdx
  add    %r10d,%r8d
  add    %r13d,%edi
  movsd  (%r14,%rax,8),%xmm0
  mov    (%rsp),%eax
  imul   %r9d,%eax
  add    %r9d,%eax
  add    $0x1,%r9d
  cltq
  movsd  %xmm0,0x0(%rbp,%rax,8)
  cmp    %edx,%r13d
  jg     L131
  nopl   0x0(%rax)
L675:
  mov    0x60(%rsp),%r14
  mov    0x50(%rsp),%rcx
  mov    %rbp,%rdi
  mov    (%rsp),%esi
  mov    %r14,%rdx
  call   <eigenRealSym@plt>
  mov    D46(%rip),%rdi
  movslq 0x8(%rsp),%rdx
  mov    %r14,%rcx
  mov    %eax,0x58(%rsp)
  movslq 0x28(%rsp),%rax
  movq   %rdi,%xmm1
  mov    %rax,0x10(%rsp)
  nopw   0x0(%rax,%rax,1)
L95:
  movsd  (%r12,%rax,8),%xmm0
  comisd %xmm1,%xmm0
  jbe    L466
L720:
  movsd  (%rcx,%rdx,8),%xmm0
  lea    -0x1(%rdx),%esi
  movsd  %xmm0,(%rcx,%rax,8)
  sub    $0x1,%rax
  test   %eax,%eax
  js     L303
  movsd  (%r12,%rax,8),%xmm0
  movslq %esi,%rdx
  comisd %xmm1,%xmm0
  ja     L720
L466:
  movq   $0x0,(%rcx,%rax,8)
  sub    $0x1,%rax
  test   %eax,%eax
  jns    L95
L303:
  mov    0x28(%rsp),%r15d
  mov    %r13d,0x18(%rsp)
  mov    %r13d,%r8d
  pxor   %xmm2,%xmm2
  mov    0x10(%rsp),%rsi
  mov    0x8(%rsp),%r11d
  imul   %r13d,%r15d
  mov    0x50(%rsp),%r9
  mov    (%rsp),%r13d
  movsd  D3(%rip),%xmm3
  mov    %r15d,0x20(%rsp)
  mov    %r15d,%r14d
  nopl   0x0(%rax,%rax,1)
L696:
  movsd  (%r12,%rsi,8),%xmm0
  comisd %xmm1,%xmm0
  ja     L179
  movslq %r14d,%rax
  lea    (%r9,%rax,8),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax)
L120:
  cmp    %esi,%eax
  je     L161
  movq   $0x0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L120
  sub    $0x1,%rsi
  sub    0x18(%rsp),%r14d
  test   %esi,%esi
  jns    L696
L49:
  mov    0x18(%rsp),%r8d
  mov    0x20(%rsp),%r15d
  pxor   %xmm2,%xmm2
  mov    0x10(%rsp),%rcx
  mov    0x8(%rsp),%r14d
  movsd  D3(%rip),%xmm3
  mov    %r8,%r13
  nopl   0x0(%rax)
L662:
  movsd  (%r12,%rcx,8),%xmm0
  comisd %xmm1,%xmm0
  ja     L269
  movslq %r15d,%rax
  lea    0x0(%rbp,%rax,8),%rdx
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L716:
  cmp    %ecx,%eax
  je     L547
  movq   $0x0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r8
  jne    L716
  sub    $0x1,%rcx
  sub    %r13d,%r15d
  test   %ecx,%ecx
  jns    L662
L743:
  mov    0x58(%rsp),%eax
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L36:
  movsd  (%r14),%xmm0
  mov    $0x1,%r9d
  movsd  %xmm0,0x0(%rbp)
  jmp    L415
  nopl   0x0(%rax,%rax,1)
L547:
  movsd  %xmm3,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L716
  sub    $0x1,%rcx
  sub    %r13d,%r15d
  test   %ecx,%ecx
  jns    L662
  jmp    L743
  nop
L161:
  movsd  %xmm3,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L120
  sub    $0x1,%rsi
  sub    0x18(%rsp),%r14d
  test   %esi,%esi
  jns    L696
  jmp    L49
  nopl   0x0(%rax,%rax,1)
L269:
  movslq %r14d,%rax
  mov    (%rsp),%r11d
  mov    0x8(%rsp),%edi
  lea    (%rbx,%rax,8),%r10
  mov    0x28(%rsp),%eax
  imul   %r14d,%r11d
  lea    (%r15,%rax,1),%edx
  mov    0x10(%rsp),%rax
  jmp    L9
  nopw   0x0(%rax,%rax,1)
L737:
  lea    (%r11,%rdi,1),%r9d
  movslq %edx,%rsi
  sub    $0x1,%rax
  sub    $0x1,%edi
  movslq %r9d,%r9
  sub    $0x1,%edx
  movsd  0x0(%rbp,%r9,8),%xmm0
  divsd  (%r10),%xmm0
  movsd  %xmm0,0x0(%rbp,%rsi,8)
  test   %eax,%eax
  js     L30
L9:
  movsd  (%r12,%rax,8),%xmm0
  comisd %xmm1,%xmm0
  ja     L737
  movapd %xmm2,%xmm0
  cmp    %ecx,%eax
  je     L569
L237:
  movslq %edx,%rsi
  sub    $0x1,%rax
  sub    $0x1,%edx
  movsd  %xmm0,0x0(%rbp,%rsi,8)
  test   %eax,%eax
  jns    L9
L30:
  sub    $0x1,%rcx
  sub    $0x1,%r14d
  sub    %r13d,%r15d
  test   %ecx,%ecx
  jns    L662
  jmp    L743
  cs nopw 0x0(%rax,%rax,1)
L179:
  mov    0x28(%rsp),%eax
  mov    0x8(%rsp),%edi
  lea    (%r14,%rax,1),%edx
  mov    0x10(%rsp),%rax
  jmp    L365
  nopl   0x0(%rax,%rax,1)
L726:
  mov    %r13d,%ecx
  movslq %edi,%r15
  movslq %edx,%r10
  sub    $0x1,%rax
  imul   %edi,%ecx
  sub    $0x1,%edx
  sub    $0x1,%edi
  add    %r11d,%ecx
  movslq %ecx,%rcx
  movsd  0x0(%rbp,%rcx,8),%xmm0
  mulsd  (%rbx,%r15,8),%xmm0
  movsd  %xmm0,(%r9,%r10,8)
  test   %eax,%eax
  js     L305
L365:
  movsd  (%r12,%rax,8),%xmm0
  comisd %xmm1,%xmm0
  ja     L726
  movapd %xmm2,%xmm0
  cmp    %esi,%eax
  je     L430
L277:
  movslq %edx,%rcx
  sub    $0x1,%rax
  sub    $0x1,%edx
  movsd  %xmm0,(%r9,%rcx,8)
  test   %eax,%eax
  jns    L365
L305:
  sub    $0x1,%rsi
  sub    $0x1,%r11d
  sub    0x18(%rsp),%r14d
  test   %esi,%esi
  jns    L696
  jmp    L49
  nopl   0x0(%rax)
L430:
  movapd %xmm3,%xmm0
  jmp    L277
  cs nopw 0x0(%rax,%rax,1)
L569:
  movapd %xmm3,%xmm0
  jmp    L237
  nopl   0x0(%rax)
L509:
  movsd  (%r14),%xmm0
  movsd  %xmm0,0x0(%rbp)
  cmp    $0x1,%r13d
  je     L227
  movslq %r13d,%rdi
  lea    0x8(%rbx),%rax
  mov    %r13d,%r10d
  mov    $0x8,%r12d
  lea    0x0(,%rdi,8),%r9
  mov    %rdi,0x68(%rsp)
  shl    $0x4,%rdi
  mov    %rax,%rdx
  mov    %rax,0x18(%rsp)
  lea    0x8(%r9),%rsi
  mov    %r12,%r13
  lea    (%r14,%r9,1),%rcx
  mov    %rdi,0x58(%rsp)
  lea    0x0(%rbp,%r9,1),%rax
  mov    %r9,%r11
  mov    %r10d,%r12d
  lea    0x8(%rbp),%rdi
  mov    %rsi,0x38(%rsp)
  mov    $0x1,%r15d
  mov    %rax,0x40(%rsp)
  mov    %rdi,0x48(%rsp)
  mov    %r9,0x8(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L699:
  xor    %edi,%edi
  mov    %rax,%rsi
  sub    0x40(%rsp),%rsi
  test   %r10d,%r10d
  cmovns %rsi,%rdi
  mov    0x48(%rsp),%r9
  movsd  0x8(%r14,%r11,1),%xmm0
  lea    (%rdi,%r13,1),%r8
  mov    $0x0,%edi
  movsd  %xmm0,0x8(%rbp,%r11,1)
  cmovns %rdi,%rsi
  mov    %r8,0x10(%rsp)
  add    %rbp,%r8
  mov    %r8,0x20(%rsp)
  add    %r13,%rsi
  lea    0x0(%rbp,%rsi,1),%rdi
  mov    %rdi,(%rsp)
  lea    0x8(%rcx),%rdi
  cmp    %rdi,%rax
  setne  %dil
  cmp    0x18(%rsp),%rax
  setne  %r8b
  and    %edi,%r8d
  cmp    $0x1,%r15d
  setne  %dil
  and    %edi,%r8d
  lea    (%r9,%r11,1),%rdi
  lea    0x8(%rdx),%r9
  cmp    %rdi,%rdx
  mov    %r9,0x30(%rsp)
  setae  %dil
  cmp    %r9,%rax
  setae  0x2f(%rsp)
  movzbl 0x2f(%rsp),%r9d
  or     %r9d,%edi
  mov    %rax,%r9
  and    %r8d,%edi
  sub    %rbp,%r9
  cmp    0x10(%rsp),%r9
  mov    0x20(%rsp),%r9
  setg   %r8b
  cmp    %r11,%rsi
  setg   %sil
  or     %esi,%r8d
  lea    (%r14,%r11,1),%rsi
  and    %r8d,%edi
  cmp    %rsi,(%rsp)
  seta   %sil
  cmp    %rcx,%r9
  setb   %r8b
  or     %r8d,%esi
  and    %edi,%esi
  cmp    (%rsp),%rdx
  setb   %dil
  cmp    %r9,%rdx
  seta   %r8b
  or     %r8d,%edi
  test   %dil,%sil
  je     L661
  lea    -0x8(%rdx),%rsi
  cmp    %rsi,(%rsp)
  seta   %sil
  cmp    %r9,%rbx
  seta   %dil
  or     %sil,%dil
  je     L661
  movsd  (%rdx),%xmm1
  mov    %r15d,%r8d
  mov    %rdx,(%rsp)
  lea    0x0(%rbp,%r13,1),%rdi
  shr    %r8d
  mov    0x8(%rsp),%r9
  mov    0x58(%rsp),%rdx
  xor    %esi,%esi
  unpcklpd %xmm1,%xmm1
  shl    $0x4,%r8
  nopl   0x0(%rax,%rax,1)
L395:
  movupd (%rcx,%rsi,1),%xmm0
  movupd (%rbx,%rsi,1),%xmm5
  mulpd  %xmm1,%xmm0
  divpd  %xmm5,%xmm0
  movlpd %xmm0,(%rdi)
  movhpd %xmm0,(%rdi,%r9,1)
  add    %rdx,%rdi
  movups %xmm0,(%rax,%rsi,1)
  add    $0x10,%rsi
  cmp    %r8,%rsi
  jne    L395
  mov    %r15d,%esi
  mov    %r9,0x8(%rsp)
  mov    (%rsp),%rdx
  and    $0xfffffffe,%esi
  test   $0x1,%r15b
  je     L377
  lea    (%r12,%rsi,1),%edi
  movslq %edi,%rdi
  movsd  (%r14,%rdi,8),%xmm0
  mulsd  (%rdx),%xmm0
  mov    %esi,%edx
  imul   %r10d,%esi
  divsd  (%rbx,%rdx,8),%xmm0
  add    %r15d,%esi
  movslq %esi,%rsi
  movsd  %xmm0,0x0(%rbp,%rsi,8)
  movsd  %xmm0,0x0(%rbp,%rdi,8)
L377:
  mov    0x8(%rsp),%rdi
  add    $0x1,%r15d
  add    %r10d,%r12d
  add    $0x8,%r13
  mov    0x30(%rsp),%rdx
  add    0x38(%rsp),%r11
  add    %rdi,%rcx
  add    %rdi,%rax
  cmp    %r15d,%r10d
  jne    L699
  mov    %r10d,%r13d
L676:
  mov    0x50(%rsp),%r14
  mov    0x60(%rsp),%rdx
  mov    %r13d,%esi
  mov    %rbp,%rdi
  mov    %r14,%rcx
  call   <eigenRealSym@plt>
  mov    0x68(%rsp),%rdi
  xor    %edx,%edx
  mov    %rbp,(%rsp)
  mov    %eax,0x58(%rsp)
  mov    0x28(%rsp),%eax
  mov    %rdx,%r10
  mov    %r14,%rcx
  lea    0x0(,%rdi,8),%r8
  mov    %rbp,0x60(%rsp)
  mov    %r14,%rsi
  mov    %rax,0x50(%rsp)
  mov    %r13d,%eax
  mov    %rax,0x30(%rsp)
  lea    -0x1(%rdi),%rax
  imul   %r8,%rax
  test   %r13d,%r13d
  mov    %r13d,0x10(%rsp)
  cmovns %rax,%r10
  cmovs  %rax,%rdx
  shl    $0x4,%rdi
  mov    %r13d,%eax
  mov    %rdi,%r11
  mov    %r13d,%edi
  shr    %eax
  and    $0xfffffffe,%edi
  mov    %r10,0x40(%rsp)
  xor    %r9d,%r9d
  lea    -0x1(%rax),%r10d
  mov    %rdx,0x38(%rsp)
  mov    %edi,%eax
  mov    %edi,%edx
  imul   %r13d,%edx
  lea    (%rbx,%rax,8),%r12
  mov    %r11,0x8(%rsp)
  xor    %r14d,%r14d
  lea    -0x8(%r8),%rax
  add    $0x1,%r10
  mov    %rcx,%r13
  mov    %rax,0x48(%rsp)
  shl    $0x4,%r10
  mov    %edx,%r15d
  nop
L516:
  mov    0x38(%rsp),%rcx
  lea    0x0(,%r14,8),%rax
  mov    %r14d,%edx
  add    %rax,%rcx
  add    %rbp,%rcx
  mov    %rcx,%r11
  mov    0x48(%rsp),%rcx
  add    %rsi,%rcx
  cmp    %rcx,%r11
  seta   %cl
  add    0x40(%rsp),%rax
  add    %rbp,%rax
  cmp    %rax,%rsi
  seta   %al
  or     %cl,%al
  je     L684
  cmp    0x18(%rsp),%rsi
  mov    (%rsp),%rcx
  setne  0x20(%rsp)
  cmpl   $0x3,0x28(%rsp)
  seta   0x2f(%rsp)
  xor    %eax,%eax
  movzbl 0x2f(%rsp),%r11d
  test   %r11b,0x20(%rsp)
  je     L684
  mov    0x8(%rsp),%r11
  nopl   (%rax)
L243:
  movsd  (%rcx),%xmm0
  movupd (%rbx,%rax,1),%xmm4
  movhpd (%rcx,%r8,1),%xmm0
  add    %r11,%rcx
  mulpd  %xmm4,%xmm0
  movups %xmm0,(%rsi,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%r10
  jne    L243
  mov    %r11,0x8(%rsp)
  cmp    0x10(%rsp),%edi
  je     L341
  add    %r15d,%edx
  lea    (%r9,%rdi,1),%eax
  movslq %edx,%rdx
  cltq
  movsd  0x0(%rbp,%rdx,8),%xmm0
  mulsd  (%r12),%xmm0
  movsd  %xmm0,0x0(%r13,%rax,8)
L341:
  addq   $0x8,(%rsp)
  add    $0x1,%r14
  add    %r8,%rsi
  add    0x10(%rsp),%r9d
  cmp    %r14,0x30(%rsp)
  jne    L516
  mov    0x50(%rsp),%r9
  mov    0x18(%rsp),%rsi
  xor    %edx,%edx
  mov    0x60(%rsp),%r15
  mov    0x10(%rsp),%r13d
  shl    $0x3,%r9
  add    %r9,%rsi
  add    $0x8,%r9
  nopw   0x0(%rax,%rax,1)
L261:
  mov    %rbx,%r11
  lea    (%r8,%r15,1),%rcx
  add    $0x8,%rbx
  cmp    %rcx,%r11
  setae  %al
  cmp    %rbx,%r15
  setae  %r12b
  or     %r12b,%al
  je     L579
  cmp    $0x1,%r13d
  je     L579
  movsd  (%r11),%xmm1
  lea    (%r10,%r15,1),%rax
  unpcklpd %xmm1,%xmm1
L313:
  movupd (%r15),%xmm0
  add    $0x10,%r15
  divpd  %xmm1,%xmm0
  movups %xmm0,-0x10(%r15)
  cmp    %r15,%rax
  jne    L313
  cmp    %r13d,%edi
  je     L62
  lea    (%rdx,%rdi,1),%eax
  cltq
  lea    0x0(%rbp,%rax,8),%rax
  movsd  (%rax),%xmm0
  divsd  (%r11),%xmm0
  movsd  %xmm0,(%rax)
L62:
  mov    %rcx,%r15
  add    %r13d,%edx
  cmp    %rbx,%rsi
  jne    L261
  jmp    L743
  nopl   0x0(%rax,%rax,1)
L579:
  lea    (%r9,%r15,1),%rax
  nopl   0x0(%rax)
L633:
  movsd  (%r15),%xmm0
  add    $0x8,%r15
  divsd  (%r11),%xmm0
  movsd  %xmm0,-0x8(%r15)
  cmp    %r15,%rax
  jne    L633
  jmp    L62
  nopl   0x0(%rax,%rax,1)
L684:
  mov    (%rsp),%rdx
  mov    0x8(%rsp),%r11
  xor    %eax,%eax
  mov    0x30(%rsp),%rcx
L527:
  movsd  (%rbx,%rax,8),%xmm0
  mulsd  (%rdx),%xmm0
  add    %r8,%rdx
  movsd  %xmm0,(%rsi,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rcx
  jne    L527
  mov    %r11,0x8(%rsp)
  jmp    L341
  nopl   0x0(%rax)
L661:
  mov    0x8(%rsp),%r9
  lea    0x0(%rbp,%r13,1),%rdi
  xor    %esi,%esi
  nopl   0x0(%rax)
L245:
  movsd  (%rcx,%rsi,1),%xmm0
  mulsd  (%rdx),%xmm0
  divsd  (%rbx,%rsi,1),%xmm0
  movsd  %xmm0,(%rdi)
  add    %r9,%rdi
  movsd  %xmm0,(%rax,%rsi,1)
  add    $0x8,%rsi
  cmp    %rsi,%r13
  jne    L245
  mov    %r9,0x8(%rsp)
  jmp    L377
L568:
  mov    0x60(%rsp),%rdx
  add    $0x78,%rsp
  mov    %r9,%rcx
  xor    %esi,%esi
  pop    %rbx
  mov    %r8,%rdi
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <eigenRealSym@plt>
L227:
  movq   $0x1,0x68(%rsp)
  lea    0x8(%rbx),%rax
  mov    %rax,0x18(%rsp)
  jmp    L676
L405:
  mov    %rax,0x10(%rsp)
  mov    %ecx,0x8(%rsp)
  mov    %rdx,(%rsp)
  call   <sqrt@plt>
  mov    D46(%rip),%rdi
  mov    0x10(%rsp),%rax
  pxor   %xmm2,%xmm2
  mov    0x8(%rsp),%ecx
  mov    (%rsp),%rdx
  movq   %rdi,%xmm1
  jmp    L319
```

tool_calls: name: retrieve_data
arguments: label: D46
data_type: byte[8]
name: retrieve_data
arguments: label: D3
data_type: byte[8]

tool: {"D46": [0x30,0x05,0x8e,0xe4,0x2e,0xff,0x2b,0x2b]}

tool: {"D3": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

assistant: ```c
int eigenQREV(double Q[], double pi[], int n, double Root[], double U[], double V[], double spacesqrtpi[]) {
  int i, j, inew, jnew, nnew, status;
  double *pi_sqrt = spacesqrtpi, small = 1e-100;
  for (j = 0, nnew = 0; j < n; j++)
    if (pi[j] > small)
      pi_sqrt[nnew++] = sqrt(pi[j]);
  if (nnew == n) {
    for (i = 0; i < n; i++)
      for (j = 0, U[i * n + i] = Q[i * n + i]; j < i; j++)
        U[i * n + j] = U[j * n + i] = (Q[i * n + j] * pi_sqrt[i] / pi_sqrt[j]);
    status = eigenRealSym(U, n, Root, V);
    for (i = 0; i < n; i++)
      for (j = 0; j < n; j++)
        V[i * n + j] = U[j * n + i] * pi_sqrt[j];
    for (i = 0; i < n; i++)
      for (j = 0; j < n; j++)
        U[i * n + j] /= pi_sqrt[i];
  } else {
    for (i = 0, inew = 0; i < n; i++) {
      if (pi[i] > small) {
        for (j = 0, jnew = 0; j < i; j++)
          if (pi[j] > small) {
            U[inew * nnew + jnew] = U[jnew * nnew + inew] = Q[i * n + j] * pi_sqrt[inew] / pi_sqrt[jnew];
            jnew++;
          }
        U[inew * nnew + inew] = Q[i * n + i];
        inew++;
      }
    }
    status = eigenRealSym(U, nnew, Root, V);
    for (i = n - 1, inew = nnew - 1; i >= 0; i--)
      Root[i] = (pi[i] > small ? Root[inew--] : 0);
    for (i = n - 1, inew = nnew - 1; i >= 0; i--) {
      if (pi[i] > small) {
        for (j = n - 1, jnew = nnew - 1; j >= 0; j--)
          if (pi[j] > small) {
            V[i * n + j] = U[jnew * nnew + inew] * pi_sqrt[jnew];
            jnew--;
          } else
            V[i * n + j] = (i == j);
        inew--;
      } else
        for (j = 0; j < n; j++)
          V[i * n + j] = (i == j);
    }
    for (i = n - 1, inew = nnew - 1; i >= 0; i--) {
      if (pi[i] > small) {
        for (j = n - 1, jnew = nnew - 1; j >= 0; j--)
          if (pi[j] > small) {
            U[i * n + j] = U[inew * nnew + jnew] / pi_sqrt[inew];
            jnew--;
          } else
            U[i * n + j] = (i == j);
        inew--;
      } else
        for (j = 0; j < n; j++)
          U[i * n + j] = (i == j);
    }
  }
  return (status);
}
```