// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x1978, %rsp           # imm = 0x1978
movq %rdi, 0x1968(%rsp)
movq %rsi, 0x1960(%rsp)
movq %rdx, 0x1958(%rsp)
movl $0x0, 0x184c(%rsp)
movl 0x184c(%rsp), %eax
movq 0x1960(%rsp), %rcx
cmpl 0x6d4(%rcx), %eax
jge 0x1ce412
movq 0x1960(%rsp), %rax
movswl 0xe(%rax), %eax
cmpl $0x1, %eax
jne 0x1cdfce
movq 0x1960(%rsp), %rax
movl 0x848(%rax), %eax
movl %eax, 0x1848(%rsp)
movq 0x1960(%rsp), %rax
movq 0x9d0(%rax), %rax
movslq 0x1848(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x1960(%rsp), %rcx
movq 0xa78(%rcx), %rcx
movl 0x1848(%rsp), %edx
movq 0x1960(%rsp), %rsi
imull 0x6d4(%rsi), %edx
addl 0x184c(%rsp), %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x1840(%rsp)
movq 0x1958(%rsp), %rcx
movl 0x184c(%rsp), %r9d
xorl %eax, %eax
movl %eax, %esi
leaq 0x46d0e(%rip), %rdx     # 0x214b64
leaq 0x46d10(%rip), %r8      # 0x214b6d
leaq 0x46d19(%rip), %rax     # 0x214b7d
movq %rsi, %rdi
movq %rax, (%rsp)
movb $0x0, %al
callq 0x8540
movl %eax, 0x183c(%rsp)
leaq 0x1850(%rsp), %rdi
movl 0x183c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movq 0x1958(%rsp), %rcx
movl 0x184c(%rsp), %r9d
leaq 0x46cbf(%rip), %rdx     # 0x214b64
leaq 0x46cc1(%rip), %r8      # 0x214b6d
leaq 0x46cca(%rip), %rax     # 0x214b7d
movq %rax, (%rsp)
movb $0x0, %al
callq 0x8540
leaq 0x1850(%rsp), %rdi
leaq 0x755c(%rip), %rsi      # 0x1d5429
callq 0x8410
movq %rax, 0x1950(%rsp)
cmpq $0x0, 0x1950(%rsp)
jne 0x1cdf52
leaq 0x1030(%rsp), %rdi
leaq 0x1850(%rsp), %rcx
leaq 0x6ad4(%rip), %rsi      # 0x1d49d0
leaq 0x9e95(%rip), %rdx      # 0x1d7d98
leaq 0x2063e(%rip), %r8      # 0x1ee548
movb $0x0, %al
callq 0x5b9c0
movq 0x1960(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x1030(%rsp), %r8
leaq 0x4105(%rip), %rsi      # 0x1d2034
leaq 0x46c4e(%rip), %rdx     # 0x214b84
movl $0x50f, %ecx            # imm = 0x50F
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1974(%rsp)
jmp 0x1ce41d
movq 0x1950(%rsp), %rdi
movsd 0x1840(%rsp), %xmm0
leaq 0x46c2f(%rip), %rsi     # 0x214b99
movl $0xc, %edx
movb $0x1, %al
callq 0x84e0
movq 0x1950(%rsp), %rdi
movq 0x1960(%rsp), %rsi
addq $0xa80, %rsi            # imm = 0xA80
movq 0x1960(%rsp), %rax
movslq 0x184c(%rsp), %rcx
movq 0x6850(%rax,%rcx,8), %rdx
movq 0x1960(%rsp), %rax
movslq 0x184c(%rsp), %rcx
movl 0x6b20(%rax,%rcx,4), %ecx
callq 0x1d1430
movq 0x1950(%rsp), %rdi
callq 0x83c0
movq 0x1960(%rsp), %rax
movswl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x1ce1e7
movq 0x1960(%rsp), %rax
movl 0x850(%rax), %eax
movl %eax, 0x1848(%rsp)
movq 0x1960(%rsp), %rax
movq 0x9d0(%rax), %rax
movslq 0x1848(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x1960(%rsp), %rcx
movq 0xa78(%rcx), %rcx
movl 0x1848(%rsp), %edx
movq 0x1960(%rsp), %rsi
imull 0x6d4(%rsi), %edx
addl 0x184c(%rsp), %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x1840(%rsp)
movq 0x1958(%rsp), %rcx
movl 0x184c(%rsp), %r9d
xorl %eax, %eax
movl %eax, %esi
leaq 0x46af5(%rip), %rdx     # 0x214b64
leaq 0x46af7(%rip), %r8      # 0x214b6d
leaq 0x46b4e(%rip), %rax     # 0x214bcb
movq %rsi, %rdi
movq %rax, (%rsp)
movb $0x0, %al
callq 0x8540
movl %eax, 0x102c(%rsp)
leaq 0x1850(%rsp), %rdi
movl 0x102c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movq 0x1958(%rsp), %rcx
movl 0x184c(%rsp), %r9d
leaq 0x46aa6(%rip), %rdx     # 0x214b64
leaq 0x46aa8(%rip), %r8      # 0x214b6d
leaq 0x46aff(%rip), %rax     # 0x214bcb
movq %rax, (%rsp)
movb $0x0, %al
callq 0x8540
leaq 0x1850(%rsp), %rdi
leaq 0x7343(%rip), %rsi      # 0x1d5429
callq 0x8410
movq %rax, 0x1950(%rsp)
cmpq $0x0, 0x1950(%rsp)
jne 0x1ce16b
leaq 0x820(%rsp), %rdi
leaq 0x1850(%rsp), %rcx
leaq 0x68bb(%rip), %rsi      # 0x1d49d0
leaq 0x9c7c(%rip), %rdx      # 0x1d7d98
leaq 0x20425(%rip), %r8      # 0x1ee548
movb $0x0, %al
callq 0x5b9c0
movq 0x1960(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x820(%rsp), %r8
leaq 0x3eec(%rip), %rsi      # 0x1d2034
leaq 0x46a35(%rip), %rdx     # 0x214b84
movl $0x51c, %ecx            # imm = 0x51C
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1974(%rsp)
jmp 0x1ce41d
movq 0x1950(%rsp), %rdi
movsd 0x1840(%rsp), %xmm0
leaq 0x46a4f(%rip), %rsi     # 0x214bd2
movl $0xc, %edx
movb $0x1, %al
callq 0x84e0
movq 0x1950(%rsp), %rdi
movq 0x1960(%rsp), %rsi
addq $0x29c0, %rsi           # imm = 0x29C0
movq 0x1960(%rsp), %rax
movslq 0x184c(%rsp), %rcx
movq 0x6940(%rax,%rcx,8), %rdx
movq 0x1960(%rsp), %rax
movslq 0x184c(%rsp), %rcx
movl 0x6b98(%rax,%rcx,4), %ecx
callq 0x1d1430
movq 0x1950(%rsp), %rdi
callq 0x83c0
movq 0x1960(%rsp), %rax
movswl 0x12(%rax), %eax
cmpl $0x1, %eax
jne 0x1ce3fa
movq 0x1960(%rsp), %rax
movl 0x84c(%rax), %eax
movl %eax, 0x1848(%rsp)
movq 0x1960(%rsp), %rax
movq 0x9d0(%rax), %rax
movslq 0x1848(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x1960(%rsp), %rcx
movq 0xa78(%rcx), %rcx
movl 0x1848(%rsp), %edx
movq 0x1960(%rsp), %rsi
imull 0x6d4(%rsi), %edx
addl 0x184c(%rsp), %edx
movslq %edx, %rdx
movslq (%rcx,%rdx,4), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x1840(%rsp)
movq 0x1958(%rsp), %rcx
movl 0x184c(%rsp), %r9d
xorl %eax, %eax
movl %eax, %esi
leaq 0x468dc(%rip), %rdx     # 0x214b64
leaq 0x468de(%rip), %r8      # 0x214b6d
leaq 0x4696e(%rip), %rax     # 0x214c04
movq %rsi, %rdi
movq %rax, (%rsp)
movb $0x0, %al
callq 0x8540
movl %eax, 0x81c(%rsp)
leaq 0x1850(%rsp), %rdi
movl 0x81c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movq 0x1958(%rsp), %rcx
movl 0x184c(%rsp), %r9d
leaq 0x4688d(%rip), %rdx     # 0x214b64
leaq 0x4688f(%rip), %r8      # 0x214b6d
leaq 0x4691f(%rip), %rax     # 0x214c04
movq %rax, (%rsp)
movb $0x0, %al
callq 0x8540
leaq 0x1850(%rsp), %rdi
leaq 0x712a(%rip), %rsi      # 0x1d5429
callq 0x8410
movq %rax, 0x1950(%rsp)
cmpq $0x0, 0x1950(%rsp)
jne 0x1ce37e
leaq 0x10(%rsp), %rdi
leaq 0x1850(%rsp), %rcx
leaq 0x66a5(%rip), %rsi      # 0x1d49d0
leaq 0x9a66(%rip), %rdx      # 0x1d7d98
leaq 0x2020f(%rip), %r8      # 0x1ee548
movb $0x0, %al
callq 0x5b9c0
movq 0x1960(%rsp), %rdi
addq $0x6c8a, %rdi           # imm = 0x6C8A
leaq 0x10(%rsp), %r8
leaq 0x3cd9(%rip), %rsi      # 0x1d2034
leaq 0x46822(%rip), %rdx     # 0x214b84
movl $0x529, %ecx            # imm = 0x529
movb $0x0, %al
callq 0x5b9c0
movl $0x1, 0x1974(%rsp)
jmp 0x1ce41d
movq 0x1950(%rsp), %rdi
movsd 0x1840(%rsp), %xmm0
leaq 0x46875(%rip), %rsi     # 0x214c0b
movl $0xc, %edx
movb $0x1, %al
callq 0x84e0
movq 0x1950(%rsp), %rdi
movq 0x1960(%rsp), %rsi
addq $0x4900, %rsi           # imm = 0x4900
movq 0x1960(%rsp), %rax
movslq 0x184c(%rsp), %rcx
movq 0x6a30(%rax,%rcx,8), %rdx
movq 0x1960(%rsp), %rax
movslq 0x184c(%rsp), %rcx
movl 0x6c10(%rax,%rcx,4), %ecx
callq 0x1d1430
movq 0x1950(%rsp), %rdi
callq 0x83c0
jmp 0x1ce3fc
movl 0x184c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x184c(%rsp)
jmp 0x1cdd9a
movl $0x0, 0x1974(%rsp)
movl 0x1974(%rsp), %eax
addq $0x1978, %rsp           # imm = 0x1978
retq
nopl (%rax)