// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/output.c
// Function: output_primordial
int output_primordial(
                      struct perturbations * ppt,
                      struct primordial * ppm,
                      struct output * pop
                      ) {
  FileName file_name;
  FILE * out;
  char titles[_MAXTITLESTRINGLENGTH_]={0};
  double * data;
  int size_data, number_of_titles;

  class_sprintf(file_name,"%s%s",pop->root,"primordial_Pk.dat");

  class_call(primordial_output_titles(ppt,ppm,titles),
             ppm->error_message,
             pop->error_message);
  number_of_titles = get_number_of_titles(titles);
  size_data = number_of_titles*ppm->lnk_size;
  class_alloc(data,sizeof(double)*size_data,pop->error_message);
  class_call(primordial_output_data(ppt,
                                    ppm,
                                    number_of_titles,
                                    data),
             ppm->error_message,
             pop->error_message);

  class_open(out,file_name,"w",pop->error_message);
  if (pop->write_header == _TRUE_) {
    fprintf(out,"# Dimensionless primordial spectrum, equal to [k^3/2pi^2] P(k) \n");
  }

  output_print_data(out,
                    titles,
                    data,
                    size_data);

  free(data);
  fclose(out);

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2848, %rsp           # imm = 0x2848
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x900(%rsp), %r12
movl $0x1f40, %edx           # imm = 0x1F40
movq %r12, %rdi
xorl %esi, %esi
callq 0x8220
leaq 0x43ac6(%rip), %r13     # 0x126700
leaq 0x445f5(%rip), %rbp     # 0x127236
xorl %edi, %edi
xorl %esi, %esi
movq %r13, %rdx
movq %rbx, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0x8580
incl %eax
movslq %eax, %rsi
movq %rsp, %rdi
movq %r13, %rdx
movq %rbx, %rcx
movq %rbp, %r8
xorl %eax, %eax
callq 0x8580
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x97a24
cmpl $0x1, %eax
jne 0xe2ccc
addq $0x32a, %r14            # imm = 0x32A
leaq 0x2762(%rip), %rsi      # 0xe53f0
leaq 0x445b3(%rip), %rdx     # 0x127248
leaq 0x100(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x237c(%rip), %rsi      # 0xe5034
leaq 0x445b2(%rip), %rdx     # 0x127271
movq %rbx, %rdi
movl $0x548, %ecx            # imm = 0x548
jmp 0xe2d63
leaq 0x900(%rsp), %rdi
callq 0x2e156
movl %eax, %r13d
movslq 0x290(%r14), %rax
movslq %r13d, %r12
imulq %rax, %r12
leaq (,%r12,8), %rbp
movq %rbp, %rdi
callq 0x8490
testq %rax, %rax
je 0xe2d6b
movq %r15, %rdi
movq %r14, %rsi
movl %r13d, %edx
movq %rax, %r15
movq %rax, %rcx
callq 0x97ac0
cmpl $0x1, %eax
jne 0xe2daf
addq $0x32a, %r14            # imm = 0x32A
leaq 0x26c6(%rip), %rsi      # 0xe53f0
leaq 0x44552(%rip), %rdx     # 0x127283
leaq 0x100(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x22e0(%rip), %rsi      # 0xe5034
leaq 0x44516(%rip), %rdx     # 0x127271
movq %rbx, %rdi
movl $0x551, %ecx            # imm = 0x551
movq %r15, %r8
jmp 0xe2e59
leaq 0x2292(%rip), %rsi      # 0xe5004
leaq 0x3f474(%rip), %rdx     # 0x1221ed
leaq 0x100(%rsp), %r14
movq %r14, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x2299(%rip), %rsi      # 0xe5034
leaq 0x444cf(%rip), %rdx     # 0x127271
movq %rbx, %rdi
movl $0x54b, %ecx            # imm = 0x54B
jmp 0xe2e56
leaq 0x562b(%rip), %rsi      # 0xe83e1
movq %rsp, %rdi
callq 0x8420
testq %rax, %rax
je 0xe2e0f
movq %rax, %r14
cmpw $0x1, 0x408(%rbx)
jne 0xe2de5
leaq 0x444e5(%rip), %rdi     # 0x1272bc
pushq $0x40
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rcx
callq 0x8700
leaq 0x900(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
movl %r12d, %ecx
callq 0xe4991
movq %r15, %rdi
callq 0x8430
movq %r14, %rdi
callq 0x83c0
xorl %eax, %eax
jmp 0xe2e63
leaq 0x4b92(%rip), %rsi      # 0xe79a8
leaq 0x8249(%rip), %rdx      # 0xeb066
leaq 0x1e4d0(%rip), %r8      # 0x1012f4
leaq 0x100(%rsp), %r14
movq %rsp, %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x420, %rbx            # imm = 0x420
leaq 0x21ed(%rip), %rsi      # 0xe5034
leaq 0x44423(%rip), %rdx     # 0x127271
movq %rbx, %rdi
movl $0x553, %ecx            # imm = 0x553
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