// File: /workspace/github_c_makefile_star2_O3/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, %r13
movq %rdx, %rbx
movq %rsi, %rbp
movq %rdi, 0x18(%rsp)
movl 0x10(%rcx), %r12d
movslq %r12d, %r15
movl %r15d, 0xf08(%rdx)
leaq (,%r15,8), %r14
movq %r14, %rdi
callq 0x8460
movq %rax, 0xf18(%rbx)
testq %rax, %rax
je 0x69778
movq %rbp, 0x20(%rsp)
movq %r14, %rdi
callq 0x8460
movq %rax, 0xf10(%rbx)
testq %rax, %rax
je 0x697be
movq %rax, %rbp
movslq 0xf04(%rbx), %rax
imulq %r15, %rax
movq %rax, %r15
movq %rax, %r14
shlq $0x3, %r14
movq %r14, %rdi
callq 0x8460
movq %rax, 0xf20(%rbx)
testq %rax, %rax
je 0x69804
movq %r14, %rdi
callq 0x8460
movq %rax, 0xf28(%rbx)
testq %rax, %rax
je 0x6984b
movq 0x18(%rsp), %rcx
movsd 0x1a0(%rcx), %xmm0
movl 0x4(%r13), %eax
testl %eax, %eax
movsd %xmm0, 0x10(%rsp)
jle 0x69680
movsd 0x190(%rcx), %xmm1
movsd %xmm1, 0x28(%rsp)
xorl %r14d, %r14d
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movsd 0x28(%rsp), %xmm0
callq 0x82c0
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x82c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movl 0x4(%r13), %eax
leal (%r15,%rax), %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), %rbp
movl 0xf08(%rbx), %r12d
leal (%r15,%r12), %eax
cltq
movsd %xmm0, (%rbp,%rax,8)
incl %r14d
movl 0x4(%r13), %eax
decl %r15d
cmpl %eax, %r14d
jl 0x695f1
movslq (%r13), %rcx
testq %rcx, %rcx
movq 0x18(%rsp), %rdx
movsd 0x10(%rsp), %xmm5
jle 0x696e5
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
notl %eax
addl %r12d, %eax
movapd 0x84b88(%rip), %xmm1    # 0xee230
movsd 0x3e8(%rdx), %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, (%rbp,%rax,8)
decl %eax
testq %rcx, %rcx
jne 0x696a8
movslq 0xc(%r13), %rax
testq %rax, %rax
jle 0x69724
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movl 0x8(%r13), %ecx
notl %ecx
addl %r12d, %ecx
decq %rax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd 0x3e8(%rdx), %xmm1
divsd %xmm0, %xmm1
movslq %ecx, %rcx
movsd %xmm1, (%rbp,%rcx,8)
decl %ecx
testq %rax, %rax
jne 0x696fe
testl %r12d, %r12d
jle 0x6988f
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x20(%rsp), %r12
movq 0xf10(%rbx), %rax
movsd (%rax,%r14), %xmm0
movq 0xf18(%rbx), %rsi
addq %r14, %rsi
movq %r12, %rdi
callq 0x5c896
cmpl $0x1, %eax
je 0x698ab
incq %r15
movslq 0xf08(%rbx), %rax
addq $0x8, %r14
cmpq %rax, %r15
jl 0x69738
jmp 0x69892
shll $0x3, %r12d
leaq 0x84881(%rip), %rsi     # 0xee004
leaq 0xa50b1(%rip), %rdx     # 0x10e83b
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x8488a(%rip), %rsi     # 0xee034
leaq 0xa5099(%rip), %rdx     # 0x10e84a
movq %rbx, %rdi
movl $0x45f, %ecx            # imm = 0x45F
jmp 0x698ef
shll $0x3, %r12d
leaq 0x8483b(%rip), %rsi     # 0xee004
leaq 0xa508f(%rip), %rdx     # 0x10e85f
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84844(%rip), %rsi     # 0xee034
leaq 0xa5053(%rip), %rdx     # 0x10e84a
movq %rbx, %rdi
movl $0x460, %ecx            # imm = 0x460
jmp 0x698ef
leal (,%r15,8), %ecx
leaq 0x847f1(%rip), %rsi     # 0xee004
leaq 0xa5052(%rip), %rdx     # 0x10e86c
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x847fd(%rip), %rsi     # 0xee034
leaq 0xa500c(%rip), %rdx     # 0x10e84a
movq %rbx, %rdi
movl $0x461, %ecx            # imm = 0x461
jmp 0x698ef
leal (,%r15,8), %ecx
leaq 0x847aa(%rip), %rsi     # 0xee004
leaq 0xa5025(%rip), %rdx     # 0x10e886
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x847b6(%rip), %rsi     # 0xee034
leaq 0xa4fc5(%rip), %rdx     # 0x10e84a
movq %rbx, %rdi
movl $0x462, %ecx            # imm = 0x462
jmp 0x698ef
movslq %r12d, %rax
movq 0xf18(%rbx), %rcx
movsd -0x8(%rcx,%rax,8), %xmm0
movsd %xmm0, 0xff8(%rbx)
xorl %eax, %eax
jmp 0x698fe
addq $0xd1c, %r12            # imm = 0xD1C
leaq 0x84b37(%rip), %rsi     # 0xee3f0
leaq 0xa4fe6(%rip), %rdx     # 0x10e8a6
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r12, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1064, %rbx           # imm = 0x1064
leaq 0x84754(%rip), %rsi     # 0xee034
leaq 0xa4f63(%rip), %rdx     # 0x10e84a
movq %rbx, %rdi
movl $0x47e, %ecx            # imm = 0x47E
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq