// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/output.c
// Function: output_background
int output_background(
                      struct background * pba,
                      struct output * pop
                      ) {

  FILE * backfile;
  FileName file_name;

  char titles[_MAXTITLESTRINGLENGTH_]={0};
  double * data;
  int size_data, number_of_titles;

  class_call(background_output_titles(pba,titles),
             pba->error_message,
             pop->error_message);
  number_of_titles = get_number_of_titles(titles);
  size_data = number_of_titles*pba->bt_size;
  class_alloc(data,sizeof(double)*size_data,pop->error_message);
  class_call(background_output_data(pba,
                                    number_of_titles,
                                    data),
             pba->error_message,
             pop->error_message);

  class_sprintf(file_name,"%s%s",pop->root,"background.dat");
  class_open(backfile,file_name,"w",pop->error_message);

  if (pop->write_header == _TRUE_) {
    fprintf(backfile,"# Table of selected background quantities\n");
    fprintf(backfile,"# All densities are multiplied by (8piG/3) (below, shortcut notation (.) for this factor) \n");
    fprintf(backfile,"# Densities are in units [Mpc^-2] while all distances are in [Mpc]. \n");
    if (pba->has_scf == _TRUE_){
      fprintf(backfile,"# The units of phi, tau in the derivatives and the potential V are the following:\n");
      fprintf(backfile,"# --> phi is given in units of the reduced Planck mass m_Pl = (8 pi G)^(-1/2)\n");
      fprintf(backfile,"# --> tau in the derivative of V(phi) is given in units of Mpc.\n");
      fprintf(backfile,"# --> the potential V(phi) is given in units of m_Pl^2/Mpc^2.\n");
    }
  }

  output_print_data(backfile,
                    titles,
                    data,
                    size_data);

  free(data);
  fclose(backfile);

  return _SUCCESS_;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2848, %rsp           # imm = 0x2848
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x900(%rsp), %r15
movl $0x1f40, %edx           # imm = 0x1F40
movq %r15, %rdi
xorl %esi, %esi
callq 0x8220
movq %r14, %rdi
movq %r15, %rsi
callq 0x60bdb
cmpl $0x1, %eax
jne 0xe212e
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x3300(%rip), %rsi      # 0xe53f0
leaq 0x44954(%rip), %rdx     # 0x126a4b
leaq 0x100(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x2f1a(%rip), %rsi      # 0xe5034
leaq 0x4494f(%rip), %rdx     # 0x126a70
movq %rbx, %rdi
movl $0x497, %ecx            # imm = 0x497
jmp 0xe21c0
leaq 0x900(%rsp), %rdi
callq 0x2e156
movl %eax, %ebp
movslq 0x440(%r14), %rax
movslq %ebp, %r15
imulq %rax, %r15
leaq (,%r15,8), %r13
movq %r13, %rdi
callq 0x8490
testq %rax, %rax
je 0xe21c8
movq %rax, %r12
movq %r14, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x6144b
cmpl $0x1, %eax
jne 0xe220d
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x3269(%rip), %rsi      # 0xe53f0
leaq 0x448f4(%rip), %rdx     # 0x126a82
leaq 0x100(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x2e83(%rip), %rsi      # 0xe5034
leaq 0x448b8(%rip), %rdx     # 0x126a70
movq %rbx, %rdi
movl $0x49f, %ecx            # imm = 0x49F
movq %r15, %r8
jmp 0xe238c
leaq 0x2e35(%rip), %rsi      # 0xe5004
leaq 0x40017(%rip), %rdx     # 0x1221ed
leaq 0x100(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x2e3b(%rip), %rsi      # 0xe5034
leaq 0x44870(%rip), %rdx     # 0x126a70
movq %rbx, %rdi
movl $0x49a, %ecx            # imm = 0x49A
jmp 0xe2389
leaq 0x444ec(%rip), %r13     # 0x126700
leaq 0x7d5e(%rip), %r8       # 0xe9f79
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x8580
incl %eax
movslq %eax, %rsi
movq %rsp, %rbp
movq %rbp, %rdi
movq %r13, %rdx
movq %rbx, %rcx
leaq 0x7d35(%rip), %r8       # 0xe9f79
xorl %eax, %eax
callq 0x8580
leaq 0x618f(%rip), %rsi      # 0xe83e1
movq %rbp, %rdi
callq 0x8420
testq %rax, %rax
je 0xe2342
movq %rax, %r13
cmpw $0x1, 0x408(%rbx)
jne 0xe2318
leaq 0x44844(%rip), %rdi     # 0x126abf
pushq $0x2a
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
movq %r13, %rcx
callq 0x8700
leaq 0x44857(%rip), %rdi     # 0x126aea
pushq $0x5b
popq %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x8700
leaq 0x4489e(%rip), %rdi     # 0x126b46
pushq $0x45
popq %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x8700
cmpw $0x1, 0x4bc(%r14)
jne 0xe2318
leaq 0x448c4(%rip), %rdi     # 0x126b8c
pushq $0x52
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
movq %r13, %rcx
callq 0x8700
leaq 0x448ff(%rip), %rdi     # 0x126bdf
pushq $0x4e
popq %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x8700
leaq 0x44939(%rip), %rdi     # 0x126c2e
pushq $0x40
popq %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x8700
leaq 0x44965(%rip), %rdi     # 0x126c6f
pushq $0x3e
popq %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x8700
leaq 0x900(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rdx
movl %r15d, %ecx
callq 0xe4991
movq %r12, %rdi
callq 0x8430
movq %r13, %rdi
callq 0x83c0
xorl %eax, %eax
jmp 0xe2396
leaq 0x565f(%rip), %rsi      # 0xe79a8
leaq 0x44766(%rip), %rdx     # 0x126ab6
leaq 0x1ef9d(%rip), %r8      # 0x1012f4
leaq 0x100(%rsp), %r14
movq %rsp, %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x2cba(%rip), %rsi      # 0xe5034
leaq 0x446ef(%rip), %rdx     # 0x126a70
movq %rbx, %rdi
movl $0x4a2, %ecx            # imm = 0x4A2
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x2848, %rsp           # imm = 0x2848
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq