// File: /workspace/github_c_makefile_star2_O1/PoulinV[P]AxiCLASS/build/../source/distortions.c
// Function: distortions_get_xz_lists
int distortions_get_xz_lists(struct precision * ppr,
                             struct background * pba,
                             struct thermodynamics * pth,
                             struct distortions * psd){

  /** Define local variables */
  int index_z, index_x;

  /** Define and allocate z array */
  psd->z_min = ppr->sd_z_min;
  psd->z_max = ppr->sd_z_max;
  psd->z_size = ppr->sd_z_size;
  psd->z_delta = (log(psd->z_max)-log(psd->z_min))/psd->z_size;

  class_alloc(psd->z,
              psd->z_size*sizeof(double),
              psd->error_message);

  for (index_z = 0; index_z < psd->z_size; index_z++) {
    psd->z[index_z] = exp(log(psd->z_min+1)+psd->z_delta*index_z);
  }

  /** Define and allocate integrating weights for z array */
  class_alloc(psd->z_weights,
              psd->z_size*sizeof(double),
              psd->error_message);
  class_call(array_trapezoidal_weights(
                                       psd->z,
                                       psd->z_size,
                                       psd->z_weights,
                                       psd->error_message),
             psd->error_message,
             psd->error_message);

  /** Define and allocate x array */
  if (psd->sd_branching_approx != bra_exact) {
    psd->x_min = ppr->sd_x_min;
    psd->x_max = ppr->sd_x_max;
    psd->x_size = ppr->sd_x_size;
    psd->x_delta = (log(psd->x_max)-log(psd->x_min))/psd->x_size;

    class_alloc(psd->x,
                psd->x_size*sizeof(double),
                psd->error_message);

    for (index_x = 0; index_x<psd->x_size; index_x++) {
      psd->x[index_x] = exp(log(psd->x_min)+psd->x_delta*index_x);
    }

  }
  else if (psd->has_detector_file == _FALSE_) {
    psd->x_min = psd->sd_detector_nu_min/psd->x_to_nu;
    psd->x_max = psd->sd_detector_nu_max/psd->x_to_nu;
    psd->x_delta = psd->sd_detector_nu_delta/psd->x_to_nu;
    psd->x_size = psd->sd_detector_bin_number+1;

    class_alloc(psd->x,
                psd->x_size*sizeof(double),
                psd->error_message);

    for (index_x = 0; index_x<psd->x_size; index_x++){
      psd->x[index_x] = psd->x_min+psd->x_delta*index_x;
    }
  }

  /** Define and allocate integrating weights for x array */
  class_alloc(psd->x_weights,
              psd->x_size*sizeof(double),
              psd->error_message);
  class_call(array_trapezoidal_weights(
                                       psd->x,
                                       psd->x_size,
                                       psd->x_weights,
                                       psd->error_message),
             psd->error_message,
             psd->error_message);

  return _SUCCESS_;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x818, %rsp            # imm = 0x818
movq %rcx, %rbx
movq %rdi, %r15
movups 0x8f0(%rdi), %xmm0
movups %xmm0, 0x320(%rcx)
movl 0x900(%rdi), %eax
movl %eax, 0x330(%rcx)
movhlps %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0x82c0
movsd %xmm0, 0x8(%rsp)
movsd 0x320(%rbx), %xmm0
callq 0x82c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movslq 0x330(%rbx), %r14
xorps %xmm0, %xmm0
cvtsi2sd %r14d, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x338(%rbx)
movq %r14, %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x340(%rbx)
testq %rax, %rax
je 0xcbacd
movl 0x330(%rbx), %r12d
testl %r12d, %r12d
jle 0xcba51
xorl %r14d, %r14d
movsd 0x320(%rbx), %xmm0
addsd 0x25849(%rip), %xmm0    # 0xf1260
callq 0x82c0
xorps %xmm1, %xmm1
cvtsi2sd %r14d, %xmm1
mulsd 0x338(%rbx), %xmm1
addsd %xmm1, %xmm0
callq 0x8670
movq 0x340(%rbx), %rax
movsd %xmm0, (%rax,%r14,8)
incq %r14
movslq 0x330(%rbx), %r12
cmpq %r12, %r14
jl 0xcba07
movslq %r12d, %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x348(%rbx)
testq %rax, %rax
je 0xcbb11
movq 0x340(%rbx), %rdi
leaq 0x1602(%rbx), %r14
movl %r12d, %esi
movq %rax, %rdx
movq %r14, %rcx
callq 0x1b383
cmpl $0x1, %eax
jne 0xcbb5a
leaq 0x25957(%rip), %rsi     # 0xf13f0
leaq 0x5e1ab(%rip), %rdx     # 0x129c4b
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x2557b(%rip), %rsi     # 0xf1034
leaq 0x5e163(%rip), %rdx     # 0x129c23
movq %r14, %rdi
movl $0x23d, %ecx            # imm = 0x23D
jmp 0xcbeb3
leal (,%r14,8), %ecx
leaq 0x25528(%rip), %rsi     # 0xf1004
leaq 0x5e139(%rip), %rdx     # 0x129c1c
leaq 0x10(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30c2c
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x25534(%rip), %rsi     # 0xf1034
leaq 0x5e11c(%rip), %rdx     # 0x129c23
movq %rbx, %rdi
movl $0x22d, %ecx            # imm = 0x22D
jmp 0xcbb52
shll $0x3, %r12d
leaq 0x254e8(%rip), %rsi     # 0xf1004
leaq 0x5e119(%rip), %rdx     # 0x129c3c
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30c2c
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x254f1(%rip), %rsi     # 0xf1034
leaq 0x5e0d9(%rip), %rdx     # 0x129c23
movq %rbx, %rdi
movl $0x236, %ecx            # imm = 0x236
movq %r14, %r8
jmp 0xcbeb6
cmpl $0x4, (%rbx)
jne 0xcbcbd
cmpl $0x0, 0xcdc(%rbx)
jne 0xcbd83
movsd 0x380(%rbx), %xmm0
movupd 0x2d0(%rbx), %xmm1
movapd %xmm0, %xmm2
unpcklpd %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
divpd %xmm2, %xmm1
movupd %xmm1, 0x350(%rbx)
movsd 0x2e0(%rbx), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x360(%rbx)
movslq 0x2e8(%rbx), %r12
leaq 0x1(%r12), %r15
movl %r15d, 0x368(%rbx)
leaq 0x8(,%r12,8), %rdi
callq 0x8460
movq %rax, 0x370(%rbx)
testq %rax, %rax
je 0xcbe79
movl %r12d, %edx
testl %edx, %edx
js 0xcbd83
movl %edx, %ecx
andl $0x7ffffffe, %ecx       # imm = 0x7FFFFFFE
addq $0x2, %rcx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movsd 0x350(%rbx), %xmm1
movsd 0x360(%rbx), %xmm2
unpcklpd %xmm2, %xmm2            # xmm2 = xmm2[0,0]
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
movdqa 0x26067(%rip), %xmm3    # 0xf1c80
xorl %edx, %edx
movdqa 0x2606d(%rip), %xmm4    # 0xf1c90
pxor %xmm4, %xmm0
pcmpeqd %xmm5, %xmm5
movdqa 0x26b4d(%rip), %xmm6    # 0xf2780
movdqa %xmm3, %xmm7
pxor %xmm4, %xmm7
movdqa %xmm7, %xmm8
pcmpgtd %xmm0, %xmm8
pcmpeqd %xmm0, %xmm7
pshufd $0xf5, %xmm7, %xmm7     # xmm7 = xmm7[1,1,3,3]
pand %xmm8, %xmm7
pshufd $0xf5, %xmm8, %xmm8     # xmm8 = xmm8[1,1,3,3]
por %xmm7, %xmm8
xorps %xmm7, %xmm7
cvtsi2sd %edx, %xmm7
leal 0x1(%rdx), %esi
xorps %xmm9, %xmm9
cvtsi2sd %esi, %xmm9
unpcklpd %xmm9, %xmm7            # xmm7 = xmm7[0],xmm9[0]
mulpd %xmm2, %xmm7
addpd %xmm1, %xmm7
movd %xmm8, %esi
notl %esi
testb $0x1, %sil
je 0xcbc90
movlpd %xmm7, (%rax,%rdx,8)
pxor %xmm5, %xmm8
pextrw $0x4, %xmm8, %esi
testb $0x1, %sil
je 0xcbca7
movhpd %xmm7, 0x8(%rax,%rdx,8)
addq $0x2, %rdx
paddq %xmm6, %xmm3
cmpq %rdx, %rcx
jne 0xcbc33
jmp 0xcbd83
movups 0x908(%r15), %xmm0
movups %xmm0, 0x350(%rbx)
movl 0x918(%r15), %eax
movl %eax, 0x368(%rbx)
movhlps %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0x82c0
movsd %xmm0, 0x8(%rsp)
movsd 0x350(%rbx), %xmm0
callq 0x82c0
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm1
movslq 0x368(%rbx), %r15
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x360(%rbx)
movq %r15, %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x370(%rbx)
testq %rax, %rax
je 0xcbe3c
cmpl $0x0, 0x368(%rbx)
jle 0xcbd83
xorl %r15d, %r15d
movsd 0x350(%rbx), %xmm0
callq 0x82c0
xorps %xmm1, %xmm1
cvtsi2sd %r15d, %xmm1
mulsd 0x360(%rbx), %xmm1
addsd %xmm1, %xmm0
callq 0x8670
movq 0x370(%rbx), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
movslq 0x368(%rbx), %rax
cmpq %rax, %r15
jl 0xcbd41
movslq 0x368(%rbx), %r15
movq %r15, %rdi
shlq $0x3, %rdi
callq 0x8460
movq %rax, 0x378(%rbx)
testq %rax, %rax
je 0xcbdff
movq 0x370(%rbx), %rdi
movl %r15d, %esi
movq %rax, %rdx
movq %r14, %rcx
callq 0x1b383
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0xcbec2
leaq 0x25625(%rip), %rsi     # 0xf13f0
leaq 0x5dedc(%rip), %rdx     # 0x129cae
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30c2c
leaq 0x25249(%rip), %rsi     # 0xf1034
leaq 0x5de31(%rip), %rdx     # 0x129c23
movq %r14, %rdi
movl $0x268, %ecx            # imm = 0x268
jmp 0xcbeb3
leal (,%r15,8), %ecx
leaq 0x251f6(%rip), %rsi     # 0xf1004
leaq 0x5de8a(%rip), %rdx     # 0x129c9f
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x25209(%rip), %rsi     # 0xf1034
leaq 0x5ddf1(%rip), %rdx     # 0x129c23
movq %r14, %rdi
movl $0x261, %ecx            # imm = 0x261
jmp 0xcbeb3
leal (,%r15,8), %ecx
leaq 0x251b9(%rip), %rsi     # 0xf1004
leaq 0x5dcfd(%rip), %rdx     # 0x129b4f
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30c2c
leaq 0x251cc(%rip), %rsi     # 0xf1034
leaq 0x5ddb4(%rip), %rdx     # 0x129c23
movq %r14, %rdi
movl $0x248, %ecx            # imm = 0x248
jmp 0xcbeb3
shll $0x3, %r15d
leaq 0x25180(%rip), %rsi     # 0xf1004
leaq 0x5dcc4(%rip), %rdx     # 0x129b4f
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x30c2c
leaq 0x25190(%rip), %rsi     # 0xf1034
leaq 0x5dd78(%rip), %rdx     # 0x129c23
movq %r14, %rdi
movl $0x257, %ecx            # imm = 0x257
movq %rbx, %r8
xorl %eax, %eax
callq 0x30c2c
movl $0x1, %eax
addq $0x818, %rsp            # imm = 0x818
popq %rbx
popq %r12
popq %r14
popq %r15
retq