// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/output.c
// Function: output_perturbations
int output_perturbations(
                         struct background * pba,
                         struct perturbations * ppt,
                         struct output * pop
                         ) {

  FILE * out;
  FileName file_name;
  int index_ikout, index_md;
  double k;

  for (index_ikout=0; index_ikout<ppt->k_output_values_num; index_ikout++){

    if (ppt->has_scalars == _TRUE_){
      index_md = ppt->index_md_scalars;
      k = ppt->k[index_md][ppt->index_k_output_values[index_md*ppt->k_output_values_num+index_ikout]];
      class_sprintf(file_name,"%s%s%d%s",pop->root,"perturbations_k",index_ikout,"_s.dat");
      class_open(out, file_name, "w", ppt->error_message);
      fprintf(out,"#scalar perturbations for mode k = %.*e Mpc^(-1)\n",_OUTPUTPRECISION_,k);
      output_print_data(out,
                        ppt->scalar_titles,
                        ppt->scalar_perturbations_data[index_ikout],
                        ppt->size_scalar_perturbation_data[index_ikout]);

      fclose(out);
    }
    if (ppt->has_vectors == _TRUE_){
      index_md = ppt->index_md_vectors;
      k = ppt->k[index_md][ppt->index_k_output_values[index_md*ppt->k_output_values_num+index_ikout]];
      class_sprintf(file_name,"%s%s%d%s",pop->root,"perturbations_k",index_ikout,"_v.dat");
      class_open(out, file_name, "w", ppt->error_message);
      fprintf(out,"#vector perturbations for mode k = %.*e Mpc^(-1)\n",_OUTPUTPRECISION_,k);
      output_print_data(out,
                        ppt->vector_titles,
                        ppt->vector_perturbations_data[index_ikout],
                        ppt->size_vector_perturbation_data[index_ikout]);

      fclose(out);
    }
    if (ppt->has_tensors == _TRUE_){
      index_md = ppt->index_md_tensors;
      k = ppt->k[index_md][ppt->index_k_output_values[index_md*ppt->k_output_values_num+index_ikout]];
      class_sprintf(file_name,"%s%s%d%s",pop->root,"perturbations_k",index_ikout,"_t.dat");
      class_open(out, file_name, "w", ppt->error_message);
      fprintf(out,"#tensor perturbations for mode k = %.*e Mpc^(-1)\n",_OUTPUTPRECISION_,k);
      output_print_data(out,
                        ppt->tensor_titles,
                        ppt->tensor_perturbations_data[index_ikout],
                        ppt->size_tensor_perturbation_data[index_ikout]);

      fclose(out);
    }


  }
  return _SUCCESS_;

}

// Assembly:
movl 0x6d4(%rsi), %eax
testl %eax, %eax
jle 0xeb238
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x938, %rsp            # imm = 0x938
movq %rdx, %r14
movq %rsi, %rbx
leaq 0xa80(%rsi), %rcx
movq %rcx, 0x28(%rsp)
leaq 0x29c0(%rsi), %rcx
movq %rcx, 0x20(%rsp)
leaq 0x4900(%rsi), %rcx
movq %rcx, 0x18(%rsp)
xorl %r15d, %r15d
cmpw $0x1, 0xe(%rbx)
jne 0xeb03e
movslq 0x848(%rbx), %rcx
movq 0x9d0(%rbx), %rdx
movq 0xa78(%rbx), %rsi
movq (%rdx,%rcx,8), %rdx
cltq
imulq %rcx, %rax
addq %r15, %rax
movslq (%rsi,%rax,4), %rax
movsd (%rdx,%rax,8), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x45377(%rip), %rbp     # 0x130306
movq %rbp, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
leaq 0x4534f(%rip), %r13     # 0x1302ed
movq %r13, %rdx
movq %r14, %rcx
leaq 0x4534b(%rip), %r12     # 0x1302f6
movq %r12, %r8
movl %r15d, %r9d
xorl %eax, %eax
callq 0x8550
incl %eax
movslq %eax, %rsi
movq %rbp, (%rsp)
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rdx
movq %r14, %rcx
movq %r12, %r8
movl %r15d, %r9d
xorl %eax, %eax
callq 0x8550
movq %rbp, %rdi
leaq 0x643b(%rip), %rsi      # 0xf1421
callq 0x8400
testq %rax, %rax
je 0xeb23b
movq %rax, %rbp
movq %rax, %rdi
leaq 0x45321(%rip), %rsi     # 0x130322
movl $0xc, %edx
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x84e0
movq 0x6850(%rbx,%r15,8), %rdx
movl 0x6b20(%rbx,%r15,4), %ecx
movq %rbp, %rdi
movq 0x28(%rsp), %rsi
callq 0xed1c2
movq %rbp, %rdi
callq 0x83a0
movl 0x6d4(%rbx), %eax
cmpw $0x1, 0x10(%rbx)
jne 0xeb130
movslq 0x850(%rbx), %rcx
movq 0x9d0(%rbx), %rdx
movq 0xa78(%rbx), %rsi
movq (%rdx,%rcx,8), %rdx
cltq
imulq %rcx, %rax
addq %r15, %rax
movslq (%rsi,%rax,4), %rax
movsd (%rdx,%rax,8), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x452d3(%rip), %rbp     # 0x130354
movq %rbp, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
leaq 0x4525d(%rip), %r13     # 0x1302ed
movq %r13, %rdx
movq %r14, %rcx
leaq 0x45259(%rip), %r12     # 0x1302f6
movq %r12, %r8
movl %r15d, %r9d
xorl %eax, %eax
callq 0x8550
incl %eax
movslq %eax, %rsi
movq %rbp, (%rsp)
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rdx
movq %r14, %rcx
movq %r12, %r8
movl %r15d, %r9d
xorl %eax, %eax
callq 0x8550
movq %rbp, %rdi
leaq 0x6349(%rip), %rsi      # 0xf1421
callq 0x8400
testq %rax, %rax
je 0xeb289
movq %rax, %rbp
movq %rax, %rdi
leaq 0x45268(%rip), %rsi     # 0x13035b
movl $0xc, %edx
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x84e0
movq 0x6940(%rbx,%r15,8), %rdx
movl 0x6b98(%rbx,%r15,4), %ecx
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
callq 0xed1c2
movq %rbp, %rdi
callq 0x83a0
movl 0x6d4(%rbx), %eax
cmpw $0x1, 0x12(%rbx)
jne 0xeb222
movslq 0x84c(%rbx), %rcx
movq 0x9d0(%rbx), %rdx
movq 0xa78(%rbx), %rsi
movq (%rdx,%rcx,8), %rdx
cltq
imulq %rcx, %rax
addq %r15, %rax
movslq (%rsi,%rax,4), %rax
movsd (%rdx,%rax,8), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x4521a(%rip), %rbp     # 0x13038d
movq %rbp, (%rsp)
xorl %edi, %edi
xorl %esi, %esi
leaq 0x4516b(%rip), %r13     # 0x1302ed
movq %r13, %rdx
movq %r14, %rcx
leaq 0x45167(%rip), %r12     # 0x1302f6
movq %r12, %r8
movl %r15d, %r9d
xorl %eax, %eax
callq 0x8550
incl %eax
movslq %eax, %rsi
movq %rbp, (%rsp)
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rdx
movq %r14, %rcx
movq %r12, %r8
movl %r15d, %r9d
xorl %eax, %eax
callq 0x8550
movq %rbp, %rdi
leaq 0x6257(%rip), %rsi      # 0xf1421
callq 0x8400
testq %rax, %rax
je 0xeb2d4
movq %rax, %rbp
movq %rax, %rdi
leaq 0x451af(%rip), %rsi     # 0x130394
movl $0xc, %edx
movsd 0x10(%rsp), %xmm0
movb $0x1, %al
callq 0x84e0
movq 0x6a30(%rbx,%r15,8), %rdx
movl 0x6c10(%rbx,%r15,4), %ecx
movq %rbp, %rdi
movq 0x18(%rsp), %rsi
callq 0xed1c2
movq %rbp, %rdi
callq 0x83a0
movl 0x6d4(%rbx), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0xeaf4c
xorl %eax, %eax
jmp 0xeb32c
xorl %eax, %eax
retq
leaq 0x57a6(%rip), %rsi      # 0xf09e8
leaq 0x8f55(%rip), %rdx      # 0xf419e
leaq 0x1f1dc(%rip), %r8      # 0x10a42c
leaq 0x130(%rsp), %r14
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x2dbf(%rip), %rsi      # 0xee034
leaq 0x45091(%rip), %rdx     # 0x13030d
movq %rbx, %rdi
movl $0x50f, %ecx            # imm = 0x50F
jmp 0xeb31d
leaq 0x5758(%rip), %rsi      # 0xf09e8
leaq 0x8f07(%rip), %rdx      # 0xf419e
leaq 0x1f18e(%rip), %r8      # 0x10a42c
leaq 0x130(%rsp), %r14
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x2d71(%rip), %rsi      # 0xee034
leaq 0x45043(%rip), %rdx     # 0x13030d
movq %rbx, %rdi
movl $0x51c, %ecx            # imm = 0x51C
jmp 0xeb31d
leaq 0x570d(%rip), %rsi      # 0xf09e8
leaq 0x8ebc(%rip), %rdx      # 0xf419e
leaq 0x1f143(%rip), %r8      # 0x10a42c
leaq 0x130(%rsp), %r14
leaq 0x30(%rsp), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x2d26(%rip), %rsi      # 0xee034
leaq 0x44ff8(%rip), %rdx     # 0x13030d
movq %rbx, %rdi
movl $0x529, %ecx            # imm = 0x529
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x938, %rsp            # imm = 0x938
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq