// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/dei_rkck.c
// Function: generic_integrator
int generic_integrator(int (*derivs)(double x, double y[], double yprime[], void * parameters_and_workspace, ErrorMsg error_message),
		       double x1,
		       double x2,
		       double ystart[],
		       void * parameters_and_workspace_for_derivs,
		       double eps,
		       double hmin,
		       struct generic_integrator_workspace * pgi)

{
  int nstp,i;
  double x,hnext,hdid,h,h1;

  h1=x2-x1;
  x=x1;
  h=dsign(h1,x2-x1);
  for (i=0;i<pgi->n;i++) pgi->y[i]=ystart[i];
  for (nstp=1;nstp<=_MAXSTP_;nstp++) {
    class_call((*derivs)(x,pgi->y,pgi->dydx,parameters_and_workspace_for_derivs, pgi->error_message),
	       pgi->error_message,
	       pgi->error_message);
    for (i=0;i<pgi->n;i++)
      pgi->yscal[i]=fabs(pgi->y[i])+fabs(pgi->dydx[i]*h)+_TINY_;
    if ((x+h-x2)*(x+h-x1) > 0.0) h=x2-x;
    class_call(rkqs(&x,
		    h,
		    eps,
		    &hdid,
		    &hnext,
		    derivs,
		    parameters_and_workspace_for_derivs,
		    pgi),
	       pgi->error_message,
	       pgi->error_message);
    if ((x-x2)*(x2-x1) >= 0.0) {
      for (i=0;i<pgi->n;i++) ystart[i]=pgi->y[i];
      return _SUCCESS_;
    }
    class_test(fabs(hnext/x1) <= hmin,
	       pgi->error_message,
	       "Step size too small: step:%g, minimum:%g, in interval: [%g:%g]",
	       fabs(hnext/x1),
	       hmin,
	       x1,
	       x2);
    h=hnext;
  }

  class_stop(pgi->error_message,
	     "Too many integration steps needed within interval [%g : %g],\n the system of equations is probably buggy or featuring a discontinuity",x1,x2);

}

