// File: /workspace/github_c_makefile_star2_O3/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 0x8200
leaq 0xa10(%rsp), %rdi
movl $0x1f40, %edx           # imm = 0x1F40
xorl %esi, %esi
callq 0x8200
cmpw $0x1, 0x418(%rbx)
jne 0xeb80c
leaq 0x44280(%rip), %r14     # 0x12f890
leaq 0x44e76(%rip), %r12     # 0x13048d
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8550
incl %eax
movslq %eax, %rsi
leaq 0x110(%rsp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8550
leaq 0x2950(%rsp), %rsi
movq %r15, %rdi
callq 0xd2571
cmpl $0x1, %eax
jne 0xeb6a2
addq $0x570, %r15            # imm = 0x570
leaq 0x2d85(%rip), %rsi      # 0xee3f0
leaq 0x44e30(%rip), %rdx     # 0x1304a2
leaq 0x210(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x29a6(%rip), %rsi      # 0xee034
leaq 0x44e3b(%rip), %rdx     # 0x1304d0
movq %r15, %rdi
movl $0x57f, %ecx            # imm = 0x57F
jmp 0xeb8ab
movq %r13, 0x8(%rsp)
leaq 0x2950(%rsp), %rdi
callq 0x30c32
movl %eax, %r13d
movslq 0x450(%r15), %rax
movslq %r13d, %r12
imulq %rax, %r12
leaq (,%r12,8), %r14
movq %r14, %rdi
callq 0x8460
testq %rax, %rax
je 0xeb740
movq %r15, %rdi
movl %r13d, %esi
movq %rax, %r14
movq %rax, %rdx
callq 0xd2649
cmpl $0x1, %eax
jne 0xeb785
addq $0x570, %r15            # imm = 0x570
leaq 0x2cee(%rip), %rsi      # 0xee3f0
leaq 0x44de5(%rip), %rdx     # 0x1304ee
leaq 0x210(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %rbx            # imm = 0x420
leaq 0x2908(%rip), %rsi      # 0xee034
leaq 0x44d9d(%rip), %rdx     # 0x1304d0
movq %rbx, %rdi
movl $0x58b, %ecx            # imm = 0x58B
jmp 0xeba96
leaq 0x28bd(%rip), %rsi      # 0xee004
leaq 0x44d91(%rip), %rdx     # 0x1304df
leaq 0x210(%rsp), %r15
movq %r15, %rdi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %rbx            # imm = 0x420
leaq 0x28c3(%rip), %rsi      # 0xee034
leaq 0x44d58(%rip), %rdx     # 0x1304d0
movq %rbx, %rdi
movl $0x586, %ecx            # imm = 0x586
jmp 0xeb98a
leaq 0x5c95(%rip), %rsi      # 0xf1421
leaq 0x110(%rsp), %rdi
callq 0x8400
testq %rax, %rax
je 0xeb9ff
movq %rax, %r13
cmpw $0x1, 0x408(%rbx)
jne 0xeb7e1
leaq 0x44d8d(%rip), %rdi     # 0x130543
movl $0x42, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x44db7(%rip), %rdi     # 0x130586
movl $0x16, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x2950(%rsp), %rsi
movq %r13, %rdi
movq %r14, %rdx
movl %r12d, %ecx
callq 0xed1c2
movq %r14, %rdi
callq 0x8410
movq %r13, %rdi
callq 0x83a0
movq 0x8(%rsp), %r13
cmpw $0x1, 0x41a(%rbx)
jne 0xebaa5
leaq 0x4406f(%rip), %r14     # 0x12f890
leaq 0x44d75(%rip), %r12     # 0x13059d
xorl %edi, %edi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8550
incl %eax
movslq %eax, %rsi
leaq 0x10(%rsp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r12, %r8
xorl %eax, %eax
callq 0x8550
leaq 0xa10(%rsp), %rsi
movq %r13, %rdi
callq 0xd36a8
cmpl $0x1, %eax
jne 0xeb8b3
addq $0x110, %r13            # imm = 0x110
leaq 0x2b77(%rip), %rsi      # 0xee3f0
leaq 0x44d35(%rip), %rdx     # 0x1305b5
leaq 0x210(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x2798(%rip), %rsi      # 0xee034
leaq 0x44c2d(%rip), %rdx     # 0x1304d0
movq %r13, %rdi
movl $0x5a9, %ecx            # imm = 0x5A9
movq %rbx, %r8
jmp 0xeba99
leaq 0xa10(%rsp), %rdi
callq 0x30c32
movl %eax, %ebp
movslq 0x450(%r15), %rax
movslq %ebp, %r15
imulq %rax, %r15
leaq (,%r15,8), %r14
movq %r14, %rdi
callq 0x8460
testq %rax, %rax
je 0xeb94a
movq %rax, %r12
movq %r13, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0xd370c
cmpl $0x1, %eax
jne 0xeb992
addq $0x110, %r13            # imm = 0x110
leaq 0x2ae4(%rip), %rsi      # 0xee3f0
leaq 0x44ce8(%rip), %rdx     # 0x1305fb
leaq 0x210(%rsp), %r14
movq %r14, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %rbx            # imm = 0x420
leaq 0x26fe(%rip), %rsi      # 0xee034
leaq 0x44b93(%rip), %rdx     # 0x1304d0
movq %rbx, %rdi
movl $0x5b5, %ecx            # imm = 0x5B5
jmp 0xeba96
leaq 0x26b3(%rip), %rsi      # 0xee004
leaq 0x44c91(%rip), %rdx     # 0x1305e9
leaq 0x210(%rsp), %r15
movq %r15, %rdi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %rbx            # imm = 0x420
leaq 0x26b9(%rip), %rsi      # 0xee034
leaq 0x44b4e(%rip), %rdx     # 0x1304d0
movq %rbx, %rdi
movl $0x5b0, %ecx            # imm = 0x5B0
movq %r15, %r8
jmp 0xeba99
leaq 0x5a88(%rip), %rsi      # 0xf1421
leaq 0x10(%rsp), %rdi
callq 0x8400
testq %rax, %rax
je 0xeba4d
movq %rax, %r14
cmpw $0x1, 0x408(%rbx)
jne 0xeb9d2
leaq 0x44c9c(%rip), %rdi     # 0x13065c
movl $0x4c, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x86d0
leaq 0xa10(%rsp), %rsi
movq %r14, %rdi
movq %r12, %rdx
movl %r15d, %ecx
callq 0xed1c2
movq %r12, %rdi
callq 0x8410
movq %r14, %rdi
callq 0x83a0
xorl %ebp, %ebp
jmp 0xebaa5
leaq 0x4fe2(%rip), %rsi      # 0xf09e8
leaq 0x44b28(%rip), %rdx     # 0x130535
leaq 0x1ea18(%rip), %r8      # 0x10a42c
leaq 0x210(%rsp), %r14
leaq 0x110(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x420, %rbx            # imm = 0x420
leaq 0x25f8(%rip), %rsi      # 0xee034
leaq 0x44a8d(%rip), %rdx     # 0x1304d0
movq %rbx, %rdi
movl $0x591, %ecx            # imm = 0x591
jmp 0xeba96
leaq 0x4f94(%rip), %rsi      # 0xf09e8
leaq 0x44bf0(%rip), %rdx     # 0x13064b
leaq 0x1e9ca(%rip), %r8      # 0x10a42c
leaq 0x210(%rsp), %r14
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x420, %rbx            # imm = 0x420
leaq 0x25ad(%rip), %rsi      # 0xee034
leaq 0x44a42(%rip), %rdx     # 0x1304d0
movq %rbx, %rdi
movl $0x5bb, %ecx            # imm = 0x5BB
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %ebp
movl %ebp, %eax
addq $0x4898, %rsp           # imm = 0x4898
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq