// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/thermodynamics.c
// Function: thermodynamics_indices
int thermodynamics_indices(
                           struct background * pba,
                           struct thermodynamics * pth,
                           struct thermo_workspace * ptw
                           ) {

  /** Summary: */

  /** - define local variables */
  struct thermo_reionization_parameters* ptrp = ptw->ptrp;
  /* a running index for the vector of thermodynamics quantities */
  int index_th;
  /* a running index for the vector of reionization parameters */
  int index_re;

  /** - initialization of all indices and flags in thermodynamics structure */
  index_th = 0;

  /* Free electron fraction */
  class_define_index(pth->index_th_xe,_TRUE_,index_th,1);
  /* Optical depth and related quantities */
  class_define_index(pth->index_th_dkappa,_TRUE_,index_th,1);
  class_define_index(pth->index_th_ddkappa,_TRUE_,index_th,1);
  class_define_index(pth->index_th_dddkappa,_TRUE_,index_th,1);
  class_define_index(pth->index_th_exp_m_kappa,_TRUE_,index_th,1);
  /* Visibility function + derivatives */
  class_define_index(pth->index_th_g,_TRUE_,index_th,1);
  class_define_index(pth->index_th_dg,_TRUE_,index_th,1);
  class_define_index(pth->index_th_ddg,_TRUE_,index_th,1);
  /* Baryon quantities, Temperature, Sound Speed, Drag time end */
  class_define_index(pth->index_th_Tb,_TRUE_,index_th,1);
  class_define_index(pth->index_th_dTb,_TRUE_,index_th,1);
  class_define_index(pth->index_th_wb,_TRUE_,index_th,1);
  class_define_index(pth->index_th_cb2,_TRUE_,index_th,1);
  class_define_index(pth->index_th_tau_d,_TRUE_,index_th,1);
  /* Derivatives of baryon sound speed (only computed if some non-minimal tight-coupling schemes is requested) */
  class_define_index(pth->index_th_dcb2,pth->compute_cb2_derivatives,index_th,1);
  class_define_index(pth->index_th_ddcb2,pth->compute_cb2_derivatives,index_th,1);

  /* idm quantities  */
  if (pba->has_idm == _TRUE_) {
    /* global quantities */
    class_define_index(pth->index_th_T_idm, pba->has_idm, index_th, 1);
    class_define_index(pth->index_th_c2_idm, pba->has_idm, index_th, 1);
    /* idm-b quantities */
    class_define_index(pth->index_th_R_idm_b,pth->has_idm_b,index_th,1);
    class_define_index(pth->index_th_dR_idm_b,pth->has_idm_b,index_th,1);
    class_define_index(pth->index_th_ddR_idm_b,pth->has_idm_b,index_th,1);
    /* idm-g quantities */
    class_define_index(pth->index_th_dmu_idm_g,pth->has_idm_g, index_th, 1);
    class_define_index(pth->index_th_ddmu_idm_g,pth->has_idm_g, index_th, 1);
    class_define_index(pth->index_th_dddmu_idm_g,pth->has_idm_g, index_th, 1);
    class_define_index(pth->index_th_exp_mu_idm_g,pth->has_idm_g, index_th, 1);
    /* idm-dr quantities */
    class_define_index(pth->index_th_dmu_idm_dr,pth->has_idm_dr, index_th, 1);
    class_define_index(pth->index_th_ddmu_idm_dr,pth->has_idm_dr, index_th, 1);
    class_define_index(pth->index_th_dddmu_idm_dr,pth->has_idm_dr, index_th, 1);
    class_define_index(pth->index_th_tau_idm_dr,pth->has_idm_dr, index_th, 1);
    class_define_index(pth->index_th_tau_idr,pth->has_idm_dr, index_th, 1);
    class_define_index(pth->index_th_g_idm_dr,pth->has_idm_dr, index_th, 1);
  }
  /* idr quantities */
  if (pba->has_idr == _TRUE_) {
    class_define_index(pth->index_th_T_idr,pba->has_idr, index_th, 1);
    class_define_index(pth->index_th_dmu_idr,pba->has_idr, index_th, 1);
  }

  /* Quantity defining the stepsize in perturbations.c */
  class_define_index(pth->index_th_rate,_TRUE_,index_th,1);
  /* Damping scale */
  class_define_index(pth->index_th_r_d,pth->compute_damping_scale,index_th,1);

  /* end of thermodynamics indices */

  pth->th_size = index_th;

  /** - initialization of all indices of parameters of reionization function */

  index_re=0;

  class_define_index(ptrp->index_re_reio_start,_TRUE_,index_re,1);

  switch (pth->reio_parametrization) {

    /* case with no reionization requested */
  case reio_none:
    class_define_index(ptrp->index_re_xe_before,_TRUE_,index_re,1);
    break;

    /* case where x_e(z) taken like in CAMB (other cases can be added) */
  case reio_camb:
  case reio_half_tanh:
    class_define_index(ptrp->index_re_reio_redshift,_TRUE_,index_re,1);
    class_define_index(ptrp->index_re_reio_exponent,_TRUE_,index_re,1);
    class_define_index(ptrp->index_re_reio_width,_TRUE_,index_re,1);
    class_define_index(ptrp->index_re_xe_before,_TRUE_,index_re,1);
    class_define_index(ptrp->index_re_xe_after,_TRUE_,index_re,1);
    class_define_index(ptrp->index_re_helium_fullreio_fraction,_TRUE_,index_re,1);
    class_define_index(ptrp->index_re_helium_fullreio_redshift,_TRUE_,index_re,1);
    class_define_index(ptrp->index_re_helium_fullreio_width,_TRUE_,index_re,1);
    break;

    /* case where x_e(z) is interpolated by tanh between plateaux */
  case reio_bins_tanh:

    /* the code will not only copy here the "bin centers" passed in input. It will add an initial and final value for (z,xe). So
       this array has a dimension bigger than the bin center array */

    ptrp->re_z_size=pth->binned_reio_num+2; /* add two values: beginning and end of reio */

    class_define_index(ptrp->index_re_first_z,_TRUE_,index_re,ptrp->re_z_size);
    class_define_index(ptrp->index_re_first_xe,_TRUE_,index_re,ptrp->re_z_size);
    class_define_index(ptrp->index_re_step_sharpness,_TRUE_,index_re,1);
    class_define_index(ptrp->index_re_xe_before,_TRUE_,index_re,1);
    break;

    /* case where x_e(z) is interpolated by tanh between knots */
  case reio_many_tanh:

    /* the code will not only copy here the "jump centers" passed in input. It will add an initial and final value for (z,xe). So
       this array has a dimension bigger than the jump center array */

    ptrp->re_z_size=pth->many_tanh_num+2; /* add two values: beginning and end of reio */

    class_define_index(ptrp->index_re_first_z,_TRUE_,index_re,ptrp->re_z_size);
    class_define_index(ptrp->index_re_first_xe,_TRUE_,index_re,ptrp->re_z_size);
    class_define_index(ptrp->index_re_step_sharpness,_TRUE_,index_re,1);
    class_define_index(ptrp->index_re_xe_before,_TRUE_,index_re,1);
    break;

    /* case where x_e(z) is linearly interpolated between knots */
  case reio_inter:

    ptrp->re_z_size=pth->reio_inter_num;

    class_define_index(ptrp->index_re_first_z,_TRUE_,index_re,ptrp->re_z_size);
    class_define_index(ptrp->index_re_first_xe,_TRUE_,index_re,ptrp->re_z_size);
    class_define_index(ptrp->index_re_xe_before,_TRUE_,index_re,1);
    break;

  default:
    class_stop(pth->error_message,
               "value of reio_parametrization=%d unclear",pth->reio_parametrization);
    break;
  }
  ptrp->re_size = index_re;

  return _SUCCESS_;

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rsi, %rbx
movq 0x88(%rdx), %rax
movaps 0xa4b76(%rip), %xmm0    # 0x110760
movups %xmm0, 0xe8c(%rsi)
movl $0x7, 0xe9c(%rsi)
movaps 0xa4b6e(%rip), %xmm0    # 0x110770
movups %xmm0, 0xee4(%rsi)
movaps 0xa4b70(%rip), %xmm0    # 0x110780
movups %xmm0, 0xe7c(%rsi)
movzwl 0x30(%rsi), %ecx
testw %cx, %cx
je 0x6bc31
movl $0xd, 0xef4(%rbx)
movl $0xe, %edx
jmp 0x6bc36
movl $0xd, %edx
testw %cx, %cx
je 0x6bc43
movl %edx, 0xef8(%rbx)
incl %edx
cmpw $0x1, 0x4b6(%rdi)
jne 0x6bd1d
movl %edx, 0xea0(%rbx)
leal 0x1(%rdx), %ecx
movl %ecx, 0xea4(%rbx)
leal 0x2(%rdx), %ecx
movzwl 0x34(%rbx), %esi
testw %si, %si
je 0x6bc77
movl %ecx, 0xed8(%rbx)
addl $0x3, %edx
movl %edx, %ecx
testw %si, %si
je 0x6bc84
movl %ecx, 0xedc(%rbx)
incl %ecx
testw %si, %si
je 0x6bc91
movl %ecx, 0xee0(%rbx)
incl %ecx
movzwl 0x36(%rbx), %edx
testw %dx, %dx
je 0x6bca2
movl %ecx, 0xec8(%rbx)
incl %ecx
testw %dx, %dx
je 0x6bcaf
movl %ecx, 0xecc(%rbx)
incl %ecx
testw %dx, %dx
je 0x6bcbc
movl %ecx, 0xed0(%rbx)
incl %ecx
testw %dx, %dx
je 0x6bcc9
movl %ecx, 0xed4(%rbx)
incl %ecx
movzwl 0x38(%rbx), %edx
testw %dx, %dx
je 0x6bcda
movl %ecx, 0xeac(%rbx)
incl %ecx
testw %dx, %dx
je 0x6bce7
movl %ecx, 0xeb0(%rbx)
incl %ecx
testw %dx, %dx
je 0x6bcf4
movl %ecx, 0xeb4(%rbx)
incl %ecx
testw %dx, %dx
je 0x6bd01
movl %ecx, 0xebc(%rbx)
incl %ecx
testw %dx, %dx
je 0x6bd0e
movl %ecx, 0xec0(%rbx)
incl %ecx
testw %dx, %dx
je 0x6bd1b
movl %ecx, 0xec4(%rbx)
incl %ecx
movl %ecx, %edx
cmpw $0x1, 0x4c6(%rdi)
jne 0x6bd39
movl %edx, 0xea8(%rbx)
leal 0x1(%rdx), %ecx
movl %ecx, 0xeb8(%rbx)
addl $0x2, %edx
movl %edx, 0xefc(%rbx)
leal 0x1(%rdx), %ecx
cmpw $0x0, 0x32(%rbx)
je 0x6bd54
movl %ecx, 0xf00(%rbx)
addl $0x2, %edx
movl %edx, %ecx
movl %ecx, 0xf04(%rbx)
movl $0x0, 0x30(%rax)
movl 0x18(%rbx), %edx
cmpq $0x5, %rdx
ja 0x6bdde
leaq 0xa4a4f(%rip), %rcx     # 0x1107c0
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movaps 0xa1dcf(%rip), %xmm0    # 0x10db50
movups %xmm0, (%rax)
movaps 0xa1dd5(%rip), %xmm0    # 0x10db60
movups %xmm0, 0x10(%rax)
movl $0x9, %ecx
jmp 0x6be6d
movl 0x60(%rbx), %ecx
jmp 0x6be42
movl $0x1, 0xc(%rax)
movl $0x2, %ecx
jmp 0x6be6d
movl 0xa0(%rbx), %ecx
movl %ecx, 0x20(%rax)
movl $0x1, 0x24(%rax)
leal 0x1(%rcx), %edx
movl %edx, 0x28(%rax)
leal 0x1(,%rcx,2), %edx
movl %edx, 0xc(%rax)
leal 0x2(,%rcx,2), %ecx
jmp 0x6be6d
leaq 0xa59c6(%rip), %rsi     # 0x1117ab
leaq 0x800(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x85787(%rip), %rsi     # 0xf1585
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x85218(%rip), %rsi     # 0xf1034
leaq 0xa59b1(%rip), %rdx     # 0x1117d4
movq %rbx, %rdi
movl $0x43c, %ecx            # imm = 0x43C
movq %r15, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
jmp 0x6be72
movl 0x80(%rbx), %ecx
leal 0x2(%rcx), %edx
movl %edx, 0x20(%rax)
movl $0x1, 0x24(%rax)
leal 0x3(%rcx), %edx
movl %edx, 0x28(%rax)
leal 0x5(%rcx,%rcx), %edx
movl %edx, 0x2c(%rax)
leal 0x6(,%rcx,2), %edx
movl %edx, 0xc(%rax)
leal 0x7(,%rcx,2), %ecx
movl %ecx, 0x40(%rax)
xorl %eax, %eax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r14
popq %r15
retq