// File: /workspace/github_c_makefile_star2_O3/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 0x7294b
movl %ecx, %r12d
cmpl %ecx, 0xa60(%rbx)
jle 0x7294b
movq %r9, %r13
movq %rdi, 0x28(%rsp)
movl %edx, 0x18(%rsp)
movl %r8d, 0x1c(%rsp)
movslq 0x848(%rbx), %r15
movq 0x9c8(%rbx), %rax
movl (%rax,%r15,4), %edx
movq 0x870(%rbx), %rax
movq 0x998(%rbx), %rcx
movl (%rax,%r15,4), %r14d
movl %r14d, %eax
movq %rdx, 0x10(%rsp)
imull %edx, %eax
movl (%rcx,%r15,4), %ebp
movl %ebp, %ecx
imull %eax, %ecx
testl %ecx, %ecx
jle 0x729c4
movl %ecx, (%rsp)
movl %ecx, %edi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x729cd
movl (%rsp), %ecx
shll $0x3, %ecx
leaq 0x7b6f1(%rip), %rsi     # 0xee004
leaq 0xa06e0(%rip), %rdx     # 0x112ffa
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x7b6fd(%rip), %rsi     # 0xee034
leaq 0xa07f8(%rip), %rdx     # 0x113136
movq %rbx, %rdi
movl $0x183, %ecx            # imm = 0x183
movq %r14, %r8
jmp 0x729a4
leaq 0xa0790(%rip), %rsi     # 0x1130e2
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x7b71a(%rip), %rsi     # 0xee082
leaq 0xa0794(%rip), %rdx     # 0x113103
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x7b6a2(%rip), %rsi     # 0xee034
leaq 0xa079d(%rip), %rdx     # 0x113136
movq %rbx, %rdi
movl $0x17c, %ecx            # imm = 0x17C
movq %r15, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %ebx
movl %ebx, %eax
addq $0x1038, %rsp           # imm = 0x1038
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x0, 0x8(%rsp)
movq %r13, 0x20(%rsp)
movq %rbx, %rcx
cmpl $0x0, 0x10(%rsp)
jle 0x72a6f
imull 0x10(%rsp), %r12d
leaq (,%rbp,8), %rax
movq $0x0, (%rsp)
xorl %edx, %edx
testl %ebp, %ebp
jle 0x72a5a
movl (%rsp), %esi
imulq %rax, %rsi
addq 0x8(%rsp), %rsi
leaq (,%rdx,8), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
testl %r14d, %r14d
jle 0x72a4a
movq 0xa68(%rcx), %r10
movq (%r10,%r15,8), %r10
addq %r8, %r10
movq %r14, %r11
xorl %r13d, %r13d
movq (%r10,%r13), %rbx
addq %rdi, %rbx
movsd (%rbx,%r12,8), %xmm0
movsd %xmm0, (%rsi,%r13)
addq %rax, %r13
decq %r11
jne 0x72a2f
incq %r9
addq $0x8, %rsi
addq $0x8, %r8
cmpq %rbp, %r9
jne 0x72a16
incq %rdx
movq (%rsp), %rsi
addl %r14d, %esi
movq %rsi, (%rsp)
cmpq 0x10(%rsp), %rdx
jne 0x729f8
movq 0x28(%rsp), %rdi
movq %rcx, %rsi
movl 0x18(%rsp), %edx
movq 0x8(%rsp), %r14
movq %r14, %rcx
movl 0x1c(%rsp), %r8d
movq 0x20(%rsp), %r9
callq 0x72157
xorl %ebx, %ebx
testq %r14, %r14
je 0x729b0
movq %r14, %rdi
callq 0x8410
jmp 0x729b0