// File: /workspace/github_cpp_makefile_star2_O3/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 0x12a83
movq 0x1d8(%r15), %rsi
movl 0x1e0(%r15), %edx
leaq 0x30(%rsp), %rdi
callq 0x11e1d
movl $0x1, %ebx
testl %eax, %eax
jne 0x12bd8
movl 0x30(%rsp), %eax
testl %eax, %eax
je 0x12a66
cmpl $0x2, %eax
jne 0x12a6a
cmpl $0x0, 0x84(%rsp)
movl $0x0, %edx
je 0x12a83
cmpl $0x0, 0x74(%rsp)
jne 0x12a76
jmp 0x12a83
movl %eax, %edx
jmp 0x12a83
cmpl $0x0, 0x74(%rsp)
movl $0x0, %edx
je 0x12a83
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 0x12ab4
xorl %ecx, %ecx
movss (%r12,%rcx,4), %xmm0
movss %xmm0, (%r13,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x12a9f
leaq 0xd0(%r15), %rax
testl %edx, %edx
movl %r14d, 0x14(%rsp)
movq %r13, 0x8(%rsp)
movl %edx, 0x10(%rsp)
movq %rax, 0x20(%rsp)
je 0x12b24
testq %rbp, %rbp
je 0x12bac
xorl %r13d, %r13d
movq 0x8(%rsp), %r14
leaq 0xb0(%rsp), %rbx
xorl %r15d, %r15d
movss (%r12,%r15,4), %xmm0
movq %rbx, %rdi
callq 0x13a49
movss %xmm0, (%r14,%r15,4)
incq %r15
addq $0x38, %rbx
cmpq $0x3, %r15
jne 0x12aee
incq %r13
addq $0x10, %r14
addq $0x10, %r12
cmpq %rbp, %r13
jne 0x12ae3
jmp 0x12bac
cmpl $0x0, 0x198(%r15)
je 0x12b3c
cmpl $0x0, 0x1c4(%r15)
je 0x12c13
testq %rbp, %rbp
je 0x12bac
xorl %ebx, %ebx
movss 0x63461(%rip), %xmm1    # 0x75fac
movq 0x8(%rsp), %r15
xorl %r14d, %r14d
movss (%r12,%r14,4), %xmm0
ucomiss %xmm0, %xmm1
jbe 0x12b68
divss 0x63456(%rip), %xmm0    # 0x75fbc
jmp 0x12b8d
addss 0x63440(%rip), %xmm0    # 0x75fb0
divss 0x6343c(%rip), %xmm0    # 0x75fb4
movss 0x63438(%rip), %xmm1    # 0x75fb8
callq 0x13c26
movss 0x6341f(%rip), %xmm1    # 0x75fac
movss %xmm0, (%r15,%r14,4)
incq %r14
cmpq $0x3, %r14
jne 0x12b53
incq %rbx
addq $0x10, %r15
addq $0x10, %r12
cmpq %rbp, %rbx
jne 0x12b50
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 0x1287e
movl %eax, %ebx
movq 0xb8(%rsp), %rdi
callq 0x22a0
movq 0xf0(%rsp), %rdi
callq 0x22a0
movq 0x128(%rsp), %rdi
callq 0x22a0
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 0x12bac
testq %rbp, %rbp
je 0x12bac
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movss 0x63370(%rip), %xmm1    # 0x75fa8
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 0x12c68
movss 0x1c(%rsp), %xmm1
callq 0x13c26
xorps %xmm1, %xmm1
movss %xmm0, (%r15,%r14,4)
incq %r14
cmpq $0x3, %r14
jne 0x12c4f
incq %rbx
addq $0x10, %r15
addq $0x10, %r12
cmpq %rbp, %rbx
jne 0x12c4c
jmp 0x12bac