// File: /workspace/github_c_makefile_star2_O1/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 0x40a9(%rip), %rsi      # 0xf4411
movq %r8, %rdi
callq 0x8400
movq %rax, (%rbx)
testq %rax, %rax
je 0xf0497
xorl %ebp, %ebp
cmpw $0x1, 0x408(%r12)
jne 0xf04ea
leaq 0x43893(%rip), %rsi     # 0x133c28
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 0x424b2(%rip), %rsi     # 0x1328a0
movq %r12, %rdi
movsd 0x8(%rsp), %xmm0
movb $0x2, %al
callq 0x84e0
movq (%rbx), %rdi
movl 0x6c(%r14), %edx
leaq 0x424ad(%rip), %rsi     # 0x1328b9
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x84e0
movq (%rbx), %rsi
movl $0x23, %edi
callq 0x8440
movq (%rbx), %rdi
leaq 0x25cf1(%rip), %rax     # 0x11611d
movq %rax, (%rsp)
leaq 0x43486(%rip), %r14     # 0x1338bd
leaq 0x4347e(%rip), %r15     # 0x1338bc
movq %r14, %rsi
movl $0x3, %edx
movq %r15, %rcx
movl $0x1, %r8d
movl $0x12, %r9d
xorl %eax, %eax
callq 0x84e0
movq (%rbx), %rdi
leaq 0x437f3(%rip), %rax     # 0x133c59
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 0xf04ea
leaq 0x353a(%rip), %rsi      # 0xf39d8
leaq 0x43767(%rip), %rdx     # 0x133c0c
leaq 0x1cf58(%rip), %r8      # 0x10d404
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x420, %r12            # imm = 0x420
leaq 0xb68(%rip), %rsi       # 0xf1034
leaq 0x43741(%rip), %rdx     # 0x133c14
movq %r12, %rdi
movl $0x754, %ecx            # imm = 0x754
movq %rbx, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %ebp
movl %ebp, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq