// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/transfer.c
// Function: transfer_f_evo
int transfer_f_evo(
                   struct background* pba,
                   struct transfer * ptr,
                   double* pvecback,
                   int last_index,
                   double cotKgen, /* Should be FILLED with values of corresponding time */
                   double* f_evo
                   ){
  /* Allocate temporary variables for calculation of f_evo */
  double z;
  double dNdz;
  double dln_dNdz_dz;
  double temp_f_evo;

  if ((ptr->has_nz_evo_file == _TRUE_) || (ptr->has_nz_evo_analytic == _TRUE_)){

    temp_f_evo = 2./pvecback[pba->index_bg_H]/pvecback[pba->index_bg_a]*cotKgen
      + pvecback[pba->index_bg_H_prime]/pvecback[pba->index_bg_H]/pvecback[pba->index_bg_H]/pvecback[pba->index_bg_a];

    /* z = a_0/a-1 (remember that a in the code is in fact a/a_0) */
    z = 1./pvecback[pba->index_bg_a]-1.;

    if (ptr->has_nz_evo_file ==_TRUE_) {

      class_test((z<ptr->nz_evo_z[0]) || (z>ptr->nz_evo_z[ptr->nz_evo_size-1]),
                 ptr->error_message,
                 "Your input file for the selection function only covers the redshift range [%f : %f]. However, your input for the selection function requires z=%f",
                 ptr->nz_evo_z[0],
                 ptr->nz_evo_z[ptr->nz_evo_size-1],
                 z);


      class_call(array_interpolate_spline(
                                          ptr->nz_evo_z,
                                          ptr->nz_evo_size,
                                          ptr->nz_evo_dlog_nz,
                                          ptr->nz_evo_dd_dlog_nz,
                                          1,
                                          z,
                                          &last_index,
                                          &dln_dNdz_dz,
                                          1,
                                          ptr->error_message),
                 ptr->error_message,
                 ptr->error_message);

    }
    else {

      class_call(transfer_dNdz_analytic(ptr,
                                        z,
                                        &dNdz,
                                        &dln_dNdz_dz),
                 ptr->error_message,
                 ptr->error_message);
    }

    temp_f_evo -= dln_dNdz_dz/pvecback[pba->index_bg_a];
  }
  else {
    temp_f_evo = 0.;
  }

  /* after obtaining f_evo, store it in output */
  *f_evo = temp_f_evo;

  return _SUCCESS_;
}

// Assembly:
subq $0x2078, %rsp           # imm = 0x2078
movq %rdi, 0x2068(%rsp)
movq %rsi, 0x2060(%rsp)
movq %rdx, 0x2058(%rsp)
movl %ecx, 0x2054(%rsp)
movsd %xmm0, 0x2048(%rsp)
movq %r8, 0x2040(%rsp)
movq 0x2060(%rsp), %rax
movswl 0x778(%rax), %eax
cmpl $0x1, %eax
je 0x148cc3
movq 0x2060(%rsp), %rax
movswl 0x77a(%rax), %eax
cmpl $0x1, %eax
jne 0x1490ba
movq 0x2058(%rsp), %rax
movq 0x2068(%rsp), %rcx
movslq 0x384(%rcx), %rcx
movsd 0x89f9e(%rip), %xmm0    # 0x1d2c80
divsd (%rax,%rcx,8), %xmm0
movq 0x2058(%rsp), %rax
movq 0x2068(%rsp), %rcx
movslq 0x380(%rcx), %rcx
divsd (%rax,%rcx,8), %xmm0
movsd 0x2048(%rsp), %xmm2
movq 0x2058(%rsp), %rax
movq 0x2068(%rsp), %rcx
movslq 0x388(%rcx), %rcx
movsd (%rax,%rcx,8), %xmm1
movq 0x2058(%rsp), %rax
movq 0x2068(%rsp), %rcx
movslq 0x384(%rcx), %rcx
divsd (%rax,%rcx,8), %xmm1
movq 0x2058(%rsp), %rax
movq 0x2068(%rsp), %rcx
movslq 0x384(%rcx), %rcx
divsd (%rax,%rcx,8), %xmm1
movq 0x2058(%rsp), %rax
movq 0x2068(%rsp), %rcx
movslq 0x380(%rcx), %rcx
divsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x2020(%rsp)
movq 0x2058(%rsp), %rax
movq 0x2068(%rsp), %rcx
movslq 0x380(%rcx), %rcx
movsd 0x8949c(%rip), %xmm0    # 0x1d2248
divsd (%rax,%rcx,8), %xmm0
movsd 0x8948f(%rip), %xmm1    # 0x1d2248
subsd %xmm1, %xmm0
movsd %xmm0, 0x2038(%rsp)
movq 0x2060(%rsp), %rax
movswl 0x778(%rax), %eax
cmpl $0x1, %eax
jne 0x148fec
movsd 0x2038(%rsp), %xmm1
movq 0x2060(%rsp), %rax
movq 0x880(%rax), %rax
movsd (%rax), %xmm0
ucomisd %xmm1, %xmm0
ja 0x148e37
movsd 0x2038(%rsp), %xmm0
movq 0x2060(%rsp), %rax
movq 0x880(%rax), %rax
movq 0x2060(%rsp), %rcx
movl 0x87c(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
ucomisd (%rax,%rcx,8), %xmm0
jbe 0x148ef7
leaq 0x1820(%rsp), %rdi
movq 0x2060(%rsp), %rax
movq 0x880(%rax), %rax
movsd (%rax), %xmm0
movq 0x2060(%rsp), %rax
movq 0x880(%rax), %rax
movq 0x2060(%rsp), %rcx
movl 0x87c(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movsd 0x2038(%rsp), %xmm2
leaq 0xbae65(%rip), %rsi     # 0x203cef
movb $0x3, %al
callq 0x5b9c0
leaq 0x1020(%rsp), %rdi
leaq 0x1820(%rsp), %rcx
leaq 0x891da(%rip), %rsi     # 0x1d2082
leaq 0xbc83b(%rip), %rdx     # 0x2056ea
movb $0x0, %al
callq 0x5b9c0
movq 0x2060(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x1020(%rsp), %r8
leaq 0x89160(%rip), %rsi     # 0x1d2034
leaq 0xbc84d(%rip), %rdx     # 0x205728
movl $0x14c8, %ecx           # imm = 0x14C8
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2074(%rsp)
jmp 0x1490e6
movq 0x2060(%rsp), %rax
movq 0x880(%rax), %rdi
movq 0x2060(%rsp), %rax
movl 0x87c(%rax), %esi
movq 0x2060(%rsp), %rax
movq 0x890(%rax), %rdx
movq 0x2060(%rsp), %rax
movq 0x898(%rax), %rcx
movsd 0x2038(%rsp), %xmm0
movq 0x2060(%rsp), %rax
addq $0x96a, %rax            # imm = 0x96A
movl $0x1, %r8d
leaq 0x2054(%rsp), %r9
leaq 0x2028(%rsp), %r10
movq %r10, (%rsp)
movl $0x1, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x24220
cmpl $0x1, %eax
jne 0x148fe7
leaq 0x820(%rsp), %rdi
movq 0x2060(%rsp), %rcx
addq $0x96a, %rcx            # imm = 0x96A
leaq 0x89440(%rip), %rsi     # 0x1d23d8
leaq 0xbc798(%rip), %rdx     # 0x205737
movb $0x0, %al
callq 0x5b9c0
movq 0x2060(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x820(%rsp), %r8
leaq 0x89070(%rip), %rsi     # 0x1d2034
leaq 0xbc75d(%rip), %rdx     # 0x205728
movl $0x14d7, %ecx           # imm = 0x14D7
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2074(%rsp)
jmp 0x1490e6
jmp 0x14907d
movq 0x2060(%rsp), %rdi
movsd 0x2038(%rsp), %xmm0
leaq 0x2030(%rsp), %rsi
leaq 0x2028(%rsp), %rdx
callq 0x142220
cmpl $0x1, %eax
jne 0x14907b
leaq 0x20(%rsp), %rdi
movq 0x2060(%rsp), %rcx
addq $0x96a, %rcx            # imm = 0x96A
leaq 0x893a6(%rip), %rsi     # 0x1d23d8
leaq 0xbae14(%rip), %rdx     # 0x203e4d
movb $0x0, %al
callq 0x5b9c0
movq 0x2060(%rsp), %rdi
addq $0x96a, %rdi            # imm = 0x96A
leaq 0x20(%rsp), %r8
leaq 0x88fd9(%rip), %rsi     # 0x1d2034
leaq 0xbc6c6(%rip), %rdx     # 0x205728
movl $0x14e1, %ecx           # imm = 0x14E1
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x2074(%rsp)
jmp 0x1490e6
jmp 0x14907d
movsd 0x2028(%rsp), %xmm1
movq 0x2058(%rsp), %rax
movq 0x2068(%rsp), %rcx
movslq 0x380(%rcx), %rcx
divsd (%rax,%rcx,8), %xmm1
movsd 0x2020(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x2020(%rsp)
jmp 0x1490c6
xorps %xmm0, %xmm0
movsd %xmm0, 0x2020(%rsp)
movsd 0x2020(%rsp), %xmm0
movq 0x2040(%rsp), %rax
movsd %xmm0, (%rax)
movl $0x0, 0x2074(%rsp)
movl 0x2074(%rsp), %eax
addq $0x2078, %rsp           # imm = 0x2078
retq
nopw %cs:(%rax,%rax)