// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/primordial.c
// Function: primordial_inflation_potential
int primordial_inflation_potential(
                                   struct primordial * ppm,
                                   double phi,
                                   double * V,
                                   double * dV,
                                   double * ddV
                                   ) {

  double e,de,dde,mu,dmu,ddmu,l,dl,ddl,p,dp,ddp;

  switch (ppm->potential) {

    /* V(phi)=polynomial in phi */
  case polynomial:

    *V   = ppm->V0+phi*ppm->V1+pow(phi,2)/2.*ppm->V2+pow(phi,3)/6.*ppm->V3+pow(phi,4)/24.*ppm->V4;
    *dV  = ppm->V1+phi*ppm->V2+pow(phi,2)/2.*ppm->V3+pow(phi,3)/6.*ppm->V4;
    *ddV = ppm->V2+phi*ppm->V3+pow(phi,2)/2.*ppm->V4;
    break;

    /* V(phi) = Lambda^4(1+cos(phi/f)) = V0 (1+cos(phi/V1)) */
  case natural:

    *V   = ppm->V0*(1.+cos(phi/ppm->V1));
    *dV  = -ppm->V0/ppm->V1*sin(phi/ppm->V1);
    *ddV = -ppm->V0/ppm->V1/ppm->V1*cos(phi/ppm->V1);
    break;

    /* Higgs inflation from arXiv:1403.6078 */
  case higgs_inflation:

    // correspondence with 1403.6078:
    // V0 = b
    // V1 = ksi
    // V2 = kappa
    // V3 = delta_lambda
    // mu = bar(mu)/M_P
    // phi = -chi/M_P

    e = exp(2./sqrt(6.)*sqrt(8.*_PI_)*phi);
    de = 2./sqrt(6.)*sqrt(8.*_PI_)*e;
    dde = 2./3. * 8.*_PI_ * e;

    mu = pow(1.-e,0.5);
    dmu = -0.5*de*pow(1.-e,-0.5);
    ddmu = -0.5*dde*pow(1.-e,-0.5)-0.25*de*de*pow(1.-e,-1.5);

    l = log(mu/ppm->V2);
    dl = dmu/mu;
    ddl = ddmu/mu - dl*dl;

    p = 1./16. + ppm->V3/ppm->V0 + l*l;
    dp = 2.*dl*l;
    ddp = 2.*ddl*l+2.*dl*dl;

    *V = ppm->V0/4./pow(8.*_PI_,2)/ppm->V1/ppm->V1*p*pow(mu,4);
    *dV = ppm->V0/4./pow(8.*_PI_,2)/ppm->V1/ppm->V1*(dp*pow(mu,4)+4.*p*dmu*pow(mu,3));
    *ddV = ppm->V0/4./pow(8.*_PI_,2)/ppm->V1/ppm->V1*(ddp*pow(mu,4)+8.*dp*dmu*pow(mu,3)+4.*p*ddmu*pow(mu,3)+12.*p*pow(dmu*mu,2));

    //fprintf(stderr,"%e  %e  %e\n",*V,p,mu);

    break;

    /* code here other shapes */

  default:
    class_stop(ppm->error_message,"ppm->potential=%d different from all known cases",ppm->potential);
    break;
  }

  return _SUCCESS_;
}

// Assembly:
subq $0x1198, %rsp           # imm = 0x1198
movq %rdi, 0x1188(%rsp)
movsd %xmm0, 0x1180(%rsp)
movq %rsi, 0x1178(%rsp)
movq %rdx, 0x1170(%rsp)
movq %rcx, 0x1168(%rsp)
movq 0x1188(%rsp), %rax
movl 0x1a8(%rax), %eax
movl %eax, 0xfc(%rsp)
testl %eax, %eax
je 0x118a22
jmp 0x1189fb
movl 0xfc(%rsp), %eax
subl $0x1, %eax
je 0x118c94
jmp 0x118a0d
movl 0xfc(%rsp), %eax
subl $0x2, %eax
je 0x118dfc
jmp 0x11947d
movq 0x1188(%rsp), %rax
movsd 0x1b0(%rax), %xmm1
movsd 0x1180(%rsp), %xmm0
movq 0x1188(%rsp), %rax
movsd 0x1b8(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xc8(%rsp)
movsd 0x1180(%rsp), %xmm0
movl $0x2, %edi
callq 0x5b970
movsd 0xc8(%rsp), %xmm1
movsd 0xba200(%rip), %xmm2    # 0x1d2c80
divsd %xmm2, %xmm0
movq 0x1188(%rsp), %rax
movsd 0x1c0(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xd0(%rsp)
movsd 0x1180(%rsp), %xmm0
movl $0x3, %edi
callq 0x5b970
movsd 0xd0(%rsp), %xmm1
movsd 0xbabbf(%rip), %xmm2    # 0x1d3688
divsd %xmm2, %xmm0
movq 0x1188(%rsp), %rax
movsd 0x1c8(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xd8(%rsp)
movsd 0x1180(%rsp), %xmm0
movl $0x4, %edi
callq 0x5b970
movsd 0xd8(%rsp), %xmm1
movsd 0xbab7e(%rip), %xmm2    # 0x1d3690
divsd %xmm2, %xmm0
movq 0x1188(%rsp), %rax
movsd 0x1d0(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x1178(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x1188(%rsp), %rax
movsd 0x1b8(%rax), %xmm1
movsd 0x1180(%rsp), %xmm0
movq 0x1188(%rsp), %rax
movsd 0x1c0(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xe0(%rsp)
movsd 0x1180(%rsp), %xmm0
movl $0x2, %edi
callq 0x5b970
movsd 0xe0(%rsp), %xmm1
movsd 0xba0e8(%rip), %xmm2    # 0x1d2c80
divsd %xmm2, %xmm0
movq 0x1188(%rsp), %rax
movsd 0x1c8(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xe8(%rsp)
movsd 0x1180(%rsp), %xmm0
movl $0x3, %edi
callq 0x5b970
movsd 0xe8(%rsp), %xmm1
movsd 0xbaaa7(%rip), %xmm2    # 0x1d3688
divsd %xmm2, %xmm0
movq 0x1188(%rsp), %rax
movsd 0x1d0(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x1170(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x1188(%rsp), %rax
movsd 0x1c0(%rax), %xmm1
movsd 0x1180(%rsp), %xmm0
movq 0x1188(%rsp), %rax
movsd 0x1c8(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xf0(%rsp)
movsd 0x1180(%rsp), %xmm0
movl $0x2, %edi
callq 0x5b970
movsd 0xf0(%rsp), %xmm1
movsd 0xba019(%rip), %xmm2    # 0x1d2c80
divsd %xmm2, %xmm0
movq 0x1188(%rsp), %rax
movsd 0x1d0(%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0x1168(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x1194fd
movq 0x1188(%rsp), %rax
movsd 0x1b0(%rax), %xmm0
movsd %xmm0, 0xb0(%rsp)
movsd 0x1180(%rsp), %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
callq 0x86a0
movaps %xmm0, %xmm2
movsd 0xb0(%rsp), %xmm0
movsd 0xb9569(%rip), %xmm1    # 0x1d2248
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movq 0x1178(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x1188(%rsp), %rax
movsd 0x1b0(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
movsd %xmm0, 0xb8(%rsp)
movsd 0x1180(%rsp), %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
callq 0x80a0
movaps %xmm0, %xmm1
movsd 0xb8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0x1170(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x1188(%rsp), %rax
movsd 0x1b0(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
movsd %xmm0, 0xc0(%rsp)
movsd 0x1180(%rsp), %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
callq 0x86a0
movaps %xmm0, %xmm1
movsd 0xc0(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0x1168(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x1194fd
movsd 0xba884(%rip), %xmm0    # 0x1d3688
callq 0x82e0
movaps %xmm0, %xmm1
movsd 0xb9e6c(%rip), %xmm0    # 0x1d2c80
divsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
movsd 0xbd9fb(%rip), %xmm0    # 0x1d6820
callq 0x82e0
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
mulsd 0x1180(%rsp), %xmm0
callq 0x8670
movsd %xmm0, 0x1160(%rsp)
movsd 0xba833(%rip), %xmm0    # 0x1d3688
callq 0x82e0
movaps %xmm0, %xmm1
movsd 0xb9e1b(%rip), %xmm0    # 0x1d2c80
divsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xbd9a9(%rip), %xmm0    # 0x1d6820
callq 0x82e0
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
mulsd 0x1160(%rsp), %xmm0
movsd %xmm0, 0x1158(%rsp)
movsd 0xe350d(%rip), %xmm0    # 0x1fc3b0
mulsd 0x1160(%rsp), %xmm0
movsd %xmm0, 0x1150(%rsp)
movsd 0xb938b(%rip), %xmm0    # 0x1d2248
subsd 0x1160(%rsp), %xmm0
movsd 0xb9dba(%rip), %xmm1    # 0x1d2c88
callq 0x8610
movsd %xmm0, 0x1148(%rsp)
movsd 0xba7bc(%rip), %xmm0    # 0x1d36a0
mulsd 0x1158(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0xb934d(%rip), %xmm0    # 0x1d2248
subsd 0x1160(%rsp), %xmm0
movsd 0xba794(%rip), %xmm1    # 0x1d36a0
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x1140(%rsp)
movsd 0xba771(%rip), %xmm0    # 0x1d36a0
mulsd 0x1150(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0xb9302(%rip), %xmm0    # 0x1d2248
subsd 0x1160(%rsp), %xmm0
movsd 0xba749(%rip), %xmm1    # 0x1d36a0
callq 0x8610
movsd %xmm0, 0x20(%rsp)
movsd 0xb9d56(%rip), %xmm0    # 0x1d2cc0
mulsd 0x1158(%rsp), %xmm0
mulsd 0x1158(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0xb92be(%rip), %xmm0    # 0x1d2248
subsd 0x1160(%rsp), %xmm0
movsd 0xbc54d(%rip), %xmm1    # 0x1d54e8
callq 0x8610
movsd 0x18(%rsp), %xmm1
movsd 0x20(%rsp), %xmm2
movaps %xmm0, %xmm3
movsd 0x28(%rsp), %xmm0
mulsd %xmm3, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x1138(%rsp)
movsd 0x1148(%rsp), %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1c0(%rax), %xmm0
callq 0x82f0
movsd %xmm0, 0x1130(%rsp)
movsd 0x1140(%rsp), %xmm0
divsd 0x1148(%rsp), %xmm0
movsd %xmm0, 0x1128(%rsp)
movsd 0x1138(%rsp), %xmm1
divsd 0x1148(%rsp), %xmm1
movsd 0x1128(%rsp), %xmm0
movsd 0x1128(%rsp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x1120(%rsp)
movq 0x1188(%rsp), %rax
movsd 0x1c8(%rax), %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b0(%rax), %xmm0
movsd 0xe3311(%rip), %xmm1    # 0x1fc3a8
addsd %xmm0, %xmm1
movsd 0x1130(%rsp), %xmm0
movsd 0x1130(%rsp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x1118(%rsp)
movsd 0xb9bba(%rip), %xmm0    # 0x1d2c80
mulsd 0x1128(%rsp), %xmm0
mulsd 0x1130(%rsp), %xmm0
movsd %xmm0, 0x1110(%rsp)
movsd 0xb9b97(%rip), %xmm0    # 0x1d2c80
mulsd 0x1120(%rsp), %xmm0
movsd 0x1130(%rsp), %xmm2
movsd 0xb9b7d(%rip), %xmm1    # 0x1d2c80
mulsd 0x1128(%rsp), %xmm1
mulsd 0x1128(%rsp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x1108(%rsp)
movq 0x1188(%rsp), %rax
movsd 0x1b0(%rax), %xmm0
movsd 0xbc38a(%rip), %xmm1    # 0x1d54c8
divsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0xbd6d0(%rip), %xmm0    # 0x1d6820
movl $0x2, %edi
callq 0x5b970
movaps %xmm0, %xmm1
movsd 0x30(%rsp), %xmm0
divsd %xmm1, %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
mulsd 0x1118(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x1148(%rsp), %xmm0
movl $0x4, %edi
callq 0x5b970
movaps %xmm0, %xmm1
movsd 0x38(%rsp), %xmm0
mulsd %xmm1, %xmm0
movq 0x1178(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x1188(%rsp), %rax
movsd 0x1b0(%rax), %xmm0
movsd 0xbc2ee(%rip), %xmm1    # 0x1d54c8
divsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0xbd634(%rip), %xmm0    # 0x1d6820
movl $0x2, %edi
callq 0x5b970
movaps %xmm0, %xmm1
movsd 0x40(%rsp), %xmm0
divsd %xmm1, %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x1110(%rsp), %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x1148(%rsp), %xmm0
movl $0x4, %edi
callq 0x5b970
movsd %xmm0, 0x58(%rsp)
movsd 0xbc26f(%rip), %xmm0    # 0x1d54c8
mulsd 0x1118(%rsp), %xmm0
mulsd 0x1140(%rsp), %xmm0
movsd %xmm0, 0x48(%rsp)
movsd 0x1148(%rsp), %xmm0
movl $0x3, %edi
callq 0x5b970
movsd 0x48(%rsp), %xmm2
movsd 0x50(%rsp), %xmm1
movsd 0x58(%rsp), %xmm3
movaps %xmm0, %xmm4
movsd 0x60(%rsp), %xmm0
mulsd %xmm4, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movq 0x1170(%rsp), %rax
movsd %xmm0, (%rax)
movq 0x1188(%rsp), %rax
movsd 0x1b0(%rax), %xmm0
movsd 0xbc1f5(%rip), %xmm1    # 0x1d54c8
divsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
movsd 0xbd53b(%rip), %xmm0    # 0x1d6820
movl $0x2, %edi
callq 0x5b970
movaps %xmm0, %xmm1
movsd 0x68(%rsp), %xmm0
divsd %xmm1, %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
movq 0x1188(%rsp), %rax
divsd 0x1b8(%rax), %xmm0
movsd %xmm0, 0xa8(%rsp)
movsd 0x1108(%rsp), %xmm0
movsd %xmm0, 0x80(%rsp)
movsd 0x1148(%rsp), %xmm0
movl $0x4, %edi
callq 0x5b970
movsd %xmm0, 0x78(%rsp)
movsd 0xbc180(%rip), %xmm0    # 0x1d54d8
mulsd 0x1110(%rsp), %xmm0
mulsd 0x1140(%rsp), %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x1148(%rsp), %xmm0
movl $0x3, %edi
callq 0x5b970
movsd 0x70(%rsp), %xmm1
movsd 0x78(%rsp), %xmm2
movaps %xmm0, %xmm3
movsd 0x80(%rsp), %xmm0
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x88(%rsp)
movsd 0xbc110(%rip), %xmm0    # 0x1d54c8
mulsd 0x1118(%rsp), %xmm0
mulsd 0x1138(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0x1148(%rsp), %xmm0
movl $0x3, %edi
callq 0x5b970
movsd 0x88(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x90(%rsp), %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0xd5354(%rip), %xmm0    # 0x1ee768
mulsd 0x1118(%rsp), %xmm0
movsd %xmm0, 0x98(%rsp)
movsd 0x1140(%rsp), %xmm0
mulsd 0x1148(%rsp), %xmm0
movl $0x2, %edi
callq 0x5b970
movsd 0x98(%rsp), %xmm1
movsd 0xa0(%rsp), %xmm2
movaps %xmm0, %xmm3
movsd 0xa8(%rsp), %xmm0
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movq 0x1168(%rsp), %rax
movsd %xmm0, (%rax)
jmp 0x1194fd
leaq 0x900(%rsp), %rdi
movq 0x1188(%rsp), %rax
movl 0x1a8(%rax), %edx
leaq 0xe41b7(%rip), %rsi     # 0x1fd651
movb $0x0, %al
callq 0x5b9c0
leaq 0x100(%rsp), %rdi
leaq 0x900(%rsp), %rdx
leaq 0xb90b5(%rip), %rsi     # 0x1d256d
movb $0x0, %al
callq 0x5b9c0
movq 0x1188(%rsp), %rdi
addq $0x32a, %rdi            # imm = 0x32A
leaq 0x100(%rsp), %r8
leaq 0xb8b57(%rip), %rsi     # 0x1d2034
leaq 0xe419e(%rip), %rdx     # 0x1fd682
movl $0x43c, %ecx            # imm = 0x43C
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1194(%rsp)
jmp 0x119508
movl $0x0, 0x1194(%rsp)
movl 0x1194(%rsp), %eax
addq $0x1198, %rsp           # imm = 0x1198
retq
nopw (%rax,%rax)