// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/choldc.c
// Function: choldc_f
int choldc_f(float **L, float **a, int N)
{
  int i, j, k, ik, jk;
  double sum, diag[N];
  for(i=0; i<N; i++){
    for(j=i; j<N; j++){
      sum=a[i][j];
      for(k=i-1; k>=0; k--)sum-=L[i][k]*L[j][k];
      if(j==i){
	if(sum<EPS){
	  printf("WARNING, Choldc failed L_ii^2= %.2g i=%d\n", sum, i);
	  if(a==L){
	    // Ugo: Restore lower diagonal 
	    for(ik=0; ik<i; ik++){
	      a[ik][ik]=diag[ik];
	      for(jk=ik+1; jk<N; jk++)a[jk][ik]=a[ik][jk];
	    }
	  }
	  return(-1);
	}
	diag[i]=a[i][i]; L[i][i]=sqrt(sum);
      }else{
	L[j][i]=sum/L[i][i]; // j<=i 
      }
    }
  }
  return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x40(%rbp)
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x58(%rbp)
movq %rcx, %rsp
movq %rax, -0x48(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x69f1c
movl -0x20(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x69f0c
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x24(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jl 0x69d93
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x28(%rbp), %rcx
mulss (%rax,%rcx,4), %xmm0
cvtss2sd %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x69d46
movl -0x24(%rbp), %eax
cmpl -0x20(%rbp), %eax
jne 0x69ec1
movsd 0x195f1(%rip), %xmm0    # 0x83398
ucomisd -0x38(%rbp), %xmm0
jbe 0x69e76
movsd -0x38(%rbp), %xmm0
movl -0x20(%rbp), %esi
leaq 0x195df(%rip), %rdi     # 0x833a0
movb $0x1, %al
callq 0x10d0
movq -0x18(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x69e63
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x69e61
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x69e51
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x2c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x69e14
jmp 0x69e53
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x69ddd
jmp 0x69e63
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x4c(%rbp)
jmp 0x69f2a
movq -0x58(%rbp), %rax
movq -0x18(%rbp), %rcx
movslq -0x20(%rbp), %rdx
movq (%rcx,%rdx,8), %rcx
movslq -0x20(%rbp), %rdx
movss (%rcx,%rdx,4), %xmm0
cvtss2sd %xmm0, %xmm0
movslq -0x20(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd -0x38(%rbp), %xmm0
callq 0x1220
cvtsd2ss %xmm0, %xmm0
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
jmp 0x69efc
movsd -0x38(%rbp), %xmm0
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x10(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
jmp 0x69efe
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x69d13
jmp 0x69f0e
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x69d01
movl $0x0, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
movq -0x40(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax)