// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/distortions.c
// Function: distortions_interpolate_br_data
int distortions_interpolate_br_data(struct distortions* psd,
                                    double z,
                                    double * f_g,
                                    double * f_y,
                                    double * f_mu,
                                    double * f_E,
                                    int * last_index){

  /** Define local variables */
  int index = *last_index;
  int index_k;
  double h,a,b;

  /** Find z position */
  class_call(array_spline_hunt(psd->br_exact_z,
                               psd->br_exact_Nz,
                               z,
                               &index,
                               &h,&a,&b,
                               psd->error_message),
             psd->error_message,
             psd->error_message);

  /** Evaluate corresponding values for the branching ratios */
  *f_g = 4*array_spline_eval(psd->f_g_exact,
                             psd->ddf_g_exact,
                             index,
                             index+1,
                             h,a,b);
  *f_y = 4*array_spline_eval(psd->f_y_exact,
                             psd->ddf_y_exact,
                             index,
                             index+1,
                             h,a,b);
  *f_mu = 1./1.401*array_spline_eval(psd->f_mu_exact,
                                     psd->ddf_mu_exact,
                                     index,
                                     index+1,
                                     h,a,b);

  for (index_k=0; index_k<psd->sd_PCA_size; ++index_k){
    f_E[index_k] = array_spline_eval(psd->E_vec+index_k*psd->br_exact_Nz,
                                     psd->ddE_vec+index_k*psd->br_exact_Nz,
                                     index,
                                     index+1,
                                     h,a,b);
  }

  *last_index = index;

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
movq %r9, %rbx
movq %r8, %r14
movq %rcx, 0x10(%rsp)
movq %rdx, %r13
movq %rsi, %rbp
movq %rdi, %r15
movl (%r9), %eax
leaq 0xc(%rsp), %rdx
movl %eax, (%rdx)
movq 0xc18(%rdi), %rdi
movl 0xc20(%r15), %esi
leaq 0x1602(%r15), %r12
movq %r12, (%rsp)
leaq 0x28(%rsp), %rcx
leaq 0x20(%rsp), %r8
leaq 0x18(%rsp), %r9
callq 0x17d10
cmpl $0x1, %eax
jne 0xc3bf5
leaq 0x2183c(%rip), %rsi     # 0xe53f0
leaq 0x5adb2(%rip), %rdx     # 0x11e96d
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x21460(%rip), %rsi     # 0xe5034
leaq 0x5adf0(%rip), %rdx     # 0x11e9cb
movq %r12, %rdi
movl $0x62f, %ecx            # imm = 0x62F
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
jmp 0xc3ddd
movsd 0x20(%rsp), %xmm0
movl 0xc(%rsp), %eax
movslq %eax, %rcx
movsd 0x18(%rsp), %xmm1
movq 0xc28(%r15), %rdx
movq 0xc30(%r15), %rsi
movsd 0x8(%rdx,%rcx,8), %xmm2
mulsd %xmm1, %xmm2
movsd (%rdx,%rcx,8), %xmm6
mulsd %xmm0, %xmm6
addsd %xmm2, %xmm6
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
mulsd %xmm0, %xmm2
subsd %xmm0, %xmm2
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
mulsd %xmm1, %xmm3
subsd %xmm1, %xmm3
movsd 0x8(%rsi,%rcx,8), %xmm4
mulsd %xmm3, %xmm4
movsd (%rsi,%rcx,8), %xmm7
mulsd %xmm2, %xmm7
addsd %xmm4, %xmm7
movsd 0x28(%rsp), %xmm4
mulsd %xmm4, %xmm7
mulsd %xmm4, %xmm7
movsd 0x229d6(%rip), %xmm5    # 0xe6650
divsd %xmm5, %xmm7
addsd %xmm6, %xmm7
movsd 0x2476e(%rip), %xmm6    # 0xe83f8
mulsd %xmm6, %xmm7
movsd %xmm7, (%rbp)
movq 0xc38(%r15), %rdx
movq 0xc40(%r15), %rsi
movsd 0x8(%rdx,%rcx,8), %xmm7
mulsd %xmm1, %xmm7
movsd (%rdx,%rcx,8), %xmm8
mulsd %xmm0, %xmm8
addsd %xmm7, %xmm8
movsd 0x8(%rsi,%rcx,8), %xmm7
mulsd %xmm3, %xmm7
movsd (%rsi,%rcx,8), %xmm9
mulsd %xmm2, %xmm9
addsd %xmm7, %xmm9
mulsd %xmm4, %xmm9
mulsd %xmm4, %xmm9
divsd %xmm5, %xmm9
addsd %xmm8, %xmm9
mulsd %xmm6, %xmm9
movsd %xmm9, (%r13)
movq 0xc48(%r15), %rdx
movq 0xc50(%r15), %rsi
movsd 0x8(%rdx,%rcx,8), %xmm6
mulsd %xmm1, %xmm6
movsd (%rdx,%rcx,8), %xmm7
mulsd %xmm0, %xmm7
addsd %xmm6, %xmm7
movsd 0x8(%rsi,%rcx,8), %xmm6
mulsd %xmm3, %xmm6
movsd (%rsi,%rcx,8), %xmm8
mulsd %xmm2, %xmm8
addsd %xmm6, %xmm8
mulsd %xmm4, %xmm8
mulsd %xmm4, %xmm8
divsd %xmm5, %xmm8
addsd %xmm7, %xmm8
mulsd 0x58ff8(%rip), %xmm8    # 0x11cd48
movq 0x10(%rsp), %rdx
movsd %xmm8, (%rdx)
movslq 0x4(%r15), %rdx
xorl %esi, %esi
cmpq %rdx, %rsi
jge 0xc3dd9
movslq 0xc20(%r15), %rdi
movslq %esi, %r8
imulq %rdi, %r8
shlq $0x3, %r8
movq 0xc58(%r15), %rdi
addq %r8, %rdi
movsd 0x8(%rdi,%rcx,8), %xmm6
mulsd %xmm1, %xmm6
movsd (%rdi,%rcx,8), %xmm7
mulsd %xmm0, %xmm7
addq 0xc60(%r15), %r8
addsd %xmm6, %xmm7
movsd 0x8(%r8,%rcx,8), %xmm6
mulsd %xmm3, %xmm6
movsd (%r8,%rcx,8), %xmm8
mulsd %xmm2, %xmm8
addsd %xmm6, %xmm8
mulsd %xmm4, %xmm8
mulsd %xmm4, %xmm8
divsd %xmm5, %xmm8
addsd %xmm7, %xmm8
movsd %xmm8, (%r14,%rsi,8)
incq %rsi
jmp 0xc3d60
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq