// File: /workspace/github_c_makefile_star2_O3/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 0x8200
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x7110b
cmpl $0x1, %eax
jne 0xeab2e
addq $0x1064, %r15           # imm = 0x1064
leaq 0x3900(%rip), %rsi      # 0xee3f0
leaq 0x45347(%rip), %rdx     # 0x12fe3e
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %r13            # imm = 0x420
leaq 0x351a(%rip), %rsi      # 0xee034
leaq 0x4534a(%rip), %rdx     # 0x12fe6b
movq %r13, %rdi
movl $0x4ca, %ecx            # imm = 0x4CA
jmp 0xeaedf
leaq 0x910(%rsp), %rdi
callq 0x30c32
movl %eax, %r14d
movslq 0xf08(%r15), %rax
movslq %r14d, %rbx
imulq %rax, %rbx
leaq (,%rbx,8), %rbp
movq %rbp, %rdi
callq 0x8460
testq %rax, %rax
je 0xeabcc
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
movq %rax, 0x8(%rsp)
movq %rax, %rcx
callq 0x714db
cmpl $0x1, %eax
jne 0xeac10
addq $0x1064, %r15           # imm = 0x1064
leaq 0x3862(%rip), %rsi      # 0xee3f0
leaq 0x452ec(%rip), %rdx     # 0x12fe81
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %r13            # imm = 0x420
leaq 0x347c(%rip), %rsi      # 0xee034
leaq 0x452ac(%rip), %rdx     # 0x12fe6b
movq %r13, %rdi
movl $0x4d3, %ecx            # imm = 0x4D3
jmp 0xeaedf
leaq 0x3431(%rip), %rsi      # 0xee004
leaq 0x407a3(%rip), %rdx     # 0x12b37d
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %r13            # imm = 0x420
leaq 0x3438(%rip), %rsi      # 0xee034
leaq 0x45268(%rip), %rdx     # 0x12fe6b
movq %r13, %rdi
movl $0x4cd, %ecx            # imm = 0x4CD
jmp 0xeaedf
leaq 0x44c79(%rip), %r14     # 0x12f890
leaq 0x84a2(%rip), %r12      # 0xf30c0
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %r13, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8550
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 0x8550
leaq 0x67cb(%rip), %rsi      # 0xf1421
movq %rbp, %rdi
callq 0x8400
testq %rax, %rax
je 0xeae96
movq %rax, %r12
cmpw $0x1, 0x408(%r13)
jne 0xeae68
leaq 0x45249(%rip), %rdi     # 0x12fec9
movl $0x2e, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x4525f(%rip), %rdi     # 0x12fef8
movl $0x33, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x4527a(%rip), %rdi     # 0x12ff2c
movl $0x2d, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x4528f(%rip), %rdi     # 0x12ff5a
movl $0x1e, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x45295(%rip), %rdi     # 0x12ff79
movl $0x52, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x452cf(%rip), %rdi     # 0x12ffcc
movl $0x37, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x452ee(%rip), %rdi     # 0x130004
movl $0x24, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x452fa(%rip), %rdi     # 0x130029
movl $0x34, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x45316(%rip), %rdi     # 0x13005e
movl $0x2c, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x4532a(%rip), %rdi     # 0x13008b
movl $0x2b, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
cmpw $0x1, 0x32(%r15)
jne 0xead94
leaq 0x45335(%rip), %rdi     # 0x1300b7
movl $0x44, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
cmpw $0x1, 0x38(%r15)
jne 0xeae68
leaq 0x45355(%rip), %rdi     # 0x1300fc
movl $0x69, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x453a6(%rip), %rdi     # 0x130166
movl $0x28, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x453b6(%rip), %rdi     # 0x13018f
movl $0x48, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x453e6(%rip), %rdi     # 0x1301d8
movl $0x41, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x4540f(%rip), %rdi     # 0x13021a
movl $0x30, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x45427(%rip), %rdi     # 0x13024b
movl $0x3d, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x4544c(%rip), %rdi     # 0x130289
movl $0x37, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x4546b(%rip), %rdi     # 0x1302c1
movl $0x2b, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x910(%rsp), %rsi
movq %r12, %rdi
movq 0x8(%rsp), %r14
movq %r14, %rdx
movl %ebx, %ecx
callq 0xed1c2
movq %r14, %rdi
callq 0x8410
movq %r12, %rdi
callq 0x83a0
xorl %eax, %eax
jmp 0xeaeee
leaq 0x5b4b(%rip), %rsi      # 0xf09e8
leaq 0x4501a(%rip), %rdx     # 0x12febe
leaq 0x1f581(%rip), %r8      # 0x10a42c
leaq 0x110(%rsp), %rbx
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x420, %r13            # imm = 0x420
leaq 0x3164(%rip), %rsi      # 0xee034
leaq 0x44f94(%rip), %rdx     # 0x12fe6b
movq %r13, %rdi
movl $0x4d6, %ecx            # imm = 0x4D6
movq %rbx, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x2858, %rsp           # imm = 0x2858
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq