// File: /workspace/github_c_makefile_star2_O2/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 $0x1038, %rsp           # imm = 0x1038
movq %rsi, %rbx
xorpd %xmm0, %xmm0
ucomisd 0x10(%rsi), %xmm0
jae 0x5be24
ucomisd 0x20(%rbx), %xmm0
jae 0x5be24
movsd (%rbx), %xmm0
movsd 0x8(%rbx), %xmm2
movsd 0x8dd1e(%rip), %xmm1    # 0xe9aa8
mulsd %xmm2, %xmm1
divsd 0x8dd1a(%rip), %xmm1    # 0xe9ab0
divsd %xmm0, %xmm1
addsd 0x89a46(%rip), %xmm1    # 0xe57e8
andpd 0x89496(%rip), %xmm1    # 0xe5240
ucomisd 0xa28(%rdi), %xmm1
jbe 0x5be9b
movapd %xmm0, %xmm1
divsd 0x8dce4(%rip), %xmm1    # 0xe9aa8
mulsd 0x8dce4(%rip), %xmm1    # 0xe9ab0
leaq 0xa7008(%rip), %rsi     # 0x102ddb
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movb $0x3, %al
callq 0x2e014
leaq 0x89299(%rip), %rsi     # 0xe5082
leaq 0xa704f(%rip), %rdx     # 0x102e3f
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x89221(%rip), %rsi     # 0xe5034
leaq 0xa6faf(%rip), %rdx     # 0x102dc9
movq %rbx, %rdi
movl $0x850, %ecx            # imm = 0x850
jmp 0x5be7a
leaq 0xa6ec4(%rip), %rsi     # 0x102cef
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x89241(%rip), %rsi     # 0xe5082
leaq 0xa6f58(%rip), %rdx     # 0x102da0
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x891c9(%rip), %rsi     # 0xe5034
leaq 0xa6f57(%rip), %rdx     # 0x102dc9
movq %rbx, %rdi
movl $0x843, %ecx            # imm = 0x843
movq %r15, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpw $0x1, 0x4c2(%rbx)
jne 0x5bf09
leaq 0x28(%rsp), %rsi
leaq 0x20(%rsp), %rdx
leaq 0x18(%rsp), %rcx
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x5a0e7
testl %eax, %eax
je 0x5bf09
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x8951e(%rip), %rsi     # 0xe53f0
leaq 0xa64a8(%rip), %rdx     # 0x102381
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x89142(%rip), %rsi     # 0xe5034
leaq 0xa6ed0(%rip), %rdx     # 0x102dc9
movq %rbx, %rdi
movl $0x861, %ecx            # imm = 0x861
movq %r14, %r8
jmp 0x5be7d
cmpw $0x1, 0x4ca(%rbx)
jne 0x5bf9c
xorpd %xmm0, %xmm0
ucomisd 0x2e8(%rbx), %xmm0
jae 0x5c14f
ucomisd 0x2f0(%rbx), %xmm0
jae 0x5c1aa
ucomisd 0x300(%rbx), %xmm0
jbe 0x5bf9c
leaq 0xa6fd6(%rip), %rsi     # 0x102f1e
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x89124(%rip), %rsi     # 0xe5082
leaq 0xa6fd7(%rip), %rdx     # 0x102f3c
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x890ac(%rip), %rsi     # 0xe5034
leaq 0xa6e3a(%rip), %rdx     # 0x102dc9
movq %rbx, %rdi
movl $0x873, %ecx            # imm = 0x873
jmp 0x5be7a
xorl %ebp, %ebp
cmpw $0x0, 0xd1a(%rbx)
jle 0x5be87
cmpw $0x1, 0x4be(%rbx)
jne 0x5c109
xorl %r12d, %r12d
xorl %r15d, %r15d
movslq 0x248(%rbx), %rax
cmpq %rax, %r12
jge 0x5c109
movq 0x258(%rbx), %rax
leaq 0x1(%r12), %r13
cmpl $0x1, (%rax,%r12,4)
jne 0x5c00e
movl %r15d, %eax
shll $0xa, %eax
movslq %eax, %rdx
addq 0x250(%rbx), %rdx
leal 0x1(%r12), %esi
leaq 0xa6f63(%rip), %rdi     # 0x102f62
xorl %eax, %eax
callq 0x8030
incl %r15d
movl %r13d, %r14d
jmp 0x5c013
leal 0x1(%r12), %r14d
movq 0x278(%rbx), %rax
movsd (%rax,%r12,8), %xmm0
movq 0x2b0(%rbx), %rax
movsd (%rax,%r12,8), %xmm1
mulsd %xmm0, %xmm1
movq 0x280(%rbx), %rax
divsd (%rax,%r12,8), %xmm1
movsd 0x8(%rbx), %xmm2
divsd %xmm2, %xmm1
divsd %xmm2, %xmm1
leaq 0xa63c1(%rip), %rdi     # 0x102413
movl %r14d, %esi
movb $0x2, %al
callq 0x8030
movq 0x4d8(%rbx), %rax
movq 0x4e0(%rbx), %rcx
movq (%rax,%r12,8), %rdi
movq (%rcx,%r12,8), %rsi
movq 0x500(%rbx), %rax
movl (%rax,%r12,4), %edx
movq 0x510(%rbx), %rax
movsd (%rax,%r12,8), %xmm1
xorpd %xmm0, %xmm0
movupd %xmm0, (%rsp)
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
xorl %ecx, %ecx
leaq 0x30(%rsp), %r8
xorl %r9d, %r9d
callq 0x59e8b
movsd 0x18(%rbx), %xmm0
mulsd 0x8da49(%rip), %xmm0    # 0xe9b00
movsd 0x8c339(%rip), %xmm1    # 0xe83f8
callq 0x8650
mulsd 0xa58a4(%rip), %xmm0    # 0x101970
movq 0x500(%rbx), %rax
movq 0x508(%rbx), %rcx
movl (%rax,%r12,4), %edx
movl (%rcx,%r12,4), %ecx
movsd 0x30(%rsp), %xmm1
divsd %xmm0, %xmm1
leaq 0xa6e98(%rip), %rdi     # 0x102f8b
movl %r14d, %esi
movapd %xmm1, %xmm0
movb $0x1, %al
callq 0x8030
movq %r13, %r12
jmp 0x5bfc0
cmpw $0x1, 0x4c6(%rbx)
jne 0x5be87
movsd 0xf8(%rbx), %xmm0
divsd 0x8a619(%rip), %xmm0    # 0xe6740
mulsd 0x8c301(%rip), %xmm0    # 0xe8430
divsd 0x8d9b1(%rip), %xmm0    # 0xe9ae8
divsd 0x10(%rbx), %xmm0
leaq 0xa6ef1(%rip), %rdi     # 0x103034
movb $0x1, %al
callq 0x8030
jmp 0x5be87
leaq 0xa6d31(%rip), %rsi     # 0x102e87
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x88f16(%rip), %rsi     # 0xe5082
leaq 0xa6d48(%rip), %rdx     # 0x102ebb
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x88e9e(%rip), %rsi     # 0xe5034
leaq 0xa6c2c(%rip), %rdx     # 0x102dc9
movq %rbx, %rdi
movl $0x86d, %ecx            # imm = 0x86D
jmp 0x5be7a
leaq 0xa6d23(%rip), %rsi     # 0x102ed4
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x88ebb(%rip), %rsi     # 0xe5082
leaq 0xa6d3a(%rip), %rdx     # 0x102f08
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0xd1c, %rbx            # imm = 0xD1C
leaq 0x88e43(%rip), %rsi     # 0xe5034
leaq 0xa6bd1(%rip), %rdx     # 0x102dc9
movq %rbx, %rdi
movl $0x870, %ecx            # imm = 0x870
jmp 0x5be7a