// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/output.c
// Function: output_heating
int output_heating(struct injection* pin, struct noninjection* pni, struct output * pop) {

  /** Local variables*/
  FileName file_name_injection;
  FILE * out_injection;
  FileName file_name_noninjection;
  FILE * out_noninjection;

  char titles_injection[_MAXTITLESTRINGLENGTH_]={0};

  double * data_injection;
  int size_data_injection;
  int number_of_titles_injection;

  char titles_noninjection[_MAXTITLESTRINGLENGTH_]={0};

  double * data_noninjection;
  int size_data_noninjection;
  int number_of_titles_noninjection;

  if (pop->write_exotic_injection == _TRUE_){

    /* File name */
    class_sprintf(file_name_injection,"%s%s",pop->root,"exotic_injection.dat");

    /* Titles */
    class_call(injection_output_titles(pin,titles_injection),
               pin->error_message,
               pin->error_message);
    number_of_titles_injection = get_number_of_titles(titles_injection);

    /* Data array */
    size_data_injection = number_of_titles_injection*pin->z_size;
    class_alloc(data_injection,
                sizeof(double)*size_data_injection,
                pop->error_message);
    class_call(injection_output_data(pin,
                                     number_of_titles_injection,
                                     data_injection),
               pin->error_message,
               pop->error_message);

    /* File IO */
    class_open(out_injection,
               file_name_injection,
               "w",
               pop->error_message);

    if (pop->write_header == _TRUE_){
      fprintf(out_injection,"# Table of energy injection and deposition from exotic processes \n");
      fprintf(out_injection,"# Heat is dE/dt|dep_h\n");
    }

    output_print_data(out_injection,
                      titles_injection,
                      data_injection,
                      size_data_injection);
    free(data_injection);
    fclose(out_injection);

  }

  if (pop->write_noninjection == _TRUE_){

    /* File name */
    class_sprintf(file_name_noninjection,"%s%s",pop->root,"photon_noninjection.dat");

    /* Titles */
    class_call(noninjection_output_titles(pni,titles_noninjection),
               pni->error_message,
               pni->error_message);
    number_of_titles_noninjection = get_number_of_titles(titles_noninjection);

    /* Data array */
    size_data_noninjection = number_of_titles_noninjection*pin->z_size;
    class_alloc(data_noninjection,
                sizeof(double)*size_data_noninjection,
                pop->error_message);
    class_call(noninjection_output_data(pni,
                                        number_of_titles_noninjection,
                                        data_noninjection),
               pni->error_message,
               pop->error_message);

    /* File IO */
    class_open(out_noninjection,
               file_name_noninjection,
               "w",
               pop->error_message);

    if (pop->write_header == _TRUE_){
      fprintf(out_noninjection,"# Table of non-injected energy influencing the photon spectral distortions \n");
    }

    output_print_data(out_noninjection,
                      titles_noninjection,
                      data_noninjection,
                      size_data_noninjection);
    free(data_noninjection);
    fclose(out_noninjection);

  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4898, %rsp           # imm = 0x4898
movq %rdx, %rbx
movq %rsi, %r13
movq %rdi, %r15
leaq 0x2950(%rsp), %rdi
xorl %ebp, %ebp
movl $0x1f40, %edx           # imm = 0x1F40
xorl %esi, %esi
callq 0x8220
leaq 0xa10(%rsp), %rdi
movl $0x1f40, %edx           # imm = 0x1F40
xorl %esi, %esi
callq 0x8220
cmpw $0x1, 0x418(%rbx)
jne 0xe30c8
leaq 0x43832(%rip), %r14     # 0x126700
leaq 0x44428(%rip), %r12     # 0x1272fd
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8580
incl %eax
movslq %eax, %rsi
leaq 0x110(%rsp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8580
leaq 0x2950(%rsp), %rsi
movq %r15, %rdi
callq 0xcacf6
cmpl $0x1, %eax
jne 0xe2f60
addq $0x570, %r15            # imm = 0x570
leaq 0x24c7(%rip), %rsi      # 0xe53f0
leaq 0x443e2(%rip), %rdx     # 0x127312
leaq 0x210(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x20e8(%rip), %rsi      # 0xe5034
leaq 0x443ed(%rip), %rdx     # 0x127340
movq %r15, %rdi
movl $0x57f, %ecx            # imm = 0x57F
jmp 0xe3167
movq %r13, 0x8(%rsp)
leaq 0x2950(%rsp), %rdi
callq 0x2e156
movl %eax, %r13d
movslq 0x450(%r15), %rax
movslq %r13d, %r12
imulq %rax, %r12
leaq (,%r12,8), %r14
movq %r14, %rdi
callq 0x8490
testq %rax, %rax
je 0xe2ffe
movq %r15, %rdi
movl %r13d, %esi
movq %rax, %r13
movq %rax, %rdx
callq 0xcadce
cmpl $0x1, %eax
jne 0xe3043
addq $0x570, %r15            # imm = 0x570
leaq 0x2430(%rip), %rsi      # 0xe53f0
leaq 0x44397(%rip), %rdx     # 0x12735e
leaq 0x210(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x204a(%rip), %rsi      # 0xe5034
leaq 0x4434f(%rip), %rdx     # 0x127340
movq %rbx, %rdi
movl $0x58b, %ecx            # imm = 0x58B
jmp 0xe334e
leaq 0x1fff(%rip), %rsi      # 0xe5004
leaq 0x44343(%rip), %rdx     # 0x12734f
leaq 0x210(%rsp), %r15
movq %r15, %rdi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x2005(%rip), %rsi      # 0xe5034
leaq 0x4430a(%rip), %rdx     # 0x127340
movq %rbx, %rdi
movl $0x586, %ecx            # imm = 0x586
jmp 0xe3246
leaq 0x5397(%rip), %rsi      # 0xe83e1
leaq 0x110(%rsp), %rdi
callq 0x8420
testq %rax, %rax
je 0xe32b7
cmpw $0x1, 0x408(%rbx)
jne 0xe309a
leaq 0x44342(%rip), %rdi     # 0x1273b3
pushq $0x42
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
movq %rax, %r14
callq 0x8700
leaq 0x4436d(%rip), %rdi     # 0x1273f6
pushq $0x16
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x8700
movq %r14, %rax
leaq 0x2950(%rsp), %rsi
movq %rax, %rdi
movq %r13, %rdx
movl %r12d, %ecx
movq %rax, %r12
callq 0xe4991
movq %r13, %rdi
callq 0x8430
movq %r12, %rdi
callq 0x83c0
movq 0x8(%rsp), %r13
cmpw $0x1, 0x41a(%rbx)
jne 0xe335b
leaq 0x43623(%rip), %r14     # 0x126700
leaq 0x44329(%rip), %r12     # 0x12740d
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8580
incl %eax
movslq %eax, %rsi
leaq 0x10(%rsp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8580
leaq 0xa10(%rsp), %rsi
movq %r13, %rdi
callq 0xcbda3
cmpl $0x1, %eax
jne 0xe316f
addq $0x110, %r13            # imm = 0x110
leaq 0x22bb(%rip), %rsi      # 0xe53f0
leaq 0x442e9(%rip), %rdx     # 0x127425
leaq 0x210(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x1edc(%rip), %rsi      # 0xe5034
leaq 0x441e1(%rip), %rdx     # 0x127340
movq %r13, %rdi
movl $0x5a9, %ecx            # imm = 0x5A9
movq %rbx, %r8
jmp 0xe3351
leaq 0xa10(%rsp), %rdi
callq 0x2e156
movl %eax, %ebp
movslq 0x450(%r15), %rax
movslq %ebp, %r15
imulq %rax, %r15
leaq (,%r15,8), %r14
movq %r14, %rdi
callq 0x8490
testq %rax, %rax
je 0xe3206
movq %rax, %r12
movq %r13, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0xcbe07
cmpl $0x1, %eax
jne 0xe324e
addq $0x110, %r13            # imm = 0x110
leaq 0x2228(%rip), %rsi      # 0xe53f0
leaq 0x4429c(%rip), %rdx     # 0x12746b
leaq 0x210(%rsp), %r14
movq %r14, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x1e42(%rip), %rsi      # 0xe5034
leaq 0x44147(%rip), %rdx     # 0x127340
movq %rbx, %rdi
movl $0x5b5, %ecx            # imm = 0x5B5
jmp 0xe334e
leaq 0x1df7(%rip), %rsi      # 0xe5004
leaq 0x44245(%rip), %rdx     # 0x127459
leaq 0x210(%rsp), %r15
movq %r15, %rdi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x1dfd(%rip), %rsi      # 0xe5034
leaq 0x44102(%rip), %rdx     # 0x127340
movq %rbx, %rdi
movl $0x5b0, %ecx            # imm = 0x5B0
movq %r15, %r8
jmp 0xe3351
leaq 0x518c(%rip), %rsi      # 0xe83e1
leaq 0x10(%rsp), %rdi
callq 0x8420
testq %rax, %rax
je 0xe3305
movq %rax, %r14
cmpw $0x1, 0x408(%rbx)
jne 0xe328a
leaq 0x44250(%rip), %rdi     # 0x1274cc
pushq $0x4c
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x8700
leaq 0xa10(%rsp), %rsi
movq %r14, %rdi
movq %r12, %rdx
movl %r15d, %ecx
callq 0xe4991
movq %r12, %rdi
callq 0x8430
movq %r14, %rdi
callq 0x83c0
xorl %ebp, %ebp
jmp 0xe335b
leaq 0x46ea(%rip), %rsi      # 0xe79a8
leaq 0x440e0(%rip), %rdx     # 0x1273a5
leaq 0x1e028(%rip), %r8      # 0x1012f4
leaq 0x210(%rsp), %r14
leaq 0x110(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x1d40(%rip), %rsi      # 0xe5034
leaq 0x44045(%rip), %rdx     # 0x127340
movq %rbx, %rdi
movl $0x591, %ecx            # imm = 0x591
jmp 0xe334e
leaq 0x469c(%rip), %rsi      # 0xe79a8
leaq 0x441a8(%rip), %rdx     # 0x1274bb
leaq 0x1dfda(%rip), %r8      # 0x1012f4
leaq 0x210(%rsp), %r14
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x1cf5(%rip), %rsi      # 0xe5034
leaq 0x43ffa(%rip), %rdx     # 0x127340
movq %rbx, %rdi
movl $0x5bb, %ecx            # imm = 0x5BB
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x4898, %rsp           # imm = 0x4898
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq