// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../tools/dei_rkck.c
// Function: rkqs
int rkqs(double *x, double htry, double eps,
	 double *hdid, double *hnext,
	 int (*derivs)(double, double [], double [], void * parameters_and_workspace, ErrorMsg error_message),
	 void * parameters_and_workspace_for_derivs,
	 struct generic_integrator_workspace * pgi)
{

  int i;
  double errmax,h,htemp,xnew;

  h=htry;
  for (;;) {
    class_call(rkck(*x,h,derivs,parameters_and_workspace_for_derivs,pgi),
	       pgi->error_message,
	       pgi->error_message);
    errmax=0.0;
    for (i=0;i<pgi->n;i++) errmax=MAX(errmax,fabs(pgi->yerr[i]/pgi->yscal[i]));
    errmax /= eps;
    if (errmax <= 1.0) break;
    htemp=_SAFETY_*h*pow(errmax,_PSHRNK_);
    h=(h >= 0.0 ? MAX(htemp,0.1*h) : MIN(htemp,0.1*h));
    xnew=(*x)+h;
    class_test(xnew == *x,
	       pgi->error_message,
	       "stepsize underflow at x=%e",xnew);
  }
  if (errmax > _ERRCON_) *hnext=_SAFETY_*h*pow(errmax,_PGROW_);
  else *hnext=5.0*h;
  *x += (*hdid=h);
  for (i=0;i<pgi->n;i++) pgi->y[i]=pgi->ytemp[i];

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %r9, %rbx
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r12
movq %rsi, %r15
movsd %xmm1, 0x18(%rsp)
movapd %xmm0, %xmm1
movq %rdi, %r14
movsd (%r14), %xmm0
movsd %xmm1, 0x8(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0xab13
testl %eax, %eax
jne 0xaa31
movslq (%rbx), %rax
testq %rax, %rax
jle 0xa953
movq 0x8(%rbx), %rcx
movq 0x20(%rbx), %rdx
xorpd %xmm1, %xmm1
xorl %esi, %esi
movsd 0x8(%rsp), %xmm2
movapd 0xe690d(%rip), %xmm3    # 0xf1240
movsd (%rdx,%rsi,8), %xmm0
divsd (%rcx,%rsi,8), %xmm0
andpd %xmm3, %xmm0
maxsd %xmm1, %xmm0
incq %rsi
movapd %xmm0, %xmm1
cmpq %rsi, %rax
jne 0xa933
jmp 0xa95d
xorpd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm2
divsd 0x18(%rsp), %xmm0
movsd 0xe68f5(%rip), %xmm1    # 0xf1260
ucomisd %xmm0, %xmm1
jae 0xaa7f
mulsd 0xe68fb(%rip), %xmm2    # 0xf1278
movsd %xmm2, 0x10(%rsp)
movsd 0xe68fd(%rip), %xmm1    # 0xf1288
callq 0x8620
movsd 0x8(%rsp), %xmm1
mulsd 0x10(%rsp), %xmm0
ucomisd 0xe68b4(%rip), %xmm1    # 0xf1258
mulsd 0xe68e4(%rip), %xmm1    # 0xf1290
jae 0xa9b8
minsd %xmm1, %xmm0
movapd %xmm0, %xmm1
jmp 0xa9bc
maxsd %xmm0, %xmm1
movsd (%r14), %xmm2
movapd %xmm1, %xmm0
addsd %xmm2, %xmm0
ucomisd %xmm2, %xmm0
jne 0xa8ee
jp 0xa8ee
leaq 0xe6bee(%rip), %rsi     # 0xf15ce
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movb $0x1, %al
callq 0x30c2c
leaq 0xe668c(%rip), %rsi     # 0xf1082
leaq 0xe6bec(%rip), %rdx     # 0xf15e9
leaq 0x820(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x68, %rbx
leaq 0xe6617(%rip), %rsi     # 0xf1034
leaq 0xe6ba5(%rip), %rdx     # 0xf15c9
movq %rbx, %rdi
movl $0x9c, %ecx
movq %r15, %r8
jmp 0xaa6e
addq $0x68, %rbx
leaq 0xe69b4(%rip), %rsi     # 0xf13f0
leaq 0xe6b4c(%rip), %rdx     # 0xf158f
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0xe65d8(%rip), %rsi     # 0xf1034
leaq 0xe6b66(%rip), %rdx     # 0xf15c9
movq %rbx, %rdi
movl $0x92, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
jmp 0xab01
ucomisd 0xe67e1(%rip), %xmm0    # 0xf1268
jbe 0xaab6
movsd 0xe67e7(%rip), %xmm1    # 0xf1278
mulsd %xmm2, %xmm1
movsd %xmm1, 0x10(%rsp)
movsd 0xe67dd(%rip), %xmm1    # 0xf1280
callq 0x8620
movsd 0x8(%rsp), %xmm2
mulsd 0x10(%rsp), %xmm0
jmp 0xaac2
movsd 0xe67b2(%rip), %xmm0    # 0xf1270
mulsd %xmm2, %xmm0
movsd %xmm0, (%r12)
movsd %xmm2, (%r15)
addsd (%r14), %xmm2
movsd %xmm2, (%r14)
movslq (%rbx), %rcx
testq %rcx, %rcx
jle 0xaaff
movq 0x10(%rbx), %rdx
movq 0x58(%rbx), %rsi
xorl %eax, %eax
xorl %edi, %edi
movsd (%rsi,%rdi,8), %xmm0
movsd %xmm0, (%rdx,%rdi,8)
incq %rdi
cmpq %rdi, %rcx
jne 0xaaeb
jmp 0xab01
xorl %eax, %eax
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq