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

  /** - Define local variables */
  int last_index_back;
  double mass, f;
  double dMdt, f_em;

  /** - Interpolate the PBH mass evolution */
  class_call(array_interpolate_spline(pin->PBH_table_z,
                                      pin->Nz_PBH,
                                      pin->PBH_table_mass,
                                      pin->PBH_table_mass_dd,
                                      1,
                                      z,
                                      &last_index_back,
                                      &mass,                                                        // [g]
                                      1,
                                      pin->error_message),
             pin->error_message,
             pin->error_message);

  class_call(array_interpolate_spline(pin->PBH_table_z,
                                      pin->Nz_PBH,
                                      pin->PBH_table_F,
                                      pin->PBH_table_F_dd,
                                      1,
                                      z,
                                      &last_index_back,
                                      &f,                                                           // [-]
                                      1,
                                      pin->error_message),
             pin->error_message,
             pin->error_message);

  /** - Calculate injection rates */
  if(mass <= 0.0001*pin->PBH_evaporation_mass || f <= 0 || z < pin->PBH_z_evaporation){
    *energy_rate = 0.;                                                                                // [J/(m^3 s)]
  }
  else {
    dMdt=5.34e25*f*pow(mass,-2.);                                                                     // [g/s]
    f_em = 0.55*pin->PBH_QCD_activation+(1-pin->PBH_QCD_activation)*(f-6.*0.147)/f;                   // [-]
    *energy_rate = pin->rho_cdm*pin->PBH_evaporation_fraction*f_em*dMdt/pin->PBH_evaporation_mass;    // [J/(m^3 s)]
  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x828, %rsp            # imm = 0x828
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4c0(%rdi), %esi
movq 0x498(%rdi), %rdi
movq 0x4a0(%r14), %rdx
movq 0x4a8(%r14), %rcx
leaq 0x570(%r14), %r15
subq $0x8, %rsp
leaq 0x20(%rsp), %rax
movl $0x1, %ebp
leaq 0x14(%rsp), %r9
movl $0x1, %r8d
movsd %xmm0, 0x8(%rsp)
pushq %r15
pushq $0x1
pushq %rax
callq 0x17ee6
addq $0x20, %rsp
cmpl $0x1, %eax
jne 0xd52a3
leaq 0x1c181(%rip), %rsi     # 0xf13f0
leaq 0x56fb9(%rip), %rdx     # 0x12c22f
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x1bda5(%rip), %rsi     # 0xf1034
leaq 0x57034(%rip), %rdx     # 0x12c2ca
movq %r15, %rdi
movl $0x3a6, %ecx            # imm = 0x3A6
jmp 0xd5327
movl 0x4c0(%r14), %esi
movq 0x498(%r14), %rdi
movq 0x4b0(%r14), %rdx
movq 0x4b8(%r14), %rcx
subq $0x8, %rsp
leaq 0x18(%rsp), %rax
movl $0x1, %ebp
leaq 0x14(%rsp), %r9
movl $0x1, %r8d
movsd 0x8(%rsp), %xmm0
pushq %r15
pushq $0x1
pushq %rax
callq 0x17ee6
addq $0x20, %rsp
cmpl $0x1, %eax
jne 0xd5336
leaq 0x1c0f8(%rip), %rsi     # 0xf13f0
leaq 0x56fea(%rip), %rdx     # 0x12c2e9
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x1bd1c(%rip), %rsi     # 0xf1034
leaq 0x56fab(%rip), %rdx     # 0x12c2ca
movq %r15, %rdi
movl $0x3b3, %ecx            # imm = 0x3B3
movq %rbx, %r8
xorl %eax, %eax
callq 0x30c2c
jmp 0xd53fd
movsd 0x68(%r14), %xmm1
mulsd 0x1c9f4(%rip), %xmm1    # 0xf1d38
movsd 0x18(%rsp), %xmm0
ucomisd %xmm0, %xmm1
xorpd %xmm1, %xmm1
jae 0xd53f7
movsd 0x10(%rsp), %xmm3
xorpd %xmm2, %xmm2
ucomisd %xmm3, %xmm2
jae 0xd53f7
movsd 0x488(%r14), %xmm1
ucomisd (%rsp), %xmm1
xorpd %xmm1, %xmm1
ja 0xd53f7
mulsd 0x56298(%rip), %xmm3    # 0x12b620
movsd %xmm3, (%rsp)
movsd 0x1d3c3(%rip), %xmm1    # 0xf2758
callq 0x8620
mulsd (%rsp), %xmm0
movsd 0x410(%r14), %xmm1
movsd 0x490(%r14), %xmm2
movsd 0x1bea7(%rip), %xmm3    # 0xf1260
subsd %xmm2, %xmm3
movsd 0x10(%rsp), %xmm4
movsd 0x5625d(%rip), %xmm5    # 0x12b628
addsd %xmm4, %xmm5
mulsd %xmm3, %xmm5
mulsd 0x56255(%rip), %xmm2    # 0x12b630
divsd %xmm4, %xmm5
addsd %xmm5, %xmm2
mulsd 0x60(%r14), %xmm1
mulsd %xmm2, %xmm1
mulsd %xmm0, %xmm1
divsd 0x68(%r14), %xmm1
movsd %xmm1, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r14
popq %r15
popq %rbp
retq