// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../external/HMcode/hmcode.c
// Function: hmcode_sigmaprime_at_z
int hmcode_sigmaprime_at_z(
                           struct background *pba,
                           struct fourier *pfo,
                           double z,
                           double *sigma_prime,
                           double *sigma_prime_cb,
                           struct hmcode_workspace *phw
                           ) {

  double tau;

  class_call(background_tau_of_z(pba,
                                 z,
                                 &tau),
             pba->error_message,
             pfo->error_message);

  if (pfo->tau_size == 1) {
    *sigma_prime = phw->sigma_prime[pfo->index_pk_m][0];
  }
  else {
    class_call(array_interpolate_two(pfo->tau,
                                     1,
                                     0,
                                     phw->sigma_prime[pfo->index_pk_m],
                                     1,
                                     pfo->tau_size,
                                     tau,
                                     sigma_prime,
                                     1,
                                     pfo->error_message),
               pfo->error_message,
               pfo->error_message);
  }

  if (pba->has_ncdm == _TRUE_){

    if (pfo->tau_size == 1) {
      *sigma_prime_cb = phw->sigma_prime[pfo->index_pk_cb][0];
    }
    else {
      class_call(array_interpolate_two(pfo->tau,
                                       1,
                                       0,
                                       phw->sigma_prime[pfo->index_pk_cb],
                                       1,
                                       pfo->tau_size,
                                       tau,
                                       sigma_prime_cb,
                                       1,
                                       pfo->error_message),
                 pfo->error_message,
                 pfo->error_message);
    }
  }
  else{
    *sigma_prime_cb = *sigma_prime;
  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r12
movq %rsp, %rsi
callq 0x58adb
cmpl $0x1, %eax
jne 0xdb7a7
addq $0xd1c, %r12            # imm = 0xD1C
leaq 0x9c91(%rip), %rsi      # 0xe53f0
leaq 0x2d579(%rip), %rdx     # 0x108cdf
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x192, %rbx            # imm = 0x192
leaq 0x98ae(%rip), %rsi      # 0xe5034
leaq 0x48ff8(%rip), %rdx     # 0x124785
movq %rbx, %rdi
movl $0x728, %ecx            # imm = 0x728
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rbp
jmp 0xdb893
movl 0x140(%rbx), %r9d
cmpl $0x1, %r9d
jne 0xdb7cf
movq 0x48(%r15), %rax
movslq 0x54(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%r13)
jmp 0xdb85b
movq 0x148(%rbx), %rdi
movq 0x48(%r15), %rax
movslq 0x54(%rbx), %rcx
movq (%rax,%rcx,8), %rcx
movsd (%rsp), %xmm0
leaq 0x192(%rbx), %rax
subq $0x8, %rsp
pushq $0x1
popq %rbp
movl %ebp, %esi
xorl %edx, %edx
movl %ebp, %r8d
movq %rax, 0x10(%rsp)
pushq %rax
pushq $0x1
pushq %r13
callq 0x17f36
addq $0x20, %rsp
cmpl $0x1, %eax
jne 0xdb85b
leaq 0x9bd5(%rip), %rsi      # 0xe53f0
leaq 0x48f7a(%rip), %rdx     # 0x12479c
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x97f4(%rip), %rsi      # 0xe5034
leaq 0x48f3e(%rip), %rdx     # 0x124785
movq %r14, %rdi
movl $0x739, %ecx            # imm = 0x739
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
jmp 0xdb893
cmpw $0x1, 0x4be(%r12)
jne 0xdb886
movl 0x140(%rbx), %r9d
cmpl $0x1, %r9d
jne 0xdb8a7
movq 0x48(%r15), %rax
movslq 0x58(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movsd (%rax), %xmm0
jmp 0xdb88c
movsd (%r13), %xmm0
movsd %xmm0, (%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x148(%rbx), %rdi
movq 0x48(%r15), %rax
movslq 0x58(%rbx), %rcx
movq (%rax,%rcx,8), %rcx
movsd (%rsp), %xmm0
addq $0x192, %rbx            # imm = 0x192
subq $0x8, %rsp
xorl %ebp, %ebp
pushq $0x1
popq %r15
movl %r15d, %esi
xorl %edx, %edx
movl %r15d, %r8d
pushq %rbx
pushq $0x1
pushq %r14
callq 0x17f36
addq $0x20, %rsp
cmpl $0x1, %eax
jne 0xdb893
leaq 0x9afe(%rip), %rsi      # 0xe53f0
leaq 0x48f27(%rip), %rdx     # 0x124820
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x9722(%rip), %rsi      # 0xe5034
leaq 0x48e6c(%rip), %rdx     # 0x124785
movq %rbx, %rdi
movl $0x74d, %ecx            # imm = 0x74D
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
movl %r15d, %ebp
jmp 0xdb893