// File: /workspace/github_c_makefile_star2_O1/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 0x19cfd
cmpl $0x1, %eax
jne 0xceabe
leaq 0x22975(%rip), %rsi     # 0xf13f0
leaq 0x5c013(%rip), %rdx     # 0x12aa95
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x22599(%rip), %rsi     # 0xf1034
leaq 0x5c051(%rip), %rdx     # 0x12aaf3
movq %r12, %rdi
movl $0x62f, %ecx            # imm = 0x62F
movq %rbx, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
jmp 0xceca2
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 0x23b2f(%rip), %xmm5    # 0xf2670
divsd %xmm5, %xmm7
addsd %xmm6, %xmm7
movsd 0x258d7(%rip), %xmm6    # 0xf4428
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 0x5a251(%rip), %xmm8    # 0x128e68
movq 0x10(%rsp), %rcx
movsd %xmm8, (%rcx)
movslq 0x4(%r15), %rcx
testq %rcx, %rcx
jle 0xcec9e
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 0xcec48
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq