// File: /workspace/github_c_makefile_star2_O2/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 $0x1018, %rsp           # imm = 0x1018
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r13
movl $0x900, %edi            # imm = 0x900
callq 0x8490
testq %rax, %rax
je 0xdc84b
movq %rax, %r12
movq %rax, 0x70(%r14)
movabsq $0x400000003, %rax      # imm = 0x400000003
movq %rax, 0x40(%r12)
movl $0x5, 0x48(%r12)
movaps 0x46789(%rip), %xmm0    # 0x122eb0
movups %xmm0, 0x30(%r12)
movapd 0x4678b(%rip), %xmm0    # 0x122ec0
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 0x8490
movq %rax, (%r12)
testq %rax, %rax
je 0xdc88f
movq %rax, %rbp
movl $0x1800, %edi           # imm = 0x1800
callq 0x8490
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0xdc8d3
movl $0x400, %edi            # imm = 0x400
callq 0x8490
movq %rax, 0x18(%r12)
testq %rax, %rax
je 0xdc917
movl $0x400, %edi            # imm = 0x400
callq 0x8490
movq %rax, 0x20(%r12)
testq %rax, %rax
je 0xdc95b
movl $0x400, %edi            # imm = 0x400
callq 0x8490
movq %rax, 0x28(%r12)
testq %rax, %rax
je 0xdcb2f
pushq $0x18
popq %rdi
callq 0x8490
movq %rax, 0xe8(%r12)
testq %rax, %rax
je 0xdcb73
movq %r13, 0x8(%rsp)
movl $0x80, %eax
xorl %r13d, %r13d
movslq %eax, %rcx
cmpq %rcx, %r13
jge 0xdc99f
cvtsi2sd %r13d, %xmm0
mulsd 0x465b9(%rip), %xmm0    # 0x122dd8
decl %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
callq 0x86a0
mulsd 0x94e2(%rip), %xmm0     # 0xe5d18
movq (%r12), %rbp
movsd %xmm0, (%rbp,%r13,8)
incq %r13
movl 0x8(%r12), %eax
jmp 0xdc806
leaq 0x87b2(%rip), %rsi      # 0xe5004
leaq 0x48519(%rip), %rdx     # 0x124d72
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x900, %ecx            # imm = 0x900
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x87b9(%rip), %rsi      # 0xe5034
leaq 0x484f4(%rip), %rdx     # 0x124d76
movq %rbx, %rdi
movl $0x901, %ecx            # imm = 0x901
jmp 0xdcc01
leaq 0x876e(%rip), %rsi      # 0xe5004
leaq 0x484f8(%rip), %rdx     # 0x124d95
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x400, %ecx            # imm = 0x400
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x8775(%rip), %rsi      # 0xe5034
leaq 0x484b0(%rip), %rdx     # 0x124d76
movq %rbx, %rdi
movl $0x921, %ecx            # imm = 0x921
jmp 0xdcc01
leaq 0x872a(%rip), %rsi      # 0xe5004
leaq 0x484c1(%rip), %rdx     # 0x124da2
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x1800, %ecx           # imm = 0x1800
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x8731(%rip), %rsi      # 0xe5034
leaq 0x4846c(%rip), %rdx     # 0x124d76
movq %rbx, %rdi
movl $0x922, %ecx            # imm = 0x922
jmp 0xdcc01
leaq 0x86e6(%rip), %rsi      # 0xe5004
leaq 0x4848f(%rip), %rdx     # 0x124db4
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x400, %ecx            # imm = 0x400
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x86ed(%rip), %rsi      # 0xe5034
leaq 0x48428(%rip), %rdx     # 0x124d76
movq %rbx, %rdi
movl $0x923, %ecx            # imm = 0x923
jmp 0xdcc01
leaq 0x86a2(%rip), %rsi      # 0xe5004
leaq 0x48461(%rip), %rdx     # 0x124dca
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x400, %ecx            # imm = 0x400
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x86a9(%rip), %rsi      # 0xe5034
leaq 0x483e4(%rip), %rdx     # 0x124d76
movq %rbx, %rdi
movl $0x924, %ecx            # imm = 0x924
jmp 0xdcc01
movaps 0x4652a(%rip), %xmm0    # 0x122ed0
movups %xmm0, 0xb0(%r12)
movabsq $0x3f1a36e2eb1c432d, %rax # imm = 0x3F1A36E2EB1C432D
movq %rax, (%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x8(%rbp,%rcx,8)
movq 0x8(%rsp), %rcx
movsd 0xa28(%rcx), %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 0x9d21(%rip), %xmm1     # 0xe6740
mulsd 0xcf89(%rip), %xmm1     # 0xe99b0
mulsd 0xd0b9(%rip), %xmm1     # 0xe9ae8
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 0x87ff(%rip), %xmm2     # 0xe5260
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 0xdcbb2
leaq 0x48328(%rip), %rsi     # 0x124e00
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x8594(%rip), %rsi      # 0xe5082
leaq 0x48343(%rip), %rdx     # 0x124e38
leaq 0x810(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x851c(%rip), %rsi      # 0xe5034
leaq 0x48257(%rip), %rdx     # 0x124d76
movq %rbx, %rdi
movl $0x946, %ecx            # imm = 0x946
movq %r15, %r8
jmp 0xdcc04
leaq 0x84ce(%rip), %rsi      # 0xe5004
leaq 0x482a5(%rip), %rdx     # 0x124de2
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl $0x400, %ecx            # imm = 0x400
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x84d5(%rip), %rsi      # 0xe5034
leaq 0x48210(%rip), %rdx     # 0x124d76
movq %rbx, %rdi
movl $0x925, %ecx            # imm = 0x925
jmp 0xdcc01
leaq 0x848a(%rip), %rsi      # 0xe5004
leaq 0x48270(%rip), %rdx     # 0x124df1
leaq 0x10(%rsp), %r14
pushq $0x18
popq %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x8493(%rip), %rsi      # 0xe5034
leaq 0x481ce(%rip), %rdx     # 0x124d76
movq %rbx, %rdi
movl $0x926, %ecx            # imm = 0x926
jmp 0xdcc01
movq %r14, %rsi
callq 0xdcc24
testl %eax, %eax
je 0xdcc20
movl $0x100, %ecx            # imm = 0x100
addq 0x70(%r14), %rcx
leaq 0x8822(%rip), %rsi      # 0xe53f0
leaq 0x48275(%rip), %rdx     # 0x124e4a
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x8442(%rip), %rsi      # 0xe5034
leaq 0x4817d(%rip), %rdx     # 0x124d76
movq %rbx, %rdi
movl $0x94a, %ecx            # imm = 0x94A
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x1018, %rsp           # imm = 0x1018
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0xdcc0e