// File: /workspace/github_c_makefile_star2_O1/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 $0x1048, %rsp           # imm = 0x1048
movq %rsi, %rbx
xorpd %xmm0, %xmm0
ucomisd 0x10(%rsi), %xmm0
jae 0x6250b
ucomisd 0x20(%rbx), %xmm0
jae 0x6250b
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm2
movsd 0x93747(%rip), %xmm1    # 0xf5bb8
mulsd %xmm2, %xmm1
divsd 0x93743(%rip), %xmm1    # 0xf5bc0
divsd %xmm0, %xmm1
addsd 0x8f35f(%rip), %xmm1    # 0xf17e8
andpd 0x8edaf(%rip), %xmm1    # 0xf1240
ucomisd 0xa28(%rdi), %xmm1
jbe 0x62582
movapd %xmm0, %xmm1
divsd 0x9370d(%rip), %xmm1    # 0xf5bb8
mulsd 0x9370d(%rip), %xmm1    # 0xf5bc0
leaq 0xaca41(%rip), %rsi     # 0x10eefb
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movb $0x3, %al
callq 0x30c2c
leaq 0x8ebb2(%rip), %rsi     # 0xf1082
leaq 0xaca88(%rip), %rdx     # 0x10ef5f
leaq 0x840(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8eb3a(%rip), %rsi     # 0xf1034
leaq 0xac9e8(%rip), %rdx     # 0x10eee9
movq %rbx, %rdi
movl $0x850, %ecx            # imm = 0x850
jmp 0x62561
leaq 0xac8fd(%rip), %rsi     # 0x10ee0f
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x8eb5a(%rip), %rsi     # 0xf1082
leaq 0xac991(%rip), %rdx     # 0x10eec0
leaq 0x840(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8eae2(%rip), %rsi     # 0xf1034
leaq 0xac990(%rip), %rdx     # 0x10eee9
movq %rbx, %rdi
movl $0x843, %ecx            # imm = 0x843
movq %r15, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x1048, %rsp           # imm = 0x1048
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpw $0x1, 0x4c2(%rbx)
jne 0x625f0
leaq 0x38(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x28(%rsp), %rcx
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x6074e
testl %eax, %eax
je 0x625f0
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8ee37(%rip), %rsi     # 0xf13f0
leaq 0xabee1(%rip), %rdx     # 0x10e4a1
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x8ea5b(%rip), %rsi     # 0xf1034
leaq 0xac909(%rip), %rdx     # 0x10eee9
movq %rbx, %rdi
movl $0x861, %ecx            # imm = 0x861
movq %r14, %r8
jmp 0x62564
cmpw $0x1, 0x4ca(%rbx)
jne 0x62683
xorpd %xmm0, %xmm0
ucomisd 0x2e8(%rbx), %xmm0
jae 0x6289f
ucomisd 0x2f0(%rbx), %xmm0
jae 0x628fa
ucomisd 0x300(%rbx), %xmm0
jbe 0x62683
leaq 0xaca0f(%rip), %rsi     # 0x10f03e
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x8ea3d(%rip), %rsi     # 0xf1082
leaq 0xaca10(%rip), %rdx     # 0x10f05c
leaq 0x840(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8e9c5(%rip), %rsi     # 0xf1034
leaq 0xac873(%rip), %rdx     # 0x10eee9
movq %rbx, %rdi
movl $0x873, %ecx            # imm = 0x873
jmp 0x62561
xorl %eax, %eax
cmpw $0x0, 0xd1a(%rbx)
jle 0x62570
cmpw $0x1, 0x4be(%rbx)
jne 0x6285b
cmpl $0x0, 0x248(%rbx)
jle 0x6285b
xorl %r13d, %r13d
movl $0x0, 0x4(%rsp)
movq 0x258(%rbx), %rax
cmpl $0x1, (%rax,%r13,4)
jne 0x626f2
movl 0x4(%rsp), %ebp
movl %ebp, %eax
shll $0xa, %eax
movslq %eax, %rdx
addq 0x250(%rbx), %rdx
leal 0x1(%r13), %esi
leaq 0xac99d(%rip), %rdi     # 0x10f082
xorl %eax, %eax
callq 0x8030
incl %ebp
movl %ebp, 0x4(%rsp)
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
leaq 0x1(%r13), %rsi
movsd 0x8(%rbx), %xmm2
divsd %xmm2, %xmm1
divsd %xmm2, %xmm1
leaq 0xabdfe(%rip), %rdi     # 0x10e533
movq %rsi, 0x10(%rsp)
movb $0x2, %al
callq 0x8030
movq 0x500(%rbx), %rax
movslq (%rax,%r13,4), %r12
movq 0x510(%rbx), %rax
movsd (%rax,%r13,8), %xmm0
movsd %xmm0, 0x8(%rsp)
testq %r12, %r12
jle 0x627d8
movq 0x4d8(%rbx), %rax
movq 0x4e0(%rbx), %rcx
movq (%rax,%r13,8), %r14
movq (%rcx,%r13,8), %rbp
xorpd %xmm1, %xmm1
xorl %r15d, %r15d
movsd (%r14,%r15,8), %xmm2
mulsd %xmm2, %xmm2
ucomisd 0x8eac5(%rip), %xmm2    # 0xf1258
jb 0x6279e
xorps %xmm0, %xmm0
sqrtsd %xmm2, %xmm0
jmp 0x627bf
movapd %xmm2, %xmm0
movsd %xmm1, 0x20(%rsp)
movsd %xmm2, 0x18(%rsp)
callq 0x82b0
movsd 0x18(%rsp), %xmm2
movsd 0x20(%rsp), %xmm1
mulsd %xmm0, %xmm2
mulsd (%rbp,%r15,8), %xmm2
addsd %xmm2, %xmm1
incq %r15
cmpq %r15, %r12
jne 0x62781
jmp 0x627dc
xorpd %xmm1, %xmm1
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rbx), %xmm0
mulsd 0x93417(%rip), %xmm0    # 0xf5c10
movsd 0x91c27(%rip), %xmm1    # 0xf4428
callq 0x8620
mulsd 0xab272(%rip), %xmm0    # 0x10da80
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movq 0x500(%rbx), %rax
movq 0x508(%rbx), %rcx
movl (%rax,%r13,4), %edx
movl (%rcx,%r13,4), %ecx
leaq 0xac876(%rip), %rdi     # 0x10f0ab
movq 0x10(%rsp), %r14
movl %r14d, %esi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x8030
movslq 0x248(%rbx), %rax
movq %r14, %r13
cmpq %rax, %r14
jl 0x626b9
cmpw $0x1, 0x4c6(%rbx)
jne 0x62898
movsd 0xf8(%rbx), %xmm0
divsd 0x8feeb(%rip), %xmm0    # 0xf2760
mulsd 0x91be3(%rip), %xmm0    # 0xf4460
divsd 0x93373(%rip), %xmm0    # 0xf5bf8
divsd 0x10(%rbx), %xmm0
leaq 0xac8c3(%rip), %rdi     # 0x10f154
movb $0x1, %al
callq 0x8030
xorl %eax, %eax
jmp 0x62570
leaq 0xac701(%rip), %rsi     # 0x10efa7
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x8e7c6(%rip), %rsi     # 0xf1082
leaq 0xac718(%rip), %rdx     # 0x10efdb
leaq 0x840(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8e74e(%rip), %rsi     # 0xf1034
leaq 0xac5fc(%rip), %rdx     # 0x10eee9
movq %rbx, %rdi
movl $0x86d, %ecx            # imm = 0x86D
jmp 0x62561
leaq 0xac6f3(%rip), %rsi     # 0x10eff4
leaq 0x40(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x8e76b(%rip), %rsi     # 0xf1082
leaq 0xac70a(%rip), %rdx     # 0x10f028
leaq 0x840(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8e6f3(%rip), %rsi     # 0xf1034
leaq 0xac5a1(%rip), %rdx     # 0x10eee9
movq %rbx, %rdi
movl $0x870, %ecx            # imm = 0x870
jmp 0x62561