// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/transfer.c
// Function: transfer_perturbation_sources_free
int transfer_perturbation_sources_free(
                                       struct perturbations * ppt,
                                       struct fourier * pfo,
                                       struct transfer * ptr,
                                       double *** sources
                                       ) {
  int index_md;
  int index_ic;
  int index_tp;

  for (index_md = 0; index_md < ptr->md_size; index_md++) {
    for (index_ic = 0; index_ic < ppt->ic_size[index_md]; index_ic++) {
      for (index_tp = 0; index_tp < ppt->tp_size[index_md]; index_tp++) {
        if ((pfo->method != nl_none) && (_scalars_) &&
            (((ppt->has_source_delta_m == _TRUE_) && (index_tp == ppt->index_tp_delta_m)) ||
             ((ppt->has_source_theta_m == _TRUE_) && (index_tp == ppt->index_tp_theta_m)) ||
             ((ppt->has_source_delta_cb == _TRUE_) && (index_tp == ppt->index_tp_delta_cb)) ||
             ((ppt->has_source_theta_cb == _TRUE_) && (index_tp == ppt->index_tp_theta_cb)) ||
             ((ppt->has_source_phi == _TRUE_) && (index_tp == ppt->index_tp_phi)) ||
             ((ppt->has_source_phi_prime == _TRUE_) && (index_tp == ppt->index_tp_phi_prime)) ||
             ((ppt->has_source_phi_plus_psi == _TRUE_) && (index_tp == ppt->index_tp_phi_plus_psi)) ||
             ((ppt->has_source_psi == _TRUE_) && (index_tp == ppt->index_tp_psi)))) {

          free(sources[index_md][index_ic * ppt->tp_size[index_md] + index_tp]);
        }
      }
    }
    free(sources[index_md]);
  }
  free(sources);

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, (%rsp)
cmpl $0x0, 0x8a4(%rdx)
jle 0xab367
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
movq 0x870(%r12), %rax
cmpl $0x0, (%rax,%r13,4)
jle 0xab347
xorl %ebp, %ebp
movq 0x998(%r12), %rax
movl (%rax,%r13,4), %eax
testl %eax, %eax
jle 0xab333
xorl %r14d, %r14d
cmpl $0x0, (%r15)
je 0xab31b
cmpw $0x1, 0xe(%r12)
jne 0xab31b
movl 0x848(%r12), %ecx
cmpq %rcx, %r13
jne 0xab31b
cmpw $0x1, 0x87c(%r12)
jne 0xab268
cmpl 0x8d8(%r12), %r14d
je 0xab306
cmpw $0x1, 0x898(%r12)
jne 0xab282
cmpl 0x934(%r12), %r14d
je 0xab306
cmpw $0x1, 0x87e(%r12)
jne 0xab298
cmpl 0x8dc(%r12), %r14d
je 0xab306
cmpw $0x1, 0x89a(%r12)
jne 0xab2ae
cmpl 0x938(%r12), %r14d
je 0xab306
cmpw $0x1, 0x8b4(%r12)
jne 0xab2c4
cmpl 0x970(%r12), %r14d
je 0xab306
cmpw $0x1, 0x8b6(%r12)
jne 0xab2da
cmpl 0x974(%r12), %r14d
je 0xab306
cmpw $0x1, 0x8b8(%r12)
jne 0xab2f0
cmpl 0x978(%r12), %r14d
je 0xab306
cmpw $0x1, 0x8ba(%r12)
jne 0xab31b
cmpl 0x97c(%r12), %r14d
jne 0xab31b
movq (%rbx,%r13,8), %rcx
imull %ebp, %eax
addl %r14d, %eax
cltq
movq (%rcx,%rax,8), %rdi
callq 0x8410
incl %r14d
movq 0x998(%r12), %rax
movl (%rax,%r13,4), %eax
cmpl %eax, %r14d
jl 0xab226
incl %ebp
movq 0x870(%r12), %rax
cmpl (%rax,%r13,4), %ebp
jl 0xab20f
movq (%rbx,%r13,8), %rdi
callq 0x8410
incq %r13
movq (%rsp), %rax
movslq 0x8a4(%rax), %rax
cmpq %rax, %r13
jl 0xab1fa
movq %rbx, %rdi
callq 0x8410
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq