// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/primordial.c
// Function: primordial_inflation_find_attractor
int primordial_inflation_find_attractor(
                                        struct primordial * ppm,
                                        struct precision * ppr,
                                        double phi_0,
                                        double precision,
                                        double * y,
                                        double * dy,
                                        double * H_0,
                                        double * dphidt_0
                                        ) {

  double V_0,dV_0,ddV_0;
  double V=0.,dV=0.,ddV=0.;
  double a;
  double dphidt,dphidt_0new,dphidt_0old,phi;
  int counter;

  /* we want a series of value of phi' in phi_0, obtained by
     integrating the system from earlier and earlier time. The first
     value iof the series is the slow-roll prediction phi' =
     -V'/3H. The following lines compute this value and initialize relevant quantities. */

  class_call(primordial_inflation_check_potential(ppm,phi_0,&V_0,&dV_0,&ddV_0),
             ppm->error_message,
             ppm->error_message);

  dphidt_0new = -dV_0/3./sqrt((8.*_PI_/3.)*V_0);
  phi = phi_0;
  counter = 0;

  dphidt_0old = dphidt_0new/(precision+2.); // this silly value just
                                            // ensures that the loop
                                            // below will be executed
                                            // at least once.

  /* loop over different values of phi, from which the background
     equations are integrated until phi_0 */

  while (fabs(dphidt_0new/dphidt_0old-1.) >= precision) {

    counter ++;
    class_test(counter >= ppr->primordial_inflation_attractor_maxit,
               ppm->error_message,
               "could not converge after %d iterations: there exists no attractor solution near phi=%g. Potential probably too steep in this region, or precision parameter primordial_inflation_attractor_precision=%g too small",
               counter,
               phi_0,
               precision);

    dphidt_0old = dphidt_0new;

    /* take one step in phi, corresponding roughly to adding one more
       e-fold of inflation */

    phi=phi+dV_0/V_0/16./_PI_;

    /* fix the initial phi' to the slow-roll prediction in that point,
       and initialize other relevant quantities */

    class_call(primordial_inflation_check_potential(ppm,phi,&V,&dV,&ddV),
               ppm->error_message,
               ppm->error_message);

    a = 1.;
    dphidt = -dV/3./sqrt((8.*_PI_/3.)*V);
    y[ppm->index_in_a]=a;
    y[ppm->index_in_phi]=phi;
    y[ppm->index_in_dphi]=a*dphidt;

    /* evolve the background equations until phi_0 is reached */

    class_call(primordial_inflation_evolve_background(ppm,
                                                      ppr,
                                                      y,
                                                      dy,
                                                      _phi_,
                                                      phi_0,
                                                      _TRUE_,
                                                      forward,
                                                      conformal),
               ppm->error_message,
               ppm->error_message);

    /* compute phi' in phi_0, this is the new point in the series
       which convergence we want to check */

    dphidt_0new = y[ppm->index_in_dphi]/y[ppm->index_in_a];

  }

  /* if we have converged and found the attractor, we take the last
     value of phi' in phi_0 to be the correct one for the attractor
     solution */

  *dphidt_0 = dphidt_0new;
  *H_0 = sqrt((8.*_PI_/3.)*(0.5*dphidt_0new*dphidt_0new+V_0));

  if (ppm->primordial_verbose > 1) {
    printf(" (attractor found in phi=%g with phi'=%g, H=%g)\n",phi_0,*dphidt_0,*H_0);
  }

  return _SUCCESS_;
}

// Assembly:
subq $0x28c8, %rsp           # imm = 0x28C8
movq %rdi, 0x28b8(%rsp)
movq %rsi, 0x28b0(%rsp)
movsd %xmm0, 0x28a8(%rsp)
movsd %xmm1, 0x28a0(%rsp)
movq %rdx, 0x2898(%rsp)
movq %rcx, 0x2890(%rsp)
movq %r8, 0x2888(%rsp)
movq %r9, 0x2880(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x2860(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x2858(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x2850(%rsp)
movq 0x28b8(%rsp), %rdi
movsd 0x28a8(%rsp), %xmm0
leaq 0x2878(%rsp), %rsi
leaq 0x2870(%rsp), %rdx
leaq 0x2868(%rsp), %rcx
callq 0x11e190
cmpl $0x1, %eax
jne 0x11b8fd
leaq 0x2020(%rsp), %rdi
movq 0x28b8(%rsp), %rcx
addq $0x32a, %rcx            # imm = 0x32A
leaq 0xb6b2a(%rip), %rsi     # 0x1d23d8
leaq 0xe28a5(%rip), %rdx     # 0x1fe15a
movb $0x0, %al
callq 0x5b9c0
movq 0x28b8(%rsp), %rdi
addq $0x32a, %rdi            # imm = 0x32A
leaq 0x2020(%rsp), %r8
leaq 0xb675a(%rip), %rsi     # 0x1d2034
leaq 0xe28bb(%rip), %rdx     # 0x1fe19c
movl $0x7ab, %ecx            # imm = 0x7AB
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x28c4(%rsp)
jmp 0x11be16
movsd 0x2870(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0xb7d73(%rip), %xmm1    # 0x1d3698
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0xe0aa1(%rip), %xmm0    # 0x1fc3d8
mulsd 0x2878(%rsp), %xmm0
callq 0x82e0
movaps %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x2838(%rsp)
movsd 0x28a8(%rsp), %xmm0
movsd %xmm0, 0x2828(%rsp)
movl $0x0, 0x2824(%rsp)
movsd 0x2838(%rsp), %xmm0
movsd 0xb72f7(%rip), %xmm1    # 0x1d2c80
addsd 0x28a0(%rsp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x2830(%rsp)
movsd 0x2838(%rsp), %xmm0
divsd 0x2830(%rsp), %xmm0
movsd 0xb688f(%rip), %xmm1    # 0x1d2248
subsd %xmm1, %xmm0
movaps 0xb686c(%rip), %xmm1    # 0x1d2230
pand %xmm1, %xmm0
ucomisd 0x28a0(%rsp), %xmm0
jb 0x11bd6b
movl 0x2824(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2824(%rsp)
movl 0x2824(%rsp), %eax
movq 0x28b0(%rsp), %rcx
cmpl 0x6c8(%rcx), %eax
jl 0x11ba98
leaq 0x1820(%rsp), %rdi
movl 0x2824(%rsp), %edx
movsd 0x28a8(%rsp), %xmm0
movsd 0x28a0(%rsp), %xmm1
leaq 0xe2795(%rip), %rsi     # 0x1fe1c0
movb $0x2, %al
callq 0x5b9c0
leaq 0x1020(%rsp), %rdi
leaq 0x1820(%rsp), %rcx
leaq 0xb6639(%rip), %rsi     # 0x1d2082
leaq 0xe2842(%rip), %rdx     # 0x1fe292
movb $0x0, %al
callq 0x5b9c0
movq 0x28b8(%rsp), %rdi
addq $0x32a, %rdi            # imm = 0x32A
leaq 0x1020(%rsp), %r8
leaq 0xb65bf(%rip), %rsi     # 0x1d2034
leaq 0xe2720(%rip), %rdx     # 0x1fe19c
movl $0x7c1, %ecx            # imm = 0x7C1
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x28c4(%rsp)
jmp 0x11be16
movsd 0x2838(%rsp), %xmm0
movsd %xmm0, 0x2830(%rsp)
movsd 0x2828(%rsp), %xmm0
movsd 0x2870(%rsp), %xmm1
divsd 0x2878(%rsp), %xmm1
movsd 0xb6d0b(%rip), %xmm2    # 0x1d27d8
divsd %xmm2, %xmm1
movsd 0xb9507(%rip), %xmm2    # 0x1d4fe0
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x2828(%rsp)
movq 0x28b8(%rsp), %rdi
movsd 0x2828(%rsp), %xmm0
leaq 0x2860(%rsp), %rsi
leaq 0x2858(%rsp), %rdx
leaq 0x2850(%rsp), %rcx
callq 0x11e190
cmpl $0x1, %eax
jne 0x11bb8a
leaq 0x820(%rsp), %rdi
movq 0x28b8(%rsp), %rcx
addq $0x32a, %rcx            # imm = 0x32A
leaq 0xb689d(%rip), %rsi     # 0x1d23d8
leaq 0xe2785(%rip), %rdx     # 0x1fe2c7
movb $0x0, %al
callq 0x5b9c0
movq 0x28b8(%rsp), %rdi
addq $0x32a, %rdi            # imm = 0x32A
leaq 0x820(%rsp), %r8
leaq 0xb64cd(%rip), %rsi     # 0x1d2034
leaq 0xe262e(%rip), %rdx     # 0x1fe19c
movl $0x7cf, %ecx            # imm = 0x7CF
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x28c4(%rsp)
jmp 0x11be16
movsd 0xb66b6(%rip), %xmm0    # 0x1d2248
movsd %xmm0, 0x2848(%rsp)
movsd 0x2858(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd 0xb7ad5(%rip), %xmm1    # 0x1d3698
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0xe0803(%rip), %xmm0    # 0x1fc3d8
mulsd 0x2860(%rsp), %xmm0
callq 0x82e0
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x2840(%rsp)
movsd 0x2848(%rsp), %xmm0
movq 0x2898(%rsp), %rax
movq 0x28b8(%rsp), %rcx
movslq 0x2d0(%rcx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x2828(%rsp), %xmm0
movq 0x2898(%rsp), %rax
movq 0x28b8(%rsp), %rcx
movslq 0x2d4(%rcx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x2848(%rsp), %xmm0
mulsd 0x2840(%rsp), %xmm0
movq 0x2898(%rsp), %rax
movq 0x28b8(%rsp), %rcx
movslq 0x2d8(%rcx), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x28b8(%rsp), %rdi
movq 0x28b0(%rsp), %rsi
movq 0x2898(%rsp), %rdx
movq 0x2890(%rsp), %rcx
movsd 0x28a8(%rsp), %xmm0
movl $0x1, %r9d
xorl %eax, %eax
movl %r9d, %r8d
movl $0x1, (%rsp)
movl $0x0, 0x8(%rsp)
callq 0x11c060
cmpl $0x1, %eax
jne 0x11bd25
leaq 0x20(%rsp), %rdi
movq 0x28b8(%rsp), %rcx
addq $0x32a, %rcx            # imm = 0x32A
leaq 0xb66ff(%rip), %rsi     # 0x1d23d8
leaq 0xe2621(%rip), %rdx     # 0x1fe301
movb $0x0, %al
callq 0x5b9c0
movq 0x28b8(%rsp), %rdi
addq $0x32a, %rdi            # imm = 0x32A
leaq 0x20(%rsp), %r8
leaq 0xb6332(%rip), %rsi     # 0x1d2034
leaq 0xe2493(%rip), %rdx     # 0x1fe19c
movl $0x7e3, %ecx            # imm = 0x7E3
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x28c4(%rsp)
jmp 0x11be16
movq 0x2898(%rsp), %rax
movq 0x28b8(%rsp), %rcx
movslq 0x2d8(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x2898(%rsp), %rax
movq 0x28b8(%rsp), %rcx
movslq 0x2d0(%rcx), %rcx
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x2838(%rsp)
jmp 0x11b99f
movsd 0x2838(%rsp), %xmm0
movq 0x2880(%rsp), %rax
movsd %xmm0, (%rax)
movsd 0xb6f00(%rip), %xmm1    # 0x1d2c88
mulsd 0x2838(%rsp), %xmm1
movsd 0x2838(%rsp), %xmm2
movsd 0x2878(%rsp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd 0xe0625(%rip), %xmm0    # 0x1fc3d8
mulsd %xmm1, %xmm0
callq 0x82e0
movq 0x2888(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x28b8(%rsp), %rax
movswl 0x328(%rax), %eax
cmpl $0x1, %eax
jle 0x11be0b
movsd 0x28a8(%rsp), %xmm0
movq 0x2880(%rsp), %rax
movsd (%rax), %xmm1
movq 0x2888(%rsp), %rax
movsd (%rax), %xmm2
leaq 0xe255a(%rip), %rdi     # 0x1fe35e
movb $0x3, %al
callq 0x8030
movl $0x0, 0x28c4(%rsp)
movl 0x28c4(%rsp), %eax
addq $0x28c8, %rsp           # imm = 0x28C8
retq
nopw %cs:(%rax,%rax)