// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../tools/evolver_rkck.c
// Function: evolver_rk
int evolver_rk(int (*derivs)(double x,
				  double * y,
				  double * dy,
				  void * parameters_and_workspace,
				  ErrorMsg error_message),
		    double x_ini,
		    double x_end,
		    double * y,
		    int * used_in_output,
		    int y_size,
		    void * parameters_and_workspace_for_derivs,
		    double tolerance,
		    double minimum_variation,
		    int (*evaluate_timescale)(double x,
					      void * parameters_and_workspace,
					      double * timescale,
					      ErrorMsg error_message),
		    double timestep_over_timescale,
		    double * x_sampling,
		    int x_size,
		    int (*output)(double x,
				  double y[],
				  double dy[],
				  int index_x,
				  void * parameters_and_workspace,
				  ErrorMsg error_message),
		    int (*print_variables)(double x,
					   double y[],
					   double dy[],
					   void * parameters_and_workspace,
					   ErrorMsg error_message),
		    ErrorMsg error_message) {

  int next_index_x;
  double x1,x2=0.,timestep,timescale;
  struct generic_integrator_workspace gi;
  double * dy;
  short call_output;

  class_test(x_ini > x_sampling[x_size-1],
	     error_message,
	     "called with x=%e, last x_sampling=%e",x_ini,x_sampling[x_size-1]);

  next_index_x=0;

  while (x_sampling[next_index_x] < x_ini) next_index_x++;

  class_call(initialize_generic_integrator(y_size, &gi),
	     gi.error_message,
	     error_message);

  class_alloc(dy,y_size*sizeof(double),error_message);

  x1=x_ini;

  call_output = _FALSE_;

  while ((x1 < x_end) && (next_index_x<x_size)) {

    class_call((*evaluate_timescale)(x1,
				     parameters_and_workspace_for_derivs,
				     &timescale,
				     error_message),
	       error_message,
	       error_message);

    timestep = timestep_over_timescale * timescale;

    class_test(fabs(timestep/x1) < minimum_variation,
	       error_message,
	       "integration step =%e < machine precision : leads either to numerical error or infinite loop",fabs(timestep/x1));

    if (x1 + 2.* timestep < x_sampling[next_index_x]) {
      x2 = x1 + timestep;
    }
    else {
      x2 = x_sampling[next_index_x];
      call_output = _TRUE_;
    }

    if (x2 > x_end) {
      x2 = x_end;
      call_output = _FALSE_;
    }

    if (print_variables != NULL) {

      if (x1 == x_ini) {

	class_call((*derivs)(x1,
			     y,
			     dy,
			     parameters_and_workspace_for_derivs,
			     error_message),
		   error_message,
		   error_message);
      }

      class_call((*print_variables)(x1,
				    y,
				    dy,
				    parameters_and_workspace_for_derivs,
				    error_message),
		 error_message,
		 error_message);
    }

    class_call(generic_integrator(derivs,
				  x1,
				  x2,
				  y,
				  parameters_and_workspace_for_derivs,
				  tolerance,
				  x1*minimum_variation,
				  &gi),
	       gi.error_message,
	       error_message);

    if (call_output == _TRUE_) {

      class_call((*derivs)(x2,
			   y,
			   dy,
			   parameters_and_workspace_for_derivs,
			   error_message),
		 error_message,
		 error_message);

      class_call((*output)(x2,
			   y,
			   dy,
			   next_index_x,
			   parameters_and_workspace_for_derivs,
			   error_message),
		 error_message,
		 error_message);

      call_output = _FALSE_;

      next_index_x++;

    }

    x1 = x2;

  }

  /* a last call is compulsory to ensure that all quantitites in
     y,dy,parameters_and_workspace_for_derivs are updated to the last
     point in the covered range */
  class_call((*derivs)(x1,
		       y,
		       dy,
		       parameters_and_workspace_for_derivs,
		       error_message),
	     error_message,
	     error_message);

  if (print_variables != NULL)
    class_call((*print_variables)(x1,
				  y,
				  dy,
				  parameters_and_workspace_for_derivs,
				  error_message),
	       error_message,
	       error_message);

  class_call(cleanup_generic_integrator(&gi),
	     gi.error_message,
	     error_message);

  free(dy);

  return _SUCCESS_;

}

// Assembly:
subq $0x8128, %rsp           # imm = 0x8128
movq 0x8150(%rsp), %rax
movq 0x8148(%rsp), %rax
movq 0x8140(%rsp), %rax
movl 0x8138(%rsp), %eax
movq 0x8130(%rsp), %rax
movq %rdi, 0x8118(%rsp)
movsd %xmm0, 0x8110(%rsp)
movsd %xmm1, 0x8108(%rsp)
movq %rsi, 0x8100(%rsp)
movq %rdx, 0x80f8(%rsp)
movl %ecx, 0x80f4(%rsp)
movq %r8, 0x80e8(%rsp)
movsd %xmm2, 0x80e0(%rsp)
movsd %xmm3, 0x80d8(%rsp)
movq %r9, 0x80d0(%rsp)
movsd %xmm4, 0x80c8(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x80b0(%rsp)
movsd 0x8110(%rsp), %xmm0
movq 0x8130(%rsp), %rax
movl 0x8138(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0xec17
leaq 0x7020(%rsp), %rdi
movsd 0x8110(%rsp), %xmm0
movq 0x8130(%rsp), %rax
movl 0x8138(%rsp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
leaq 0x1c3d30(%rip), %rsi    # 0x1d28e1
movb $0x2, %al
callq 0x5b9c0
leaq 0x6820(%rsp), %rdi
leaq 0x7020(%rsp), %rcx
leaq 0x1c34b3(%rip), %rsi    # 0x1d2082
leaq 0x1c3d30(%rip), %rdx    # 0x1d2906
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x6820(%rsp), %r8
leaq 0x1c3440(%rip), %rsi    # 0x1d2034
leaq 0x1c3d28(%rip), %rdx    # 0x1d2923
movl $0x2c, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
movl $0x0, 0x80c4(%rsp)
movq 0x8130(%rsp), %rax
movslq 0x80c4(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd 0x8110(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xec59
movl 0x80c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x80c4(%rsp)
jmp 0xec22
movl 0x80f4(%rsp), %edi
leaq 0x7838(%rsp), %rsi
callq 0x8ff0
cmpl $0x1, %eax
jne 0xecd5
leaq 0x6020(%rsp), %rdi
leaq 0x7838(%rsp), %rcx
addq $0x68, %rcx
leaq 0x1c374b(%rip), %rsi    # 0x1d23d8
leaq 0x1c3c9a(%rip), %rdx    # 0x1d292e
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x6020(%rsp), %r8
leaq 0x1c3382(%rip), %rsi    # 0x1d2034
leaq 0x1c3c6a(%rip), %rdx    # 0x1d2923
movl $0x34, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
movslq 0x80f4(%rsp), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x7830(%rsp)
cmpq $0x0, 0x7830(%rsp)
jne 0xed6a
movslq 0x80f4(%rsp), %rax
shlq $0x3, %rax
movl %eax, 0x601c(%rsp)
leaq 0x5810(%rsp), %rdi
movl 0x601c(%rsp), %ecx
leaq 0x1c32e2(%rip), %rsi    # 0x1d2004
leaq 0x1ebd8c(%rip), %rdx    # 0x1faab5
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x5810(%rsp), %r8
leaq 0x1c32ed(%rip), %rsi    # 0x1d2034
leaq 0x1c3bd5(%rip), %rdx    # 0x1d2923
movl $0x36, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
movsd 0x8110(%rsp), %xmm0
movsd %xmm0, 0x80b8(%rsp)
movw $0x0, 0x782e(%rsp)
movsd 0x80b8(%rsp), %xmm1
movsd 0x8108(%rsp), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, 0xf(%rsp)
jbe 0xedb9
movl 0x80c4(%rsp), %eax
cmpl 0x8138(%rsp), %eax
setl %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0xedc6
jmp 0xf36d
movq 0x80d0(%rsp), %rax
movsd 0x80b8(%rsp), %xmm0
movq 0x80e8(%rsp), %rdi
movq 0x8150(%rsp), %rdx
leaq 0x80a0(%rsp), %rsi
callq *%rax
cmpl $0x1, %eax
jne 0xee55
leaq 0x5010(%rsp), %rdi
movq 0x8150(%rsp), %rcx
leaq 0x1c35cb(%rip), %rsi    # 0x1d23d8
leaq 0x1c3b45(%rip), %rdx    # 0x1d2959
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x5010(%rsp), %r8
leaq 0x1c3202(%rip), %rsi    # 0x1d2034
leaq 0x1c3aea(%rip), %rdx    # 0x1d2923
movl $0x43, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
movsd 0x80c8(%rsp), %xmm0
mulsd 0x80a0(%rsp), %xmm0
movsd %xmm0, 0x80a8(%rsp)
movsd 0x80a8(%rsp), %xmm1
divsd 0x80b8(%rsp), %xmm1
movaps 0x1c33a7(%rip), %xmm0   # 0x1d2230
pand %xmm0, %xmm1
movsd 0x80d8(%rsp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xef32
leaq 0x4810(%rsp), %rdi
movsd 0x80a8(%rsp), %xmm0
divsd 0x80b8(%rsp), %xmm0
movaps 0x1c336f(%rip), %xmm1   # 0x1d2230
pand %xmm1, %xmm0
leaq 0x1c3ae7(%rip), %rsi    # 0x1d29b3
movb $0x1, %al
callq 0x5b9c0
leaq 0x4010(%rsp), %rdi
leaq 0x4810(%rsp), %rcx
leaq 0x1c3198(%rip), %rsi    # 0x1d2082
leaq 0x1c3b1e(%rip), %rdx    # 0x1d2a0f
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x4010(%rsp), %r8
leaq 0x1c3125(%rip), %rsi    # 0x1d2034
leaq 0x1c3a0d(%rip), %rdx    # 0x1d2923
movl $0x49, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
movsd 0x80b8(%rsp), %xmm0
movsd 0x80a8(%rsp), %xmm1
addsd %xmm1, %xmm1
addsd %xmm0, %xmm1
movq 0x8130(%rsp), %rax
movslq 0x80c4(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm1, %xmm0
jbe 0xef84
movsd 0x80b8(%rsp), %xmm0
addsd 0x80a8(%rsp), %xmm0
movsd %xmm0, 0x80b0(%rsp)
jmp 0xefac
movq 0x8130(%rsp), %rax
movslq 0x80c4(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x80b0(%rsp)
movw $0x1, 0x782e(%rsp)
movsd 0x80b0(%rsp), %xmm0
ucomisd 0x8108(%rsp), %xmm0
jbe 0xefdc
movsd 0x8108(%rsp), %xmm0
movsd %xmm0, 0x80b0(%rsp)
movw $0x0, 0x782e(%rsp)
cmpq $0x0, 0x8148(%rsp)
je 0xf13b
movsd 0x80b8(%rsp), %xmm0
ucomisd 0x8110(%rsp), %xmm0
jne 0xf0a2
jp 0xf0a2
movq 0x8118(%rsp), %rax
movsd 0x80b8(%rsp), %xmm0
movq 0x8100(%rsp), %rdi
movq 0x7830(%rsp), %rsi
movq 0x80e8(%rsp), %rdx
movq 0x8150(%rsp), %rcx
callq *%rax
cmpl $0x1, %eax
jne 0xf0a0
leaq 0x3810(%rsp), %rdi
movq 0x8150(%rsp), %rcx
leaq 0x1c3380(%rip), %rsi    # 0x1d23d8
leaq 0x1c39d6(%rip), %rdx    # 0x1d2a35
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x3810(%rsp), %r8
leaq 0x1c2fb7(%rip), %rsi    # 0x1d2034
leaq 0x1c389f(%rip), %rdx    # 0x1d2923
movl $0x62, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
jmp 0xf0a2
movq 0x8148(%rsp), %rax
movsd 0x80b8(%rsp), %xmm0
movq 0x8100(%rsp), %rdi
movq 0x7830(%rsp), %rsi
movq 0x80e8(%rsp), %rdx
movq 0x8150(%rsp), %rcx
callq *%rax
cmpl $0x1, %eax
jne 0xf139
leaq 0x3010(%rsp), %rdi
movq 0x8150(%rsp), %rcx
leaq 0x1c32e7(%rip), %rsi    # 0x1d23d8
leaq 0x1c3986(%rip), %rdx    # 0x1d2a7e
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x3010(%rsp), %r8
leaq 0x1c2f1e(%rip), %rsi    # 0x1d2034
leaq 0x1c3806(%rip), %rdx    # 0x1d2923
movl $0x6b, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
jmp 0xf13b
movq 0x8118(%rsp), %rdi
movsd 0x80b8(%rsp), %xmm0
movsd 0x80b0(%rsp), %xmm1
movq 0x8100(%rsp), %rsi
movq 0x80e8(%rsp), %rdx
movsd 0x80e0(%rsp), %xmm2
movsd 0x80b8(%rsp), %xmm3
mulsd 0x80d8(%rsp), %xmm3
leaq 0x7838(%rsp), %rcx
callq 0x97d0
cmpl $0x1, %eax
jne 0xf1f5
leaq 0x2810(%rsp), %rdi
leaq 0x7838(%rsp), %rcx
addq $0x68, %rcx
leaq 0x1c322b(%rip), %rsi    # 0x1d23d8
leaq 0x1c391c(%rip), %rdx    # 0x1d2ad0
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x2810(%rsp), %r8
leaq 0x1c2e62(%rip), %rsi    # 0x1d2034
leaq 0x1c374a(%rip), %rdx    # 0x1d2923
movl $0x77, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
movswl 0x782e(%rsp), %eax
cmpl $0x1, %eax
jne 0xf356
movq 0x8118(%rsp), %rax
movsd 0x80b0(%rsp), %xmm0
movq 0x8100(%rsp), %rdi
movq 0x7830(%rsp), %rsi
movq 0x80e8(%rsp), %rdx
movq 0x8150(%rsp), %rcx
callq *%rax
cmpl $0x1, %eax
jne 0xf29d
leaq 0x2010(%rsp), %rdi
movq 0x8150(%rsp), %rcx
leaq 0x1c3183(%rip), %rsi    # 0x1d23d8
leaq 0x1c38e5(%rip), %rdx    # 0x1d2b41
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x2010(%rsp), %r8
leaq 0x1c2dba(%rip), %rsi    # 0x1d2034
leaq 0x1c36a2(%rip), %rdx    # 0x1d2923
movl $0x81, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
movq 0x8140(%rsp), %rax
movsd 0x80b0(%rsp), %xmm0
movq 0x8100(%rsp), %rdi
movq 0x7830(%rsp), %rsi
movl 0x80c4(%rsp), %edx
movq 0x80e8(%rsp), %rcx
movq 0x8150(%rsp), %r8
callq *%rax
cmpl $0x1, %eax
jne 0xf33b
leaq 0x1810(%rsp), %rdi
movq 0x8150(%rsp), %rcx
leaq 0x1c30e5(%rip), %rsi    # 0x1d23d8
leaq 0x1c3890(%rip), %rdx    # 0x1d2b8a
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x1810(%rsp), %r8
leaq 0x1c2d1c(%rip), %rsi    # 0x1d2034
leaq 0x1c3604(%rip), %rdx    # 0x1d2923
movl $0x8a, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
movw $0x0, 0x782e(%rsp)
movl 0x80c4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x80c4(%rsp)
movsd 0x80b0(%rsp), %xmm0
movsd %xmm0, 0x80b8(%rsp)
jmp 0xed86
movq 0x8118(%rsp), %rax
movsd 0x80b8(%rsp), %xmm0
movq 0x8100(%rsp), %rdi
movq 0x7830(%rsp), %rsi
movq 0x80e8(%rsp), %rdx
movq 0x8150(%rsp), %rcx
callq *%rax
cmpl $0x1, %eax
jne 0xf404
leaq 0x1010(%rsp), %rdi
movq 0x8150(%rsp), %rcx
leaq 0x1c301c(%rip), %rsi    # 0x1d23d8
leaq 0x1c3672(%rip), %rdx    # 0x1d2a35
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x1010(%rsp), %r8
leaq 0x1c2c53(%rip), %rsi    # 0x1d2034
leaq 0x1c353b(%rip), %rdx    # 0x1d2923
movl $0x9f, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
cmpq $0x0, 0x8148(%rsp)
je 0xf4ac
movq 0x8148(%rsp), %rax
movsd 0x80b8(%rsp), %xmm0
movq 0x8100(%rsp), %rdi
movq 0x7830(%rsp), %rsi
movq 0x80e8(%rsp), %rdx
movq 0x8150(%rsp), %rcx
callq *%rax
cmpl $0x1, %eax
jne 0xf4aa
leaq 0x810(%rsp), %rdi
movq 0x8150(%rsp), %rcx
leaq 0x1c2f76(%rip), %rsi    # 0x1d23d8
leaq 0x1c3615(%rip), %rdx    # 0x1d2a7e
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x810(%rsp), %r8
leaq 0x1c2bad(%rip), %rsi    # 0x1d2034
leaq 0x1c3495(%rip), %rdx    # 0x1d2923
movl $0xa8, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
jmp 0xf4ac
leaq 0x7838(%rsp), %rdi
callq 0x9730
cmpl $0x1, %eax
jne 0xf518
leaq 0x10(%rsp), %rdi
leaq 0x7838(%rsp), %rcx
addq $0x68, %rcx
leaq 0x1c2f02(%rip), %rsi    # 0x1d23d8
leaq 0x1c3704(%rip), %rdx    # 0x1d2be1
movb $0x0, %al
callq 0x5b9c0
movq 0x8150(%rsp), %rdi
leaq 0x10(%rsp), %r8
leaq 0x1c2b3c(%rip), %rsi    # 0x1d2034
leaq 0x1c3424(%rip), %rdx    # 0x1d2923
movl $0xac, %ecx
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x8124(%rsp)
jmp 0xf530
movq 0x7830(%rsp), %rdi
callq 0x8420
movl $0x0, 0x8124(%rsp)
movl 0x8124(%rsp), %eax
addq $0x8128, %rsp           # imm = 0x8128
retq
nop