// File: /workspace/github_c_makefile_star2_O2/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 0xbfee9
movq %r9, %rbx
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
testw %ax, %ax
jle 0xbfe7e
leaq 0x5f040(%rip), %rdi     # 0x11eeb9
callq 0x8540
cmpw $0x0, 0x32(%r14)
je 0xbff6c
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xc00dd
cmpl $0x4, (%rbx)
jne 0xbff05
movq %r12, %rdi
movq %rbx, %rsi
callq 0xc0268
testl %eax, %eax
je 0xbff05
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x25533(%rip), %rsi     # 0xe53f0
leaq 0x5d004(%rip), %rdx     # 0x11cec8
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x25159(%rip), %rsi     # 0xe5034
leaq 0x5cfd5(%rip), %rdx     # 0x11ceb7
pushq $0x38
jmp 0xc00ab
xorl %ebx, %ebx
testw %ax, %ax
jle 0xc00bc
leaq 0x5efdd(%rip), %rdi     # 0x11eed8
callq 0x8540
jmp 0xc00bc
movaps 0x5cb14(%rip), %xmm0    # 0x11ca20
movups %xmm0, 0xbe0(%rbx)
movl 0x4(%rbx), %eax
addl $0x3, %eax
movl %eax, 0xbf0(%rbx)
movq %r12, %rdi
movq %rbx, %rcx
callq 0xc0c66
testl %eax, %eax
je 0xbffc6
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x254b0(%rip), %rsi     # 0xe53f0
leaq 0x5cfa3(%rip), %rdx     # 0x11ceea
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x250d6(%rip), %rsi     # 0xe5034
leaq 0x5cf52(%rip), %rdx     # 0x11ceb7
pushq $0x43
jmp 0xc00ab
leaq 0x5cee5(%rip), %rsi     # 0x11ce58
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x250fb(%rip), %rsi     # 0xe5082
leaq 0x5cf05(%rip), %rdx     # 0x11ce93
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x25083(%rip), %rsi     # 0xe5034
leaq 0x5ceff(%rip), %rdx     # 0x11ceb7
pushq $0x2d
popq %rcx
movq %rbx, %rdi
movq %r15, %r8
jmp 0xc00b2
movq %r12, %rdi
movq %rbx, %rsi
callq 0xc1105
testl %eax, %eax
je 0xc000f
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x2540d(%rip), %rsi     # 0xe53f0
leaq 0x5cf2a(%rip), %rdx     # 0x11cf14
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x25033(%rip), %rsi     # 0xe5034
leaq 0x5ceaf(%rip), %rdx     # 0x11ceb7
pushq $0x48
jmp 0xc00ab
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %r13, %r8
movq %rbx, %r9
callq 0xc1766
testl %eax, %eax
je 0xc0061
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x253b8(%rip), %rsi     # 0xe53f0
leaq 0x5cf03(%rip), %rdx     # 0x11cf42
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x24fde(%rip), %rsi     # 0xe5034
leaq 0x5ce5a(%rip), %rdx     # 0x11ceb7
pushq $0x4d
jmp 0xc00ab
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xc1bec
testl %eax, %eax
je 0xc00d0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x2536c(%rip), %rsi     # 0xe53f0
leaq 0x5cef1(%rip), %rdx     # 0x11cf7c
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x24f92(%rip), %rsi     # 0xe5034
leaq 0x5ce0e(%rip), %rdx     # 0x11ceb7
pushq $0x52
popq %rcx
movq %rbx, %rdi
movq %r14, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rbx
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 0xc00bc