// Assembly:
subq $0x3088, %rsp           # imm = 0x3088
movq %rdi, 0x3078(%rsp)
movsd %xmm0, 0x3070(%rsp)
movsd %xmm1, 0x3068(%rsp)
movq %rsi, 0x3060(%rsp)
movq %rdx, 0x3058(%rsp)
movsd %xmm2, 0x3050(%rsp)
movsd %xmm3, 0x3048(%rsp)
movq %rcx, 0x3040(%rsp)
movsd 0x3068(%rsp), %xmm0
subsd 0x3070(%rsp), %xmm0
movsd %xmm0, 0x3010(%rsp)
movsd 0x3070(%rsp), %xmm0
movsd %xmm0, 0x3030(%rsp)
movsd 0x3068(%rsp), %xmm0
subsd 0x3070(%rsp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x9874
movsd 0x3010(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x989a
movsd 0x3010(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x3018(%rsp)
movl $0x0, 0x3038(%rsp)
movl 0x3038(%rsp), %eax
movq 0x3040(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x9908
movq 0x3060(%rsp), %rax
movslq 0x3038(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x3040(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x3038(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x3038(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3038(%rsp)
jmp 0x98b4
movl $0x1, 0x303c(%rsp)
cmpl $0x186a0, 0x303c(%rsp) # imm = 0x186A0
jg 0x9d3b
movq 0x3078(%rsp), %rax
movsd 0x3030(%rsp), %xmm0
movq 0x3040(%rsp), %rcx
movq 0x10(%rcx), %rdi
movq 0x3040(%rsp), %rcx
movq 0x18(%rcx), %rsi
movq 0x3058(%rsp), %rdx
movq 0x3040(%rsp), %rcx
addq $0x68, %rcx
callq *%rax
cmpl $0x1, %eax
jne 0x99cf
leaq 0x2810(%rsp), %rdi
movq 0x3040(%rsp), %rcx
addq $0x68, %rcx
leaq 0x1c8a55(%rip), %rsi    # 0x1d23d8
leaq 0x1c8a60(%rip), %rdx    # 0x1d23ea
movb $0x0, %al
callq 0x5b9c0
movq 0x3040(%rsp), %rdi
addq $0x68, %rdi
leaq 0x2810(%rsp), %r8
leaq 0x1c8688(%rip), %rsi    # 0x1d2034
leaq 0x1c89b3(%rip), %rdx    # 0x1d2366
movl $0x63, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3084(%rsp)
jmp 0x9db4
movl $0x0, 0x3038(%rsp)
movl 0x3038(%rsp), %eax
movq 0x3040(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x9a81
movq 0x3040(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x3038(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movaps 0x1c881f(%rip), %xmm1   # 0x1d2230
pand %xmm1, %xmm0
movq 0x3040(%rsp), %rax
movq 0x18(%rax), %rax
movslq 0x3038(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd 0x3018(%rsp), %xmm1
movaps 0x1c87f2(%rip), %xmm2   # 0x1d2230
pand %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd 0x1c87f2(%rip), %xmm1   # 0x1d2240
addsd %xmm1, %xmm0
movq 0x3040(%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x3038(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x3038(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3038(%rsp)
jmp 0x99da
movsd 0x3030(%rsp), %xmm0
addsd 0x3018(%rsp), %xmm0
subsd 0x3068(%rsp), %xmm0
movsd 0x3030(%rsp), %xmm1
addsd 0x3018(%rsp), %xmm1
subsd 0x3070(%rsp), %xmm1
mulsd %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x9adf
movsd 0x3068(%rsp), %xmm0
subsd 0x3030(%rsp), %xmm0
movsd %xmm0, 0x3018(%rsp)
movsd 0x3018(%rsp), %xmm0
movsd 0x3050(%rsp), %xmm1
movq 0x3078(%rsp), %rcx
movq 0x3058(%rsp), %r8
movq 0x3040(%rsp), %r9
leaq 0x3030(%rsp), %rdi
leaq 0x3020(%rsp), %rsi
leaq 0x3028(%rsp), %rdx
callq 0x9dd0
cmpl $0x1, %eax
jne 0x9b92
leaq 0x2010(%rsp), %rdi
movq 0x3040(%rsp), %rcx
addq $0x68, %rcx
leaq 0x1c8892(%rip), %rsi    # 0x1d23d8
leaq 0x1c88f3(%rip), %rdx    # 0x1d2440
movb $0x0, %al
callq 0x5b9c0
movq 0x3040(%rsp), %rdi
addq $0x68, %rdi
leaq 0x2010(%rsp), %r8
leaq 0x1c84c5(%rip), %rsi    # 0x1d2034
leaq 0x1c87f0(%rip), %rdx    # 0x1d2366
movl $0x70, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3084(%rsp)
jmp 0x9db4
movsd 0x3030(%rsp), %xmm0
subsd 0x3068(%rsp), %xmm0
movsd 0x3068(%rsp), %xmm1
subsd 0x3070(%rsp), %xmm1
mulsd %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x9c32
movl $0x0, 0x3038(%rsp)
movl 0x3038(%rsp), %eax
movq 0x3040(%rsp), %rcx
cmpl (%rcx), %eax
jge 0x9c22
movq 0x3040(%rsp), %rax
movq 0x10(%rax), %rax
movslq 0x3038(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x3060(%rsp), %rax
movslq 0x3038(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x3038(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3038(%rsp)
jmp 0x9bce
movl $0x0, 0x3084(%rsp)
jmp 0x9db4
movsd 0x3028(%rsp), %xmm1
divsd 0x3070(%rsp), %xmm1
movaps 0x1c85e5(%rip), %xmm0   # 0x1d2230
pand %xmm0, %xmm1
movsd 0x3048(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jb 0x9d13
leaq 0x1810(%rsp), %rdi
movsd 0x3028(%rsp), %xmm0
divsd 0x3070(%rsp), %xmm0
movaps 0x1c85ad(%rip), %xmm1   # 0x1d2230
pand %xmm1, %xmm0
movsd 0x3048(%rsp), %xmm1
movsd 0x3070(%rsp), %xmm2
movsd 0x3068(%rsp), %xmm3
leaq 0x1c87e9(%rip), %rsi    # 0x1d2492
movb $0x4, %al
callq 0x5b9c0
leaq 0x1010(%rsp), %rdi
leaq 0x1810(%rsp), %rcx
leaq 0x1c83bb(%rip), %rsi    # 0x1d2082
leaq 0x1c8803(%rip), %rdx    # 0x1d24d1
movb $0x0, %al
callq 0x5b9c0
movq 0x3040(%rsp), %rdi
addq $0x68, %rdi
leaq 0x1010(%rsp), %r8
leaq 0x1c8344(%rip), %rsi    # 0x1d2034
leaq 0x1c866f(%rip), %rdx    # 0x1d2366
movl $0x7b, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3084(%rsp)
jmp 0x9db4
movsd 0x3028(%rsp), %xmm0
movsd %xmm0, 0x3018(%rsp)
movl 0x303c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x303c(%rsp)
jmp 0x9913
leaq 0x810(%rsp), %rdi
movsd 0x3070(%rsp), %xmm0
movsd 0x3068(%rsp), %xmm1
leaq 0x1c878c(%rip), %rsi    # 0x1d24e8
movb $0x2, %al
callq 0x5b9c0
leaq 0x10(%rsp), %rdi
leaq 0x810(%rsp), %rdx
leaq 0x1c87f6(%rip), %rsi    # 0x1d256d
movb $0x0, %al
callq 0x5b9c0
movq 0x3040(%rsp), %rdi
addq $0x68, %rdi
leaq 0x10(%rsp), %r8
leaq 0x1c829e(%rip), %rsi    # 0x1d2034
leaq 0x1c85c9(%rip), %rdx    # 0x1d2366
movl $0x80, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x3084(%rsp)
movl 0x3084(%rsp), %eax
addq $0x3088, %rsp           # imm = 0x3088
retq
nopw %cs:(%rax,%rax)