user: What is the c source code of the assembly code below:

```asm
<mod_chol>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%rbx
  mov    %rdx,0x20(%rsp)
  mov    %rcx,0x10(%rsp)
  cmp    $0x1,%esi
  je     L176
  mov    %esi,%ebp
  mov    %r8,%r15
  mov    %esi,%edx
  mov    $0x0,%eax
  test   %esi,%esi
  jle    L420
  mov    0x20(%rsp),%rcx
  mov    0x10(%rsp),%rsi
L341:
  mov    %eax,(%rsi,%rax,4)
  movq   $0x0,(%rcx,%rax,8)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L341
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x8(%rsp)
  mov    $0x0,%edx
  mov    $0x1,%r12d
  movq   D55(%rip),%xmm3
  movapd %xmm5,%xmm2
  mov    $0x0,%esi
L496:
  mov    %edx,%ecx
  add    $0x1,%edx
  mov    %edx,%edi
  imul   %ecx,%edi
  mov    %edi,%eax
  shr    $0x1f,%eax
  add    %edi,%eax
  sar    %eax
  add    %ecx,%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  movapd %xmm0,%xmm1
  andpd  %xmm3,%xmm1
  maxsd  0x8(%rsp),%xmm1
  movsd  %xmm1,0x8(%rsp)
  ucomisd %xmm0,%xmm2
  cmova  %esi,%r12d
  cmp    %ebp,%edx
  jne    L496
  test   %r12d,%r12d
  je     L345
  mov    $0x0,%r12d
  mov    %r15,(%rsp)
  jmp    L475
L176:
  movsd  (%rdi),%xmm1
  movapd %xmm1,%xmm0
  andpd  D55(%rip),%xmm0
  mulsd  D192(%rip),%xmm0
  subsd  %xmm1,%xmm0
  comisd D74(%rip),%xmm0
  jbe    L347
L536:
  mov    0x20(%rsp),%rax
  movsd  %xmm0,(%rax)
  pxor   %xmm0,%xmm0
  ucomisd (%rbx),%xmm0
  jp     L16
  jne    L16
  mov    D192(%rip),%rdi
  mov    %rdi,(%rax)
L16:
  movsd  (%rbx),%xmm0
  mov    0x20(%rsp),%rax
  addsd  (%rax),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L426
  sqrtsd %xmm0,%xmm0
L285:
  movsd  %xmm0,(%rbx)
  mov    0x10(%rsp),%rax
  movl   $0x0,(%rax)
  mov    0x20(%rsp),%rax
  movsd  (%rax),%xmm6
  movsd  %xmm6,0x18(%rsp)
  jmp    L126
L347:
  pxor   %xmm0,%xmm0
  jmp    L536
L426:
  call   <sqrt@plt>
  jmp    L285
L388:
  mov    %r12d,%r13d
  movapd %xmm1,%xmm2
  jmp    L151
L353:
  cmp    %ebp,%r14d
  jge    L85
  movsd  (%r15),%xmm3
  mov    %r14d,%edx
  pxor   %xmm2,%xmm2
L216:
  mov    %edx,%esi
  add    $0x1,%edx
  mov    %edx,%ecx
  imul   %esi,%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  lea    (%rax,%r12,1),%ecx
  movslq %ecx,%rcx
  movsd  (%rbx,%rcx,8),%xmm0
  add    %esi,%eax
  cltq
  mulsd  %xmm0,%xmm0
  divsd  %xmm3,%xmm0
  movsd  (%rbx,%rax,8),%xmm1
  subsd  %xmm0,%xmm1
  minsd  %xmm2,%xmm1
  movapd %xmm1,%xmm2
  cmp    %ebp,%edx
  jne    L216
  movsd  0x8(%rsp),%xmm0
  mulsd  D180(%rip),%xmm0
  comisd %xmm1,%xmm0
  ja     L499
  mov    %r12d,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <jthIteration@plt>
L551:
  mov    %r14d,%r12d
L475:
  lea    0x1(%r12),%r14d
  mov    %r14d,%edx
  imul   %r12d,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  add    %r12d,%eax
  cltq
  lea    (%rbx,%rax,8),%r15
  movsd  (%r15),%xmm1
  cmp    %ebp,%r14d
  jge    L388
  mov    %r12d,%r13d
  movapd %xmm1,%xmm2
  mov    %r14d,%edx
L405:
  mov    %edx,%ecx
  add    $0x1,%edx
  mov    %edx,%esi
  imul   %ecx,%esi
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  add    %ecx,%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  comisd %xmm1,%xmm0
  cmova  %ecx,%r13d
  movapd %xmm0,%xmm4
  maxsd  %xmm1,%xmm4
  movapd %xmm4,%xmm1
  minsd  %xmm2,%xmm0
  movapd %xmm0,%xmm2
  cmp    %ebp,%edx
  jne    L405
L151:
  movsd  D192(%rip),%xmm0
  mulsd  0x8(%rsp),%xmm0
  comisd %xmm1,%xmm0
  ja     L395
  mulsd  D180(%rip),%xmm1
  comisd %xmm2,%xmm1
  ja     L137
  cmp    %r13d,%r12d
  je     L353
  mov    %r12d,%ecx
  mov    %r13d,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <switch_row_and_colMAT@plt>
  mov    %r12d,%edx
  mov    %r13d,%esi
  mov    0x10(%rsp),%rdi
  mov    $0x0,%eax
  call   <switch_row_and_colVEC@plt>
  jmp    L353
L85:
  movsd  0x8(%rsp),%xmm0
  mulsd  D180(%rip),%xmm0
  comisd D74(%rip),%xmm0
  ja     L232
  mov    %r12d,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <jthIteration@plt>
  cmp    %ebp,%r14d
  jne    L551
L420:
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x18(%rsp)
L126:
  movsd  0x18(%rsp),%xmm0
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L395:
  mov    (%rsp),%r15
L345:
  lea    -0x1(%rbp),%eax
  mov    %eax,0x38(%rsp)
  cmp    %r12d,%eax
  je     L391
  cmp    %r12d,0x38(%rsp)
  jle    L316
  cmp    %r12d,%ebp
  jle    L289
  lea    0x1(%r12),%r8d
  movslq %r12d,%rdi
  lea    0x0(,%rdi,8),%rdx
  lea    (%r15,%rdx,1),%rsi
  mov    %r8d,%ecx
  imul   %r12d,%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  add    %r12d,%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  movsd  %xmm0,(%rsi)
  movslq %r8d,%r8
  lea    0x8(%r15,%rdx,1),%r13
  movq   D55(%rip),%xmm3
  lea    0x8(%rbx),%r14
  movapd %xmm3,%xmm2
  mov    %r15,(%rsp)
  mov    %rdi,%r15
  jmp    L603
L137:
  mov    (%rsp),%r15
  jmp    L345
L232:
  mov    (%rsp),%r15
  jmp    L345
L391:
  mov    %ebp,%edx
  imul   %r12d,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  add    %r12d,%eax
  cltq
  lea    (%rbx,%rax,8),%r12
  mov    (%r12),%rbx
  movq   %rbx,%xmm0
  mulsd  D122(%rip),%xmm0
  divsd  D119(%rip),%xmm0
  movsd  0x8(%rsp),%xmm1
  mulsd  D192(%rip),%xmm1
  call   <fmax@plt>
  movapd %xmm0,%xmm5
  movq   %rbx,%xmm7
  subsd  %xmm7,%xmm5
  movsd  %xmm5,0x18(%rsp)
  movq   %rbx,%xmm0
  addsd  %xmm5,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L39
  sqrtsd %xmm0,%xmm0
L580:
  movsd  %xmm0,(%r12)
  movslq %ebp,%rbp
  mov    0x20(%rsp),%rax
  movsd  0x18(%rsp),%xmm7
  movsd  %xmm7,-0x8(%rax,%rbp,8)
  jmp    L126
L39:
  call   <sqrt@plt>
  jmp    L580
L326:
  movslq %eax,%rdx
  lea    (%rdx,%r15,1),%rax
  lea    (%rbx,%rax,8),%rax
  sub    %r12d,%r10d
  lea    -0x1(%r10),%ecx
  add    %r15,%rcx
  add    %rcx,%rdx
  lea    (%r14,%rdx,8),%rdx
L105:
  movsd  (%rax),%xmm1
  andpd  %xmm2,%xmm1
  movsd  (%rsi),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rsi)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L105
L599:
  add    $0x1,%r8
  add    $0x8,%r13
L603:
  mov    %r8d,%r10d
  lea    -0x1(%r8),%edi
  mov    %r8d,%r9d
  mov    %r8d,%r11d
  cmp    %r8d,%ebp
  jle    L10
  mov    %r8d,%edx
L89:
  mov    %edx,%ecx
  add    $0x1,%edx
  imul   %edx,%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  add    %edi,%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm1
  andpd  %xmm3,%xmm1
  movsd  (%rsi),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rsi)
  cmp    %ebp,%edx
  jne    L89
  lea    0x1(%r10),%edx
  imul   %r9d,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  mov    %r13,%rsi
  add    %eax,%r9d
  movslq %r9d,%r9
  movsd  (%rbx,%r9,8),%xmm0
  movsd  %xmm0,0x0(%r13)
  cmp    %r11d,%r12d
  jl     L326
  jmp    L599
L10:
  mov    (%rsp),%r15
L289:
  lea    -0x2(%rbp),%eax
  mov    %eax,0x3c(%rsp)
  cmp    %r12d,%eax
  jle    L81
  movslq %r12d,%r13
  mov    %eax,0x34(%rsp)
  pxor   %xmm7,%xmm7
  movsd  %xmm7,0x18(%rsp)
  mov    %r13,%r14
  jmp    L165
L394:
  mov    0x30(%rsp),%ecx
  mov    %r13d,%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <switch_row_and_colMAT@plt>
  mov    0x30(%rsp),%edx
  mov    %r13d,%esi
  mov    0x10(%rsp),%rdi
  mov    $0x0,%eax
  call   <switch_row_and_colVEC@plt>
  movslq %r13d,%r13
  lea    (%r15,%r13,8),%rax
  movsd  (%rax),%xmm0
  movsd  (%r15,%r14,8),%xmm1
  movsd  %xmm1,(%rax)
  movsd  %xmm0,(%r15,%r14,8)
L564:
  mov    %r12d,%edx
  pxor   %xmm7,%xmm7
  movsd  %xmm7,(%rsp)
L8:
  mov    %edx,%ecx
  add    $0x1,%edx
  imul   %edx,%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  add    0x30(%rsp),%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  andpd  D55(%rip),%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  cmp    %ebp,%edx
  jl     L8
L510:
  movsd  D192(%rip),%xmm1
  mulsd  0x8(%rsp),%xmm1
  movsd  (%rsp),%xmm0
  call   <fmax@plt>
  mov    0x30(%rsp),%edi
  mov    %edi,%edx
  imul   %r12d,%edx
  mov    %edx,%eax
  shr    $0x1f,%eax
  add    %edx,%eax
  sar    %eax
  add    %edi,%eax
  cltq
  lea    (%rbx,%rax,8),%r13
  movsd  0x0(%r13),%xmm7
  movsd  %xmm7,0x28(%rsp)
  subsd  %xmm7,%xmm0
  movsd  0x18(%rsp),%xmm1
  call   <fmax@plt>
  movapd %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  call   <fmax@plt>
  pxor   %xmm6,%xmm6
  comisd %xmm6,%xmm0
  jbe    L380
  movsd  0x28(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  movsd  %xmm1,0x0(%r13)
  mov    0x20(%rsp),%rax
  movsd  %xmm0,(%rax,%r14,8)
  movsd  %xmm0,0x18(%rsp)
L380:
  movsd  0x0(%r13),%xmm1
  movsd  (%rsp),%xmm6
  ucomisd %xmm6,%xmm1
  jp     L264
  jne    L264
L146:
  mov    0x30(%rsp),%edx
  mov    %ebp,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <jthIteration@plt>
  add    $0x1,%r14
  cmp    0x34(%rsp),%r12d
  je     L597
L165:
  movsd  (%r15,%r14,8),%xmm0
  mov    %r12d,%r13d
  mov    %r12d,0x30(%rsp)
  add    $0x1,%r12d
  cmp    %r12d,%ebp
  jle    L257
  movslq %r12d,%rax
L632:
  movsd  (%r15,%rax,8),%xmm1
  comisd %xmm0,%xmm1
  cmova  %eax,%r13d
  maxsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L632
  cmp    %r14d,%r13d
  jne    L394
  jmp    L564
L257:
  pxor   %xmm6,%xmm6
  movsd  %xmm6,(%rsp)
  jmp    L510
L264:
  movsd  (%rsp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  D112(%rip),%xmm1
  subsd  %xmm0,%xmm1
  cmp    %r12d,%ebp
  jle    L146
  movslq %r12d,%rax
  lea    (%r15,%rax,8),%rcx
  mov    %r12d,%edx
L637:
  mov    %edx,%esi
  add    $0x1,%edx
  imul   %edx,%esi
  mov    %esi,%eax
  shr    $0x1f,%eax
  add    %esi,%eax
  sar    %eax
  add    0x30(%rsp),%eax
  cltq
  movsd  (%rbx,%rax,8),%xmm0
  andpd  D55(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  addsd  (%rcx),%xmm0
  movsd  %xmm0,(%rcx)
  add    $0x8,%rcx
  cmp    %ebp,%edx
  jne    L637
  jmp    L146
L81:
  pxor   %xmm5,%xmm5
  movsd  %xmm5,0x18(%rsp)
L597:
  mov    0x38(%rsp),%edi
  mov    %edi,%ecx
  mov    0x3c(%rsp),%esi
  imul   %esi,%ecx
  mov    %ecx,%eax
  shr    $0x1f,%eax
  add    %ecx,%eax
  sar    %eax
  lea    (%rax,%rsi,1),%edx
  movslq %edx,%rdx
  lea    (%rbx,%rdx,8),%r14
  mov    (%r14),%r15
  lea    (%rcx,%rdi,2),%ecx
  mov    %ecx,%edx
  shr    $0x1f,%edx
  add    %ecx,%edx
  sar    %edx
  add    %edi,%edx
  movslq %edx,%rdx
  lea    (%rbx,%rdx,8),%r13
  mov    0x0(%r13),%r12
  movq   %r15,%xmm1
  movq   %r12,%xmm5
  subsd  %xmm5,%xmm1
  add    %edi,%eax
  cltq
  lea    (%rbx,%rax,8),%rbx
  movsd  (%rbx),%xmm2
  movapd %xmm2,%xmm0
  mulsd  D157(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L411
  sqrtsd %xmm0,%xmm0
L563:
  movq   %r12,%xmm1
  movq   %r15,%xmm7
  addsd  %xmm7,%xmm1
  movapd %xmm1,%xmm3
  subsd  %xmm0,%xmm3
  movsd  D100(%rip),%xmm2
  movapd %xmm3,%xmm5
  mulsd  %xmm2,%xmm5
  addsd  %xmm0,%xmm1
  mulsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm5,(%rsp)
  subsd  %xmm5,%xmm0
  mulsd  D122(%rip),%xmm0
  divsd  D6(%rip),%xmm0
  movsd  0x8(%rsp),%xmm1
  mulsd  D192(%rip),%xmm1
  call   <fmax@plt>
  movapd %xmm0,%xmm1
  subsd  (%rsp),%xmm1
  pxor   %xmm0,%xmm0
  call   <fmax@plt>
  movsd  0x18(%rsp),%xmm1
  call   <fmax@plt>
  pxor   %xmm6,%xmm6
  comisd %xmm6,%xmm0
  jbe    L409
  movq   %r15,%xmm1
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%r14)
  movapd %xmm0,%xmm1
  addsd  0x0(%r13),%xmm1
  movsd  %xmm1,0x0(%r13)
  movslq %ebp,%rax
  shl    $0x3,%rax
  mov    0x20(%rsp),%rdi
  movsd  %xmm0,-0x10(%rdi,%rax,1)
  movsd  %xmm0,-0x8(%rdi,%rax,1)
  movsd  %xmm0,0x18(%rsp)
L409:
  movsd  (%r14),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L424
  sqrtsd %xmm0,%xmm0
L483:
  movsd  %xmm0,(%r14)
  movsd  (%rbx),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,(%rbx)
  mulsd  %xmm1,%xmm1
  movsd  0x0(%r13),%xmm0
  subsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L332
  sqrtsd %xmm0,%xmm0
L237:
  movsd  %xmm0,0x0(%r13)
  jmp    L126
L411:
  call   <sqrt@plt>
  jmp    L563
L424:
  call   <sqrt@plt>
  jmp    L483
L332:
  call   <sqrt@plt>
  jmp    L237
L316:
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x18(%rsp)
  jmp    L126
L499:
  mov    (%rsp),%r15
  jmp    L345
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D55
type: qword[2]
name: extract_symbolic_data
arguments: data_label: D192
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D74
type: f64[2]
name: extract_symbolic_data
arguments: data_label: D180
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D122
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D119
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D112
type: f64
name: extract_symbolic_data
arguments: data_label: D157
type: f64
name: extract_symbolic_data
arguments: data_label: D100
type: f64
name: extract_symbolic_data
arguments: data_label: D6
type: byte[8]

tool: {"D55": [0x7fffffffffffffff,0x0000000000000000]}

tool: {"D192": [0x8d,0x72,0x8d,0xf9,0xa2,0x28,0xc4,0x3d]}

tool: {"D74": [0.0,3.666852862501033e-11]}

tool: {"D180": [0x9a,0x99,0x99,0x99,0x99,0x99,0xb9,0xbf]}

tool: {"D122": [0x3e,0x6e,0x3d,0xa5,0xfe,0x65,0xd9,0x3e]}

tool: {"D119": [0x61,0xad,0x00,0x4d,0xf3,0xff,0xef,0xbf]}

tool: D112: 1

tool: D157: 4

tool: D100: 0.5

tool: {"D6": [0x61,0xad,0x00,0x4d,0xf3,0xff,0xef,0x3f]}

assistant: ```c
double mod_chol(double *A, int n, double *E, int *P, double *g) {
  int phaseone = 1;
  int i, j, k;
  double tau = pow(2.22044604925031e-16, 1. / 3.);
  double taubar = pow(2.22044604925031e-16, 2.0 / 3.0);
  double mu = 0.1;
  double gamma = 0.0;
  double tmp = 0.;
  double delta = 0.;
  double deltaprev = 0.;
  double normj;
  double lambda_hi;
  double lambda_lo;
  if (n == 1) {
    delta = (taubar * fabs(A[0])) - A[0];
    if (delta > 0.0)
      E[0] = delta;
    else
      E[0] = 0.;
    if (A[0] == 0.0)
      E[0] = taubar;
    A[0] = sqrt(A[0] + E[0]);
    P[0] = 0;
    return E[0];
  }
  for (i = 0; i < n; i++) {
    P[i] = i;
    E[i] = 0.0;
  }
  for (i = 0; i < n; i++) {
    tmp = fabs(A[(((i) * ((i) + 1)) / 2 + (i))]);
    if (tmp > gamma)
      gamma = tmp;
    if (A[(((i) * ((i) + 1)) / 2 + (i))] < 0.0)
      phaseone = 0;
  }
  j = 0;
  while ((j < n) && phaseone) {
    double tmp_max = A[(((j) * ((j) + 1)) / 2 + (j))];
    double tmp_min = A[(((j) * ((j) + 1)) / 2 + (j))];
    int id = j;
    for (i = j + 1; i < n; i++) {
      if (tmp_max < A[(((i) * ((i) + 1)) / 2 + (i))]) {
        tmp_max = A[(((i) * ((i) + 1)) / 2 + (i))];
        id = i;
      }
      if (tmp_min > A[(((i) * ((i) + 1)) / 2 + (i))])
        tmp_min = A[(((i) * ((i) + 1)) / 2 + (i))];
    }
    if (tmp_max < taubar * gamma || tmp_min < -mu * tmp_max) {
      phaseone = 0;
      break;
    } else {
      if (id != j) {
        switch_row_and_colMAT(A, n, id, j);
        switch_row_and_colVEC(P, id, j);
      }
      tmp_min = 0.0;
      for (i = j + 1; i < n; i++) {
        tmp = A[(((i) * ((i) + 1)) / 2 + (i))] - A[(((i) * ((i) + 1)) / 2 + (j))] * A[(((i) * ((i) + 1)) / 2 + (j))] / A[(((j) * ((j) + 1)) / 2 + (j))];
        if (tmp_min > tmp)
          tmp_min = tmp;
      }
      if (tmp_min < -mu * gamma) {
        phaseone = 0;
        break;
      } else {
        jthIteration(A, n, j);
        j++;
      }
    }
  }
  if (!phaseone && (j == (n - 1))) {
    delta = -A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))] + fmax(tau * A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))] / (tau - 1.), taubar * gamma);
    A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))] += delta;
    A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))] = sqrt(A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))]);
    E[n - 1] = delta;
    deltaprev = delta;
  }
  if (!phaseone && (j < (n - 1))) {
    k = j - 1;
    for (i = k + 1; i < n; i++) {
      g[i] = A[(((i) * ((i) + 1)) / 2 + (i))];
      for (j = k + 1; j <= i - 1; j++) {
        g[i] -= fabs(A[(((i) * ((i) + 1)) / 2 + (j))]);
      }
      for (j = i + 1; j < n; j++) {
        g[i] -= fabs(A[(((j) * ((j) + 1)) / 2 + (i))]);
      }
    }
    for (j = k + 1; j < n - 2; j++) {
      int id = j;
      tmp = g[id];
      for (i = j + 1; i < n; i++) {
        if (tmp < g[i]) {
          tmp = g[i];
          id = i;
        }
      }
      if (id != j) {
        switch_row_and_colMAT(A, n, id, j);
        switch_row_and_colVEC(P, id, j);
        tmp = g[id];
        g[id] = g[j];
        g[j] = tmp;
      }
      normj = 0.;
      for (i = j + 1; i < n; i++) {
        normj += fabs(A[(((i) * ((i) + 1)) / 2 + (j))]);
      }
      delta = fmax(0.0, fmax(fmax(normj, taubar * gamma) - A[(((j) * ((j) + 1)) / 2 + (j))], deltaprev));
      if (delta > 0) {
        A[(((j) * ((j) + 1)) / 2 + (j))] += delta;
        deltaprev = delta;
        E[j] = delta;
      }
      if (A[(((j) * ((j) + 1)) / 2 + (j))] != normj) {
        tmp = 1.0 - normj / A[(((j) * ((j) + 1)) / 2 + (j))];
        for (i = j + 1; i < n; i++) {
          g[i] += fabs(A[(((i) * ((i) + 1)) / 2 + (j))]) * tmp;
        }
      }
      jthIteration(A, n, j);
    }
    tmp = sqrt((A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 2))] - A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))]) * (A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 2))] - A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))]) + 4.0 * A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 1))] * A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 1))]);
    lambda_hi = ((A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 2))] + A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))]) + tmp) * 0.5;
    lambda_lo = ((A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 2))] + A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))]) - tmp) * 0.5;
    delta = fmax(fmax(0.0, -lambda_lo + fmax(tau * (lambda_hi - lambda_lo) / (1.0 - tau), taubar * gamma)), deltaprev);
    if (delta > 0) {
      A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 2))] += delta;
      A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))] += delta;
      deltaprev = delta;
      E[n - 2] = delta;
      E[n - 1] = delta;
    }
    A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 2))] = sqrt(A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 2))]);
    A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 1))] /= A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 2))];
    A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))] = sqrt(A[(((n - 1) * ((n - 1) + 1)) / 2 + (n - 1))] - A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 1))] * A[(((n - 2) * ((n - 2) + 1)) / 2 + (n - 1))]);
  }
  return deltaprev;
}
```