// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/output.c
// Function: output_open_pk_file
int output_open_pk_file(
                        struct background * pba,
                        struct fourier * pfo,
                        struct output * pop,
                        FILE * * pkfile,
                        FileName filename,
                        char * first_line,
                        double z
                        ) {

  int colnum = 1;
  class_open(*pkfile,filename,"w",pop->error_message);

  if (pop->write_header == _TRUE_) {
    fprintf(*pkfile,"# Matter power spectrum P(k) %sat redshift z=%g\n",first_line,z);
    fprintf(*pkfile,"# for k=%g to %g h/Mpc,\n",
            exp(pfo->ln_k[0])/pba->h,
            exp(pfo->ln_k[pfo->k_size-1])/pba->h);
    fprintf(*pkfile,"# number of wavenumbers equal to %d\n",pfo->k_size);

    fprintf(*pkfile,"#");
    class_fprintf_columntitle(*pkfile,"k (h/Mpc)",_TRUE_,colnum);
    class_fprintf_columntitle(*pkfile,"P (Mpc/h)^3",_TRUE_,colnum);

    fprintf(*pkfile,"\n");
  }

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movsd %xmm0, 0x8(%rsp)
movq %r9, %r13
movq %r8, %rbp
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %r15
leaq 0x4470(%rip), %rsi      # 0xf1421
movq %r8, %rdi
callq 0x8400
movq %rax, (%rbx)
testq %rax, %rax
je 0xed0e0
xorl %ebp, %ebp
cmpw $0x1, 0x408(%r12)
jne 0xed133
leaq 0x43c7a(%rip), %rsi     # 0x130c58
movq %rax, %rdi
movq %r13, %rdx
movsd 0x8(%rsp), %xmm0
movb $0x1, %al
callq 0x84e0
movq (%rbx), %r12
movq 0x80(%r14), %rax
movsd (%rax), %xmm0
callq 0x8670
divsd 0x8(%r15), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x80(%r14), %rax
movslq 0x6c(%r14), %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
callq 0x8670
movapd %xmm0, %xmm1
divsd 0x8(%r15), %xmm1
leaq 0x42899(%rip), %rsi     # 0x12f8d0
movq %r12, %rdi
movsd 0x8(%rsp), %xmm0
movb $0x2, %al
callq 0x84e0
movq (%rbx), %rdi
movl 0x6c(%r14), %edx
leaq 0x42894(%rip), %rsi     # 0x12f8e9
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x84e0
movq (%rbx), %rsi
movl $0x23, %edi
callq 0x8440
movq (%rbx), %rdi
leaq 0x260e8(%rip), %rax     # 0x11315d
movq %rax, (%rsp)
leaq 0x4386d(%rip), %r14     # 0x1308ed
leaq 0x43865(%rip), %r15     # 0x1308ec
movq %r14, %rsi
movl $0x3, %edx
movq %r15, %rcx
movl $0x1, %r8d
movl $0x12, %r9d
xorl %eax, %eax
callq 0x84e0
movq (%rbx), %rdi
leaq 0x43bda(%rip), %rax     # 0x130c89
movq %rax, (%rsp)
movq %r14, %rsi
movl $0x3, %edx
movq %r15, %rcx
movl $0x2, %r8d
movl $0x12, %r9d
xorl %eax, %eax
callq 0x84e0
movq (%rbx), %rsi
movl $0xa, %edi
callq 0x8440
jmp 0xed133
leaq 0x3901(%rip), %rsi      # 0xf09e8
leaq 0x43b4e(%rip), %rdx     # 0x130c3c
leaq 0x1d337(%rip), %r8      # 0x10a42c
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x420, %r12            # imm = 0x420
leaq 0xf1f(%rip), %rsi       # 0xee034
leaq 0x43b28(%rip), %rdx     # 0x130c44
movq %r12, %rdi
movl $0x754, %ecx            # imm = 0x754
movq %rbx, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %ebp
movl %ebp, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq