// File: /workspace/github_c_makefile_star2_O1/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, %r13
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
movsd 0xe186a(%rip), %xmm2    # 0xf1298
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm2
maxsd %xmm0, %xmm2
cvttsd2si %xmm2, %ecx
movl %eax, 0x28(%rdi)
movl %ecx, 0x30(%rdi)
movq %rcx, 0x10(%rsp)
leal (,%rcx,4), %eax
leal (%rax,%rax,2), %eax
cltq
imulq $0x66666667, %rax, %r12 # imm = 0x66666667
movq %r12, %rax
shrq $0x3f, %rax
sarq $0x21, %r12
addl %eax, %r12d
movl %r12d, 0x48(%rdi)
movq 0xe21fa(%rip), %xmm0    # 0xf1c70
movdqu %xmm0, 0x34(%rdi)
movl $0x0, 0x2c(%rdi)
movslq %esi, %rax
movq %rax, 0x18(%rsp)
leaq 0x8(,%rax,8), %rbx
movq %rbx, %rdi
callq 0x8460
movq %rax, (%r15)
testq %rax, %rax
je 0xfce0
movq %rax, %rbp
movq %r13, 0x8(%rsp)
movl %r14d, %eax
imull %eax, %eax
leaq 0x8(,%rax,8), %r13
movq %r13, %rdi
callq 0x8460
movq %rax, 0x8(%rbp)
testq %rax, %rax
je 0xfd1a
movq $0x0, (%rbp)
cmpl $0x2, %r14d
jl 0xfb06
movl %r14d, %eax
leal 0x1(%r14), %ecx
movl $0x2, %edx
shlq $0x3, %rax
movq (%r15), %rsi
movq -0x8(%rsi,%rdx,8), %rdi
addq %rax, %rdi
movq %rdi, (%rsi,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0xfaef
movq %rbx, %rdi
callq 0x8460
movq %rax, 0x10(%r15)
testq %rax, %rax
je 0xfd54
movq %rax, %rbp
movq %r13, %rdi
callq 0x8460
movq %rax, 0x8(%rbp)
testq %rax, %rax
je 0xfd90
movq $0x0, (%rbp)
cmpl $0x2, %r14d
jl 0xfb69
movl %r14d, %eax
leal 0x1(%r14), %ecx
movl $0x2, %edx
shlq $0x3, %rax
movq 0x10(%r15), %rsi
movq -0x8(%rsi,%rdx,8), %rdi
addq %rax, %rdi
movq %rdi, (%rsi,%rdx,8)
incq %rdx
cmpq %rdx, %rcx
jne 0xfb51
movq %rbx, %rdi
callq 0x8460
movq %rax, 0x18(%r15)
testq %rax, %rax
movq 0x8(%rsp), %r13
movq 0x18(%rsp), %rbp
je 0xfdd0
movq %rbx, %rdi
callq 0x8460
movq %rax, 0x8(%r15)
testq %rax, %rax
je 0xfe07
leaq 0x1(%rbp), %rbx
shlq $0x2, %rbx
movq %rbx, %rdi
callq 0x8460
movq %rax, 0x20(%r15)
testq %rax, %rax
je 0xfe3e
cmpl $0x0, 0x28(%r15)
je 0x1001a
movl $0x1, 0x2c(%r15)
leaq (%rax,%rbp,4), %rcx
leaq (%rax,%rbp,4), %rax
addq $0x4, %rax
movq %rax, 0x70(%r15)
movq 0x10(%rsp), %r13
movslq %r13d, %rdi
leaq 0x4(%rcx,%rdi,8), %rax
movq %rax, 0x50(%r15)
leaq (%rax,%rbp,4), %rax
movq %rax, 0x58(%r15)
leaq (%rax,%rbp,4), %rax
movq %rax, 0x80(%r15)
leaq (%rax,%rbp,4), %rax
addq $0x4, %rax
movq %rax, 0x88(%r15)
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x70(%r15)
testq %rax, %rax
je 0xfe94
shlq $0x2, %rbp
movq %rbp, %rdi
callq 0x8460
movq %rax, 0x50(%r15)
testq %rax, %rax
je 0xfed5
movq %rbp, %rdi
callq 0x8460
movq %rax, 0x58(%r15)
testq %rax, %rax
movq 0x8(%rsp), %r13
je 0xff11
movq %rbx, %rdi
callq 0x8460
movq %rax, 0x80(%r15)
testq %rax, %rax
je 0xff4b
movslq %r12d, %rdi
shlq $0x2, %rdi
callq 0x8460
movq %rax, 0x88(%r15)
testq %rax, %rax
je 0xff85
leaq 0x78(%r15), %rdi
movl %r14d, %esi
movq %r13, %rdx
callq 0xb2c5
cmpl $0x1, %eax
jne 0xffc4
leaq 0xe1744(%rip), %rsi     # 0xf13f0
leaq 0xe278b(%rip), %rdx     # 0xf243e
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe1368(%rip), %rsi     # 0xf1034
leaq 0xe26e2(%rip), %rdx     # 0xf23b5
movq %r13, %rdi
movl $0x629, %ecx            # imm = 0x629
jmp 0xfdc8
leaq 0xe131d(%rip), %rsi     # 0xf1004
leaq 0xe26bd(%rip), %rdx     # 0xf23ab
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe132e(%rip), %rsi     # 0xf1034
leaq 0xe26a8(%rip), %rdx     # 0xf23b5
movq %r13, %rdi
movl $0x60a, %ecx            # imm = 0x60A
jmp 0xfe73
leaq 0xe12e3(%rip), %rsi     # 0xf1004
leaq 0xe26a1(%rip), %rdx     # 0xf23c9
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe12f3(%rip), %rsi     # 0xf1034
leaq 0xe266d(%rip), %rdx     # 0xf23b5
movq 0x8(%rsp), %rdi
movl $0x60b, %ecx            # imm = 0x60B
jmp 0xfdc8
leaq 0xe12a9(%rip), %rsi     # 0xf1004
leaq 0xe2674(%rip), %rdx     # 0xf23d6
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe12ba(%rip), %rsi     # 0xf1034
leaq 0xe2634(%rip), %rdx     # 0xf23b5
movq 0x8(%rsp), %rdi
movl $0x60f, %ecx            # imm = 0x60F
jmp 0xfe73
leaq 0xe126d(%rip), %rsi     # 0xf1004
leaq 0xe2640(%rip), %rdx     # 0xf23de
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe127d(%rip), %rsi     # 0xf1034
leaq 0xe25f7(%rip), %rdx     # 0xf23b5
movq 0x8(%rsp), %rdi
movl $0x610, %ecx            # imm = 0x610
movq %rbx, %r8
jmp 0xfe76
leaq 0xe122d(%rip), %rsi     # 0xf1004
leaq 0xe260b(%rip), %rdx     # 0xf23e9
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe123e(%rip), %rsi     # 0xf1034
leaq 0xe25b8(%rip), %rdx     # 0xf23b5
movq %r13, %rdi
movl $0x614, %ecx            # imm = 0x614
jmp 0xfe73
leaq 0xe11f6(%rip), %rsi     # 0xf1004
leaq 0xe25dd(%rip), %rdx     # 0xf23f2
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe1207(%rip), %rsi     # 0xf1034
leaq 0xe2581(%rip), %rdx     # 0xf23b5
movq %r13, %rdi
movl $0x615, %ecx            # imm = 0x615
jmp 0xfe73
leaq 0xe11bf(%rip), %rsi     # 0xf1004
leaq 0xe25b2(%rip), %rdx     # 0xf23fe
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe11d0(%rip), %rsi     # 0xf1034
leaq 0xe254a(%rip), %rdx     # 0xf23b5
movq %r13, %rdi
movl $0x616, %ecx            # imm = 0x616
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
shll $0x3, %r13d
leaq 0xe1165(%rip), %rsi     # 0xf1004
leaq 0xe2563(%rip), %rdx     # 0xf2409
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe1175(%rip), %rsi     # 0xf1034
leaq 0xe24ef(%rip), %rdx     # 0xf23b5
movq 0x8(%rsp), %rdi
movl $0x622, %ecx            # imm = 0x622
jmp 0xfdc8
leaq 0xe1128(%rip), %rsi     # 0xf1004
leaq 0xe2530(%rip), %rdx     # 0xf2413
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe1139(%rip), %rsi     # 0xf1034
leaq 0xe24b3(%rip), %rdx     # 0xf23b5
movq 0x8(%rsp), %rdi
movl $0x623, %ecx            # imm = 0x623
jmp 0xfdc8
leaq 0xe10ec(%rip), %rsi     # 0xf1004
leaq 0xe2503(%rip), %rdx     # 0xf2422
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe10fd(%rip), %rsi     # 0xf1034
leaq 0xe2477(%rip), %rdx     # 0xf23b5
movq %r13, %rdi
movl $0x624, %ecx            # imm = 0x624
jmp 0xfdc8
leaq 0xe10b2(%rip), %rsi     # 0xf1004
leaq 0xe24d5(%rip), %rdx     # 0xf242e
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe10c3(%rip), %rsi     # 0xf1034
leaq 0xe243d(%rip), %rdx     # 0xf23b5
movq %r13, %rdi
movl $0x625, %ecx            # imm = 0x625
jmp 0xfe73
shll $0x2, %r12d
leaq 0xe1074(%rip), %rsi     # 0xf1004
leaq 0xe249f(%rip), %rdx     # 0xf2436
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe1084(%rip), %rsi     # 0xf1034
leaq 0xe23fe(%rip), %rdx     # 0xf23b5
movq %r13, %rdi
movl $0x626, %ecx            # imm = 0x626
jmp 0xfdc8
leaq 0x68(%r15), %rdi
movl 0x30(%r15), %ecx
movl %r14d, %esi
movl %r14d, %edx
movq %r13, %r8
callq 0xb0e4
cmpl $0x1, %eax
jne 0x1001a
leaq 0xe140a(%rip), %rsi     # 0xf13f0
leaq 0xe2482(%rip), %rdx     # 0xf246f
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe102e(%rip), %rsi     # 0xf1034
leaq 0xe23a8(%rip), %rdx     # 0xf23b5
movq %r13, %rdi
movl $0x62c, %ecx            # imm = 0x62C
jmp 0xfdc8
testl %r14d, %r14d
jle 0x100c3
movq 0x8(%r15), %rcx
movl %r14d, %eax
incl %r14d
andl $-0x2, %r14d
decq %rax
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
xorl %edx, %edx
movdqa 0xe1c38(%rip), %xmm1    # 0xf1c80
movdqa 0xe1c40(%rip), %xmm2    # 0xf1c90
pxor %xmm2, %xmm0
movabsq $0x3e50000000000000, %rsi # imm = 0x3E50000000000000
pcmpeqd %xmm3, %xmm3
movq %rdx, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm1, %xmm4
pxor %xmm2, %xmm4
movdqa %xmm4, %xmm5
pcmpgtd %xmm0, %xmm5
pcmpeqd %xmm0, %xmm4
pshufd $0xf5, %xmm4, %xmm6     # xmm6 = xmm4[1,1,3,3]
pand %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm4     # xmm4 = xmm5[1,1,3,3]
por %xmm6, %xmm4
movd %xmm4, %eax
notl %eax
testb $0x1, %al
je 0x100a1
movq %rsi, 0x8(%rcx,%rdx,8)
pxor %xmm3, %xmm4
pextrw $0x4, %xmm4, %eax
testb $0x1, %al
je 0x100b3
movq %rsi, 0x10(%rcx,%rdx,8)
addq $0x2, %rdx
xorl %eax, %eax
cmpq %rdx, %r14
jne 0x10062
jmp 0xfe82
xorl %eax, %eax
jmp 0xfe82