// File: /workspace/github_c_makefile_star2_O0/PoulinV[P]AxiCLASS/build/../source/perturbations.c
// Function: perturbations_free
int perturbations_free(
                       struct perturbations * ppt
                       ) {

  int index_md,index_ic,index_tp;
  int filenum;

  perturbations_free_input(ppt);

  if (ppt->has_perturbations == _TRUE_) {

    for (index_md = 0; index_md < ppt->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++) {

          free(ppt->sources[index_md][index_ic*ppt->tp_size[index_md]+index_tp]);
          if (ppt->ln_tau_size > 1)
            free(ppt->ddlate_sources[index_md][index_ic*ppt->tp_size[index_md]+index_tp]);

        }
      }

      free(ppt->sources[index_md]);
      free(ppt->late_sources[index_md]);
      free(ppt->ddlate_sources[index_md]);

      free(ppt->k[index_md]);

    }

    free(ppt->tau_sampling);
    if (ppt->ln_tau_size > 1)
      free(ppt->ln_tau);

    free(ppt->tp_size);

    free(ppt->ic_size);

    free(ppt->k);

    free(ppt->k_size_cmb);

    free(ppt->k_size_cl);

    free(ppt->k_size);

    free(ppt->sources);

    if(ppt->has_scf == _TRUE_ && ppt->scf_has_perturbations == _TRUE_){
      free(ppt->scf_kg_eq[ppt->index_md_scalars]);
      free(ppt->scf_kg_eq);
      if (ppt->has_vectors == _TRUE_) {
        free(ppt->scf_kg_eq[ppt->index_md_vectors]);
        free(ppt->scf_kg_eq);
    }
      if (ppt->has_tensors == _TRUE_) {
        free(ppt->scf_kg_eq[ppt->index_md_tensors]);
        free(ppt->scf_kg_eq);
    }
    }
    free(ppt->late_sources);
    free(ppt->ddlate_sources);

    /** Stuff related to perturbations output: */

    /** - Free non-NULL pointers */
    if (ppt->k_output_values_num > 0 )
      free(ppt->index_k_output_values);

    for (filenum = 0; filenum<_MAX_NUMBER_OF_K_FILES_; filenum++){
      if (ppt->scalar_perturbations_data[filenum] != NULL)
        free(ppt->scalar_perturbations_data[filenum]);
      if (ppt->vector_perturbations_data[filenum] != NULL)
        free(ppt->vector_perturbations_data[filenum]);
      if (ppt->tensor_perturbations_data[filenum] != NULL)
        free(ppt->tensor_perturbations_data[filenum]);
    }

  }

  ppt->is_allocated = _FALSE_;
  return _SUCCESS_;

}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0xd1ad0
movq 0x10(%rsp), %rax
movswl (%rax), %eax
cmpl $0x1, %eax
jne 0xd1f34
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x854(%rcx), %eax
jge 0xd1cd3
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
movq 0x10(%rsp), %rcx
movq 0x870(%rcx), %rcx
movslq 0xc(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xd1c5b
movl $0x0, 0x4(%rsp)
movl 0x4(%rsp), %eax
movq 0x10(%rsp), %rcx
movq 0x998(%rcx), %rcx
movslq 0xc(%rsp), %rdx
cmpl (%rcx,%rdx,4), %eax
jge 0xd1c49
movq 0x10(%rsp), %rax
movq 0xa38(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rsp), %ecx
movq 0x10(%rsp), %rdx
movq 0x998(%rdx), %rdx
movslq 0xc(%rsp), %rsi
imull (%rdx,%rsi,4), %ecx
addl 0x4(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
cmpl $0x1, 0xa60(%rax)
jle 0xd1c37
movq 0x10(%rsp), %rax
movq 0xa70(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rsp), %ecx
movq 0x10(%rsp), %rdx
movq 0x998(%rdx), %rdx
movslq 0xc(%rsp), %rsi
imull (%rdx,%rsi,4), %ecx
addl 0x4(%rsp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
jmp 0xd1c39
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0xd1b8f
jmp 0xd1c4b
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0xd1b69
movq 0x10(%rsp), %rax
movq 0xa38(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0xa68(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0xa70(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0x9d0(%rax), %rax
movslq 0xc(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0xd1b4c
movq 0x10(%rsp), %rax
movq 0x9f0(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
cmpl $0x1, 0xa60(%rax)
jle 0xd1d03
movq 0x10(%rsp), %rax
movq 0xa58(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0x998(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0x870(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0x9d0(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0x9b0(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0x9b8(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0x9c8(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0xa38(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movswl 0x8(%rax), %eax
cmpl $0x1, %eax
jne 0xd1e52
movq 0x10(%rsp), %rax
movswl 0x4(%rax), %eax
cmpl $0x1, %eax
jne 0xd1e52
movq 0x10(%rsp), %rax
movq 0x9d8(%rax), %rax
movq 0x10(%rsp), %rcx
movslq 0x848(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0x9d8(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movswl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0xd1e10
movq 0x10(%rsp), %rax
movq 0x9d8(%rax), %rax
movq 0x10(%rsp), %rcx
movslq 0x850(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0x9d8(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movswl 0x12(%rax), %eax
cmpl $0x1, %eax
jne 0xd1e50
movq 0x10(%rsp), %rax
movq 0x9d8(%rax), %rax
movq 0x10(%rsp), %rcx
movslq 0x84c(%rcx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0x9d8(%rax), %rdi
callq 0x8420
jmp 0xd1e52
movq 0x10(%rsp), %rax
movq 0xa68(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movq 0xa70(%rax), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
cmpl $0x0, 0x6d4(%rax)
jle 0xd1e93
movq 0x10(%rsp), %rax
movq 0xa78(%rax), %rdi
callq 0x8420
movl $0x0, (%rsp)
cmpl $0x1e, (%rsp)
jge 0xd1f32
movq 0x10(%rsp), %rax
movslq (%rsp), %rcx
cmpq $0x0, 0x6850(%rax,%rcx,8)
je 0xd1ece
movq 0x10(%rsp), %rax
movslq (%rsp), %rcx
movq 0x6850(%rax,%rcx,8), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movslq (%rsp), %rcx
cmpq $0x0, 0x6940(%rax,%rcx,8)
je 0xd1ef8
movq 0x10(%rsp), %rax
movslq (%rsp), %rcx
movq 0x6940(%rax,%rcx,8), %rdi
callq 0x8420
movq 0x10(%rsp), %rax
movslq (%rsp), %rcx
cmpq $0x0, 0x6a30(%rax,%rcx,8)
je 0xd1f22
movq 0x10(%rsp), %rax
movslq (%rsp), %rcx
movq 0x6a30(%rax,%rcx,8), %rdi
callq 0x8420
jmp 0xd1f24
movl (%rsp), %eax
addl $0x1, %eax
movl %eax, (%rsp)
jmp 0xd1e9a
jmp 0xd1f34
movq 0x10(%rsp), %rax
movw $0x0, 0x748a(%rax)
xorl %eax, %eax
addq $0x18, %rsp
retq
nopl (%rax)