// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/output.c
// Function: output_thermodynamics
int output_thermodynamics(
                          struct background * pba,
                          struct thermodynamics * pth,
                          struct output * pop
                          ) {

  FileName file_name;
  FILE * thermofile;
  char titles[_MAXTITLESTRINGLENGTH_]={0};
  double * data;
  int size_data, number_of_titles;

  class_call(thermodynamics_output_titles(pba,pth,titles),
             pth->error_message,
             pop->error_message);
  number_of_titles = get_number_of_titles(titles);
  size_data = number_of_titles*pth->tt_size;
  class_alloc(data,sizeof(double)*size_data,pop->error_message);
  class_call(thermodynamics_output_data(pba,
                                        pth,
                                        number_of_titles,
                                        data),
             pth->error_message,
             pop->error_message);

  class_sprintf(file_name,"%s%s",pop->root,"thermodynamics.dat");
  class_open(thermofile,file_name,"w",pop->error_message);

  if (pop->write_header == _TRUE_) {
    fprintf(thermofile,"# Table of selected thermodynamics quantities\n");
    fprintf(thermofile,"# The following notation is used in column titles:\n");
    fprintf(thermofile,"#         x_e = electron ionization fraction\n");
    fprintf(thermofile,"#      -kappa = optical depth\n");
    fprintf(thermofile,"#      kappa' = Thomson scattering rate, prime denotes conformal time derivatives\n");
    fprintf(thermofile,"#           g = kappa' e^-kappa = visibility function \n");
    fprintf(thermofile,"#          Tb = baryon temperature \n");
    fprintf(thermofile,"#         w_b = baryon equation of state parameter \n");
    fprintf(thermofile,"#       c_b^2 = baryon sound speed squared \n");
    fprintf(thermofile,"#       tau_d = baryon drag optical depth \n");
    if (pth->compute_damping_scale == _TRUE_)
      fprintf(thermofile,"#         r_d = approximate comoving value of photon damping scale \n");
    if (pth->has_idm_dr == _TRUE_) {
      fprintf(thermofile,"#  dmu_idm_dr = scattering rate of idr with idm_dr (i.e. idr opacity to idm_dr scattering) (units 1/Mpc)\n");
      fprintf(thermofile,"# ddmu_idm_dr = derivative of this rate\n");
      fprintf(thermofile,"#  tau_idm_dr = optical depth of idm_dr (due to interactions with idr) \n");
      fprintf(thermofile,"#     tau_idr = optical depth of idr (due to self-interactions) \n");
      fprintf(thermofile,"#    g_idm_dr = visibility function of idm_idr \n");
      fprintf(thermofile,"#  c_idm_dr^2 = interacting dark matter squared sound speed \n");
      fprintf(thermofile,"#    T_idm_dr = temperature of DM interacting with DR \n");
      fprintf(thermofile,"#     dmu_idr = idr self-interaction rate \n");
    }
  }

  output_print_data(thermofile,
                    titles,
                    data,
                    size_data);

  free(data);
  fclose(thermofile);

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2858, %rsp           # imm = 0x2858
movq %rdx, %r13
movq %rsi, %r15
movq %rdi, %r12
leaq 0x910(%rsp), %rbx
movl $0x1f40, %edx           # imm = 0x1F40
movq %rbx, %rdi
xorl %esi, %esi
callq 0x8220
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x6caaa
cmpl $0x1, %eax
jne 0xe2438
addq $0x1064, %r15           # imm = 0x1064
leaq 0x2ff6(%rip), %rsi      # 0xe53f0
leaq 0x448ad(%rip), %rdx     # 0x126cae
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %r13            # imm = 0x420
leaq 0x2c10(%rip), %rsi      # 0xe5034
leaq 0x448b0(%rip), %rdx     # 0x126cdb
movq %r13, %rdi
movl $0x4ca, %ecx            # imm = 0x4CA
jmp 0xe27a5
leaq 0x910(%rsp), %rdi
callq 0x2e156
movl %eax, %r14d
movslq 0xf08(%r15), %rax
movslq %r14d, %rbx
imulq %rax, %rbx
leaq (,%rbx,8), %rbp
movq %rbp, %rdi
callq 0x8490
testq %rax, %rax
je 0xe24d6
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
movq %rax, 0x8(%rsp)
movq %rax, %rcx
callq 0x6ce79
cmpl $0x1, %eax
jne 0xe251a
addq $0x1064, %r15           # imm = 0x1064
leaq 0x2f58(%rip), %rsi      # 0xe53f0
leaq 0x44852(%rip), %rdx     # 0x126cf1
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %r13            # imm = 0x420
leaq 0x2b72(%rip), %rsi      # 0xe5034
leaq 0x44812(%rip), %rdx     # 0x126cdb
movq %r13, %rdi
movl $0x4d3, %ecx            # imm = 0x4D3
jmp 0xe27a5
leaq 0x2b27(%rip), %rsi      # 0xe5004
leaq 0x3fd09(%rip), %rdx     # 0x1221ed
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %r13            # imm = 0x420
leaq 0x2b2e(%rip), %rsi      # 0xe5034
leaq 0x447ce(%rip), %rdx     # 0x126cdb
movq %r13, %rdi
movl $0x4cd, %ecx            # imm = 0x4CD
jmp 0xe27a5
leaq 0x441df(%rip), %r14     # 0x126700
leaq 0x7a60(%rip), %r12      # 0xe9f88
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %r13, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8580
incl %eax
movslq %eax, %rsi
leaq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r14, %rdx
movq %r13, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8580
leaq 0x5e81(%rip), %rsi      # 0xe83e1
movq %rbp, %rdi
callq 0x8420
testq %rax, %rax
je 0xe275c
movq %rax, %r12
cmpw $0x1, 0x408(%r13)
jne 0xe272e
leaq 0x447af(%rip), %rdi     # 0x126d39
pushq $0x2e
popq %rsi
pushq $0x1
popq %r13
movq %r13, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x447c5(%rip), %rdi     # 0x126d68
pushq $0x33
popq %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x447e4(%rip), %rdi     # 0x126d9c
pushq $0x2d
popq %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x447fd(%rip), %rdi     # 0x126dca
pushq $0x1e
popq %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x44807(%rip), %rdi     # 0x126de9
pushq $0x52
popq %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x44845(%rip), %rdi     # 0x126e3c
pushq $0x37
popq %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x44868(%rip), %rdi     # 0x126e74
pushq $0x24
popq %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x44878(%rip), %rdi     # 0x126e99
pushq $0x34
popq %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x44898(%rip), %rdi     # 0x126ece
pushq $0x2c
popq %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x448b0(%rip), %rdi     # 0x126efb
pushq $0x2b
popq %rsi
movq %r13, %rdx
movq %r12, %rcx
callq 0x8700
cmpw $0x1, 0x32(%r15)
jne 0xe2676
leaq 0x448bf(%rip), %rdi     # 0x126f27
pushq $0x44
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rcx
callq 0x8700
cmpw $0x1, 0x38(%r15)
jne 0xe272e
leaq 0x448e3(%rip), %rdi     # 0x126f6c
pushq $0x69
popq %rsi
pushq $0x1
popq %r15
movq %r15, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x44934(%rip), %rdi     # 0x126fd6
pushq $0x28
popq %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x44948(%rip), %rdi     # 0x126fff
pushq $0x48
popq %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x4497c(%rip), %rdi     # 0x127048
pushq $0x41
popq %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x449a9(%rip), %rdi     # 0x12708a
pushq $0x30
popq %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x449c5(%rip), %rdi     # 0x1270bb
pushq $0x3d
popq %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x449ee(%rip), %rdi     # 0x1270f9
pushq $0x37
popq %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x44a11(%rip), %rdi     # 0x127131
pushq $0x2b
popq %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x8700
leaq 0x910(%rsp), %rsi
movq %r12, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rdx
movl %ebx, %ecx
callq 0xe4991
movq %r14, %rdi
callq 0x8430
movq %r12, %rdi
callq 0x83c0
xorl %eax, %eax
jmp 0xe27b2
leaq 0x5245(%rip), %rsi      # 0xe79a8
leaq 0x445c4(%rip), %rdx     # 0x126d2e
leaq 0x1eb83(%rip), %r8      # 0x1012f4
leaq 0x110(%rsp), %rbx
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x420, %r13            # imm = 0x420
leaq 0x289e(%rip), %rsi      # 0xe5034
leaq 0x4453e(%rip), %rdx     # 0x126cdb
movq %r13, %rdi
movl $0x4d6, %ecx            # imm = 0x4D6
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x2858, %rsp           # imm = 0x2858
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq