// File: /workspace/github_c_makefile_star2_O2/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 0x3c54(%rip), %rsi      # 0xe83e1
movq %r8, %rdi
callq 0x8420
movq %rax, (%rbx)
testq %rax, %rax
je 0xe48b2
xorl %ebp, %ebp
cmpw $0x1, 0x408(%r12)
jne 0xe4903
leaq 0x4330e(%rip), %rsi     # 0x127ac8
movq %rax, %rdi
movq %r13, %rdx
movsd 0x8(%rsp), %xmm0
movb $0x1, %al
callq 0x8510
movq (%rbx), %r12
movq 0x80(%r14), %rax
movsd (%rax), %xmm0
callq 0x86a0
divsd 0x8(%r15), %xmm0
movsd %xmm0, 0x8(%rsp)
movq 0x80(%r14), %rax
movslq 0x6c(%r14), %rcx
movsd -0x8(%rax,%rcx,8), %xmm0
callq 0x86a0
movapd %xmm0, %xmm1
divsd 0x8(%r15), %xmm1
leaq 0x41f2d(%rip), %rsi     # 0x126740
movq %r12, %rdi
movsd 0x8(%rsp), %xmm0
movb $0x2, %al
callq 0x8510
movq (%rbx), %rdi
movl 0x6c(%r14), %edx
leaq 0x41f28(%rip), %rsi     # 0x126759
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x8510
movq (%rbx), %rsi
pushq $0x23
popq %rdi
callq 0x8460
movq (%rbx), %rdi
leaq 0x257ae(%rip), %rax     # 0x109ffd
movq %rax, (%rsp)
leaq 0x42f03(%rip), %r14     # 0x12775d
leaq 0x42efb(%rip), %r15     # 0x12775c
pushq $0x3
popq %r12
pushq $0x1
popq %r8
pushq $0x12
popq %r13
movq %r14, %rsi
movl %r12d, %edx
movq %r15, %rcx
movl %r13d, %r9d
xorl %eax, %eax
callq 0x8510
movq (%rbx), %rdi
leaq 0x4326f(%rip), %rax     # 0x127af9
movq %rax, (%rsp)
pushq $0x2
popq %r8
movq %r14, %rsi
movl %r12d, %edx
movq %r15, %rcx
movl %r13d, %r9d
xorl %eax, %eax
callq 0x8510
movq (%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x8460
jmp 0xe4903
leaq 0x30ef(%rip), %rsi      # 0xe79a8
leaq 0x431ec(%rip), %rdx     # 0x127aac
leaq 0x1ca2d(%rip), %r8      # 0x1012f4
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x420, %r12            # imm = 0x420
leaq 0x74d(%rip), %rsi       # 0xe5034
leaq 0x431c6(%rip), %rdx     # 0x127ab4
movq %r12, %rdi
movl $0x754, %ecx            # imm = 0x754
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq