// File: /workspace/github_c_makefile_star2_O1/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 0xcabcb
movq %r9, %rbx
movq %r8, %r13
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
testw %ax, %ax
jle 0xcab5a
leaq 0x6048c(%rip), %rdi     # 0x12afe1
callq 0x8510
cmpw $0x0, 0x32(%r14)
je 0xcac54
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xcadd7
cmpl $0x4, (%rbx)
jne 0xcabe7
movq %r12, %rdi
movq %rbx, %rsi
callq 0xcaf62
testl %eax, %eax
je 0xcabe7
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x26857(%rip), %rsi     # 0xf13f0
leaq 0x5e450(%rip), %rdx     # 0x128ff0
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x2647d(%rip), %rsi     # 0xf1034
leaq 0x5e421(%rip), %rdx     # 0x128fdf
movq %rbx, %rdi
movl $0x38, %ecx
jmp 0xcada7
xorl %ebx, %ebx
testw %ax, %ax
jle 0xcadb6
leaq 0x60423(%rip), %rdi     # 0x12b000
callq 0x8510
jmp 0xcadb6
movaps 0x5df62(%rip), %xmm0    # 0x128b50
movups %xmm0, 0xbe0(%rbx)
movl 0x4(%rbx), %eax
addl $0x3, %eax
movl %eax, 0xbf0(%rbx)
movq %r12, %rdi
movq %rbx, %rcx
callq 0xcb96e
testl %eax, %eax
je 0xcacb0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x267ce(%rip), %rsi     # 0xf13f0
leaq 0x5e3e9(%rip), %rdx     # 0x129012
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x263f4(%rip), %rsi     # 0xf1034
leaq 0x5e398(%rip), %rdx     # 0x128fdf
movq %rbx, %rdi
movl $0x43, %ecx
jmp 0xcada7
leaq 0x5e325(%rip), %rsi     # 0x128f80
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x26413(%rip), %rsi     # 0xf1082
leaq 0x5e345(%rip), %rdx     # 0x128fbb
leaq 0x800(%rsp), %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x2639b(%rip), %rsi     # 0xf1034
leaq 0x5e33f(%rip), %rdx     # 0x128fdf
movq %rbx, %rdi
movl $0x2d, %ecx
movq %r15, %r8
jmp 0xcadaa
movq %r12, %rdi
movq %rbx, %rsi
callq 0xcbed1
testl %eax, %eax
je 0xcacff
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x26723(%rip), %rsi     # 0xf13f0
leaq 0x5e368(%rip), %rdx     # 0x12903c
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x26349(%rip), %rsi     # 0xf1034
leaq 0x5e2ed(%rip), %rdx     # 0x128fdf
movq %rbx, %rdi
movl $0x48, %ecx
jmp 0xcada7
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbp, %rcx
movq %r13, %r8
movq %rbx, %r9
callq 0xcc578
testl %eax, %eax
je 0xcad57
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x266c8(%rip), %rsi     # 0xf13f0
leaq 0x5e33b(%rip), %rdx     # 0x12906a
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x262ee(%rip), %rsi     # 0xf1034
leaq 0x5e292(%rip), %rdx     # 0x128fdf
movq %rbx, %rdi
movl $0x4d, %ecx
jmp 0xcada7
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0xcca00
testl %eax, %eax
je 0xcadca
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x26676(%rip), %rsi     # 0xf13f0
leaq 0x5e323(%rip), %rdx     # 0x1290a4
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x2629c(%rip), %rsi     # 0xf1034
leaq 0x5e240(%rip), %rdx     # 0x128fdf
movq %rbx, %rdi
movl $0x52, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x30c2c
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 0xcadb6