// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x828, %rsp            # imm = 0x828
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, (%rsp)
movsd 0x320(%rbx), %xmm0
callq 0x82c0
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movslq 0x330(%rbx), %r12
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x338(%rbx)
movq %r12, %r14
shlq $0x3, %r14
movq %r14, %rdi
callq 0x8460
movq %rax, 0x340(%rbx)
testq %rax, %rax
je 0xc81ef
testl %r12d, %r12d
jle 0xc8236
xorl %ebp, %ebp
movsd 0x320(%rbx), %xmm0
addsd 0x260b4(%rip), %xmm0    # 0xee260
callq 0x82c0
xorps %xmm1, %xmm1
cvtsi2sd %ebp, %xmm1
mulsd 0x338(%rbx), %xmm1
addsd %xmm1, %xmm0
callq 0x8670
movq 0x340(%rbx), %r13
movsd %xmm0, (%r13,%rbp,8)
incq %rbp
movl 0x330(%rbx), %r12d
movslq %r12d, %r14
cmpq %r14, %rbp
jl 0xc819c
shlq $0x3, %r14
jmp 0xc8239
leal (,%r12,8), %ecx
leaq 0x25e06(%rip), %rsi     # 0xee004
leaq 0x5ea3f(%rip), %rdx     # 0x126c44
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x25e12(%rip), %rsi     # 0xee034
leaq 0x5ea22(%rip), %rdx     # 0x126c4b
movq %rbx, %rdi
movl $0x22d, %ecx            # imm = 0x22D
jmp 0xc82ea
movq %rax, %r13
movq %r14, %rdi
callq 0x8460
movq %rax, 0x348(%rbx)
testq %rax, %rax
je 0xc82a9
leaq 0x1602(%rbx), %r14
movq %r13, %rdi
movl %r12d, %esi
movq %rax, %rdx
movq %r14, %rcx
callq 0x1b43a
cmpl $0x1, %eax
jne 0xc82f2
leaq 0x2617b(%rip), %rsi     # 0xee3f0
leaq 0x5e9f7(%rip), %rdx     # 0x126c73
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x25d9f(%rip), %rsi     # 0xee034
leaq 0x5e9af(%rip), %rdx     # 0x126c4b
movq %r14, %rdi
movl $0x23d, %ecx            # imm = 0x23D
jmp 0xc8644
shll $0x3, %r12d
leaq 0x25d50(%rip), %rsi     # 0xee004
leaq 0x5e9a9(%rip), %rdx     # 0x126c64
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x30af0
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x25d59(%rip), %rsi     # 0xee034
leaq 0x5e969(%rip), %rdx     # 0x126c4b
movq %rbx, %rdi
movl $0x236, %ecx            # imm = 0x236
movq %r14, %r8
jmp 0xc8647
cmpl $0x4, (%rbx)
jne 0xc8312
cmpl $0x0, 0xcdc(%rbx)
je 0xc83de
movl 0x368(%rbx), %ebp
movslq %ebp, %r15
jmp 0xc8524
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, (%rsp)
movsd 0x350(%rbx), %xmm0
callq 0x82c0
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movl 0x368(%rbx), %ebp
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x360(%rbx)
movslq %ebp, %r15
leaq (,%r15,8), %rdi
callq 0x8460
movq %rax, 0x370(%rbx)
testq %rax, %rax
je 0xc85d2
testl %ebp, %ebp
jle 0xc8524
xorl %r12d, %r12d
movsd 0x350(%rbx), %xmm0
callq 0x82c0
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
mulsd 0x360(%rbx), %xmm1
addsd %xmm1, %xmm0
callq 0x8670
movq 0x370(%rbx), %rax
movsd %xmm0, (%rax,%r12,8)
incq %r12
movl 0x368(%rbx), %ebp
movslq %ebp, %r15
cmpq %r15, %r12
jl 0xc8395
jmp 0xc8524
movsd 0x380(%rbx), %xmm0
movupd 0x2d0(%rbx), %xmm2
movapd %xmm0, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
divpd %xmm1, %xmm2
movapd %xmm2, (%rsp)
movupd %xmm2, 0x350(%rbx)
movsd 0x2e0(%rbx), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, 0x10(%rsp)
movsd %xmm1, 0x360(%rbx)
movl 0x2e8(%rbx), %r12d
leal 0x1(%r12), %ebp
movl %ebp, 0x368(%rbx)
movslq %ebp, %r15
leaq (,%r15,8), %rdi
callq 0x8460
movq %rax, 0x370(%rbx)
testq %rax, %rax
je 0xc860c
testl %r12d, %r12d
js 0xc8524
movl %ebp, %edx
leaq 0x1(%rdx), %rcx
andq $-0x2, %rcx
decq %rdx
movq %rdx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movapd 0x10(%rsp), %xmm9
unpcklpd %xmm9, %xmm9            # xmm9 = xmm9[0,0]
movapd (%rsp), %xmm8
unpcklpd %xmm8, %xmm8            # xmm8 = xmm8[0,0]
movdqa 0x267ee(%rip), %xmm1    # 0xeec80
xorl %edx, %edx
movdqa 0x267f4(%rip), %xmm2    # 0xeec90
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x272e4(%rip), %xmm4    # 0xef790
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pand %xmm6, %xmm5
pshufd $0xf5, %xmm6, %xmm6     # xmm6 = xmm6[1,1,3,3]
por %xmm5, %xmm6
xorps %xmm5, %xmm5
cvtsi2sd %edx, %xmm5
leal 0x1(%rdx), %esi
xorps %xmm7, %xmm7
cvtsi2sd %esi, %xmm7
unpcklpd %xmm7, %xmm5            # xmm5 = xmm5[0],xmm7[0]
mulpd %xmm9, %xmm5
addpd %xmm8, %xmm5
movd %xmm6, %esi
notl %esi
testb $0x1, %sil
je 0xc8502
movlpd %xmm5, (%rax,%rdx,8)
pxor %xmm3, %xmm6
pextrw $0x4, %xmm6, %esi
testb $0x1, %sil
je 0xc8517
movhpd %xmm5, 0x8(%rax,%rdx,8)
addq $0x2, %rdx
paddq %xmm4, %xmm1
cmpq %rdx, %rcx
jne 0xc84ac
shlq $0x3, %r15
movq %r15, %rdi
callq 0x8460
movq %rax, 0x378(%rbx)
testq %rax, %rax
je 0xc8598
movq 0x370(%rbx), %rdi
movl %ebp, %esi
movq %rax, %rdx
movq %r14, %rcx
callq 0x1b43a
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0xc8653
leaq 0x25e8c(%rip), %rsi     # 0xee3f0
leaq 0x5e76b(%rip), %rdx     # 0x126cd6
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x30af0
leaq 0x25ab0(%rip), %rsi     # 0xee034
leaq 0x5e6c0(%rip), %rdx     # 0x126c4b
movq %r14, %rdi
movl $0x268, %ecx            # imm = 0x268
jmp 0xc8644
shll $0x3, %ebp
leaq 0x25a62(%rip), %rsi     # 0xee004
leaq 0x5e71e(%rip), %rdx     # 0x126cc7
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0x25a73(%rip), %rsi     # 0xee034
leaq 0x5e683(%rip), %rdx     # 0x126c4b
movq %r14, %rdi
movl $0x261, %ecx            # imm = 0x261
jmp 0xc8644
shll $0x3, %ebp
leaq 0x25a28(%rip), %rsi     # 0xee004
leaq 0x5e594(%rip), %rdx     # 0x126b77
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0x25a39(%rip), %rsi     # 0xee034
leaq 0x5e649(%rip), %rdx     # 0x126c4b
movq %r14, %rdi
movl $0x248, %ecx            # imm = 0x248
jmp 0xc8644
shll $0x3, %ebp
leaq 0x259ee(%rip), %rsi     # 0xee004
leaq 0x5e55a(%rip), %rdx     # 0x126b77
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x30af0
leaq 0x259ff(%rip), %rsi     # 0xee034
leaq 0x5e60f(%rip), %rdx     # 0x126c4b
movq %r14, %rdi
movl $0x257, %ecx            # imm = 0x257
movq %rbx, %r8
xorl %eax, %eax
callq 0x30af0
movl $0x1, %eax
addq $0x828, %rsp            # imm = 0x828
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq