// File: /workspace/github_c_makefile_star2_O1/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 0x7542f
movl %ecx, %r12d
cmpl %ecx, 0xa60(%rbx)
jle 0x7542f
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 0x754a8
movl %ecx, (%rsp)
movl %ecx, %edi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x8(%rsp)
testq %rax, %rax
jne 0x754b1
movl (%rsp), %ecx
shll $0x3, %ecx
leaq 0x7bc0d(%rip), %rsi     # 0xf1004
leaq 0xa0bbc(%rip), %rdx     # 0x115fba
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x7bc19(%rip), %rsi     # 0xf1034
leaq 0xa0cd4(%rip), %rdx     # 0x1160f6
movq %rbx, %rdi
movl $0x183, %ecx            # imm = 0x183
movq %r14, %r8
jmp 0x75488
leaq 0xa0c6c(%rip), %rsi     # 0x1160a2
leaq 0x30(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x7bc36(%rip), %rsi     # 0xf1082
leaq 0xa0c70(%rip), %rdx     # 0x1160c3
leaq 0x830(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x6c8a, %rbx           # imm = 0x6C8A
leaq 0x7bbbe(%rip), %rsi     # 0xf1034
leaq 0xa0c79(%rip), %rdx     # 0x1160f6
movq %rbx, %rdi
movl $0x17c, %ecx            # imm = 0x17C
movq %r15, %r8
xorl %eax, %eax
callq 0x30c2c
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 0x75553
imull 0x10(%rsp), %r12d
leaq (,%rbp,8), %rax
movq $0x0, (%rsp)
xorl %edx, %edx
testl %ebp, %ebp
jle 0x7553e
movl (%rsp), %esi
imulq %rax, %rsi
addq 0x8(%rsp), %rsi
leaq (,%rdx,8), %rdi
xorl %r8d, %r8d
xorl %r9d, %r9d
testl %r14d, %r14d
jle 0x7552e
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 0x75513
incq %r9
addq $0x8, %rsi
addq $0x8, %r8
cmpq %rbp, %r9
jne 0x754fa
incq %rdx
movq (%rsp), %rsi
addl %r14d, %esi
movq %rsi, (%rsp)
cmpq 0x10(%rsp), %rdx
jne 0x754dc
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 0x74c23
xorl %ebx, %ebx
testq %r14, %r14
je 0x75494
movq %r14, %rdi
callq 0x8410
jmp 0x75494