// File: /workspace/github_c_makefile_star2_O1/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 $0x828, %rsp            # imm = 0x828
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movslq 0x10(%rcx), %r13
movl %r13d, 0xf08(%rdx)
leaq (,%r13,8), %rbp
movq %rbp, %rdi
callq 0x8460
movq %rax, 0xf18(%rbx)
testq %rax, %rax
je 0x6c0ff
movq %rbp, %rdi
callq 0x8460
movq %rax, 0xf10(%rbx)
testq %rax, %rax
je 0x6c145
movslq 0xf04(%rbx), %rbp
imulq %r13, %rbp
movq %rbp, %r13
shlq $0x3, %r13
movq %r13, %rdi
callq 0x8460
movq %rax, 0xf20(%rbx)
testq %rax, %rax
je 0x6c18b
movq %r13, %rdi
callq 0x8460
movq %rax, 0xf28(%rbx)
testq %rax, %rax
je 0x6c1ce
movsd 0x1a0(%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x4(%r12), %eax
testl %eax, %eax
jle 0x6bfe1
movsd 0x190(%r15), %xmm0
movsd %xmm0, 0x18(%rsp)
xorl %ebp, %ebp
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movsd 0x18(%rsp), %xmm0
callq 0x82c0
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x82c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movl 0x4(%r12), %eax
leal (%rax,%r13), %ecx
decl %eax
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
mulsd %xmm1, %xmm2
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x82c0
addsd 0x8(%rsp), %xmm0
callq 0x8670
movq 0xf10(%rbx), %rax
movl 0xf08(%rbx), %ecx
addl %r13d, %ecx
movslq %ecx, %rcx
movsd %xmm0, (%rax,%rcx,8)
incl %ebp
movl 0x4(%r12), %eax
decl %r13d
cmpl %eax, %ebp
jl 0x6bf54
movslq (%r12), %rcx
testq %rcx, %rcx
movsd 0x10(%rsp), %xmm5
jle 0x6c04b
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movq 0xf10(%rbx), %rdx
notl %eax
addl 0xf08(%rbx), %eax
movapd 0x85222(%rip), %xmm1    # 0xf1230
movsd 0x3e8(%r15), %xmm2
movapd %xmm5, %xmm3
subsd %xmm2, %xmm3
xorpd %xmm1, %xmm3
decq %rcx
xorps %xmm4, %xmm4
cvtsi2sd %ecx, %xmm4
mulsd %xmm3, %xmm4
divsd %xmm0, %xmm4
subsd %xmm2, %xmm4
xorpd %xmm1, %xmm4
cltq
movlpd %xmm4, (%rdx,%rax,8)
decl %eax
testq %rcx, %rcx
jne 0x6c00e
movslq 0xc(%r12), %rax
testq %rax, %rax
jle 0x6c096
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movq 0xf10(%rbx), %rcx
movl 0x8(%r12), %edx
notl %edx
addl 0xf08(%rbx), %edx
decq %rax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd 0x3e8(%r15), %xmm1
divsd %xmm0, %xmm1
movslq %edx, %rdx
movsd %xmm1, (%rcx,%rdx,8)
decl %edx
testq %rax, %rax
jne 0x6c070
movl 0xf08(%rbx), %eax
testl %eax, %eax
jle 0x6c0e1
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0xf10(%rbx), %rax
movsd (%rax,%r15), %xmm0
movq 0xf18(%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
callq 0x5efb7
cmpl $0x1, %eax
je 0x6c230
incq %r12
movslq 0xf08(%rbx), %rax
addq $0x8, %r15
cmpq %rax, %r12
jl 0x6c0a6
movq 0xf18(%rbx), %rcx
cltq
movsd -0x8(%rcx,%rax,8), %xmm0
movsd %xmm0, 0xff8(%rbx)
xorl %eax, %eax
jmp 0x6c21e
shll $0x3, %r13d
leaq 0x84efa(%rip), %rsi     # 0xf1004
leaq 0xa56da(%rip), %rdx     # 0x1117eb
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84f03(%rip), %rsi     # 0xf1034
leaq 0xa56c2(%rip), %rdx     # 0x1117fa
movq %rbx, %rdi
movl $0x45f, %ecx            # imm = 0x45F
jmp 0x6c20f
shll $0x3, %r13d
leaq 0x84eb4(%rip), %rsi     # 0xf1004
leaq 0xa56b8(%rip), %rdx     # 0x11180f
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84ebd(%rip), %rsi     # 0xf1034
leaq 0xa567c(%rip), %rdx     # 0x1117fa
movq %rbx, %rdi
movl $0x460, %ecx            # imm = 0x460
jmp 0x6c20f
leal (,%rbp,8), %ecx
leaq 0x84e6b(%rip), %rsi     # 0xf1004
leaq 0xa567c(%rip), %rdx     # 0x11181c
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84e77(%rip), %rsi     # 0xf1034
leaq 0xa5636(%rip), %rdx     # 0x1117fa
movq %rbx, %rdi
movl $0x461, %ecx            # imm = 0x461
jmp 0x6c20f
leal (,%rbp,8), %ecx
leaq 0x84e28(%rip), %rsi     # 0xf1004
leaq 0xa5653(%rip), %rdx     # 0x111836
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84e34(%rip), %rsi     # 0xf1034
leaq 0xa55f3(%rip), %rdx     # 0x1117fa
movq %rbx, %rdi
movl $0x462, %ecx            # imm = 0x462
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x851b2(%rip), %rsi     # 0xf13f0
leaq 0xa5611(%rip), %rdx     # 0x111856
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84dcf(%rip), %rsi     # 0xf1034
leaq 0xa558e(%rip), %rdx     # 0x1117fa
movq %rbx, %rdi
movl $0x47e, %ecx            # imm = 0x47E
movq %r15, %r8
jmp 0x6c212