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

  /** Summary: */

  /** Define local variables */
  int index_tau, index_z;
  double zinitial,zlinear;

  pth->tt_size = ptw->Nz_tot;

  /** - allocate tables*/
  class_alloc(pth->tau_table,pth->tt_size*sizeof(double),pth->error_message);
  class_alloc(pth->z_table,pth->tt_size*sizeof(double),pth->error_message);
  class_alloc(pth->thermodynamics_table,pth->th_size*pth->tt_size*sizeof(double),pth->error_message);
  class_alloc(pth->d2thermodynamics_dz2_table,pth->th_size*pth->tt_size*sizeof(double),pth->error_message);

  /** - define time sampling */

  /* Initial z, and the z at which we switch to linear sampling */
  zinitial = ppr->thermo_z_initial;
  zlinear  = ppr->thermo_z_linear;

  /* -> Between z_initial and z_linear, we use the spacing of recombination sampling */
  for (index_z=0; index_z <ptw->Nz_reco_log; index_z++) {
    pth->z_table[(pth->tt_size-1) - index_z] = -(-exp((log(zinitial)-log(zlinear))*(double)(ptw->Nz_reco_log-1-index_z) / (double)(ptw->Nz_reco_log-1)+log(zlinear)));
  }

  /* -> Between z_linear and reionization_z_start_max, we use the spacing of recombination sampling */
  for (index_z=0; index_z <ptw->Nz_reco_lin; index_z++) {
    pth->z_table[(pth->tt_size-1)-(index_z+ptw->Nz_reco_log)] = -(-(zlinear-ppr->reionization_z_start_max) * (double)(ptw->Nz_reco_lin-1-index_z) / (double)(ptw->Nz_reco_lin) - ppr->reionization_z_start_max);
  }

  /* -> Between reionization_z_start_max and 0, we use the spacing of reionization sampling, leaving out the first point to not double-count it */
  for (index_z=0; index_z <ptw->Nz_reio; index_z++) {
    pth->z_table[(pth->tt_size-1)-(index_z+ptw->Nz_reco)] = -(-ppr->reionization_z_start_max * (double)(ptw->Nz_reio-1-index_z) / (double)(ptw->Nz_reio));
  }

  for (index_tau=0; index_tau < pth->tt_size; index_tau++) {
    class_call(background_tau_of_z(pba,
                                   pth->z_table[index_tau],
                                   pth->tau_table+index_tau),
               pba->error_message,
               pth->error_message);
  }

  /** - store initial value of conformal time in the structure */
  pth->tau_ini = pth->tau_table[pth->tt_size-1];

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %rbp
movq %rdi, 0x18(%rsp)
movl 0x10(%rcx), %r13d
movslq %r13d, %r12
movl %r12d, 0xf08(%rdx)
leaq (,%r12,8), %r14
movq %r14, %rdi
callq 0x8490
movq %rax, 0xf18(%rbx)
testq %rax, %rax
je 0x652e8
movq %rbp, 0x20(%rsp)
movq %r14, %rdi
callq 0x8490
movq %rax, 0xf10(%rbx)
testq %rax, %rax
je 0x6532e
movq %rax, %rbp
movslq 0xf04(%rbx), %rax
imulq %r12, %rax
movq %rax, %r12
movq %rax, %r14
shlq $0x3, %r14
movq %r14, %rdi
callq 0x8490
movq %rax, 0xf20(%rbx)
testq %rax, %rax
je 0x6549d
movq %r14, %rdi
callq 0x8490
movq %rax, 0xf28(%rbx)
testq %rax, %rax
je 0x654e1
movq 0x18(%rsp), %rax
movsd 0x190(%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x1a0(%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %r14d, %r14d
pushq $-0x1
popq %r12
movl 0x4(%r15), %eax
cmpl %eax, %r14d
jge 0x65374
movsd 0x28(%rsp), %xmm0
callq 0x82e0
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x82e0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movl 0x4(%r15), %eax
leal (%r12,%rax), %ecx
decl %eax
cvtsi2sd %ecx, %xmm2
mulsd %xmm1, %xmm2
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x82e0
addsd 0x8(%rsp), %xmm0
callq 0x86a0
movq 0xf10(%rbx), %rbp
movl 0xf08(%rbx), %r13d
leal (%r12,%r13), %eax
cltq
movsd %xmm0, (%rbp,%rax,8)
incl %r14d
decl %r12d
jmp 0x6525a
shll $0x3, %r13d
leaq 0x7fd11(%rip), %rsi     # 0xe5004
leaq 0xa03e1(%rip), %rdx     # 0x1056db
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7fd1a(%rip), %rsi     # 0xe5034
leaq 0xa03c9(%rip), %rdx     # 0x1056ea
movq %rbx, %rdi
movl $0x45f, %ecx            # imm = 0x45F
jmp 0x65523
shll $0x3, %r13d
leaq 0x7fccb(%rip), %rsi     # 0xe5004
leaq 0xa03bf(%rip), %rdx     # 0x1056ff
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7fcd4(%rip), %rsi     # 0xe5034
leaq 0xa0383(%rip), %rdx     # 0x1056ea
movq %rbx, %rdi
movl $0x460, %ecx            # imm = 0x460
jmp 0x65523
movl (%r15), %ecx
cvtsi2sd %ecx, %xmm0
xorl %edx, %edx
testl %ecx, %ecx
cmovgl %ecx, %edx
decl %ecx
notl %eax
addl %r13d, %eax
movapd 0x7fe9f(%rip), %xmm1    # 0xe5230
movq 0x18(%rsp), %rsi
subl $0x1, %edx
jb 0x653d3
movsd 0x3e8(%rsi), %xmm2
movsd 0x10(%rsp), %xmm3
subsd %xmm2, %xmm3
xorpd %xmm1, %xmm3
cvtsi2sd %ecx, %xmm4
mulsd %xmm3, %xmm4
divsd %xmm0, %xmm4
subsd %xmm2, %xmm4
xorpd %xmm1, %xmm4
cltq
movlpd %xmm4, (%rbp,%rax,8)
decl %ecx
decl %eax
jmp 0x65396
movl 0xc(%r15), %eax
cvtsi2sd %eax, %xmm0
xorl %ecx, %ecx
testl %eax, %eax
cmovgl %eax, %ecx
decl %eax
decl %r13d
subl $0x1, %ecx
jb 0x6540e
cvtsi2sd %eax, %xmm1
mulsd 0x3e8(%rsi), %xmm1
divsd %xmm0, %xmm1
movl %r13d, %edx
subl 0x8(%r15), %edx
movslq %edx, %rdx
movsd %xmm1, (%rbp,%rdx,8)
jmp 0x653e2
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x20(%rsp), %r12
movslq 0xf08(%rbx), %rax
cmpq %rax, %r15
jge 0x65542
movq 0xf10(%rbx), %rax
movsd (%rax,%r14), %xmm0
movq 0xf18(%rbx), %rsi
addq %r14, %rsi
movq %r12, %rdi
callq 0x58adb
incq %r15
addq $0x8, %r14
cmpl $0x1, %eax
jne 0x65419
addq $0xd1c, %r12            # imm = 0xD1C
leaq 0x7ff8e(%rip), %rsi     # 0xe53f0
leaq 0xa02dd(%rip), %rdx     # 0x105746
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7fbab(%rip), %rsi     # 0xe5034
leaq 0xa025a(%rip), %rdx     # 0x1056ea
movq %rbx, %rdi
movl $0x47e, %ecx            # imm = 0x47E
jmp 0x65523
leal (,%r12,8), %ecx
leaq 0x7fb58(%rip), %rsi     # 0xe5004
leaq 0xa0259(%rip), %rdx     # 0x10570c
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7fb64(%rip), %rsi     # 0xe5034
leaq 0xa0213(%rip), %rdx     # 0x1056ea
movq %rbx, %rdi
movl $0x461, %ecx            # imm = 0x461
jmp 0x65523
leal (,%r12,8), %ecx
leaq 0x7fb14(%rip), %rsi     # 0xe5004
leaq 0xa022f(%rip), %rdx     # 0x105726
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x7fb20(%rip), %rsi     # 0xe5034
leaq 0xa01cf(%rip), %rdx     # 0x1056ea
movq %rbx, %rdi
movl $0x462, %ecx            # imm = 0x462
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xf18(%rbx), %rcx
movsd -0x8(%rcx,%rax,8), %xmm0
movsd %xmm0, 0xff8(%rbx)
xorl %eax, %eax
jmp 0x65530