// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::convertToXYZFloat(float*, float*, float const*, unsigned int, unsigned int, LodePNGState const*)
unsigned convertToXYZFloat(float* out, float whitepoint[3], const float* in,
                           unsigned w, unsigned h, const LodePNGState* state) {
  unsigned error = 0;
  const LodePNGInfo* info = &state->info_png;

  unsigned use_icc = 0;
  LodePNGICC icc;
  lodepng_icc_init(&icc);
  if(info->iccp_defined) {
    error = parseICC(&icc, info->iccp_profile, info->iccp_profile_size);
    if(error) goto cleanup; /* corrupted ICC profile */
    use_icc = validateICC(&icc);
  }
  /* Input is floating point, so lookup table cannot be used, but it's ensured to
  use float pow, not the slower double pow. */
  error = convertToXYZ_gamma(out, in, w, h, info, use_icc, &icc);
  if(error) goto cleanup;
  error = convertToXYZ_chrm(out, w, h, info, use_icc, &icc, whitepoint);
  if(error) goto cleanup;

cleanup:
  lodepng_icc_cleanup(&icc);
  return error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %r9, %r15
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %r12
movq %rsi, 0x28(%rsp)
movq %rdi, %r13
xorps %xmm0, %xmm0
movups %xmm0, 0xb8(%rsp)
movups %xmm0, 0xf0(%rsp)
movups %xmm0, 0x128(%rsp)
xorl %edx, %edx
cmpl $0x0, 0x1cc(%r9)
je 0x12cdf
movq 0x1d8(%r15), %rsi
movl 0x1e0(%r15), %edx
leaq 0x30(%rsp), %rdi
callq 0x12165
movl $0x1, %ebx
testl %eax, %eax
jne 0x12e34
movl 0x30(%rsp), %eax
testl %eax, %eax
je 0x12cc2
cmpl $0x2, %eax
jne 0x12cc6
cmpl $0x0, 0x84(%rsp)
movl $0x0, %edx
je 0x12cdf
cmpl $0x0, 0x74(%rsp)
jne 0x12cd2
jmp 0x12cdf
movl %eax, %edx
jmp 0x12cdf
cmpl $0x0, 0x74(%rsp)
movl $0x0, %edx
je 0x12cdf
xorl %edx, %edx
cmpl $0x0, 0xac(%rsp)
setne %dl
movl %r14d, %eax
movl %ebp, 0x18(%rsp)
movl %ebp, %ebp
imulq %rax, %rbp
leaq (,%rbp,4), %rax
testq %rax, %rax
je 0x12d10
xorl %ecx, %ecx
movss (%r12,%rcx,4), %xmm0
movss %xmm0, (%r13,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x12cfb
leaq 0xd0(%r15), %rax
testl %edx, %edx
movl %r14d, 0x14(%rsp)
movq %r13, 0x8(%rsp)
movl %edx, 0x10(%rsp)
movq %rax, 0x20(%rsp)
je 0x12d80
testq %rbp, %rbp
je 0x12e08
xorl %r13d, %r13d
movq 0x8(%rsp), %r14
leaq 0xb0(%rsp), %rbx
xorl %r15d, %r15d
movss (%r12,%r15,4), %xmm0
movq %rbx, %rdi
callq 0x13ca9
movss %xmm0, (%r14,%r15,4)
incq %r15
addq $0x38, %rbx
cmpq $0x3, %r15
jne 0x12d4a
incq %r13
addq $0x10, %r14
addq $0x10, %r12
cmpq %rbp, %r13
jne 0x12d3f
jmp 0x12e08
cmpl $0x0, 0x198(%r15)
je 0x12d98
cmpl $0x0, 0x1c4(%r15)
je 0x12e6f
testq %rbp, %rbp
je 0x12e08
xorl %ebx, %ebx
movss 0x62fd5(%rip), %xmm1    # 0x75d7c
movq 0x8(%rsp), %r15
xorl %r14d, %r14d
movss (%r12,%r14,4), %xmm0
ucomiss %xmm0, %xmm1
jbe 0x12dc4
divss 0x62fca(%rip), %xmm0    # 0x75d8c
jmp 0x12de9
addss 0x62fb4(%rip), %xmm0    # 0x75d80
divss 0x62fb0(%rip), %xmm0    # 0x75d84
movss 0x62fac(%rip), %xmm1    # 0x75d88
callq 0x13e86
movss 0x62f93(%rip), %xmm1    # 0x75d7c
movss %xmm0, (%r15,%r14,4)
incq %r14
cmpq $0x3, %r14
jne 0x12daf
incq %rbx
addq $0x10, %r15
addq $0x10, %r12
cmpq %rbp, %rbx
jne 0x12dac
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
leaq 0x30(%rsp), %r9
movq 0x8(%rsp), %rdi
movl 0x14(%rsp), %esi
movl 0x18(%rsp), %edx
movq 0x20(%rsp), %rcx
movl 0x10(%rsp), %r8d
callq 0x12ac5
movl %eax, %ebx
movq 0xb8(%rsp), %rdi
callq 0x2290
movq 0xf0(%rsp), %rdi
callq 0x2290
movq 0x128(%rsp), %rdi
callq 0x2290
movl %ebx, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x19c(%r15), %eax
cmpl $0x186a0, %eax          # imm = 0x186A0
je 0x12e08
testq %rbp, %rbp
je 0x12e08
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movss 0x62ee4(%rip), %xmm1    # 0x75d78
divss %xmm0, %xmm1
movss %xmm1, 0x1c(%rsp)
xorl %ebx, %ebx
xorps %xmm1, %xmm1
movq 0x8(%rsp), %r15
xorl %r14d, %r14d
movss (%r12,%r14,4), %xmm0
ucomiss %xmm0, %xmm1
jae 0x12ec4
movss 0x1c(%rsp), %xmm1
callq 0x13e86
xorps %xmm1, %xmm1
movss %xmm0, (%r15,%r14,4)
incq %r14
cmpq $0x3, %r14
jne 0x12eab
incq %rbx
addq $0x10, %r15
addq $0x10, %r12
cmpq %rbp, %rbx
jne 0x12ea8
jmp 0x12e08