// File: /workspace/github_c_makefile_star2_O3/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 0x19e56
cmpl $0x1, %eax
jne 0xcb24e
leaq 0x231e5(%rip), %rsi     # 0xee3f0
leaq 0x5c8ab(%rip), %rdx     # 0x127abd
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x22e09(%rip), %rsi     # 0xee034
leaq 0x5c8e9(%rip), %rdx     # 0x127b1b
movq %r12, %rdi
movl $0x62f, %ecx            # imm = 0x62F
movq %rbx, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
jmp 0xcb432
movsd 0x20(%rsp), %xmm0
movslq 0xc(%rsp), %rax
movsd 0x18(%rsp), %xmm1
movq 0xc28(%r15), %rcx
movq 0xc30(%r15), %rdx
movsd 0x8(%rcx,%rax,8), %xmm2
mulsd %xmm1, %xmm2
movsd (%rcx,%rax,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(%rdx,%rax,8), %xmm4
mulsd %xmm3, %xmm4
movsd (%rdx,%rax,8), %xmm7
mulsd %xmm2, %xmm7
addsd %xmm4, %xmm7
movsd 0x28(%rsp), %xmm4
mulsd %xmm4, %xmm7
mulsd %xmm4, %xmm7
movsd 0x2439f(%rip), %xmm5    # 0xef670
divsd %xmm5, %xmm7
addsd %xmm6, %xmm7
movsd 0x26157(%rip), %xmm6    # 0xf1438
mulsd %xmm6, %xmm7
movsd %xmm7, (%rbp)
movq 0xc38(%r15), %rcx
movq 0xc40(%r15), %rdx
movsd 0x8(%rcx,%rax,8), %xmm7
mulsd %xmm1, %xmm7
movsd (%rcx,%rax,8), %xmm8
mulsd %xmm0, %xmm8
addsd %xmm7, %xmm8
movsd 0x8(%rdx,%rax,8), %xmm7
mulsd %xmm3, %xmm7
movsd (%rdx,%rax,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), %rcx
movq 0xc50(%r15), %rdx
movsd 0x8(%rcx,%rax,8), %xmm6
mulsd %xmm1, %xmm6
movsd (%rcx,%rax,8), %xmm7
mulsd %xmm0, %xmm7
addsd %xmm6, %xmm7
movsd 0x8(%rdx,%rax,8), %xmm6
mulsd %xmm3, %xmm6
movsd (%rdx,%rax,8), %xmm8
mulsd %xmm2, %xmm8
addsd %xmm6, %xmm8
mulsd %xmm4, %xmm8
mulsd %xmm4, %xmm8
divsd %xmm5, %xmm8
addsd %xmm7, %xmm8
mulsd 0x5aaf1(%rip), %xmm8    # 0x125e98
movq 0x10(%rsp), %rcx
movsd %xmm8, (%rcx)
movslq 0x4(%r15), %rcx
testq %rcx, %rcx
jle 0xcb42e
movq %rax, %rdx
incq %rdx
movq 0xc58(%r15), %rsi
movq 0xc60(%r15), %rdi
movslq 0xc20(%r15), %r8
xorl %r9d, %r9d
movsd (%rsi,%rdx,8), %xmm6
movsd (%rdi,%rdx,8), %xmm7
mulsd %xmm3, %xmm7
movsd -0x8(%rdi,%rdx,8), %xmm8
mulsd %xmm2, %xmm8
mulsd %xmm1, %xmm6
addsd %xmm7, %xmm8
movsd -0x8(%rsi,%rdx,8), %xmm7
mulsd %xmm0, %xmm7
addsd %xmm6, %xmm7
mulsd %xmm4, %xmm8
mulsd %xmm4, %xmm8
divsd %xmm5, %xmm8
addsd %xmm7, %xmm8
movsd %xmm8, (%r14,%r9,8)
incq %r9
addq %r8, %rdx
cmpq %r9, %rcx
jne 0xcb3d8
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq