// File: /workspace/github_c_makefile_star2_O3/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 0xa8343
movq %rsi, %r15
movq %rdi, %r12
xorl %r13d, %r13d
movq 0x870(%r12), %rdx
cmpl $0x0, (%rdx,%r13,4)
jle 0xa8323
movq 0x998(%r12), %rax
xorl %ebp, %ebp
movl (%rax,%r13,4), %ecx
testl %ecx, %ecx
jle 0xa8317
xorl %r14d, %r14d
cmpl $0x0, (%r15)
je 0xa82ff
cmpw $0x1, 0xe(%r12)
jne 0xa82ff
movl 0x848(%r12), %edx
cmpq %rdx, %r13
jne 0xa82ff
cmpw $0x1, 0x87c(%r12)
jne 0xa8243
cmpl 0x8d8(%r12), %r14d
je 0xa82e1
cmpw $0x1, 0x898(%r12)
jne 0xa825d
cmpl 0x934(%r12), %r14d
je 0xa82e1
cmpw $0x1, 0x87e(%r12)
jne 0xa8273
cmpl 0x8dc(%r12), %r14d
je 0xa82e1
cmpw $0x1, 0x89a(%r12)
jne 0xa8289
cmpl 0x938(%r12), %r14d
je 0xa82e1
cmpw $0x1, 0x8b4(%r12)
jne 0xa829f
cmpl 0x970(%r12), %r14d
je 0xa82e1
cmpw $0x1, 0x8b6(%r12)
jne 0xa82b5
cmpl 0x974(%r12), %r14d
je 0xa82e1
cmpw $0x1, 0x8b8(%r12)
jne 0xa82cb
cmpl 0x978(%r12), %r14d
je 0xa82e1
cmpw $0x1, 0x8ba(%r12)
jne 0xa82ff
cmpl 0x97c(%r12), %r14d
jne 0xa82ff
movq (%rbx,%r13,8), %rax
imull %ebp, %ecx
addl %r14d, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8410
movq 0x998(%r12), %rax
incl %r14d
movl (%rax,%r13,4), %ecx
cmpl %ecx, %r14d
jl 0xa8201
movq 0x870(%r12), %rdx
incl %ebp
cmpl (%rdx,%r13,4), %ebp
jl 0xa81f2
movq (%rbx,%r13,8), %rdi
callq 0x8410
incq %r13
movq (%rsp), %rax
movslq 0x8a4(%rax), %rax
cmpq %rax, %r13
jl 0xa81d5
movq %rbx, %rdi
callq 0x8410
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq