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

  int last_index;
  double *pvecback;
  double tau_growth;
  double g_lcdm,g_wcdm;
  double w0,dw_over_da_fld,integral_fld;
  double h,a,b;
  double growth;

  /** - if there is dynamical Dark Energy (w is not -1) modeled as a fluid */

  if (pba->has_fld==_TRUE_){

    class_alloc(pvecback,pba->bg_size*sizeof(double),pfo->error_message);

    class_call(background_tau_of_z(pba,pfo->z_infinity,&tau_growth),
               pba->error_message,
               pfo->error_message);

    class_call(background_at_tau(pba,tau_growth,long_info,inter_normal,&last_index,pvecback),
               pba->error_message,
               pfo->error_message);

    class_call(background_w_fld(pba,1.,&w0,&dw_over_da_fld,&integral_fld),
               pba->error_message,
               pfo->error_message);

    class_call(hmcode_growint(ppr,pba,pfo,1./(1.+pfo->z_infinity),-1.,0.,&g_lcdm),
               pfo->error_message, pfo->error_message);

    class_call(hmcode_growint(ppr,pba,pfo,1./(1.+pfo->z_infinity),w0,dw_over_da_fld*(-1.),&g_wcdm),
               pfo->error_message,
               pfo->error_message);

    free(pvecback);

    switch( pfo->hm_version ){
    case hmcode_version_2015:
      phw->dark_energy_correction = pow(g_wcdm/g_lcdm, 1.5);
      break;
    case hmcode_version_2020:
    case hmcode_version_2020_unfitted:
    case hmcode_version_2020_baryonic:
      //phw->dark_energy_correction = g_wcdm/g_lcdm; //Here, we are missing the redshift dependence, which we include only within the respective function
      //hmcode_norad(phw->phg,1./(pfo->z_infinity+1.));
      class_call(array_spline_hunt(phw->phg->a_table,
                                   phw->phg->a_size,
                                   1./(pfo->z_infinity+1.),
                                   &last_index,
                                   &h,
                                   &a,
                                   &b,
                                   pfo->error_message),
                 pfo->error_message,
                 pfo->error_message);

      growth = array_spline_eval(phw->phg->normgrowth_table,phw->phg->ddnormgrowth_table,last_index,last_index+1,h,a,b);
      phw->dark_energy_correction = growth/g_lcdm;
      break;
    }
  }

  /** - otherwise, we assume no dynamical Dark Energy (w is -1) */

  else {
    phw->dark_energy_correction = 1.;
  }

  return _SUCCESS_;
}

// Assembly:
subq $0x38a8, %rsp           # imm = 0x38A8
movq %rdi, 0x3898(%rsp)
movq %rsi, 0x3890(%rsp)
movq %rdx, 0x3888(%rsp)
movq %rcx, 0x3880(%rsp)
movq 0x3890(%rsp), %rax
movswl 0x4c2(%rax), %eax
cmpl $0x1, %eax
jne 0x1bddd7
movq 0x3890(%rsp), %rax
movslq 0x43c(%rax), %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x3870(%rsp)
cmpq $0x0, 0x3870(%rsp)
jne 0x1bd7b9
movq 0x3890(%rsp), %rax
movslq 0x43c(%rax), %rax
shlq $0x3, %rax
movl %eax, 0x381c(%rsp)
leaq 0x3010(%rsp), %rdi
movl 0x381c(%rsp), %ecx
leaq 0x1489a(%rip), %rsi     # 0x1d2004
leaq 0x3bb06(%rip), %rdx     # 0x1f9277
movb $0x0, %al
callq 0x5b9c0
movq 0x3888(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x3010(%rsp), %r8
leaq 0x1489e(%rip), %rsi     # 0x1d2034
leaq 0x53cd2(%rip), %rdx     # 0x21146f
movl $0x413, %ecx            # imm = 0x413
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x38a4(%rsp)
jmp 0x1bddf7
movq 0x3890(%rsp), %rdi
movq 0x3888(%rsp), %rax
movsd 0x20(%rax), %xmm0
leaq 0x3868(%rsp), %rsi
callq 0x9ee00
cmpl $0x1, %eax
jne 0x1bd84d
leaq 0x2810(%rsp), %rdi
movq 0x3890(%rsp), %rcx
addq $0xd1c, %rcx            # imm = 0xD1C
leaq 0x14bda(%rip), %rsi     # 0x1d23d8
leaq 0x53c88(%rip), %rdx     # 0x21148d
movb $0x0, %al
callq 0x5b9c0
movq 0x3888(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x2810(%rsp), %r8
leaq 0x1480a(%rip), %rsi     # 0x1d2034
leaq 0x53c3e(%rip), %rdx     # 0x21146f
movl $0x417, %ecx            # imm = 0x417
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x38a4(%rsp)
jmp 0x1bddf7
movq 0x3890(%rsp), %rdi
movsd 0x3868(%rsp), %xmm0
movq 0x3870(%rsp), %r8
movl $0x2, %esi
xorl %edx, %edx
leaq 0x387c(%rsp), %rcx
callq 0x9e9b0
cmpl $0x1, %eax
jne 0x1bd8ec
leaq 0x2010(%rsp), %rdi
movq 0x3890(%rsp), %rcx
addq $0xd1c, %rcx            # imm = 0xD1C
leaq 0x14b3b(%rip), %rsi     # 0x1d23d8
leaq 0x53c1e(%rip), %rdx     # 0x2114c2
movb $0x0, %al
callq 0x5b9c0
movq 0x3888(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x2010(%rsp), %r8
leaq 0x1476b(%rip), %rsi     # 0x1d2034
leaq 0x53b9f(%rip), %rdx     # 0x21146f
movl $0x41b, %ecx            # imm = 0x41B
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x38a4(%rsp)
jmp 0x1bddf7
movq 0x3890(%rsp), %rdi
movsd 0x1494c(%rip), %xmm0    # 0x1d2248
leaq 0x3850(%rsp), %rsi
leaq 0x3848(%rsp), %rdx
leaq 0x3840(%rsp), %rcx
callq 0xa1970
cmpl $0x1, %eax
jne 0x1bd98b
leaq 0x1810(%rsp), %rdi
movq 0x3890(%rsp), %rcx
addq $0xd1c, %rcx            # imm = 0xD1C
leaq 0x14a9c(%rip), %rsi     # 0x1d23d8
leaq 0x53bcd(%rip), %rdx     # 0x211510
movb $0x0, %al
callq 0x5b9c0
movq 0x3888(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x1810(%rsp), %r8
leaq 0x146cc(%rip), %rsi     # 0x1d2034
leaq 0x53b00(%rip), %rdx     # 0x21146f
movl $0x41f, %ecx            # imm = 0x41F
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x38a4(%rsp)
jmp 0x1bddf7
movq 0x3898(%rsp), %rdi
movq 0x3890(%rsp), %rsi
movq 0x3888(%rsp), %rdx
movq 0x3888(%rsp), %rax
movsd 0x14895(%rip), %xmm1    # 0x1d2248
addsd 0x20(%rax), %xmm1
movsd 0x14888(%rip), %xmm0    # 0x1d2248
divsd %xmm1, %xmm0
movsd 0x14e04(%rip), %xmm1    # 0x1d27d0
xorps %xmm2, %xmm2
leaq 0x3860(%rsp), %rcx
callq 0x1bbb60
cmpl $0x1, %eax
jne 0x1bda4e
leaq 0x1010(%rsp), %rdi
movq 0x3888(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x149d9(%rip), %rsi     # 0x1d23d8
leaq 0x53b45(%rip), %rdx     # 0x21154b
movb $0x0, %al
callq 0x5b9c0
movq 0x3888(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x1010(%rsp), %r8
leaq 0x14609(%rip), %rsi     # 0x1d2034
leaq 0x53a3d(%rip), %rdx     # 0x21146f
movl $0x422, %ecx            # imm = 0x422
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x38a4(%rsp)
jmp 0x1bddf7
movq 0x3898(%rsp), %rdi
movq 0x3890(%rsp), %rsi
movq 0x3888(%rsp), %rdx
movq 0x3888(%rsp), %rax
movsd 0x147d2(%rip), %xmm1    # 0x1d2248
addsd 0x20(%rax), %xmm1
movsd 0x147c5(%rip), %xmm0    # 0x1d2248
divsd %xmm1, %xmm0
movsd 0x3850(%rsp), %xmm1
movsd 0x14d38(%rip), %xmm2    # 0x1d27d0
mulsd 0x3848(%rsp), %xmm2
leaq 0x3858(%rsp), %rcx
callq 0x1bbb60
cmpl $0x1, %eax
jne 0x1bdb20
leaq 0x810(%rsp), %rdi
movq 0x3888(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x14907(%rip), %rsi     # 0x1d23d8
leaq 0x53ab6(%rip), %rdx     # 0x21158e
movb $0x0, %al
callq 0x5b9c0
movq 0x3888(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x810(%rsp), %r8
leaq 0x14537(%rip), %rsi     # 0x1d2034
leaq 0x5396b(%rip), %rdx     # 0x21146f
movl $0x426, %ecx            # imm = 0x426
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x38a4(%rsp)
jmp 0x1bddf7
movq 0x3870(%rsp), %rdi
callq 0x8420
movq 0x3888(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0xc(%rsp)
testl %eax, %eax
je 0x1bdb52
jmp 0x1bdb42
movl 0xc(%rsp), %eax
decl %eax
subl $0x3, %eax
jb 0x1bdb83
jmp 0x1bddd5
movsd 0x3858(%rsp), %xmm0
divsd 0x3860(%rsp), %xmm0
movsd 0x150e4(%rip), %xmm1    # 0x1d2c50
callq 0x8610
movq 0x3880(%rsp), %rax
movsd %xmm0, 0x50(%rax)
jmp 0x1bddd5
movq 0x3880(%rsp), %rax
movq 0x70(%rax), %rax
movq (%rax), %rdi
movq 0x3880(%rsp), %rax
movq 0x70(%rax), %rax
movl 0x8(%rax), %esi
movq 0x3888(%rsp), %rax
movsd 0x14697(%rip), %xmm1    # 0x1d2248
addsd 0x20(%rax), %xmm1
movsd 0x1468a(%rip), %xmm0    # 0x1d2248
divsd %xmm1, %xmm0
movq 0x3888(%rsp), %rax
addq $0x192, %rax            # imm = 0x192
leaq 0x387c(%rsp), %rdx
leaq 0x3838(%rsp), %rcx
leaq 0x3830(%rsp), %r8
leaq 0x3828(%rsp), %r9
movq %rax, (%rsp)
callq 0x27de0
cmpl $0x1, %eax
jne 0x1bdc65
leaq 0x10(%rsp), %rdi
movq 0x3888(%rsp), %rcx
addq $0x192, %rcx            # imm = 0x192
leaq 0x147bf(%rip), %rsi     # 0x1d23d8
leaq 0x539c2(%rip), %rdx     # 0x2115e2
movb $0x0, %al
callq 0x5b9c0
movq 0x3888(%rsp), %rdi
addq $0x192, %rdi            # imm = 0x192
leaq 0x10(%rsp), %r8
leaq 0x143f2(%rip), %rsi     # 0x1d2034
leaq 0x53826(%rip), %rdx     # 0x21146f
movl $0x43c, %ecx            # imm = 0x43C
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x38a4(%rsp)
jmp 0x1bddf7
movsd 0x3830(%rsp), %xmm0
movq 0x3880(%rsp), %rax
movq 0x70(%rax), %rax
movq 0x18(%rax), %rax
movslq 0x387c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd 0x3828(%rsp), %xmm1
movq 0x3880(%rsp), %rax
movq 0x70(%rax), %rax
movq 0x18(%rax), %rax
movl 0x387c(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
mulsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd 0x3830(%rsp), %xmm1
mulsd 0x3830(%rsp), %xmm1
movsd 0x3830(%rsp), %xmm3
movsd 0x3830(%rsp), %xmm2
movq %xmm2, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
movq 0x3880(%rsp), %rax
movq 0x70(%rax), %rax
movq 0x20(%rax), %rax
movslq 0x387c(%rsp), %rcx
movsd (%rax,%rcx,8), %xmm3
movsd 0x3828(%rsp), %xmm2
mulsd 0x3828(%rsp), %xmm2
movsd 0x3828(%rsp), %xmm5
movsd 0x3828(%rsp), %xmm4
movq %xmm4, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm4
mulsd %xmm5, %xmm2
addsd %xmm4, %xmm2
movq 0x3880(%rsp), %rax
movq 0x70(%rax), %rax
movq 0x20(%rax), %rax
movl 0x387c(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
mulsd (%rax,%rcx,8), %xmm2
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd 0x3838(%rsp), %xmm1
mulsd 0x3838(%rsp), %xmm1
movsd 0x158e3(%rip), %xmm2    # 0x1d3688
divsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x3820(%rsp)
movsd 0x3820(%rsp), %xmm0
divsd 0x3860(%rsp), %xmm0
movq 0x3880(%rsp), %rax
movsd %xmm0, 0x50(%rax)
jmp 0x1bddec
movq 0x3880(%rsp), %rax
movsd 0x14461(%rip), %xmm0    # 0x1d2248
movsd %xmm0, 0x50(%rax)
movl $0x0, 0x38a4(%rsp)
movl 0x38a4(%rsp), %eax
addq $0x38a8, %rsp           # imm = 0x38A8
retq
nopw %cs:(%rax,%rax)