// File: /workspace/github_c_makefile_star2_O2/PoulinV[P]AxiCLASS/build/../source/perturbations.c
// Function: perturbations_output_data_at_index_tau
int perturbations_output_data_at_index_tau(
                                           struct background * pba,
                                           struct perturbations * ppt,
                                           enum file_format output_format,
                                           int index_tau,
                                           int number_of_titles,
                                           double *data
                                           ) {

  double * tkfull=NULL;  /* array with argument tkfull[(index_k * ppt->ic_size[index_md] + index_ic) * ppt->tp_size[index_md] + index_tp] */

  int index_md = ppt->index_md_scalars;
  int index_ic;
  int index_k;
  int index_tp;

  class_test((index_tau < 0) || (index_tau >= ppt->ln_tau_size),
             ppt->error_message,
             "index_tau outside of array range");

  /** - allocate and fill tkfull */

  if (ppt->k_size[index_md]*ppt->ic_size[index_md]*ppt->tp_size[index_md] > 0) {
    class_alloc(tkfull,
                ppt->k_size[index_md]*ppt->ic_size[index_md]*ppt->tp_size[index_md]*sizeof(double),
                ppt->error_message);
  }

  for (index_k=0; index_k<ppt->k_size[index_md]; index_k++) {
    for (index_tp=0; index_tp<ppt->tp_size[index_md]; index_tp++) {
      for (index_ic=0; index_ic<ppt->ic_size[index_md]; index_ic++) {
        tkfull[(index_k * ppt->ic_size[index_md] + index_ic) * ppt->tp_size[index_md] + index_tp]
          = ppt->late_sources[index_md][index_ic * ppt->tp_size[index_md] + index_tp][index_tau * ppt->k_size[index_md] + index_k];
      }
    }
  }

  /** - store data */

  class_call(perturbations_output_data(pba,ppt,output_format,tkfull,number_of_titles,data),
             ppt->error_message,
             ppt->error_message);

  /** - free tkfull */
  // condition necessary because the size could be zero (if ppt->tp_size is zero)
  if (tkfull != NULL)
    free(tkfull);

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1038, %rsp           # imm = 0x1038
movq %rsi, %rbx
testl %ecx, %ecx
js 0x6e2fc
cmpl %ecx, 0xa60(%rbx)
jle 0x6e2fc
movq %r9, %r12
movq %rdi, 0x28(%rsp)
movl %edx, 0x10(%rsp)
movl %r8d, 0x14(%rsp)
movslq 0x848(%rbx), %r15
movq 0x9c8(%rbx), %rax
movl (%rax,%r15,4), %edx
movq 0x870(%rbx), %rax
movq 0x998(%rbx), %rsi
movslq (%rax,%r15,4), %rax
movq %rax, 0x8(%rsp)
movq %rdx, %r13
imull %edx, %eax
movslq (%rsi,%r15,4), %rbp
movl %ebp, %edx
imull %eax, %edx
testl %edx, %edx
jle 0x6e364
movl %edx, (%rsp)
movl %edx, %edi
shlq $0x3, %rdi
movl %ecx, %r14d
callq 0x8490
movl %r14d, %ecx
movq %rax, %rsi
testq %rax, %rax
jne 0x6e366
movl (%rsp), %ecx
shll $0x3, %ecx
leaq 0x76d40(%rip), %rsi     # 0xe5004
leaq 0x9bbcf(%rip), %rdx     # 0x109e9a
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x76d4c(%rip), %rsi     # 0xe5034
leaq 0x9bce7(%rip), %rdx     # 0x109fd6
movq %rbx, %rdi
movl $0x183, %ecx            # imm = 0x183
movq %r14, %r8
jmp 0x6e355
leaq 0x9bc7f(%rip), %rsi     # 0x109f82
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x76d69(%rip), %rsi     # 0xe5082
leaq 0x9bc83(%rip), %rdx     # 0x109fa3
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x76cf1(%rip), %rsi     # 0xe5034
leaq 0x9bc8c(%rip), %rdx     # 0x109fd6
movq %rbx, %rdi
movl $0x17c, %ecx            # imm = 0x17C
movq %r15, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
jmp 0x6e449
xorl %esi, %esi
movq %r12, 0x20(%rsp)
imull %r13d, %ecx
movq 0x8(%rsp), %rax
testl %eax, %eax
movl $0x0, %r12d
cmovgl %eax, %r12d
testl %ebp, %ebp
movl $0x0, %r14d
cmovgl %ebp, %r14d
movslq %ecx, %rdx
testl %r13d, %r13d
movl $0x0, %ecx
cmovlel %ecx, %r13d
movq %r13, (%rsp)
imulq %rbp, %rax
shlq $0x3, %rbp
shlq $0x3, %rax
movq %rax, 0x8(%rsp)
movq %rsi, 0x18(%rsp)
cmpq (%rsp), %rcx
je 0x6e41c
leaq (,%rcx,8), %rdi
movq %rsi, %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpq %r14, %r10
je 0x6e412
xorl %r11d, %r11d
movq %r12, %rax
subq $0x1, %rax
jb 0x6e405
movq 0xa68(%rbx), %r13
movq (%r13,%r15,8), %r13
addq %r9, %r13
movq (%r11,%r13), %r13
addq %rdi, %r13
movsd (%r13,%rdx,8), %xmm0
movsd %xmm0, (%r8,%r11)
addq %rbp, %r11
jmp 0x6e3d7
incq %r10
addq $0x8, %r9
addq $0x8, %r8
jmp 0x6e3cc
incq %rcx
addq 0x8(%rsp), %rsi
jmp 0x6e3b5
movq 0x28(%rsp), %rdi
movq %rbx, %rsi
movl 0x10(%rsp), %edx
movq 0x18(%rsp), %rbx
movq %rbx, %rcx
movl 0x14(%rsp), %r8d
movq 0x20(%rsp), %r9
callq 0x6daf1
movq %rbx, %rdi
callq 0x8430
xorl %eax, %eax
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq