// File: /workspace/github_c_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1088, %rsp           # imm = 0x1088
movq %r9, %r14
movq %r8, %r15
movq %rcx, %r12
movq %rdx, %r13
movsd %xmm1, 0x18(%rsp)
movq %rsi, %rbp
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x48(%rsp)
movq %rax, 0x40(%rsp)
leaq 0x68(%rsp), %rsi
leaq 0x60(%rsp), %rdx
leaq 0x78(%rsp), %rcx
movsd %xmm0, 0x8(%rsp)
callq 0x9b3e7
testl %eax, %eax
je 0x99c9c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x547a9(%rip), %rsi     # 0xee3f0
leaq 0x8022c(%rip), %rdx     # 0x119e7a
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x543ca(%rip), %rsi     # 0xee034
leaq 0x8024b(%rip), %rdx     # 0x119ebc
movq %rbx, %rdi
movl $0x7ab, %ecx            # imm = 0x7AB
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %ebp
movl %ebp, %eax
addq $0x1088, %rsp           # imm = 0x1088
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x60(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movapd %xmm0, %xmm3
divsd 0x577cc(%rip), %xmm3    # 0xf1480
movsd 0x68(%rsp), %xmm1
movsd 0x7e7c6(%rip), %xmm0    # 0x118488
movsd %xmm1, 0x38(%rsp)
mulsd %xmm1, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x99cdc
sqrtsd %xmm0, %xmm0
jmp 0x99ced
movsd %xmm3, 0x20(%rsp)
callq 0x82b0
movsd 0x20(%rsp), %xmm3
movsd 0x18(%rsp), %xmm1
movq %r15, 0x30(%rsp)
movq %r14, 0x50(%rsp)
divsd %xmm0, %xmm3
movsd 0x54ff7(%rip), %xmm0    # 0xeed00
addsd %xmm1, %xmm0
movapd %xmm3, %xmm2
divsd %xmm0, %xmm2
movapd %xmm3, %xmm0
divsd %xmm2, %xmm0
addsd 0x54ac3(%rip), %xmm0    # 0xee7e8
andpd 0x54513(%rip), %xmm0    # 0xee240
ucomisd %xmm1, %xmm0
jae 0x99d79
movapd %xmm3, %xmm2
movsd 0x54f91(%rip), %xmm0    # 0xeecd0
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm0
addsd 0x38(%rsp), %xmm0
mulsd 0x7e733(%rip), %xmm0    # 0x118488
movq 0x50(%rsp), %r14
movsd %xmm2, (%r14)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x99ef6
xorps %xmm2, %xmm2
sqrtsd %xmm0, %xmm2
jmp 0x99eff
movsd 0x10(%rsp), %xmm0
divsd 0x38(%rsp), %xmm0
mulsd 0x7e6eb(%rip), %xmm0    # 0x118478
divsd 0x57243(%rip), %xmm0    # 0xf0fd8
movsd %xmm0, 0x10(%rsp)
movl $0x1, %r15d
leaq 0x70(%rsp), %r14
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
cmpl 0x6c8(%rbp), %r15d
jge 0x99f36
movsd %xmm3, 0x20(%rsp)
movsd 0x28(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movq %rbx, %rdi
movsd %xmm0, 0x28(%rsp)
leaq 0x48(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %r14, %rcx
callq 0x9b3e7
testl %eax, %eax
jne 0x99fa0
movsd 0x40(%rsp), %xmm2
divsd 0x5767e(%rip), %xmm2    # 0xf1480
movsd 0x48(%rsp), %xmm0
mulsd 0x7e678(%rip), %xmm0    # 0x118488
ucomisd 0x54440(%rip), %xmm0    # 0xee258
jb 0x99e20
sqrtsd %xmm0, %xmm0
jmp 0x99e31
movsd %xmm2, 0x58(%rsp)
callq 0x82b0
movsd 0x58(%rsp), %xmm2
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm2
movslq 0x2d0(%rbx), %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%r13,%rax,8)
movslq 0x2d4(%rbx), %rax
movsd 0x28(%rsp), %xmm0
movsd %xmm0, (%r13,%rax,8)
movslq 0x2d8(%rbx), %rax
movsd %xmm2, (%r13,%rax,8)
movq %rbx, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r12, %rcx
movl $0x1, %r8d
movapd %xmm1, %xmm0
movl $0x1, %r9d
pushq $0x0
pushq $0x1
callq 0x9a126
addq $0x10, %rsp
testl %eax, %eax
jne 0x99fe5
movslq 0x2d8(%rbx), %rax
movsd (%r13,%rax,8), %xmm2
movslq 0x2d0(%rbx), %rax
divsd (%r13,%rax,8), %xmm2
movapd %xmm2, %xmm0
divsd 0x20(%rsp), %xmm0
addsd 0x54916(%rip), %xmm0    # 0xee7e8
andpd 0x54366(%rip), %xmm0    # 0xee240
incl %r15d
movsd 0x18(%rsp), %xmm1
ucomisd %xmm1, %xmm0
movapd %xmm2, %xmm3
jae 0x99db2
jmp 0x99d37
callq 0x82b0
movapd %xmm0, %xmm2
movq 0x30(%rsp), %rax
movsd %xmm2, (%rax)
xorl %ebp, %ebp
cmpw $0x2, 0x328(%rbx)
jl 0x99c88
movsd (%r14), %xmm1
leaq 0x8015a(%rip), %rdi     # 0x11a07e
movsd 0x8(%rsp), %xmm0
movb $0x3, %al
callq 0x8030
jmp 0x99c88
leaq 0x7ffa3(%rip), %rsi     # 0x119ee0
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movl %r15d, %edx
movsd 0x8(%rsp), %xmm0
movb $0x2, %al
callq 0x30af0
leaq 0x54123(%rip), %rsi     # 0xee082
leaq 0x8004c(%rip), %rdx     # 0x119fb2
leaq 0x880(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x540ab(%rip), %rsi     # 0xee034
leaq 0x7ff2c(%rip), %rdx     # 0x119ebc
movq %rbx, %rdi
movl $0x7c1, %ecx            # imm = 0x7C1
movq %r15, %r8
jmp 0x99c7c
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x54442(%rip), %rsi     # 0xee3f0
leaq 0x80032(%rip), %rdx     # 0x119fe7
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x54063(%rip), %rsi     # 0xee034
leaq 0x7fee4(%rip), %rdx     # 0x119ebc
movq %rbx, %rdi
movl $0x7cf, %ecx            # imm = 0x7CF
jmp 0x99c79
addq $0x32a, %rbx            # imm = 0x32A
leaq 0x543fd(%rip), %rsi     # 0xee3f0
leaq 0x80027(%rip), %rdx     # 0x11a021
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x5401e(%rip), %rsi     # 0xee034
leaq 0x7fe9f(%rip), %rdx     # 0x119ebc
movq %rbx, %rdi
movl $0x7e3, %ecx            # imm = 0x7E3
jmp 0x99c79