// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/background.c
// Function: background_checks
int background_checks(
                      struct precision* ppr,
                      struct background* pba
                      ) {

  /** - define local variables */
  int n_ncdm;
  double rho_ncdm_rel,rho_nu_rel;
  double N_dark;
  double w_fld, dw_over_da, integral_fld;
  int filenum=0;

  /** - control that we have photons and baryons in the problem */
  class_test((pba->Omega0_g<=0) || (pba->Omega0_b<=0),
             pba->error_message,
             "CLASS is conceived to work in a universe containing at least two species: photons and baryons. You could work in the limit where Omega_g or Omega_b are very small, but not zero");

  /** - control that cosmological parameter values make sense, otherwise inform user */

  /* H0 in Mpc^{-1} */
  /* Many users asked for this test to be supressed. It is commented out. */
  /*class_test((pba->H0 < _H0_SMALL_)||(pba->H0 > _H0_BIG_),
    pba->error_message,
    "H0=%g out of bounds (%g<H0<%g) \n",pba->H0,_H0_SMALL_,_H0_BIG_);*/

  /* consistency between h and H0 */
  class_test(fabs(pba->h * 1.e5 / _c_  / pba->H0 -1.)>ppr->smallest_allowed_variation,
             pba->error_message,
             "inconsistency between Hubble and reduced Hubble parameters: you have H0=%f/Mpc=%fkm/s/Mpc, but h=%f",pba->H0,pba->H0/1.e5* _c_,pba->h);

  /* T_cmb in K */
  /* Many users asked for this test to be supressed. It is commented out. */
  /*class_test((pba->T_cmb < _TCMB_SMALL_)||(pba->T_cmb > _TCMB_BIG_),
    pba->error_message,
    "T_cmb=%g out of bounds (%g<T_cmb<%g)",pba->T_cmb,_TCMB_SMALL_,_TCMB_BIG_);*/

  /* Omega_k */
  /* Many users asked for this test to be supressed. It is commented out. */
  /*class_test((pba->Omega0_k < _OMEGAK_SMALL_)||(pba->Omega0_k > _OMEGAK_BIG_),
    pba->error_message,
    "Omegak = %g out of bounds (%g<Omegak<%g) \n",pba->Omega0_k,_OMEGAK_SMALL_,_OMEGAK_BIG_);*/

  /* fluid equation of state */
  if (pba->has_fld == _TRUE_) {

    class_call(background_w_fld(pba,0.,&w_fld,&dw_over_da,&integral_fld), pba->error_message, pba->error_message);
    //
    // class_test(w_fld >= 1./3.,
    //            pba->error_message,
    //            "Your choice for w(a--->0)=%g is suspicious, since it is bigger than 1/3 there cannot be radiation domination at early times\n",
    //            w_fld);
  }

  /* Varying fundamental constants */
  if (pba->has_varconst == _TRUE_) {
    class_test(pba->varconst_alpha <= 0,
               pba->error_message,
               "incorrect fine structure constant before transition");
    class_test(pba->varconst_me <= 0,
               pba->error_message,
               "incorrect effective electron mass before transition");
    class_test(pba->varconst_transition_redshift < 0,
               pba->error_message,
               "incorrect transition redshift");
  }

  /** - in verbose mode, send to standard output some additional information on non-obvious background parameters */
  if (pba->background_verbose > 0) {

    if (pba->has_ncdm == _TRUE_) {

      /* loop over ncdm species */
      for (n_ncdm=0;n_ncdm<pba->N_ncdm; n_ncdm++) {

        /* inform if p-s-d read in files */
        if (pba->got_files[n_ncdm] == _TRUE_) {
          printf(" -> ncdm species i=%d read from file %s\n",n_ncdm+1,pba->ncdm_psd_files+filenum*_ARGUMENT_LENGTH_MAX_);
          filenum++;
        }

        /* inform the user also about the value of the ncdm
           masses in eV and about */
        printf(" -> non-cold dark matter species with i=%d has m_i = %e eV (so m_i / omega_i =%e eV)\n",
               n_ncdm+1,
               pba->m_ncdm_in_eV[n_ncdm],
               pba->m_ncdm_in_eV[n_ncdm]*pba->deg_ncdm[n_ncdm]/pba->Omega0_ncdm[n_ncdm]/pba->h/pba->h);

        /* call this function to get rho_ncdm */
        background_ncdm_momenta(pba->q_ncdm_bg[n_ncdm],
                                pba->w_ncdm_bg[n_ncdm],
                                pba->q_size_ncdm_bg[n_ncdm],
                                0.,
                                pba->factor_ncdm[n_ncdm],
                                0.,
                                NULL,
                                &rho_ncdm_rel,
                                NULL,
                                NULL,
                                NULL);

        /* inform user of the contribution of each species to
           radiation density (in relativistic limit): should be
           between 1.01 and 1.02 for each active neutrino species;
           evaluated as rho_ncdm/rho_nu_rel where rho_nu_rel is the
           density of one neutrino in the instantaneous decoupling
           limit, i.e. assuming T_nu=(4/11)^1/3 T_gamma (this comes
           from the definition of N_eff) */
        rho_nu_rel = 56.0/45.0*pow(_PI_,6)*pow(4.0/11.0,4.0/3.0)*_G_/pow(_h_P_,3)/pow(_c_,7)*
          pow(_Mpc_over_m_,2)*pow(pba->T_cmb*_k_B_,4);

        printf(" -> ncdm species i=%d sampled with %d (resp. %d) points for purpose of background (resp. perturbation) integration. In the relativistic limit it gives Delta N_eff = %g\n",
               n_ncdm+1,
               pba->q_size_ncdm_bg[n_ncdm],
               pba->q_size_ncdm[n_ncdm],
               rho_ncdm_rel/rho_nu_rel);
      }
    }

    /* contribution of interacting dark radiation _idr to N_eff */
    if (pba->has_idr == _TRUE_) {
      N_dark = pba->Omega0_idr/7.*8./pow(4./11.,4./3.)/pba->Omega0_g;
      printf(" -> dark radiation Delta Neff %e\n",N_dark);
    }
  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %rsi, %rbx
xorpd %xmm0, %xmm0
ucomisd 0x10(%rsi), %xmm0
jae 0x5fdfb
ucomisd 0x20(%rbx), %xmm0
jae 0x5fdfb
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm2
movsd 0x92e87(%rip), %xmm1    # 0xf2be8
mulsd %xmm2, %xmm1
divsd 0x92e83(%rip), %xmm1    # 0xf2bf0
divsd %xmm0, %xmm1
addsd 0x8ea6f(%rip), %xmm1    # 0xee7e8
andpd 0x8e4bf(%rip), %xmm1    # 0xee240
ucomisd 0xa28(%rdi), %xmm1
jbe 0x5fe74
movapd %xmm0, %xmm1
divsd 0x92e4d(%rip), %xmm1    # 0xf2be8
mulsd 0x92e4d(%rip), %xmm1    # 0xf2bf0
leaq 0xac171(%rip), %rsi     # 0x10bf1b
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movb $0x3, %al
callq 0x30af0
leaq 0x8e2c2(%rip), %rsi     # 0xee082
leaq 0xac1b8(%rip), %rdx     # 0x10bf7f
leaq 0x820(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8e24a(%rip), %rsi     # 0xee034
leaq 0xac118(%rip), %rdx     # 0x10bf09
movq %rbx, %rdi
movl $0x850, %ecx            # imm = 0x850
jmp 0x5fe51
leaq 0xac02d(%rip), %rsi     # 0x10be2f
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x8e26a(%rip), %rsi     # 0xee082
leaq 0xac0c1(%rip), %rdx     # 0x10bee0
leaq 0x820(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8e1f2(%rip), %rsi     # 0xee034
leaq 0xac0c0(%rip), %rdx     # 0x10bf09
movq %rbx, %rdi
movl $0x843, %ecx            # imm = 0x843
movq %r15, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %ebp
movl %ebp, %eax
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpw $0x1, 0x4c2(%rbx)
jne 0x5fee2
leaq 0x18(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x8(%rsp), %rcx
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x5e095
testl %eax, %eax
je 0x5fee2
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8e545(%rip), %rsi     # 0xee3f0
leaq 0xab60f(%rip), %rdx     # 0x10b4c1
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x8e169(%rip), %rsi     # 0xee034
leaq 0xac037(%rip), %rdx     # 0x10bf09
movq %rbx, %rdi
movl $0x861, %ecx            # imm = 0x861
movq %r14, %r8
jmp 0x5fe54
cmpw $0x1, 0x4ca(%rbx)
jne 0x5ff75
xorpd %xmm0, %xmm0
ucomisd 0x2e8(%rbx), %xmm0
jae 0x60144
ucomisd 0x2f0(%rbx), %xmm0
jae 0x6019f
ucomisd 0x300(%rbx), %xmm0
jbe 0x5ff75
leaq 0xac13d(%rip), %rsi     # 0x10c05e
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x8e14b(%rip), %rsi     # 0xee082
leaq 0xac13e(%rip), %rdx     # 0x10c07c
leaq 0x820(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8e0d3(%rip), %rsi     # 0xee034
leaq 0xabfa1(%rip), %rdx     # 0x10bf09
movq %rbx, %rdi
movl $0x873, %ecx            # imm = 0x873
jmp 0x5fe51
xorl %ebp, %ebp
cmpw $0x0, 0xd1a(%rbx)
jle 0x5fe60
cmpw $0x1, 0x4be(%rbx)
jne 0x600fe
cmpl $0x0, 0x248(%rbx)
jle 0x600fe
leaq 0xac124(%rip), %r12     # 0x10c0cb
xorl %r13d, %r13d
xorl %r14d, %r14d
movq 0x258(%rbx), %rax
leaq 0x1(%r13), %r15
cmpl $0x1, (%rax,%r13,4)
jne 0x5ffe3
movl %r14d, %eax
shll $0xa, %eax
movslq %eax, %rdx
addq 0x250(%rbx), %rdx
leaq 0xac0cc(%rip), %rdi     # 0x10c0a2
movl %r15d, %esi
xorl %eax, %eax
callq 0x8030
incl %r14d
movq 0x278(%rbx), %rax
movsd (%rax,%r13,8), %xmm0
movq 0x2b0(%rbx), %rax
movsd (%rax,%r13,8), %xmm1
mulsd %xmm0, %xmm1
movq 0x280(%rbx), %rax
divsd (%rax,%r13,8), %xmm1
movsd 0x8(%rbx), %xmm2
divsd %xmm2, %xmm1
divsd %xmm2, %xmm1
leaq 0xab531(%rip), %rdi     # 0x10b553
movl %r15d, %esi
movb $0x2, %al
callq 0x8030
movq 0x500(%rbx), %rax
movslq (%rax,%r13,4), %rax
movq 0x510(%rbx), %rcx
movsd (%rcx,%r13,8), %xmm3
testq %rax, %rax
jle 0x6008c
movq 0x4d8(%rbx), %rcx
movq 0x4e0(%rbx), %rdx
movq (%rcx,%r13,8), %rcx
movq (%rdx,%r13,8), %rdx
xorpd %xmm0, %xmm0
xorl %esi, %esi
movsd (%rcx,%rsi,8), %xmm1
mulsd %xmm1, %xmm1
xorps %xmm2, %xmm2
sqrtsd %xmm1, %xmm2
mulsd %xmm1, %xmm2
mulsd (%rdx,%rsi,8), %xmm2
addsd %xmm2, %xmm0
incq %rsi
cmpq %rsi, %rax
jne 0x60065
jmp 0x60090
xorpd %xmm0, %xmm0
mulsd %xmm0, %xmm3
movsd %xmm3, (%rsp)
movsd 0x18(%rbx), %xmm0
mulsd 0x92b9a(%rip), %xmm0    # 0xf2c40
movsd 0x9138a(%rip), %xmm1    # 0xf1438
callq 0x8620
mulsd 0xaa9ed(%rip), %xmm0    # 0x10aaa8
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x500(%rbx), %rax
movq 0x508(%rbx), %rcx
movl (%rax,%r13,4), %edx
movl (%rcx,%r13,4), %ecx
movq %r12, %rdi
movl %r15d, %esi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x8030
movslq 0x248(%rbx), %rax
movq %r15, %r13
cmpq %rax, %r15
jl 0x5ffad
cmpw $0x1, 0x4c6(%rbx)
jne 0x5fe60
movsd 0xf8(%rbx), %xmm0
divsd 0x8f64c(%rip), %xmm0    # 0xef768
mulsd 0x9134c(%rip), %xmm0    # 0xf1470
divsd 0x92afc(%rip), %xmm0    # 0xf2c28
divsd 0x10(%rbx), %xmm0
leaq 0xac03c(%rip), %rdi     # 0x10c174
movb $0x1, %al
callq 0x8030
jmp 0x5fe60
leaq 0xabe7c(%rip), %rsi     # 0x10bfc7
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x8df21(%rip), %rsi     # 0xee082
leaq 0xabe93(%rip), %rdx     # 0x10bffb
leaq 0x820(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8dea9(%rip), %rsi     # 0xee034
leaq 0xabd77(%rip), %rdx     # 0x10bf09
movq %rbx, %rdi
movl $0x86d, %ecx            # imm = 0x86D
jmp 0x5fe51
leaq 0xabe6e(%rip), %rsi     # 0x10c014
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x8dec6(%rip), %rsi     # 0xee082
leaq 0xabe85(%rip), %rdx     # 0x10c048
leaq 0x820(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8de4e(%rip), %rsi     # 0xee034
leaq 0xabd1c(%rip), %rdx     # 0x10bf09
movq %rbx, %rdi
movl $0x870, %ecx            # imm = 0x870
jmp 0x5fe51