// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x78, %rsp
movq %rdi, 0x70(%rsp)
movsd %xmm0, 0x68(%rsp)
movq %rsi, 0x60(%rsp)
movsd 0x68(%rsp), %xmm0
movq 0x70(%rsp), %rax
ucomisd 0x30(%rax), %xmm0
jbe 0x1a1ac4
movq 0x70(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x48(%rsp)
movq 0x70(%rsp), %rax
movsd 0x20(%rax), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x40(%rsp)
movq 0x70(%rsp), %rax
movsd 0x307db(%rip), %xmm0    # 0x1d2248
addsd 0x28(%rax), %xmm0
movq 0x70(%rsp), %rax
movsd 0x307c9(%rip), %xmm1    # 0x1d2248
addsd 0x30(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x82f0
movsd 0x311eb(%rip), %xmm1    # 0x1d2c80
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x40(%rsp), %xmm0
mulsd %xmm1, %xmm0
callq 0x8670
movaps %xmm0, %xmm1
movsd 0x48(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
jmp 0x1a1c9b
movsd 0x68(%rsp), %xmm0
movq 0x70(%rsp), %rax
ucomisd 0x38(%rax), %xmm0
jbe 0x1a1bba
movq 0x70(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x70(%rsp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x70(%rsp), %rax
movsd 0x30742(%rip), %xmm0    # 0x1d2248
addsd 0x28(%rax), %xmm0
movq 0x70(%rsp), %rax
movsd 0x30730(%rip), %xmm1    # 0x1d2248
addsd 0x30(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x82f0
movsd 0x31152(%rip), %xmm1    # 0x1d2c80
callq 0x8610
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x306f0(%rip), %xmm0    # 0x1d2248
addsd 0x68(%rsp), %xmm0
movq 0x70(%rsp), %rax
movsd 0x306dd(%rip), %xmm1    # 0x1d2248
addsd 0x30(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x82f0
movsd 0x310ff(%rip), %xmm1    # 0x1d2c80
callq 0x8610
movsd 0x28(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x30(%rsp), %xmm0
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
callq 0x8670
movaps %xmm0, %xmm1
movsd 0x38(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
jmp 0x1a1c99
movq 0x70(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x70(%rsp), %rax
movsd 0x20(%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x70(%rsp), %rax
movsd 0x30662(%rip), %xmm0    # 0x1d2248
addsd 0x28(%rax), %xmm0
movq 0x70(%rsp), %rax
movsd 0x30650(%rip), %xmm1    # 0x1d2248
addsd 0x30(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x82f0
movsd 0x31072(%rip), %xmm1    # 0x1d2c80
callq 0x8610
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x70(%rsp), %rax
movsd 0x3060b(%rip), %xmm0    # 0x1d2248
addsd 0x38(%rax), %xmm0
movq 0x70(%rsp), %rax
movsd 0x305f9(%rip), %xmm1    # 0x1d2248
addsd 0x30(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x82f0
movsd 0x3101b(%rip), %xmm1    # 0x1d2c80
callq 0x8610
movsd 0x10(%rsp), %xmm1
movaps %xmm0, %xmm2
movsd 0x18(%rsp), %xmm0
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
callq 0x8670
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
jmp 0x1a1c9b
movq 0x70(%rsp), %rax
movsd 0x48(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1a1d28
movq 0x70(%rsp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, (%rsp)
movsd 0x30583(%rip), %xmm0    # 0x1d2248
addsd 0x68(%rsp), %xmm0
movq 0x70(%rsp), %rax
movsd 0x30570(%rip), %xmm1    # 0x1d2248
addsd 0x48(%rax), %xmm1
divsd %xmm1, %xmm0
callq 0x8600
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x30548(%rip), %xmm0    # 0x1d2248
addsd 0x68(%rsp), %xmm0
movsd 0x3198a(%rip), %xmm1    # 0x1d3698
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
jmp 0x1a1d31
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x70(%rsp), %rax
movsd 0x410(%rax), %xmm0
movsd 0x30f3a(%rip), %xmm1    # 0x1d2c80
callq 0x8610
mulsd 0x58(%rsp), %xmm0
movsd 0x304ef(%rip), %xmm1    # 0x1d2248
addsd 0x50(%rsp), %xmm1
mulsd %xmm1, %xmm0
movq 0x60(%rsp), %rax
movsd %xmm0, (%rax)
xorl %eax, %eax
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)