// File: /workspace/github_c_makefile_star2_O3/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 0x8200
movq %r14, %rdi
movq %r15, %rsi
callq 0x64d42
cmpl $0x1, %eax
jne 0xea80c
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x3c22(%rip), %rsi      # 0xee3f0
leaq 0x45406(%rip), %rdx     # 0x12fbdb
leaq 0x100(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %rbx            # imm = 0x420
leaq 0x383c(%rip), %rsi      # 0xee034
leaq 0x45401(%rip), %rdx     # 0x12fc00
movq %rbx, %rdi
movl $0x497, %ecx            # imm = 0x497
jmp 0xea89e
leaq 0x900(%rsp), %rdi
callq 0x30c32
movl %eax, %ebp
movslq 0x440(%r14), %rax
movslq %ebp, %r15
imulq %rax, %r15
leaq (,%r15,8), %r13
movq %r13, %rdi
callq 0x8460
testq %rax, %rax
je 0xea8a6
movq %rax, %r12
movq %r14, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x655c5
cmpl $0x1, %eax
jne 0xea8eb
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x3b8b(%rip), %rsi      # 0xee3f0
leaq 0x453a6(%rip), %rdx     # 0x12fc12
leaq 0x100(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %rbx            # imm = 0x420
leaq 0x37a5(%rip), %rsi      # 0xee034
leaq 0x4536a(%rip), %rdx     # 0x12fc00
movq %rbx, %rdi
movl $0x49f, %ecx            # imm = 0x49F
movq %r15, %r8
jmp 0xeaa80
leaq 0x3757(%rip), %rsi      # 0xee004
leaq 0x40ac9(%rip), %rdx     # 0x12b37d
leaq 0x100(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %rbx            # imm = 0x420
leaq 0x375d(%rip), %rsi      # 0xee034
leaq 0x45322(%rip), %rdx     # 0x12fc00
movq %rbx, %rdi
movl $0x49a, %ecx            # imm = 0x49A
jmp 0xeaa7d
leaq 0x44f9e(%rip), %r13     # 0x12f890
leaq 0x87b8(%rip), %r8       # 0xf30b1
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x8550
incl %eax
movslq %eax, %rsi
movq %rsp, %rbp
movq %rbp, %rdi
movq %r13, %rdx
movq %rbx, %rcx
leaq 0x878f(%rip), %r8       # 0xf30b1
xorl %eax, %eax
callq 0x8550
leaq 0x6af1(%rip), %rsi      # 0xf1421
movq %rbp, %rdi
callq 0x8400
testq %rax, %rax
je 0xeaa36
movq %rax, %r13
cmpw $0x1, 0x408(%rbx)
jne 0xeaa0c
leaq 0x452f6(%rip), %rdi     # 0x12fc4f
movl $0x2a, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x45308(%rip), %rdi     # 0x12fc7a
movl $0x5b, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x4534b(%rip), %rdi     # 0x12fcd6
movl $0x45, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
cmpw $0x1, 0x4bc(%r14)
jne 0xeaa0c
leaq 0x4536d(%rip), %rdi     # 0x12fd1c
movl $0x52, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x453a7(%rip), %rdi     # 0x12fd6f
movl $0x4e, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x453dd(%rip), %rdi     # 0x12fdbe
movl $0x40, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x45405(%rip), %rdi     # 0x12fdff
movl $0x3e, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x900(%rsp), %rsi
movq %r13, %rdi
movq %r12, %rdx
movl %r15d, %ecx
callq 0xed1c2
movq %r12, %rdi
callq 0x8410
movq %r13, %rdi
callq 0x83a0
xorl %eax, %eax
jmp 0xeaa8c
leaq 0x5fab(%rip), %rsi      # 0xf09e8
leaq 0x45202(%rip), %rdx     # 0x12fc46
leaq 0x1f9e1(%rip), %r8      # 0x10a42c
leaq 0x100(%rsp), %r14
movq %rsp, %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x420, %rbx            # imm = 0x420
leaq 0x35c6(%rip), %rsi      # 0xee034
leaq 0x4518b(%rip), %rdx     # 0x12fc00
movq %rbx, %rdi
movl $0x4a2, %ecx            # imm = 0x4A2
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x2848, %rsp           # imm = 0x2848
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq