// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x1068, %rsp           # imm = 0x1068
movq %rdi, 0x1058(%rsp)
movsd %xmm0, 0x1050(%rsp)
movq %rsi, 0x1048(%rsp)
movq 0x1058(%rsp), %rax
movq 0x498(%rax), %rdi
movq 0x1058(%rsp), %rax
movl 0x4c0(%rax), %esi
movq 0x1058(%rsp), %rax
movq 0x4a0(%rax), %rdx
movq 0x1058(%rsp), %rax
movq 0x4a8(%rax), %rcx
movsd 0x1050(%rsp), %xmm0
movq 0x1058(%rsp), %rax
addq $0x570, %rax            # imm = 0x570
movl $0x1, %r8d
leaq 0x1044(%rsp), %r9
leaq 0x1038(%rsp), %r10
movq %r10, (%rsp)
movl $0x1, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x24220
cmpl $0x1, %eax
jne 0x1a1f20
leaq 0x820(%rsp), %rdi
movq 0x1058(%rsp), %rcx
addq $0x570, %rcx            # imm = 0x570
leaq 0x30507(%rip), %rsi     # 0x1d23d8
leaq 0x6b90f(%rip), %rdx     # 0x20d7e7
movb $0x0, %al
callq 0x5b9c0
movq 0x1058(%rsp), %rdi
addq $0x570, %rdi            # imm = 0x570
leaq 0x820(%rsp), %r8
leaq 0x30137(%rip), %rsi     # 0x1d2034
leaq 0x6b97e(%rip), %rdx     # 0x20d882
movl $0x3a6, %ecx            # imm = 0x3A6
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1064(%rsp)
jmp 0x1a2168
movq 0x1058(%rsp), %rax
movq 0x498(%rax), %rdi
movq 0x1058(%rsp), %rax
movl 0x4c0(%rax), %esi
movq 0x1058(%rsp), %rax
movq 0x4b0(%rax), %rdx
movq 0x1058(%rsp), %rax
movq 0x4b8(%rax), %rcx
movsd 0x1050(%rsp), %xmm0
movq 0x1058(%rsp), %rax
addq $0x570, %rax            # imm = 0x570
movl $0x1, %r8d
leaq 0x1044(%rsp), %r9
leaq 0x1030(%rsp), %r10
movq %r10, (%rsp)
movl $0x1, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x24220
cmpl $0x1, %eax
jne 0x1a200a
leaq 0x20(%rsp), %rdi
movq 0x1058(%rsp), %rcx
addq $0x570, %rcx            # imm = 0x570
leaq 0x3041a(%rip), %rsi     # 0x1d23d8
leaq 0x6b8dc(%rip), %rdx     # 0x20d8a1
movb $0x0, %al
callq 0x5b9c0
movq 0x1058(%rsp), %rdi
addq $0x570, %rdi            # imm = 0x570
leaq 0x20(%rsp), %r8
leaq 0x3004d(%rip), %rsi     # 0x1d2034
leaq 0x6b894(%rip), %rdx     # 0x20d882
movl $0x3b3, %ecx            # imm = 0x3B3
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1064(%rsp)
jmp 0x1a2168
movsd 0x1038(%rsp), %xmm1
movq 0x1058(%rsp), %rax
movsd 0x32f9d(%rip), %xmm0    # 0x1d4fc0
mulsd 0x68(%rax), %xmm0
ucomisd %xmm1, %xmm0
jae 0x1a205b
xorps %xmm0, %xmm0
ucomisd 0x1030(%rsp), %xmm0
jae 0x1a205b
movsd 0x1050(%rsp), %xmm1
movq 0x1058(%rsp), %rax
movsd 0x488(%rax), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1a206f
movq 0x1048(%rsp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
jmp 0x1a215d
movsd 0x6ab39(%rip), %xmm0    # 0x20cbb0
mulsd 0x1030(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x1038(%rsp), %xmm0
movsd 0x316e9(%rip), %xmm1    # 0x1d3780
callq 0x8610
movaps %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x1028(%rsp)
movq 0x1058(%rsp), %rax
movsd 0x490(%rax), %xmm0
movq 0x1058(%rsp), %rax
movsd 0x30176(%rip), %xmm1    # 0x1d2248
subsd 0x490(%rax), %xmm1
movsd 0x1030(%rsp), %xmm2
movsd 0x6aa8d(%rip), %xmm3    # 0x20cb78
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm1
divsd 0x1030(%rsp), %xmm1
movsd 0x6aaec(%rip), %xmm2    # 0x20cbf0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x1020(%rsp)
movq 0x1058(%rsp), %rax
movsd 0x410(%rax), %xmm0
movq 0x1058(%rsp), %rax
mulsd 0x60(%rax), %xmm0
mulsd 0x1020(%rsp), %xmm0
mulsd 0x1028(%rsp), %xmm0
movq 0x1058(%rsp), %rax
divsd 0x68(%rax), %xmm0
movq 0x1048(%rsp), %rax
movsd %xmm0, (%rax)
movl $0x0, 0x1064(%rsp)
movl 0x1064(%rsp), %eax
addq $0x1068, %rsp           # imm = 0x1068
retq
nopw (%rax,%rax)