// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../external/HMcode/hmcode.c
// Function: hmcode_noradiation_growth_init
int hmcode_noradiation_growth_init(
                                   struct precision *ppr,
                                   struct background *pba,
                                   struct fourier *pfo,
                                   struct hmcode_workspace *phw
                                   ){

  struct hmcode_growth *phg;
  int index_fg,index_gt, index_norad;
  int i;
  double a_ini;
  double a_final;
  double lna_ini;
  double lna_final;
  double neutrino_constant;
  double Omega_nu_rad;

  class_alloc(phg,sizeof(struct hmcode_growth),pfo->error_message);
  phw->phg = phg;

  index_fg = 0;
  class_define_index(phg->index_fg_g,_TRUE_,index_fg,1);
  class_define_index(phg->index_fg_dg,_TRUE_,index_fg,1);

  phg->fg_size = index_fg;

  index_gt = 0;
  class_define_index(phg->index_gt_g,_TRUE_,index_gt,1); //Actually g(a)/a
  class_define_index(phg->index_gt_ddg,_TRUE_,index_gt,1);
  class_define_index(phg->index_gt_intg,_TRUE_,index_gt,1);
  class_define_index(phg->index_gt_ddintg,_TRUE_,index_gt,1);
  class_define_index(phg->index_gt_Omnorad,_TRUE_,index_gt,1);
  class_define_index(phg->index_gt_ddOmnorad,_TRUE_,index_gt,1);

  phg->gt_size = index_gt;

  index_norad = 0;
  class_define_index(phg->index_norad_H2,_TRUE_,index_norad,1);
  class_define_index(phg->index_norad_AH,_TRUE_,index_norad,1);
  class_define_index(phg->index_norad_Om,_TRUE_,index_norad,1);

  phg->norad_size = index_norad;

  a_ini = 1e-4;
  a_final = 1;
  lna_ini = log(a_ini);
  lna_final = log(a_final);

  phg->a_size = 128;
  class_alloc(phg->a_table,phg->a_size*sizeof(double),pfo->error_message);
  class_alloc(phg->growth_table,phg->a_size*phg->gt_size*sizeof(double),pfo->error_message);
  class_alloc(phg->normgrowth_table,phg->a_size*sizeof(double),pfo->error_message);
  class_alloc(phg->ddnormgrowth_table,phg->a_size*sizeof(double),pfo->error_message);
  class_alloc(phg->dda_table,phg->a_size*sizeof(double),pfo->error_message);
  class_alloc(phg->pvecnorad,phg->norad_size*sizeof(double),pfo->error_message);

  for(i=0;i<phg->a_size;++i){
    phg->a_table[i] = a_ini*exp(i*(lna_final-lna_ini)/(phg->a_size-1));
  }

  phg->a_ini = a_ini;
  phg->a_final = a_final;
  phg->a_table[0]=a_ini;
  phg->a_table[phg->a_size-1]=a_final;
  phg->smallest_allowed_variation = ppr->smallest_allowed_variation;

  phg->Omega_cdm = pba->Omega0_m-pba->Omega0_b;//pba->Omega0_cdm;
  phg->Omega_b = pba->Omega0_b;
  phg->Omega_v = pba->Omega0_lambda;
  Omega_nu_rad = pba->Omega0_g*pba->Neff*7./8.*pow(4./11.,4./3.);

  phg->Omega_nu = Omega_nu_rad;
  phg->a_nu = 1;
  // These would be the expressions for mnu>0, but to emulate the default HMcode, we use the expressions above
  //phg->a_nu = pba->T_cmb*pow(4./11.,1./3.) /(mnu/pba->Neff)*(1.38064852e-23/1.60218e-19);
  //phg->Omega_nu = Omega_nu_rad*(pow(1.+pow(0.3173*1./phg->a_nu,1.83),1./1.83));

  phg->Omega_w = pba->Omega0_fld;
  phg->w0 = pba->w0_fld;
  phg->wa = pba->wa_fld;
  phg->Omega_m = 1.-phg->Omega_v-phg->Omega_w;
  phg->Tcmb = pba->T_cmb;
  phg->om_m = pba->Omega0_m*pba->h*pba->h;
  phg->fnu = pba->Omega0_ncdm_tot/pba->Omega0_m;
  class_test(pba->Omega0_scf>0,
             pfo->error_message,
             "Cannot use scalar field scf with HMcode (not yet coded)");

  class_call(hmcode_noradiation_growth_compute(pfo, phw),
             phw->phg->error_message,
             pfo->error_message);

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r13
movl $0x900, %edi            # imm = 0x900
callq 0x8460
testq %rax, %rax
je 0xe4da2
movq %rax, %r12
movq %rax, 0x70(%r14)
movabsq $0x400000003, %rax      # imm = 0x400000003
movq %rax, 0x40(%r12)
movl $0x5, 0x48(%r12)
movaps 0x47541(%rip), %xmm0    # 0x12c040
movups %xmm0, 0x30(%r12)
movapd 0x47543(%rip), %xmm0    # 0x12c050
movupd %xmm0, 0xc8(%r12)
movabsq $0x200000001, %rax      # imm = 0x200000001
movq %rax, 0xd8(%r12)
movl $0x3, 0xe0(%r12)
movl $0x80, 0x8(%r12)
movl $0x400, %edi            # imm = 0x400
callq 0x8460
movq %rax, (%r12)
testq %rax, %rax
je 0xe4de4
movl $0x1800, %edi           # imm = 0x1800
callq 0x8460
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0xe4e26
movl $0x400, %edi            # imm = 0x400
callq 0x8460
movq %rax, 0x18(%r12)
testq %rax, %rax
je 0xe4e68
movl $0x400, %edi            # imm = 0x400
callq 0x8460
movq %rax, 0x20(%r12)
testq %rax, %rax
je 0xe4eaa
movl $0x400, %edi            # imm = 0x400
callq 0x8460
movq %rax, 0x28(%r12)
testq %rax, %rax
je 0xe4eec
movl $0x18, %edi
callq 0x8460
movq %rax, 0xe8(%r12)
testq %rax, %rax
je 0xe4f2e
movl $0x80, %eax
xorl %ebp, %ebp
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
mulsd 0x47382(%rip), %xmm0    # 0x12bf68
decl %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
callq 0x8670
mulsd 0xa138(%rip), %xmm0     # 0xeed38
movq (%r12), %rcx
movsd %xmm0, (%rcx,%rbp,8)
incq %rbp
movl 0x8(%r12), %eax
movslq %eax, %rdx
cmpq %rdx, %rbp
jl 0xe4bd7
movaps 0x47440(%rip), %xmm0    # 0x12c060
movups %xmm0, 0xb0(%r12)
movabsq $0x3f1a36e2eb1c432d, %rax # imm = 0x3F1A36E2EB1C432D
movq %rax, (%rcx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x8(%rcx,%rdx,8)
movsd 0xa28(%r13), %xmm0
movsd %xmm0, 0xc0(%r12)
movsd 0x340(%r15), %xmm0
movsd 0x20(%r15), %xmm1
movapd %xmm0, %xmm2
subsd %xmm1, %xmm2
movsd %xmm2, 0x50(%r12)
movsd %xmm1, 0x58(%r12)
movsd 0x10(%r15), %xmm1
mulsd 0x328(%r15), %xmm1
mulsd 0xaad4(%rip), %xmm1     # 0xef768
mulsd 0xde54(%rip), %xmm1     # 0xf2af0
mulsd 0xdf84(%rip), %xmm1     # 0xf2c28
movsd %xmm1, 0x88(%r12)
movq %rax, 0x90(%r12)
movupd 0x30(%r15), %xmm1
movupd %xmm1, 0x60(%r12)
movups 0x48(%r15), %xmm2
movups %xmm2, 0x70(%r12)
movsd 0x958a(%rip), %xmm2     # 0xee260
subsd %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
subsd %xmm1, %xmm2
movsd %xmm2, 0x80(%r12)
movsd 0x18(%r15), %xmm1
movsd %xmm1, 0x98(%r12)
movsd 0x8(%r15), %xmm1
movapd %xmm0, %xmm2
mulsd %xmm1, %xmm2
mulsd %xmm1, %xmm2
movsd %xmm2, 0xa0(%r12)
movsd 0x288(%r15), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0xa8(%r12)
movsd 0x128(%r15), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0xe4f6d
leaq 0x49243(%rip), %rsi     # 0x12df90
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x9321(%rip), %rsi      # 0xee082
leaq 0x49260(%rip), %rdx     # 0x12dfc8
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x192, %rbx            # imm = 0x192
leaq 0x92a9(%rip), %rsi      # 0xee034
leaq 0x49174(%rip), %rdx     # 0x12df06
movq %rbx, %rdi
movl $0x946, %ecx            # imm = 0x946
movq %r15, %r8
jmp 0xe4fbd
leaq 0x925b(%rip), %rsi      # 0xee004
leaq 0x49152(%rip), %rdx     # 0x12df02
movq %rsp, %r14
movq %r14, %rdi
movl $0x900, %ecx            # imm = 0x900
xorl %eax, %eax
callq 0x30af0
addq $0x192, %rbx            # imm = 0x192
leaq 0x9264(%rip), %rsi      # 0xee034
leaq 0x4912f(%rip), %rdx     # 0x12df06
movq %rbx, %rdi
movl $0x901, %ecx            # imm = 0x901
jmp 0xe4fba
leaq 0x9219(%rip), %rsi      # 0xee004
leaq 0x49133(%rip), %rdx     # 0x12df25
movq %rsp, %r14
movq %r14, %rdi
movl $0x400, %ecx            # imm = 0x400
xorl %eax, %eax
callq 0x30af0
addq $0x192, %rbx            # imm = 0x192
leaq 0x9222(%rip), %rsi      # 0xee034
leaq 0x490ed(%rip), %rdx     # 0x12df06
movq %rbx, %rdi
movl $0x921, %ecx            # imm = 0x921
jmp 0xe4fba
leaq 0x91d7(%rip), %rsi      # 0xee004
leaq 0x490fe(%rip), %rdx     # 0x12df32
movq %rsp, %r14
movq %r14, %rdi
movl $0x1800, %ecx           # imm = 0x1800
xorl %eax, %eax
callq 0x30af0
addq $0x192, %rbx            # imm = 0x192
leaq 0x91e0(%rip), %rsi      # 0xee034
leaq 0x490ab(%rip), %rdx     # 0x12df06
movq %rbx, %rdi
movl $0x922, %ecx            # imm = 0x922
jmp 0xe4fba
leaq 0x9195(%rip), %rsi      # 0xee004
leaq 0x490ce(%rip), %rdx     # 0x12df44
movq %rsp, %r14
movq %r14, %rdi
movl $0x400, %ecx            # imm = 0x400
xorl %eax, %eax
callq 0x30af0
addq $0x192, %rbx            # imm = 0x192
leaq 0x919e(%rip), %rsi      # 0xee034
leaq 0x49069(%rip), %rdx     # 0x12df06
movq %rbx, %rdi
movl $0x923, %ecx            # imm = 0x923
jmp 0xe4fba
leaq 0x9153(%rip), %rsi      # 0xee004
leaq 0x490a2(%rip), %rdx     # 0x12df5a
movq %rsp, %r14
movq %r14, %rdi
movl $0x400, %ecx            # imm = 0x400
xorl %eax, %eax
callq 0x30af0
addq $0x192, %rbx            # imm = 0x192
leaq 0x915c(%rip), %rsi      # 0xee034
leaq 0x49027(%rip), %rdx     # 0x12df06
movq %rbx, %rdi
movl $0x924, %ecx            # imm = 0x924
jmp 0xe4fba
leaq 0x9111(%rip), %rsi      # 0xee004
leaq 0x49078(%rip), %rdx     # 0x12df72
movq %rsp, %r14
movq %r14, %rdi
movl $0x400, %ecx            # imm = 0x400
xorl %eax, %eax
callq 0x30af0
addq $0x192, %rbx            # imm = 0x192
leaq 0x911a(%rip), %rsi      # 0xee034
leaq 0x48fe5(%rip), %rdx     # 0x12df06
movq %rbx, %rdi
movl $0x925, %ecx            # imm = 0x925
jmp 0xe4fba
leaq 0x90cf(%rip), %rsi      # 0xee004
leaq 0x49045(%rip), %rdx     # 0x12df81
movq %rsp, %r14
movq %r14, %rdi
movl $0x18, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x192, %rbx            # imm = 0x192
leaq 0x90d8(%rip), %rsi      # 0xee034
leaq 0x48fa3(%rip), %rdx     # 0x12df06
movq %rbx, %rdi
movl $0x926, %ecx            # imm = 0x926
jmp 0xe4fba
movq %r14, %rsi
callq 0xe4fdf
testl %eax, %eax
je 0xe4fdb
movl $0x100, %ecx            # imm = 0x100
addq 0x70(%r14), %rcx
leaq 0x9467(%rip), %rsi      # 0xee3f0
leaq 0x4904a(%rip), %rdx     # 0x12dfda
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x192, %rbx            # imm = 0x192
leaq 0x9089(%rip), %rsi      # 0xee034
leaq 0x48f54(%rip), %rdx     # 0x12df06
movq %rbx, %rdi
movl $0x94a, %ecx            # imm = 0x94A
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0xe4fc9