// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../tools/evolver_ndf15.c
// Function: adjust_stepsize
int adjust_stepsize(double **dif, double abshdivabshlast, int neq,int k){
  double mydifU[5][5]={{-1,-2,-3,-4,-5},{0,1,3,6,10},{0,0,-1,-4,-10},{0,0,0,1,5},{0,0,0,0,-1}};
  double tempvec[5];
  double mydifRU[5][5];
  int ii,jj,kk;

  for(ii=1;ii<=5;ii++) mydifRU[0][ii-1] = -ii*abshdivabshlast;
  for(jj=2;jj<=5;jj++){
    for(ii=1;ii<=5;ii++){
      mydifRU[jj-1][ii-1] = mydifRU[jj-2][ii-1]*(1.0-(1.0+ii*abshdivabshlast)/jj);
    }
  }
  for(ii=0;ii<5;ii++){
    for(kk=0;kk<5;kk++){
      /* Save the i'th row of mydifRU */
      tempvec[kk] = mydifRU[ii][kk];
    }
    for(jj=0;jj<5;jj++){
      /* Now do the matrix multiplication: */
      mydifRU[ii][jj] = 0.0;
      for(kk=0;kk<5;kk++)    mydifRU[ii][jj] += tempvec[kk]*mydifU[kk][jj];
    }
  }

  for(ii=0;ii<neq;ii++){
    for(kk=0;kk<k;kk++){
      /* Save the k first values of the i'th row of dif */
      tempvec[kk] = dif[ii+1][kk+1];
    }
    for(jj=0;jj<k;jj++){
      /* Now do the matrix multiplication: */
      dif[ii+1][jj+1] = 0.0;
      for(kk=0;kk<k;kk++) dif[ii+1][jj+1] += tempvec[kk]*mydifRU[kk][jj];
    }
  }
  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl %edx, 0xc(%rsp)
movq %rdi, 0x18(%rsp)
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
xorl %ecx, %ecx
movdqa 0xdd705(%rip), %xmm1    # 0xeec80
movdqa 0xdd70d(%rip), %xmm2    # 0xeec90
movdqa 0xdd715(%rip), %xmm3    # 0xeeca0
pshufd $0xf5, %xmm3, %xmm4     # xmm4 = xmm3[1,1,3,3]
movq %rcx, %xmm5
pshufd $0x44, %xmm5, %xmm5     # xmm5 = xmm5[0,1,0,1]
por %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm3, %xmm6
pcmpgtd %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pcmpeqd %xmm4, %xmm5
pand %xmm6, %xmm5
movd %xmm5, %edx
testb $0x1, %dl
je 0x115d4
leal 0x1(%rax), %edx
xorps %xmm6, %xmm6
cvtsi2sd %edx, %xmm6
mulsd %xmm0, %xmm6
movsd %xmm6, 0x50(%rsp,%rcx,8)
pextrw $0x4, %xmm5, %edx
testb $0x1, %dl
je 0x115ef
xorps %xmm5, %xmm5
cvtsi2sd %eax, %xmm5
mulsd %xmm0, %xmm5
movsd %xmm5, 0x58(%rsp,%rcx,8)
addq $0x2, %rcx
addl $-0x2, %eax
cmpq $0x6, %rcx
jne 0x11590
movl $0x2, %eax
leaq 0x78(%rsp), %rcx
movsd 0xdcc52(%rip), %xmm1    # 0xee260
xorps %xmm2, %xmm2
cvtsi2sd %eax, %xmm2
movq $-0x5, %rdx
leal 0x6(%rdx), %edi
xorps %xmm3, %xmm3
cvtsi2sd %edi, %xmm3
mulsd %xmm0, %xmm3
addsd %xmm1, %xmm3
divsd %xmm2, %xmm3
movapd %xmm1, %xmm4
subsd %xmm3, %xmm4
mulsd (%rcx,%rdx,8), %xmm4
movsd %xmm4, 0x28(%rcx,%rdx,8)
incq %rdx
jne 0x1161c
incq %rax
addq $0x28, %rcx
cmpq $0x6, %rax
jne 0x1160e
xorl %eax, %eax
leaq 0xddf40(%rip), %rcx     # 0xef5a0
leaq (%rax,%rax,4), %rdx
leaq (%rsp,%rdx,8), %rdx
addq $0x50, %rdx
movq 0x20(%rdx), %rdi
movq %rdi, 0x40(%rsp)
movupd (%rdx), %xmm0
movups 0x10(%rdx), %xmm1
movaps %xmm1, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
movq %rcx, %rdi
xorl %r8d, %r8d
leaq (%rdx,%r8,8), %r9
xorpd %xmm0, %xmm0
movq %rdi, %r10
xorl %r11d, %r11d
movsd 0x20(%rsp,%r11,8), %xmm1
mulsd (%r10), %xmm1
addsd %xmm1, %xmm0
incq %r11
addq $0x28, %r10
cmpq $0x5, %r11
jne 0x1169c
movsd %xmm0, (%r9)
incq %r8
addq $0x8, %rdi
cmpq $0x5, %r8
jne 0x1168e
incq %rax
cmpq $0x5, %rax
jne 0x11660
testl %esi, %esi
jle 0x11768
movl 0xc(%rsp), %r13d
leaq (,%r13,8), %rax
movq %rax, 0x10(%rsp)
movl %esi, %ebp
leaq (,%r13,4), %r14
addq %r13, %r14
xorl %ebx, %ebx
leaq 0x20(%rsp), %r12
cmpl $0x0, 0xc(%rsp)
jle 0x11760
movq 0x18(%rsp), %rax
movq 0x8(%rax,%rbx,8), %r15
leaq 0x8(%r15), %rsi
movq %r12, %rdi
movq 0x10(%rsp), %rdx
callq 0x82d0
leaq 0x50(%rsp), %rax
xorl %ecx, %ecx
incq %rcx
xorpd %xmm0, %xmm0
xorl %edx, %edx
movq %r12, %rsi
movsd (%rsi), %xmm1
mulsd (%rax,%rdx,8), %xmm1
addsd %xmm1, %xmm0
addq $0x8, %rsi
addq $0x5, %rdx
cmpq %rdx, %r14
jne 0x11737
movsd %xmm0, (%r15,%rcx,8)
addq $0x8, %rax
cmpq %r13, %rcx
jne 0x1172b
incq %rbx
cmpq %rbp, %rbx
jne 0x11702
xorl %eax, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq