// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/thermodynamics.c
// Function: thermodynamics_output_data
int thermodynamics_output_data(
                               struct background * pba,
                               struct thermodynamics *pth,
                               int number_of_titles,
                               double *data
                               ) {

  int index_z, storeidx;
  double *dataptr, *pvecthermo;
  double z,tau;

  // pth->number_of_thermodynamics_titles = get_number_of_titles(pth->thermodynamics_titles);
  // pth->size_thermodynamics_data = pth->number_of_thermodynamics_titles*pth->tt_size;

  /* Store quantities: */
  for (index_z=0; index_z<pth->tt_size; index_z++) {
    dataptr = data + index_z*number_of_titles;
    pvecthermo = pth->thermodynamics_table+index_z*pth->th_size;
    z = pth->z_table[index_z];
    storeidx=0;

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

    class_store_double(dataptr,1./(1.+z),_TRUE_,storeidx);
    class_store_double(dataptr,z,_TRUE_,storeidx);
    class_store_double(dataptr,tau,_TRUE_,storeidx);
    class_store_double(dataptr,pvecthermo[pth->index_th_xe],_TRUE_,storeidx);
    class_store_double(dataptr,pvecthermo[pth->index_th_dkappa],_TRUE_,storeidx);
    //class_store_double(dataptr,pvecthermo[pth->index_th_ddkappa],_TRUE_,storeidx);
    //class_store_double(dataptr,pvecthermo[pth->index_th_dddkappa],_TRUE_,storeidx);
    class_store_double(dataptr,pvecthermo[pth->index_th_exp_m_kappa],_TRUE_,storeidx);
    class_store_double(dataptr,pvecthermo[pth->index_th_g],_TRUE_,storeidx);
    //class_store_double(dataptr,pvecthermo[pth->index_th_dg],_TRUE_,storeidx);
    //class_store_double(dataptr,pvecthermo[pth->index_th_ddg],_TRUE_,storeidx);
    class_store_double(dataptr,pvecthermo[pth->index_th_Tb],_TRUE_,storeidx);
    class_store_double(dataptr,pvecthermo[pth->index_th_dTb],_TRUE_,storeidx);
    class_store_double(dataptr,pvecthermo[pth->index_th_wb],_TRUE_,storeidx);
    class_store_double(dataptr,pvecthermo[pth->index_th_cb2],_TRUE_,storeidx);
    if (pba->has_idm == _TRUE_) {
      class_store_double(dataptr,pvecthermo[pth->index_th_T_idm],_TRUE_,storeidx);
      class_store_double(dataptr,pvecthermo[pth->index_th_c2_idm],_TRUE_,storeidx);
      if (pth->has_idm_g == _TRUE_) {
        class_store_double(dataptr,pvecthermo[pth->index_th_dmu_idm_g],_TRUE_,storeidx);
        class_store_double(dataptr,pvecthermo[pth->index_th_ddmu_idm_g],_TRUE_,storeidx);
      }
      if (pth->has_idm_b == _TRUE_){
        class_store_double(dataptr,pvecthermo[pth->index_th_R_idm_b],_TRUE_,storeidx);
      }
      if (pth->has_idm_dr == _TRUE_){
        class_store_double(dataptr,pvecthermo[pth->index_th_dmu_idm_dr],_TRUE_,storeidx);
        class_store_double(dataptr,pvecthermo[pth->index_th_tau_idm_dr],_TRUE_,storeidx);
        class_store_double(dataptr,pvecthermo[pth->index_th_tau_idr],_TRUE_,storeidx);
        class_store_double(dataptr,pvecthermo[pth->index_th_g_idm_dr],_TRUE_,storeidx);
      }
    }
    if (pba->has_idr == _TRUE_) {
      class_store_double(dataptr, pvecthermo[pth->index_th_T_idr],_TRUE_,storeidx);
      class_store_double(dataptr,pvecthermo[pth->index_th_dmu_idr],_TRUE_,storeidx);
    }
    class_store_double(dataptr,pvecthermo[pth->index_th_tau_d],_TRUE_,storeidx);
    //class_store_double(dataptr,pvecthermo[pth->index_th_rate],_TRUE_,storeidx);
    class_store_double(dataptr,pvecthermo[pth->index_th_r_d],pth->compute_damping_scale,storeidx);

  }

  return _SUCCESS_;
}

// Assembly:
cmpl $0x0, 0xf08(%rsi)
jle 0x7177b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movq %rcx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movslq %edx, %r13
shlq $0x3, %r13
xorl %ebp, %ebp
movslq 0xf04(%rbx), %r12
imulq %rbp, %r12
shlq $0x3, %r12
addq 0xf20(%rbx), %r12
movq 0xf10(%rbx), %rax
movsd (%rax,%rbp,8), %xmm0
movq %r14, %rdi
movsd %xmm0, (%rsp)
leaq 0x8(%rsp), %rsi
callq 0x5c896
cmpl $0x1, %eax
je 0x7177e
movsd (%rsp), %xmm2
movapd %xmm2, %xmm0
movsd 0x7cd07(%rip), %xmm1    # 0xee260
addsd %xmm1, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, (%r15)
movsd %xmm2, 0x8(%r15)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x10(%r15)
movslq 0xe7c(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x18(%r15)
movslq 0xe80(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x20(%r15)
movslq 0xe90(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x28(%r15)
movslq 0xe94(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x30(%r15)
movslq 0xee4(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x38(%r15)
movslq 0xee8(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x40(%r15)
movslq 0xeec(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x48(%r15)
movslq 0xef0(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x50(%r15)
movl $0xb, %eax
cmpw $0x1, 0x4b6(%r14)
jne 0x716fa
movslq 0xea0(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x58(%r15)
movslq 0xea4(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x60(%r15)
movl $0xd, %eax
cmpw $0x1, 0x36(%rbx)
jne 0x71681
movslq 0xec8(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x68(%r15)
movslq 0xecc(%rbx), %rax
movsd (%r12,%rax,8), %xmm0
movsd %xmm0, 0x70(%r15)
movl $0xf, %eax
cmpw $0x1, 0x34(%rbx)
jne 0x7169f
movslq 0xed8(%rbx), %rcx
movsd (%r12,%rcx,8), %xmm0
movl %eax, %ecx
incl %eax
movsd %xmm0, (%r15,%rcx,8)
cmpw $0x1, 0x38(%rbx)
jne 0x716fa
movslq 0xeac(%rbx), %rcx
movsd (%r12,%rcx,8), %xmm0
movl %eax, %ecx
movsd %xmm0, (%r15,%rcx,8)
movslq 0xebc(%rbx), %rdx
movsd (%r12,%rdx,8), %xmm0
movsd %xmm0, 0x8(%r15,%rcx,8)
movslq 0xec0(%rbx), %rdx
movsd (%r12,%rdx,8), %xmm0
movsd %xmm0, 0x10(%r15,%rcx,8)
movslq 0xec4(%rbx), %rdx
movsd (%r12,%rdx,8), %xmm0
addl $0x4, %eax
movsd %xmm0, 0x18(%r15,%rcx,8)
cmpw $0x1, 0x4c6(%r14)
jne 0x71731
movslq 0xea8(%rbx), %rcx
movsd (%r12,%rcx,8), %xmm0
movl %eax, %ecx
movsd %xmm0, (%r15,%rcx,8)
movslq 0xeb8(%rbx), %rdx
movsd (%r12,%rdx,8), %xmm0
addl $0x2, %eax
movsd %xmm0, 0x8(%r15,%rcx,8)
movslq 0xe84(%rbx), %rcx
movsd (%r12,%rcx,8), %xmm0
movl %eax, %eax
movsd %xmm0, (%r15,%rax,8)
cmpw $0x1, 0x32(%rbx)
jne 0x71761
movslq 0xf00(%rbx), %rcx
movsd (%r12,%rcx,8), %xmm0
movsd %xmm0, 0x8(%r15,%rax,8)
incq %rbp
movslq 0xf08(%rbx), %rax
addq %r13, %r15
cmpq %rax, %rbp
jl 0x7150b
xorl %eax, %eax
jmp 0x717d1
xorl %eax, %eax
retq
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x7cc64(%rip), %rsi     # 0xee3f0
leaq 0xa06ac(%rip), %rdx     # 0x111e3f
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7c881(%rip), %rsi     # 0xee034
leaq 0xa06a7(%rip), %rdx     # 0x111e61
movq %rbx, %rdi
movl $0x115c, %ecx           # imm = 0x115C
movq %r15, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop