// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x820, %rsp            # imm = 0x820
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 0x82e0
movsd %xmm0, (%rsp)
movsd 0x320(%rbx), %xmm0
callq 0x82e0
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movslq 0x330(%rbx), %r12
cvtsi2sd %r12d, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x338(%rbx)
movq %r12, %rdi
shlq $0x3, %rdi
callq 0x8490
movq %rax, 0x340(%rbx)
testq %rax, %rax
je 0xc0db5
movq %rax, %r13
xorl %r14d, %r14d
movslq %r12d, %rdi
cmpq %rdi, %r14
jge 0xc0d40
movsd 0x320(%rbx), %xmm0
addsd 0x24555(%rip), %xmm0    # 0xe5260
callq 0x82e0
cvtsi2sd %r14d, %xmm1
mulsd 0x338(%rbx), %xmm1
addsd %xmm1, %xmm0
callq 0x86a0
movq 0x340(%rbx), %r13
movsd %xmm0, (%r13,%r14,8)
incq %r14
movl 0x330(%rbx), %r12d
jmp 0xc0cf3
shlq $0x3, %rdi
callq 0x8490
movq %rax, 0x348(%rbx)
testq %rax, %rax
je 0xc0df9
leaq 0x1602(%rbx), %r14
movq %r13, %rdi
movl %r12d, %esi
movq %rax, %rdx
movq %r14, %rcx
callq 0x191be
cmpl $0x1, %eax
jne 0xc0e42
leaq 0x2466f(%rip), %rsi     # 0xe53f0
leaq 0x5cd9b(%rip), %rdx     # 0x11db23
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x24293(%rip), %rsi     # 0xe5034
leaq 0x5cd53(%rip), %rdx     # 0x11dafb
movq %r14, %rdi
movl $0x23d, %ecx            # imm = 0x23D
jmp 0xc10e7
leal (,%r12,8), %ecx
leaq 0x24240(%rip), %rsi     # 0xe5004
leaq 0x5cd29(%rip), %rdx     # 0x11daf4
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x2424c(%rip), %rsi     # 0xe5034
leaq 0x5cd0c(%rip), %rdx     # 0x11dafb
movq %rbx, %rdi
movl $0x22d, %ecx            # imm = 0x22D
jmp 0xc0e3a
shll $0x3, %r12d
leaq 0x24200(%rip), %rsi     # 0xe5004
leaq 0x5cd09(%rip), %rdx     # 0x11db14
leaq 0x20(%rsp), %r14
movq %r14, %rdi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x2e014
addq $0x1602, %rbx           # imm = 0x1602
leaq 0x24209(%rip), %rsi     # 0xe5034
leaq 0x5ccc9(%rip), %rdx     # 0x11dafb
movq %rbx, %rdi
movl $0x236, %ecx            # imm = 0x236
movq %r14, %r8
jmp 0xc10ea
cmpl $0x4, (%rbx)
jne 0xc0e63
cmpl $0x0, 0xcdc(%rbx)
je 0xc0f21
movl 0x368(%rbx), %r15d
movslq %r15d, %r12
jmp 0xc0ffe
movups 0x908(%r15), %xmm0
movups %xmm0, 0x350(%rbx)
movl 0x918(%r15), %eax
movl %eax, 0x368(%rbx)
movhlps %xmm0, %xmm0            # xmm0 = xmm0[1,1]
callq 0x82e0
movsd %xmm0, (%rsp)
movsd 0x350(%rbx), %xmm0
callq 0x82e0
movsd (%rsp), %xmm1
subsd %xmm0, %xmm1
movslq 0x368(%rbx), %r15
cvtsi2sd %r15d, %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x360(%rbx)
movq %r15, %rdi
shlq $0x3, %rdi
callq 0x8490
movq %rax, 0x370(%rbx)
testq %rax, %rax
je 0xc0fbb
xorl %r13d, %r13d
movslq %r15d, %r12
cmpq %r12, %r13
jge 0xc0ffe
movsd 0x350(%rbx), %xmm0
callq 0x82e0
cvtsi2sd %r13d, %xmm1
mulsd 0x360(%rbx), %xmm1
addsd %xmm1, %xmm0
callq 0x86a0
movq 0x370(%rbx), %rax
movsd %xmm0, (%rax,%r13,8)
incq %r13
movl 0x368(%rbx), %r15d
jmp 0xc0ed9
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
movsd %xmm1, 0x18(%rsp)
movsd %xmm1, 0x360(%rbx)
movslq 0x2e8(%rbx), %r15
leaq 0x1(%r15), %r12
movl %r12d, 0x368(%rbx)
leaq 0x8(,%r15,8), %rdi
callq 0x8490
movq %rax, 0x370(%rbx)
testq %rax, %rax
je 0xc10ac
xorl %ecx, %ecx
movapd (%rsp), %xmm1
movsd 0x18(%rsp), %xmm2
cmpq %r15, %rcx
jg 0xc0ffb
cvtsi2sd %ecx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, (%rax,%rcx,8)
incq %rcx
jmp 0xc0fa0
leal (,%r15,8), %ecx
leaq 0x2403a(%rip), %rsi     # 0xe5004
leaq 0x5ca56(%rip), %rdx     # 0x11da27
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x2404d(%rip), %rsi     # 0xe5034
leaq 0x5cb0d(%rip), %rdx     # 0x11dafb
movq %r14, %rdi
movl $0x248, %ecx            # imm = 0x248
jmp 0xc10e7
movl %r12d, %r15d
shlq $0x3, %r12
movq %r12, %rdi
callq 0x8490
movq %rax, 0x378(%rbx)
testq %rax, %rax
je 0xc1070
movq 0x370(%rbx), %rdi
movl %r15d, %esi
movq %rax, %rdx
movq %r14, %rcx
callq 0x191be
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x1, %ecx
jne 0xc10f4
leaq 0x243b1(%rip), %rsi     # 0xe53f0
leaq 0x5cb40(%rip), %rdx     # 0x11db86
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x2e014
leaq 0x23fd5(%rip), %rsi     # 0xe5034
leaq 0x5ca95(%rip), %rdx     # 0x11dafb
movq %r14, %rdi
movl $0x268, %ecx            # imm = 0x268
jmp 0xc10e7
shll $0x3, %r15d
leaq 0x23f89(%rip), %rsi     # 0xe5004
leaq 0x5caf5(%rip), %rdx     # 0x11db77
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x2e014
leaq 0x23f99(%rip), %rsi     # 0xe5034
leaq 0x5ca59(%rip), %rdx     # 0x11dafb
movq %r14, %rdi
movl $0x261, %ecx            # imm = 0x261
jmp 0xc10e7
leal (,%r12,8), %ecx
leaq 0x23f49(%rip), %rsi     # 0xe5004
leaq 0x5c965(%rip), %rdx     # 0x11da27
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2e014
leaq 0x23f5c(%rip), %rsi     # 0xe5034
leaq 0x5ca1c(%rip), %rdx     # 0x11dafb
movq %r14, %rdi
movl $0x257, %ecx            # imm = 0x257
movq %rbx, %r8
xorl %eax, %eax
callq 0x2e014
pushq $0x1
popq %rax
addq $0x820, %rsp            # imm = 0x820
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq