// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::convertToXYZ_gamma_table(float*, unsigned long, unsigned long, LodePNGInfo const*, unsigned int, lodepng::LodePNGICC const*)
static void convertToXYZ_gamma_table(float* out, size_t n, size_t c,
                                     const LodePNGInfo* info, unsigned use_icc, const LodePNGICC* icc) {
  size_t i;
  float mul = 1.0f / (n - 1);
  if(use_icc) {
    for(i = 0; i < n; i++) {
      float v = i * mul;
      out[i] = iccForwardTRC(&icc->trc[c], v);
    }
  } else if(info->gama_defined && !info->srgb_defined) {
    /* no power needed if gamma is 1 */
    if(info->gama_gamma == 100000) {
      for(i = 0; i < n; i++) {
        out[i] = i * mul;
      }
    } else {
      float gamma = 100000.0f / info->gama_gamma;
      for(i = 0; i < n; i++) {
        float v = i * mul;
        out[i] = lodepng_powf(v, gamma);
      }
    }
  } else {
    for(i = 0; i < n; i++) {
      /* sRGB gamma expand */
      float v = i * mul;
      out[i] = (v < 0.04045f) ? (v / 12.92f) : lodepng_powf((v + 0.055f) / 1.055f, 2.4f);
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
leaq -0x1(%rsi), %rax
cvtsi2ss %rax, %xmm0
movq %rdi, %r14
movss 0x6390e(%rip), %xmm8    # 0x75f94
divss %xmm0, %xmm8
testl %r8d, %r8d
movss %xmm8, (%rsp)
je 0x126dc
testq %rbx, %rbx
je 0x12753
imulq $0x38, %rdx, %rax
leaq (%r9,%rax), %r15
addq $0x80, %r15
xorl %r12d, %r12d
xorps %xmm0, %xmm0
cvtsi2ss %r12, %xmm0
mulss %xmm8, %xmm0
movq %r15, %rdi
callq 0x13a49
movss (%rsp), %xmm8
movss %xmm0, (%r14,%r12,4)
incq %r12
cmpq %r12, %rbx
jne 0x126b1
jmp 0x12753
cmpl $0x0, 0xc8(%rcx)
je 0x126ee
cmpl $0x0, 0xf4(%rcx)
je 0x1275f
testq %rbx, %rbx
je 0x12753
xorl %r15d, %r15d
movss 0x638ae(%rip), %xmm1    # 0x75fac
xorps %xmm0, %xmm0
cvtsi2ss %r15, %xmm0
mulss %xmm8, %xmm0
ucomiss %xmm0, %xmm1
jbe 0x1271a
divss 0x638a4(%rip), %xmm0    # 0x75fbc
jmp 0x12745
addss 0x6388e(%rip), %xmm0    # 0x75fb0
divss 0x6388a(%rip), %xmm0    # 0x75fb4
movss 0x63886(%rip), %xmm1    # 0x75fb8
callq 0x13c26
movss 0x6386d(%rip), %xmm1    # 0x75fac
movss (%rsp), %xmm8
movss %xmm0, (%r14,%r15,4)
incq %r15
cmpq %r15, %rbx
jne 0x126fe
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl 0xcc(%rcx), %ecx
cmpl $0x186a0, %ecx          # imm = 0x186A0
jne 0x12825
testq %rbx, %rbx
je 0x12753
incq %rbx
andq $-0x2, %rbx
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa 0x5f881(%rip), %xmm1    # 0x72010
xorl %eax, %eax
movdqa 0x5f8b7(%rip), %xmm2    # 0x72050
pxor %xmm2, %xmm0
pcmpeqd %xmm3, %xmm3
movdqa 0x5f887(%rip), %xmm4    # 0x72030
movdqa %xmm1, %xmm5
pxor %xmm2, %xmm5
movdqa %xmm5, %xmm6
pcmpgtd %xmm0, %xmm6
pcmpeqd %xmm0, %xmm5
pshufd $0xf5, %xmm5, %xmm7     # xmm7 = xmm5[1,1,3,3]
pand %xmm6, %xmm7
pshufd $0xf5, %xmm6, %xmm5     # xmm5 = xmm6[1,1,3,3]
por %xmm7, %xmm5
movd %xmm5, %ecx
notl %ecx
testb $0x1, %cl
je 0x127ed
xorps %xmm6, %xmm6
cvtsi2ss %rax, %xmm6
mulss %xmm8, %xmm6
movss %xmm6, (%r14,%rax,4)
pxor %xmm3, %xmm5
pextrw $0x4, %xmm5, %ecx
testb $0x1, %cl
je 0x12813
leaq 0x1(%rax), %rcx
xorps %xmm5, %xmm5
cvtsi2ss %rcx, %xmm5
mulss %xmm8, %xmm5
movss %xmm5, 0x4(%r14,%rax,4)
addq $0x2, %rax
paddq %xmm4, %xmm1
cmpq %rax, %rbx
jne 0x127a9
jmp 0x12753
testq %rbx, %rbx
je 0x12753
movl %ecx, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movss 0x63768(%rip), %xmm1    # 0x75fa8
divss %xmm0, %xmm1
movss %xmm1, 0x4(%rsp)
xorl %r15d, %r15d
xorps %xmm0, %xmm0
cvtsi2ss %r15, %xmm0
mulss %xmm8, %xmm0
movss 0x4(%rsp), %xmm1
callq 0x13c26
movss (%rsp), %xmm8
movss %xmm0, (%r14,%r15,4)
incq %r15
cmpq %r15, %rbx
jne 0x1284d
jmp 0x12753