// File: /workspace/github_c_makefile_star2_O3/PoulinV[P]AxiCLASS/build/../source/distortions.c
// Function: distortions_init
int distortions_init(struct precision * ppr,
                     struct background * pba,
                     struct thermodynamics * pth,
                     struct perturbations * ppt,
                     struct primordial * ppm,
                     struct distortions * psd) {

  if (psd->has_distortions == _FALSE_) {
    if (psd->distortions_verbose > 0)
      printf("No distortions requested. Distortions module skipped.\n");
    return _SUCCESS_;
  }
  if (psd->distortions_verbose > 0) {
    printf("Computing spectral distortions\n");
  }

  class_test(pth->compute_damping_scale==_FALSE_,
             psd->error_message,
             "Cannot compute spectral distortions without damping scale\n");

  /** Set physical constants */
  class_call(distortions_constants(ppr,pba,pth,psd),
             psd->error_message,
             psd->error_message);

  if (psd->sd_branching_approx == bra_exact) {
    /** Set/Check the distortions detector */
    class_call(distortions_set_detector(ppr,psd),
               psd->error_message,
               psd->error_message);
  }

  /** Assign values to all indices in the distortions structure */
  class_call(distortions_indices(psd),
             psd->error_message,
             psd->error_message);

  /** Define z and x arrays */
  class_call(distortions_get_xz_lists(ppr,pba,pth,psd),
             psd->error_message,
             psd->error_message);

  /** Define branching ratios */
  class_call(distortions_compute_branching_ratios(ppr,psd),
             psd->error_message,
             psd->error_message);

  /** Define heating function */
  class_call(distortions_compute_heating_rate(ppr,pba,pth,ppt,ppm,psd),
             psd->error_message,
             psd->error_message);

  /** Define final spectral distortions */
  class_call(distortions_compute_spectral_shapes(ppr,pba,pth,psd),
             psd->error_message,
             psd->error_message);

  psd->is_allocated = _TRUE_;

  return _SUCCESS_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
cmpl $0x0, 0xcd0(%r9)
movzwl 0x1600(%r9), %eax
je 0xc735f
movq %r9, %rbx
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
testw %ax, %ax
jle 0xc72ee
leaq 0x60d20(%rip), %rdi     # 0x128009
callq 0x8510
cmpw $0x0, 0x32(%r14)
je 0xc73e8
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xc756b
cmpl $0x4, (%rbx)
jne 0xc737b
movq %r12, %rdi
movq %rbx, %rsi
callq 0xc76f6
testl %eax, %eax
je 0xc737b
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x270c3(%rip), %rsi     # 0xee3f0
leaq 0x5ece4(%rip), %rdx     # 0x126018
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x26ce9(%rip), %rsi     # 0xee034
leaq 0x5ecb5(%rip), %rdx     # 0x126007
movq %rbx, %rdi
movl $0x38, %ecx
jmp 0xc753b
xorl %ebx, %ebx
testw %ax, %ax
jle 0xc754a
leaq 0x60cb7(%rip), %rdi     # 0x128028
callq 0x8510
jmp 0xc754a
movaps 0x5e7fe(%rip), %xmm0    # 0x125b80
movups %xmm0, 0xbe0(%rbx)
movl 0x4(%rbx), %eax
addl $0x3, %eax
movl %eax, 0xbf0(%rbx)
movq %r12, %rdi
movq %rbx, %rcx
callq 0xc8107
testl %eax, %eax
je 0xc7444
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x2703a(%rip), %rsi     # 0xee3f0
leaq 0x5ec7d(%rip), %rdx     # 0x12603a
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x26c60(%rip), %rsi     # 0xee034
leaq 0x5ec2c(%rip), %rdx     # 0x126007
movq %rbx, %rdi
movl $0x43, %ecx
jmp 0xc753b
leaq 0x5ebb9(%rip), %rsi     # 0x125fa8
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
leaq 0x26c7f(%rip), %rsi     # 0xee082
leaq 0x5ebd9(%rip), %rdx     # 0x125fe3
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x26c07(%rip), %rsi     # 0xee034
leaq 0x5ebd3(%rip), %rdx     # 0x126007
movq %rbx, %rdi
movl $0x2d, %ecx
movq %r15, %r8
jmp 0xc753e
movq %r12, %rdi
movq %rbx, %rsi
callq 0xc8665
testl %eax, %eax
je 0xc7493
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x26f8f(%rip), %rsi     # 0xee3f0
leaq 0x5ebfc(%rip), %rdx     # 0x126064
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x26bb5(%rip), %rsi     # 0xee034
leaq 0x5eb81(%rip), %rdx     # 0x126007
movq %rbx, %rdi
movl $0x48, %ecx
jmp 0xc753b
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %r13, %r8
movq %rbx, %r9
callq 0xc8cd2
testl %eax, %eax
je 0xc74eb
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x26f34(%rip), %rsi     # 0xee3f0
leaq 0x5ebcf(%rip), %rdx     # 0x126092
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x26b5a(%rip), %rsi     # 0xee034
leaq 0x5eb26(%rip), %rdx     # 0x126007
movq %rbx, %rdi
movl $0x4d, %ecx
jmp 0xc753b
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xc915c
testl %eax, %eax
je 0xc755e
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x26ee2(%rip), %rsi     # 0xee3f0
leaq 0x5ebb7(%rip), %rdx     # 0x1260cc
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x26b08(%rip), %rsi     # 0xee034
leaq 0x5ead4(%rip), %rdx     # 0x126007
movq %rbx, %rdi
movl $0x52, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %ebx
movl %ebx, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movw $0x1, 0x1e02(%rbx)
xorl %ebx, %ebx
jmp 0xc754a