// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/evolver_ndf15.c
// Function: calc_C
int calc_C(struct jacobian *jac){
  int nz, i, j, k, n, col, row;
  int duplicate;
  int *Ci, *Cp, *Ai, *Ap;
  n = jac->Numerical->n;Ci = jac->Ci;Cp = jac->Cp;
  Ai = jac->spJ->Ai; Ap = jac->spJ->Ap;
  /* Calculate sparse pattern for C = J + J'. We can use jac->Numerical->xi as
     storage, since we can't refactor when jac->repeated_pattern = 0. xi[0..n][0..n].
     At first, Cp[i+1] holds the number of elements in w[i].*/
  for (j=0;j<=n;j++) Cp[j] = 0; /* Clear Cp */
  for (j=0;j<n;j++){
    /* Loop over columns */
    for (i=Ap[j];i<Ap[j+1];i++){
      /* Loop over rows */
      if(Ai[i]!=j){
    /*Don't consider diagonal entries..*/
    /* Add (i,j) to sparsity pattern of C, if it does not exist: */
    duplicate = _FALSE_;
    col = j; row = Ai[i];
    for(k=0;k<Cp[col+1];k++){
      /* Check for duplicates in column col:*/
      if(jac->Numerical->xi[col][k]==row){
        duplicate = _TRUE_;
        break;
      }
    }
    if (!duplicate){
      jac->Numerical->xi[col][Cp[col+1]] = row;
      Cp[col+1]++;
    }
    /* Add (j,i) to sparsity pattern if it does not exist: */
    duplicate = _FALSE_;
    col = Ai[i]; row = j;
    for(k=0;k<Cp[col+1];k++){
      /* Check for dublicates in the Ai[i]'th column: */
      if(jac->Numerical->xi[col][k]==row){
        duplicate = _TRUE_;
        break;
      }
    }
    if (!duplicate){
      jac->Numerical->xi[col][Cp[col+1]] = row;
      Cp[col+1]++;
    }
      }
    }
  }
  /* wi prepared, write sparsity pattern in Ci and Cp:*/
  nz = 0;
  for(j=0;j<n;j++){
    for(k=0;k<Cp[j+1];k++){
      Ci[nz] = jac->Numerical->xi[j][k];
      nz++;
    }
    Cp[j+1] +=Cp[j]; /* We can update Cp here. */
  }
  return _SUCCESS_;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq 0x78(%rax), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rsp)
movq -0x8(%rsp), %rax
movq 0x88(%rax), %rax
movq %rax, -0x30(%rsp)
movq -0x8(%rsp), %rax
movq 0x80(%rax), %rax
movq %rax, -0x38(%rsp)
movq -0x8(%rsp), %rax
movq 0x68(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, -0x40(%rsp)
movq -0x8(%rsp), %rax
movq 0x68(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rsp)
movl $0x0, -0x14(%rsp)
movl -0x14(%rsp), %eax
cmpl -0x1c(%rsp), %eax
jg 0x1783a
movq -0x38(%rsp), %rax
movslq -0x14(%rsp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0x17812
movl $0x0, -0x14(%rsp)
movl -0x14(%rsp), %eax
cmpl -0x1c(%rsp), %eax
jge 0x17a54
movq -0x48(%rsp), %rax
movslq -0x14(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rsp)
movl -0x10(%rsp), %eax
movq -0x48(%rsp), %rcx
movl -0x14(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x17a42
movq -0x40(%rsp), %rax
movslq -0x10(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x14(%rsp), %eax
je 0x17a30
movl $0x0, -0x28(%rsp)
movl -0x14(%rsp), %eax
movl %eax, -0x20(%rsp)
movq -0x40(%rsp), %rax
movslq -0x10(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x24(%rsp)
movl $0x0, -0x18(%rsp)
movl -0x18(%rsp), %eax
movq -0x38(%rsp), %rcx
movl -0x20(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x17912
movq -0x8(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x18(%rax), %rax
movslq -0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x24(%rsp), %eax
jne 0x17903
movl $0x1, -0x28(%rsp)
jmp 0x17912
jmp 0x17905
movl -0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rsp)
jmp 0x178bd
cmpl $0x0, -0x28(%rsp)
jne 0x17961
movl -0x24(%rsp), %edx
movq -0x8(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x18(%rax), %rax
movslq -0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x38(%rsp), %rcx
movl -0x20(%rsp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movslq (%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x38(%rsp), %rax
movl -0x20(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl $0x0, -0x28(%rsp)
movq -0x40(%rsp), %rax
movslq -0x10(%rsp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rsp)
movl -0x14(%rsp), %eax
movl %eax, -0x24(%rsp)
movl $0x0, -0x18(%rsp)
movl -0x18(%rsp), %eax
movq -0x38(%rsp), %rcx
movl -0x20(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x179df
movq -0x8(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x18(%rax), %rax
movslq -0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rsp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x24(%rsp), %eax
jne 0x179d0
movl $0x1, -0x28(%rsp)
jmp 0x179df
jmp 0x179d2
movl -0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rsp)
jmp 0x1798a
cmpl $0x0, -0x28(%rsp)
jne 0x17a2e
movl -0x24(%rsp), %edx
movq -0x8(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x18(%rax), %rax
movslq -0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x38(%rsp), %rcx
movl -0x20(%rsp), %esi
addl $0x1, %esi
movslq %esi, %rsi
movslq (%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x38(%rsp), %rax
movl -0x20(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x17a30
jmp 0x17a32
movl -0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rsp)
jmp 0x17861
jmp 0x17a44
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0x17842
movl $0x0, -0xc(%rsp)
movl $0x0, -0x14(%rsp)
movl -0x14(%rsp), %eax
cmpl -0x1c(%rsp), %eax
jge 0x17b07
movl $0x0, -0x18(%rsp)
movl -0x18(%rsp), %eax
movq -0x38(%rsp), %rcx
movl -0x14(%rsp), %edx
addl $0x1, %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0x17ad5
movq -0x8(%rsp), %rax
movq 0x78(%rax), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x30(%rsp), %rax
movslq -0xc(%rsp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rsp)
movl -0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rsp)
jmp 0x17a7a
movq -0x38(%rsp), %rax
movslq -0x14(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x38(%rsp), %rax
movl -0x14(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
addl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
jmp 0x17a64
xorl %eax, %eax
retq
nopw (%rax,%rax)