// File: /workspace/github_c_makefile_star2_O1/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 0x73bd0
cmpl $0x1, %eax
jne 0xedee5
addq $0x1064, %r15           # imm = 0x1064
leaq 0x3549(%rip), %rsi      # 0xf13f0
leaq 0x44f60(%rip), %rdx     # 0x132e0e
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %r13            # imm = 0x420
leaq 0x3163(%rip), %rsi      # 0xf1034
leaq 0x44f63(%rip), %rdx     # 0x132e3b
movq %r13, %rdi
movl $0x4ca, %ecx            # imm = 0x4CA
jmp 0xee296
leaq 0x910(%rsp), %rdi
callq 0x30d6e
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 0xedf83
movq %r12, %rdi
movq %r15, %rsi
movl %r14d, %edx
movq %rax, 0x8(%rsp)
movq %rax, %rcx
callq 0x73fa0
cmpl $0x1, %eax
jne 0xedfc7
addq $0x1064, %r15           # imm = 0x1064
leaq 0x34ab(%rip), %rsi      # 0xf13f0
leaq 0x44f05(%rip), %rdx     # 0x132e51
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %r13            # imm = 0x420
leaq 0x30c5(%rip), %rsi      # 0xf1034
leaq 0x44ec5(%rip), %rdx     # 0x132e3b
movq %r13, %rdi
movl $0x4d3, %ecx            # imm = 0x4D3
jmp 0xee296
leaq 0x307a(%rip), %rsi      # 0xf1004
leaq 0x403bc(%rip), %rdx     # 0x12e34d
leaq 0x110(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %r13            # imm = 0x420
leaq 0x3081(%rip), %rsi      # 0xf1034
leaq 0x44e81(%rip), %rdx     # 0x132e3b
movq %r13, %rdi
movl $0x4cd, %ecx            # imm = 0x4CD
jmp 0xee296
leaq 0x44892(%rip), %r14     # 0x132860
leaq 0x80c3(%rip), %r12      # 0xf6098
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 0x6404(%rip), %rsi      # 0xf4411
movq %rbp, %rdi
callq 0x8400
testq %rax, %rax
je 0xee24d
movq %rax, %r12
cmpw $0x1, 0x408(%r13)
jne 0xee21f
leaq 0x44e62(%rip), %rdi     # 0x132e99
movl $0x2e, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44e78(%rip), %rdi     # 0x132ec8
movl $0x33, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44e93(%rip), %rdi     # 0x132efc
movl $0x2d, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44ea8(%rip), %rdi     # 0x132f2a
movl $0x1e, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44eae(%rip), %rdi     # 0x132f49
movl $0x52, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44ee8(%rip), %rdi     # 0x132f9c
movl $0x37, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44f07(%rip), %rdi     # 0x132fd4
movl $0x24, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44f13(%rip), %rdi     # 0x132ff9
movl $0x34, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44f2f(%rip), %rdi     # 0x13302e
movl $0x2c, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44f43(%rip), %rdi     # 0x13305b
movl $0x2b, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
cmpw $0x1, 0x32(%r15)
jne 0xee14b
leaq 0x44f4e(%rip), %rdi     # 0x133087
movl $0x44, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
cmpw $0x1, 0x38(%r15)
jne 0xee21f
leaq 0x44f6e(%rip), %rdi     # 0x1330cc
movl $0x69, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44fbf(%rip), %rdi     # 0x133136
movl $0x28, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44fcf(%rip), %rdi     # 0x13315f
movl $0x48, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x44fff(%rip), %rdi     # 0x1331a8
movl $0x41, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x45028(%rip), %rdi     # 0x1331ea
movl $0x30, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x45040(%rip), %rdi     # 0x13321b
movl $0x3d, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x45065(%rip), %rdi     # 0x133259
movl $0x37, %esi
movl $0x1, %edx
movq %r12, %rcx
callq 0x86d0
leaq 0x45084(%rip), %rdi     # 0x133291
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 0xf0579
movq %r14, %rdi
callq 0x8410
movq %r12, %rdi
callq 0x83a0
xorl %eax, %eax
jmp 0xee2a5
leaq 0x5784(%rip), %rsi      # 0xf39d8
leaq 0x44c33(%rip), %rdx     # 0x132e8e
leaq 0x1f1a2(%rip), %r8      # 0x10d404
leaq 0x110(%rsp), %rbx
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %r13            # imm = 0x420
leaq 0x2dad(%rip), %rsi      # 0xf1034
leaq 0x44bad(%rip), %rdx     # 0x132e3b
movq %r13, %rdi
movl $0x4d6, %ecx            # imm = 0x4D6
movq %rbx, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x2858, %rsp           # imm = 0x2858
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq