// File: /workspace/github_c_makefile_star2_O1/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 0x675e9
cmpl $0x1, %eax
jne 0xedbc3
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x386b(%rip), %rsi      # 0xf13f0
leaq 0x4501f(%rip), %rdx     # 0x132bab
leaq 0x100(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %rbx            # imm = 0x420
leaq 0x3485(%rip), %rsi      # 0xf1034
leaq 0x4501a(%rip), %rdx     # 0x132bd0
movq %rbx, %rdi
movl $0x497, %ecx            # imm = 0x497
jmp 0xedc55
leaq 0x900(%rsp), %rdi
callq 0x30d6e
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 0xedc5d
movq %rax, %r12
movq %r14, %rdi
movl %ebp, %esi
movq %rax, %rdx
callq 0x67e3e
cmpl $0x1, %eax
jne 0xedca2
addq $0xd1c, %r14            # imm = 0xD1C
leaq 0x37d4(%rip), %rsi      # 0xf13f0
leaq 0x44fbf(%rip), %rdx     # 0x132be2
leaq 0x100(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %rbx            # imm = 0x420
leaq 0x33ee(%rip), %rsi      # 0xf1034
leaq 0x44f83(%rip), %rdx     # 0x132bd0
movq %rbx, %rdi
movl $0x49f, %ecx            # imm = 0x49F
movq %r15, %r8
jmp 0xede37
leaq 0x33a0(%rip), %rsi      # 0xf1004
leaq 0x406e2(%rip), %rdx     # 0x12e34d
leaq 0x100(%rsp), %r14
movq %r14, %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %rbx            # imm = 0x420
leaq 0x33a6(%rip), %rsi      # 0xf1034
leaq 0x44f3b(%rip), %rdx     # 0x132bd0
movq %rbx, %rdi
movl $0x49a, %ecx            # imm = 0x49A
jmp 0xede34
leaq 0x44bb7(%rip), %r13     # 0x132860
leaq 0x83d9(%rip), %r8       # 0xf6089
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 0x83b0(%rip), %r8       # 0xf6089
xorl %eax, %eax
callq 0x8550
leaq 0x672a(%rip), %rsi      # 0xf4411
movq %rbp, %rdi
callq 0x8400
testq %rax, %rax
je 0xedded
movq %rax, %r13
cmpw $0x1, 0x408(%rbx)
jne 0xeddc3
leaq 0x44f0f(%rip), %rdi     # 0x132c1f
movl $0x2a, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x44f21(%rip), %rdi     # 0x132c4a
movl $0x5b, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x44f64(%rip), %rdi     # 0x132ca6
movl $0x45, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
cmpw $0x1, 0x4bc(%r14)
jne 0xeddc3
leaq 0x44f86(%rip), %rdi     # 0x132cec
movl $0x52, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x44fc0(%rip), %rdi     # 0x132d3f
movl $0x4e, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x44ff6(%rip), %rdi     # 0x132d8e
movl $0x40, %esi
movl $0x1, %edx
movq %r13, %rcx
callq 0x86d0
leaq 0x4501e(%rip), %rdi     # 0x132dcf
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 0xf0579
movq %r12, %rdi
callq 0x8410
movq %r13, %rdi
callq 0x83a0
xorl %eax, %eax
jmp 0xede43
leaq 0x5be4(%rip), %rsi      # 0xf39d8
leaq 0x44e1b(%rip), %rdx     # 0x132c16
leaq 0x1f602(%rip), %r8      # 0x10d404
leaq 0x100(%rsp), %r14
movq %rsp, %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %rbx            # imm = 0x420
leaq 0x320f(%rip), %rsi      # 0xf1034
leaq 0x44da4(%rip), %rdx     # 0x132bd0
movq %rbx, %rdi
movl $0x4a2, %ecx            # imm = 0x4A2
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x2848, %rsp           # imm = 0x2848
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq