// File: /workspace/github_c_makefile_star2_O1/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 0xeebbf
leaq 0x43e9d(%rip), %r14     # 0x132860
leaq 0x44a93(%rip), %r12     # 0x13345d
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 0xd5d7f
cmpl $0x1, %eax
jne 0xeea55
addq $0x570, %r15            # imm = 0x570
leaq 0x29d2(%rip), %rsi      # 0xf13f0
leaq 0x44a4d(%rip), %rdx     # 0x133472
leaq 0x210(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x25f3(%rip), %rsi      # 0xf1034
leaq 0x44a58(%rip), %rdx     # 0x1334a0
movq %r15, %rdi
movl $0x57f, %ecx            # imm = 0x57F
jmp 0xeec5e
movq %r13, 0x8(%rsp)
leaq 0x2950(%rsp), %rdi
callq 0x30d6e
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 0xeeaf3
movq %r15, %rdi
movl %r13d, %esi
movq %rax, %r14
movq %rax, %rdx
callq 0xd5e57
cmpl $0x1, %eax
jne 0xeeb38
addq $0x570, %r15            # imm = 0x570
leaq 0x293b(%rip), %rsi      # 0xf13f0
leaq 0x44a02(%rip), %rdx     # 0x1334be
leaq 0x210(%rsp), %r14
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %rbx            # imm = 0x420
leaq 0x2555(%rip), %rsi      # 0xf1034
leaq 0x449ba(%rip), %rdx     # 0x1334a0
movq %rbx, %rdi
movl $0x58b, %ecx            # imm = 0x58B
jmp 0xeee49
leaq 0x250a(%rip), %rsi      # 0xf1004
leaq 0x449ae(%rip), %rdx     # 0x1334af
leaq 0x210(%rsp), %r15
movq %r15, %rdi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %rbx            # imm = 0x420
leaq 0x2510(%rip), %rsi      # 0xf1034
leaq 0x44975(%rip), %rdx     # 0x1334a0
movq %rbx, %rdi
movl $0x586, %ecx            # imm = 0x586
jmp 0xeed3d
leaq 0x58d2(%rip), %rsi      # 0xf4411
leaq 0x110(%rsp), %rdi
callq 0x8400
testq %rax, %rax
je 0xeedb2
movq %rax, %r13
cmpw $0x1, 0x408(%rbx)
jne 0xeeb94
leaq 0x449aa(%rip), %rdi     # 0x133513
movl $0x42, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x449d4(%rip), %rdi     # 0x133556
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 0xf0579
movq %r14, %rdi
callq 0x8410
movq %r13, %rdi
callq 0x83a0
movq 0x8(%rsp), %r13
cmpw $0x1, 0x41a(%rbx)
jne 0xeee58
leaq 0x43c8c(%rip), %r14     # 0x132860
leaq 0x44992(%rip), %r12     # 0x13356d
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 0xd6ea3
cmpl $0x1, %eax
jne 0xeec66
addq $0x110, %r13            # imm = 0x110
leaq 0x27c4(%rip), %rsi      # 0xf13f0
leaq 0x44952(%rip), %rdx     # 0x133585
leaq 0x210(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x23e5(%rip), %rsi      # 0xf1034
leaq 0x4484a(%rip), %rdx     # 0x1334a0
movq %r13, %rdi
movl $0x5a9, %ecx            # imm = 0x5A9
movq %rbx, %r8
jmp 0xeee4c
leaq 0xa10(%rsp), %rdi
callq 0x30d6e
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 0xeecfd
movq %rax, %r12
movq %r13, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0xd6f07
cmpl $0x1, %eax
jne 0xeed45
addq $0x110, %r13            # imm = 0x110
leaq 0x2731(%rip), %rsi      # 0xf13f0
leaq 0x44905(%rip), %rdx     # 0x1335cb
leaq 0x210(%rsp), %r14
movq %r14, %rdi
movq %r13, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %rbx            # imm = 0x420
leaq 0x234b(%rip), %rsi      # 0xf1034
leaq 0x447b0(%rip), %rdx     # 0x1334a0
movq %rbx, %rdi
movl $0x5b5, %ecx            # imm = 0x5B5
jmp 0xeee49
leaq 0x2300(%rip), %rsi      # 0xf1004
leaq 0x448ae(%rip), %rdx     # 0x1335b9
leaq 0x210(%rsp), %r15
movq %r15, %rdi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %rbx            # imm = 0x420
leaq 0x2306(%rip), %rsi      # 0xf1034
leaq 0x4476b(%rip), %rdx     # 0x1334a0
movq %rbx, %rdi
movl $0x5b0, %ecx            # imm = 0x5B0
movq %r15, %r8
jmp 0xeee4c
leaq 0x56c5(%rip), %rsi      # 0xf4411
leaq 0x10(%rsp), %rdi
callq 0x8400
testq %rax, %rax
je 0xeee00
movq %rax, %r14
cmpw $0x1, 0x408(%rbx)
jne 0xeed85
leaq 0x448b9(%rip), %rdi     # 0x13362c
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 0xf0579
movq %r12, %rdi
callq 0x8410
movq %r14, %rdi
callq 0x83a0
xorl %ebp, %ebp
jmp 0xeee58
leaq 0x4c1f(%rip), %rsi      # 0xf39d8
leaq 0x44745(%rip), %rdx     # 0x133505
leaq 0x1e63d(%rip), %r8      # 0x10d404
leaq 0x210(%rsp), %r14
leaq 0x110(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %rbx            # imm = 0x420
leaq 0x2245(%rip), %rsi      # 0xf1034
leaq 0x446aa(%rip), %rdx     # 0x1334a0
movq %rbx, %rdi
movl $0x591, %ecx            # imm = 0x591
jmp 0xeee49
leaq 0x4bd1(%rip), %rsi      # 0xf39d8
leaq 0x4480d(%rip), %rdx     # 0x13361b
leaq 0x1e5ef(%rip), %r8      # 0x10d404
leaq 0x210(%rsp), %r14
leaq 0x10(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %rbx            # imm = 0x420
leaq 0x21fa(%rip), %rsi      # 0xf1034
leaq 0x4465f(%rip), %rdx     # 0x1334a0
movq %rbx, %rdi
movl $0x5bb, %ecx            # imm = 0x5BB
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %ebp
movl %ebp, %eax
addq $0x4898, %rsp           # imm = 0x4898
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq