// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../external/heating/injection.c
// Function: injection_rate_DM_annihilation
int injection_rate_DM_annihilation(struct injection * pin,
                                   double z,
                                   double * energy_rate){

  /** - Define local variables */
  double annihilation_at_z, boost_factor;

  /** - Calculate change in the annihilation efficiency */
  if (z>pin->DM_annihilation_zmax) {
    annihilation_at_z = pin->DM_annihilation_efficiency*
                        exp(-pin->DM_annihilation_variation*pow(log((pin->DM_annihilation_z+1.)/(pin->DM_annihilation_zmax+1.)),2));
  }
  else if (z>pin->DM_annihilation_zmin) {
    annihilation_at_z = pin->DM_annihilation_efficiency*
                        exp(pin->DM_annihilation_variation*(-pow(log((pin->DM_annihilation_z+1.)/(pin->DM_annihilation_zmax+1.)),2)
                                         +pow(log((z+1.)/(pin->DM_annihilation_zmax+1.)),2)));
  }
  else {
    annihilation_at_z = pin->DM_annihilation_efficiency*
                        exp(pin->DM_annihilation_variation*(-pow(log((pin->DM_annihilation_z+1.)/(pin->DM_annihilation_zmax+1.)),2)
                                         +pow(log((pin->DM_annihilation_zmin+1.)/(pin->DM_annihilation_zmax+1.)),2)));
  }

  /** - Calculate boost factor due to annihilation in halos */
  if(pin->DM_annihilation_z_halo > 0.){
    boost_factor = pin->DM_annihilation_f_halo * erfc((1+z)/(1+pin->DM_annihilation_z_halo)) / pow(1.+z,3);
  }
  else{
    boost_factor = 0;
  }

  /** - Calculate injection rates */
  *energy_rate = pow(pin->rho_cdm,2.)*annihilation_at_z*(1.+boost_factor);           // [J/(m^3 s)]

  return _SUCCESS_;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd 0x30(%rdi), %xmm1
ucomisd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
jbe 0xc9fe8
movsd (%r14), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x20(%r14), %xmm0
xorps 0x1b27b(%rip), %xmm0    # 0xe5230
movaps %xmm0, 0x10(%rsp)
movsd 0x1b29e(%rip), %xmm2    # 0xe5260
movsd 0x28(%r14), %xmm0
addsd %xmm2, %xmm0
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x82e0
mulsd %xmm0, %xmm0
mulsd 0x10(%rsp), %xmm0
jmp 0xca08f
movsd 0x38(%r14), %xmm2
movsd %xmm2, 0x30(%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x20(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x1b24d(%rip), %xmm2    # 0xe5260
movsd 0x28(%r14), %xmm0
addsd %xmm2, %xmm0
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x82e0
movsd %xmm0, (%rsp)
movsd 0x8(%rsp), %xmm0
ucomisd 0x30(%rsp), %xmm0
jbe 0xca051
movsd 0x1b21b(%rip), %xmm1    # 0xe5260
addsd %xmm1, %xmm0
addsd 0x30(%r14), %xmm1
jmp 0xca067
movupd 0x30(%r14), %xmm1
addpd 0x1e7f1(%rip), %xmm1    # 0xe8850
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
divsd %xmm1, %xmm0
callq 0x82e0
mulsd %xmm0, %xmm0
movsd (%rsp), %xmm1
mulsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm1
mulsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x86a0
movapd %xmm0, %xmm2
movsd 0x48(%r14), %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jbe 0xca118
movsd 0x40(%r14), %xmm0
movsd %xmm0, (%rsp)
movsd 0x1b1a5(%rip), %xmm0    # 0xe5260
movsd 0x8(%rsp), %xmm3
addsd %xmm0, %xmm3
movsd %xmm3, 0x8(%rsp)
addsd %xmm0, %xmm1
movapd %xmm3, %xmm0
divsd %xmm1, %xmm0
movsd %xmm2, 0x10(%rsp)
callq 0x8640
mulsd (%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x1c654(%rip), %xmm1    # 0xe6748
movsd 0x8(%rsp), %xmm0
callq 0x8650
movsd (%rsp), %xmm3
movsd 0x10(%rsp), %xmm2
divsd %xmm0, %xmm3
addsd 0x1b14a(%rip), %xmm3    # 0xe5260
jmp 0xca120
movsd 0x1b140(%rip), %xmm3    # 0xe5260
movsd 0x28(%rsp), %xmm1
mulsd %xmm2, %xmm1
movsd 0x410(%r14), %xmm0
mulsd %xmm0, %xmm0
mulsd %xmm1, %xmm0
mulsd %xmm3, %xmm0
movsd %xmm0, (%rbx)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r14
retq