// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/background.c
// Function: ddV_axion_scf
double ddV_axion_scf(
                  struct background *pba,
                  double phi){

     // int n = pba->scf_parameters[0];
     double n = pba->n_axion;
     // double fa = pba->scf_parameters[2];
     double fa = pba->f_axion;
     double m = pba->m_scf*pba->H0;
     double result;
     if(n==1) result = n*pow(m,2)*cos(phi/fa);
     else if (n==2) result =  n*pow(m,2)*(pow(sin(phi/fa),2)+(1-cos(phi/fa))*cos(phi/fa));
     else result = n*pow(m,2)*fa*((n-1)/fa*pow(1-cos(phi/fa),n-2)*pow(sin(phi/fa),2)+pow(1-cos(phi/fa),n-1)/fa*cos(phi/fa)); //this formula bugs sometimes for n=1

     return result;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movsd %xmm0, 0x88(%rsp)
movq 0x90(%rsp), %rax
movsd 0x210(%rax), %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0x90(%rsp), %rax
movsd 0x190(%rax), %xmm0
movsd %xmm0, 0x78(%rsp)
movq 0x90(%rsp), %rax
movsd 0x188(%rax), %xmm0
movq 0x90(%rsp), %rax
mulsd (%rax), %xmm0
movsd %xmm0, 0x70(%rsp)
movsd 0x80(%rsp), %xmm0
movsd 0x12220e(%rip), %xmm1   # 0x1d2248
ucomisd %xmm1, %xmm0
jne 0xb00a3
jp 0xb00a3
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x70(%rsp), %xmm0
movsd 0x122c21(%rip), %xmm1   # 0x1d2c80
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x58(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x88(%rsp), %xmm0
divsd 0x78(%rsp), %xmm0
callq 0x86a0
movaps %xmm0, %xmm1
movsd 0x60(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
jmp 0xb02ec
movsd 0x80(%rsp), %xmm0
movsd 0x122bcc(%rip), %xmm1   # 0x1d2c80
ucomisd %xmm1, %xmm0
jne 0xb0189
jp 0xb0189
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x70(%rsp), %xmm0
movsd 0x122b9f(%rip), %xmm1   # 0x1d2c80
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x38(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movsd 0x88(%rsp), %xmm0
divsd 0x78(%rsp), %xmm0
callq 0x80a0
movsd 0x122b6b(%rip), %xmm1   # 0x1d2c80
callq 0x8610
movsd %xmm0, 0x48(%rsp)
movsd 0x88(%rsp), %xmm0
divsd 0x78(%rsp), %xmm0
callq 0x86a0
movaps %xmm0, %xmm1
movsd 0x122109(%rip), %xmm0   # 0x1d2248
subsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x88(%rsp), %xmm0
divsd 0x78(%rsp), %xmm0
callq 0x86a0
movsd 0x40(%rsp), %xmm1
movsd 0x48(%rsp), %xmm2
movaps %xmm0, %xmm3
movsd 0x50(%rsp), %xmm0
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
jmp 0xb02ea
movsd 0x80(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x70(%rsp), %xmm0
movsd 0x122ada(%rip), %xmm1   # 0x1d2c80
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
mulsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x80(%rsp), %xmm0
movsd 0x122073(%rip), %xmm1   # 0x1d2248
subsd %xmm1, %xmm0
divsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x88(%rsp), %xmm0
divsd 0x78(%rsp), %xmm0
callq 0x86a0
movaps %xmm0, %xmm1
movsd 0x122044(%rip), %xmm0   # 0x1d2248
subsd %xmm1, %xmm0
movsd 0x80(%rsp), %xmm1
movsd 0x122a67(%rip), %xmm2   # 0x1d2c80
subsd %xmm2, %xmm1
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x88(%rsp), %xmm0
divsd 0x78(%rsp), %xmm0
callq 0x80a0
movsd 0x122a2f(%rip), %xmm1   # 0x1d2c80
callq 0x8610
movsd %xmm0, 0x28(%rsp)
movsd 0x88(%rsp), %xmm0
divsd 0x78(%rsp), %xmm0
callq 0x86a0
movaps %xmm0, %xmm1
movsd 0x121fcd(%rip), %xmm0   # 0x1d2248
subsd %xmm1, %xmm0
movsd 0x80(%rsp), %xmm1
movsd 0x121fb8(%rip), %xmm2   # 0x1d2248
subsd %xmm2, %xmm1
callq 0x8610
divsd 0x78(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x88(%rsp), %xmm0
divsd 0x78(%rsp), %xmm0
callq 0x86a0
movsd 0x18(%rsp), %xmm2
movsd 0x20(%rsp), %xmm1
movsd 0x28(%rsp), %xmm3
movaps %xmm0, %xmm4
movsd 0x30(%rsp), %xmm0
mulsd %xmm4, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x68(%rsp)
jmp 0xb02ec
movsd 0x68(%rsp), %xmm0
addq $0x98, %rsp
retq
nopw (%rax,%rax)