// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../tools/evolver_ndf15.c
// Function: initialize_jacobian
int initialize_jacobian(struct jacobian *jac, int neq, ErrorMsg error_message){
  int i;

  if (neq>15){
    jac->use_sparse = 1;
  }
  else{
    jac->use_sparse = 0;
  }
  jac->max_nonzero = (int)(MAX(3*neq,0.20*neq*neq));
  jac->cnzmax = 12*jac->max_nonzero/5;

  /*Maximal number of non-zero entries to be considered sparse */
  jac->repeated_pattern = 0;
  jac->trust_sparse = 4;
  /* Number of times a pattern is repeated before we trust it. */
  jac->has_grouping = 0;
  jac->has_pattern = 0;
  jac->sparse_stuff_initialized=0;

  /*Setup memory for the pointers of the dense method:*/

  class_alloc(jac->dfdy,sizeof(double*)*(neq+1),error_message); /* Allocate vector of pointers to rows of matrix.*/
  class_alloc(jac->dfdy[1],sizeof(double)*(neq*neq+1),error_message);
  jac->dfdy[0] = NULL;
  for(i=2;i<=neq;i++) jac->dfdy[i] = jac->dfdy[i-1]+neq; /* Set row pointers... */

  class_alloc(jac->LU,sizeof(double*)*(neq+1),error_message); /* Allocate vector of pointers to rows of matrix.*/
  class_alloc(jac->LU[1],sizeof(double)*(neq*neq+1),error_message);
  jac->LU[0] = NULL;
  for(i=2;i<=neq;i++) jac->LU[i] = jac->LU[i-1]+neq; /* Set row pointers... */

  class_alloc(jac->LUw,sizeof(double)*(neq+1),error_message);
  class_alloc(jac->jacvec,sizeof(double)*(neq+1),error_message);
  class_alloc(jac->luidx,sizeof(int)*(neq+1),error_message);

  /*Setup memory for the sparse method, if used: */
  if (jac->use_sparse){
    jac->sparse_stuff_initialized = 1;

    jac->xjac=(double*)(jac->luidx+neq+1);
    jac->col_group=(int*)(jac->xjac+jac->max_nonzero);
    jac->col_wi=jac->col_group+neq;
    jac->Cp=jac->col_wi+neq;
    jac->Ci=jac->Cp+neq+1;

    class_alloc(jac->xjac,sizeof(double)*jac->max_nonzero,error_message);
    class_alloc(jac->col_group,sizeof(int)*neq,error_message);
    class_alloc(jac->col_wi,sizeof(int)*neq,error_message);
    class_alloc(jac->Cp,sizeof(int)*(neq+1),error_message);
    class_alloc(jac->Ci,sizeof(int)*jac->cnzmax,error_message);

    class_call(sp_num_alloc(&jac->Numerical, neq,error_message),
           error_message,error_message);

    class_call(sp_mat_alloc(&jac->spJ, neq, neq, jac->max_nonzero,
                error_message),error_message,error_message);

  }

  /* Initialize jacvec to sqrt(eps):*/
  for (i=1;i<=neq;i++) jac->jacvec[i]=1.490116119384765597872e-8;
  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x828, %rsp            # imm = 0x828
movq %rdx, %rbp
movl %esi, %r14d
movq %rdi, %r15
xorl %eax, %eax
cmpl $0x10, %esi
setge %al
leal (%r14,%r14,2), %ecx
cvtsi2sd %ecx, %xmm0
cvtsi2sd %esi, %xmm1
movl %eax, 0x28(%rdi)
movsd 0xd7121(%rip), %xmm2    # 0xe5298
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm2
maxsd %xmm0, %xmm2
cvttsd2si %xmm2, %eax
movl %eax, 0x30(%rdi)
movl %eax, 0xc(%rsp)
imull $0xc, %eax, %eax
pushq $0x5
popq %rcx
cltd
idivl %ecx
movl %eax, 0x8(%rsp)
movl %eax, 0x48(%rdi)
movsd 0xd7ada(%rip), %xmm0    # 0xe5c80
movups %xmm0, 0x34(%rdi)
andl $0x0, 0x2c(%rdi)
movslq %esi, %r12
leaq 0x8(,%r12,8), %rbx
movq %rbx, %rdi
callq 0x8490
movq %rax, (%r15)
testq %rax, %rax
je 0xe284
movq %rax, %r13
movq %r14, %rax
movq %rbp, (%rsp)
imull %eax, %eax
leaq 0x8(,%rax,8), %rbp
movq %rbp, %rdi
callq 0x8490
movq %rax, 0x8(%r13)
testq %rax, %rax
je 0xe2be
movq %rbp, 0x10(%rsp)
andq $0x0, (%r13)
leaq 0x1(%r12), %rax
movq %rax, 0x18(%rsp)
pushq $0x2
popq %rax
leaq (,%r12,8), %rbp
cmpq %r12, %rax
jg 0xe22f
movq (%r15), %rcx
movq -0x8(%rcx,%rax,8), %rdx
addq %rbp, %rdx
movq %rdx, (%rcx,%rax,8)
incq %rax
jmp 0xe216
movq %rbx, %rdi
callq 0x8490
movq %rax, 0x10(%r15)
testq %rax, %rax
je 0xe45e
movq %rax, %r13
movq 0x10(%rsp), %rdi
callq 0x8490
movq %rax, 0x8(%r13)
testq %rax, %rax
je 0xe499
andq $0x0, (%r13)
pushq $0x2
popq %rax
cmpq %r12, %rax
jg 0xe2f9
movq 0x10(%r15), %rcx
movq -0x8(%rcx,%rax,8), %rdx
addq %rbp, %rdx
movq %rdx, (%rcx,%rax,8)
incq %rax
jmp 0xe266
leaq 0xd6d79(%rip), %rsi     # 0xe5004
leaq 0xd80f9(%rip), %rdx     # 0xe638b
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd6d8a(%rip), %rsi     # 0xe5034
leaq 0xd80e4(%rip), %rdx     # 0xe6395
movq %rbp, %rdi
movl $0x60a, %ecx            # imm = 0x60A
jmp 0xe544
leaq 0xd6d3f(%rip), %rsi     # 0xe5004
leaq 0xd80dd(%rip), %rdx     # 0xe63a9
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd6d50(%rip), %rsi     # 0xe5034
leaq 0xd80aa(%rip), %rdx     # 0xe6395
movq (%rsp), %rdi
movl $0x60b, %ecx            # imm = 0x60B
jmp 0xe4d2
movq %rbx, %rdi
callq 0x8490
movq %rax, 0x18(%r15)
testq %rax, %rax
je 0xe4d7
movq %rbx, %rdi
callq 0x8490
movq %rax, 0x8(%r15)
testq %rax, %rax
movq (%rsp), %r13
je 0xe50f
movq 0x18(%rsp), %rbp
shlq $0x2, %rbp
movq %rbp, %rdi
callq 0x8490
movq %rax, 0x20(%r15)
testq %rax, %rax
je 0xe563
cmpl $0x10, %r14d
jl 0xe71d
movl $0x1, 0x2c(%r15)
leaq (%rax,%r12,4), %rax
movl 0xc(%rsp), %ebx
movslq %ebx, %rdi
leaq (%rax,%rdi,8), %rcx
leaq 0x4(%rax,%rdi,8), %rax
movq %rax, 0x50(%r15)
leaq 0x4(%rcx,%r12,4), %rax
movq %rax, 0x58(%r15)
leaq (%rax,%r12,4), %rax
movq %rax, 0x80(%r15)
leaq (%rax,%r12,4), %rax
addq $0x4, %rax
movq %rax, 0x88(%r15)
shlq $0x3, %rdi
callq 0x8490
movq %rax, 0x70(%r15)
testq %rax, %rax
je 0xe59d
shlq $0x2, %r12
movq %r12, %rdi
callq 0x8490
movq %rax, 0x50(%r15)
testq %rax, %rax
je 0xe5da
movq %r12, %rdi
callq 0x8490
movq %rax, 0x58(%r15)
testq %rax, %rax
je 0xe615
movq %rbp, %rdi
callq 0x8490
movq %rax, 0x80(%r15)
testq %rax, %rax
je 0xe650
movl 0x8(%rsp), %ebp
movslq %ebp, %rdi
shlq $0x2, %rdi
callq 0x8490
movq %rax, 0x88(%r15)
testq %rax, %rax
je 0xe68a
leaq 0x78(%r15), %rdi
movl %r14d, %esi
movq %r13, %rdx
callq 0x9d7d
cmpl $0x1, %eax
jne 0xe6c7
leaq 0xd6fc3(%rip), %rsi     # 0xe53f0
leaq 0xd7fea(%rip), %rdx     # 0xe641e
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xd6be7(%rip), %rsi     # 0xe5034
leaq 0xd7f41(%rip), %rdx     # 0xe6395
movq %r13, %rdi
movl $0x629, %ecx            # imm = 0x629
jmp 0xe4d2
leaq 0xd6b9f(%rip), %rsi     # 0xe5004
leaq 0xd7f4a(%rip), %rdx     # 0xe63b6
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd6bb0(%rip), %rsi     # 0xe5034
leaq 0xd7f0a(%rip), %rdx     # 0xe6395
movq (%rsp), %rdi
movl $0x60f, %ecx            # imm = 0x60F
jmp 0xe544
leaq 0xd6b64(%rip), %rsi     # 0xe5004
leaq 0xd7f17(%rip), %rdx     # 0xe63be
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq 0x10(%rsp), %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xd6b72(%rip), %rsi     # 0xe5034
leaq 0xd7ecc(%rip), %rdx     # 0xe6395
movq (%rsp), %rdi
movl $0x610, %ecx            # imm = 0x610
movq %rbx, %r8
jmp 0xe547
leaq 0xd6b26(%rip), %rsi     # 0xe5004
leaq 0xd7ee4(%rip), %rdx     # 0xe63c9
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd6b37(%rip), %rsi     # 0xe5034
leaq 0xd7e91(%rip), %rdx     # 0xe6395
movq (%rsp), %rdi
movl $0x614, %ecx            # imm = 0x614
jmp 0xe544
leaq 0xd6aee(%rip), %rsi     # 0xe5004
leaq 0xd7eb5(%rip), %rdx     # 0xe63d2
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd6aff(%rip), %rsi     # 0xe5034
leaq 0xd7e59(%rip), %rdx     # 0xe6395
movq %r13, %rdi
movl $0x615, %ecx            # imm = 0x615
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd6a9a(%rip), %rsi     # 0xe5004
leaq 0xd7e6d(%rip), %rdx     # 0xe63de
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd6aab(%rip), %rsi     # 0xe5034
leaq 0xd7e05(%rip), %rdx     # 0xe6395
movq %r13, %rdi
movl $0x616, %ecx            # imm = 0x616
jmp 0xe4d2
shll $0x3, %ebx
leaq 0xd6a5d(%rip), %rsi     # 0xe5004
leaq 0xd7e3b(%rip), %rdx     # 0xe63e9
movl %ebx, %ecx
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0xd6a6e(%rip), %rsi     # 0xe5034
leaq 0xd7dc8(%rip), %rdx     # 0xe6395
movq %r13, %rdi
movl $0x622, %ecx            # imm = 0x622
jmp 0xe4d2
leaq 0xd6a23(%rip), %rsi     # 0xe5004
leaq 0xd7e0b(%rip), %rdx     # 0xe63f3
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd6a33(%rip), %rsi     # 0xe5034
leaq 0xd7d8d(%rip), %rdx     # 0xe6395
movq %r13, %rdi
movl $0x623, %ecx            # imm = 0x623
jmp 0xe4d2
leaq 0xd69e8(%rip), %rsi     # 0xe5004
leaq 0xd7ddf(%rip), %rdx     # 0xe6402
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd69f8(%rip), %rsi     # 0xe5034
leaq 0xd7d52(%rip), %rdx     # 0xe6395
movq %r13, %rdi
movl $0x624, %ecx            # imm = 0x624
jmp 0xe4d2
leaq 0xd69ad(%rip), %rsi     # 0xe5004
leaq 0xd7db0(%rip), %rdx     # 0xe640e
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd69be(%rip), %rsi     # 0xe5034
leaq 0xd7d18(%rip), %rdx     # 0xe6395
movq %r13, %rdi
movl $0x625, %ecx            # imm = 0x625
jmp 0xe4d2
shll $0x2, %ebp
leaq 0xd6970(%rip), %rsi     # 0xe5004
leaq 0xd7d7b(%rip), %rdx     # 0xe6416
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0xd6981(%rip), %rsi     # 0xe5034
leaq 0xd7cdb(%rip), %rdx     # 0xe6395
movq %r13, %rdi
movl $0x626, %ecx            # imm = 0x626
jmp 0xe4d2
leaq 0x68(%r15), %rdi
movl 0x30(%r15), %ecx
movl %r14d, %esi
movl %r14d, %edx
movq %r13, %r8
callq 0x9bb0
cmpl $0x1, %eax
jne 0xe71d
leaq 0xd6d07(%rip), %rsi     # 0xe53f0
leaq 0xd7d5f(%rip), %rdx     # 0xe644f
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0xd692b(%rip), %rsi     # 0xe5034
leaq 0xd7c85(%rip), %rdx     # 0xe6395
movq %r13, %rdi
movl $0x62c, %ecx            # imm = 0x62C
jmp 0xe4d2
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
movabsq $0x3e50000000000000, %rcx # imm = 0x3E50000000000000
xorl %edx, %edx
cmpq %rdx, %r14
je 0xe551
movq 0x8(%r15), %rsi
movq %rcx, 0x8(%rsi,%rdx,8)
incq %rdx
jmp 0xe732