// File: /workspace/github_cpp_makefile_star2_O2/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, %ebx
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
xorps %xmm0, %xmm0
movups %xmm0, 0xb8(%rsp)
movups %xmm0, 0xf0(%rsp)
movups %xmm0, 0x128(%rsp)
cmpl $0x0, 0x1cc(%r9)
je 0x1032e
movq 0x1d8(%r15), %rsi
movl 0x1e0(%r15), %edx
leaq 0x30(%rsp), %rdi
callq 0xf9f5
testl %eax, %eax
je 0x1033d
pushq $0x1
popq %rbx
jmp 0x1049a
movq %r13, 0x18(%rsp)
movl $0x0, 0x8(%rsp)
jmp 0x10350
movq %r13, 0x18(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x100c4
movl %eax, 0x8(%rsp)
leaq 0xd0(%r15), %rax
movq %rax, 0x28(%rsp)
movl %ebp, %eax
movl %ebx, %r13d
imulq %rax, %r13
leaq (,%r13,4), %rax
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x10385
movss (%r12,%rcx,4), %xmm0
movss %xmm0, (%r14,%rcx,4)
incq %rcx
jmp 0x1036f
cmpl $0x0, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movl %ebp, 0xc(%rsp)
movq %r14, 0x20(%rsp)
je 0x103e2
xorl %ebp, %ebp
movq %r14, %rbx
cmpq %r13, %rbp
je 0x1046e
leaq 0xb0(%rsp), %r15
xorl %r14d, %r14d
cmpq $0x3, %r14
je 0x103d5
movss (%r12,%r14,4), %xmm0
movq %r15, %rdi
callq 0x11151
movss %xmm0, (%rbx,%r14,4)
incq %r14
addq $0x38, %r15
jmp 0x103b2
incq %rbp
addq $0x10, %r12
addq $0x10, %rbx
jmp 0x1039e
cmpl $0x0, 0x198(%r15)
je 0x103f6
cmpl $0x0, 0x1c4(%r15)
je 0x10460
xorl %r15d, %r15d
movss 0x4f997(%rip), %xmm1    # 0x5fd98
cmpq %r13, %r15
je 0x1046e
xorl %ebx, %ebx
cmpq $0x3, %rbx
je 0x10453
movss (%r12,%rbx,4), %xmm0
ucomiss %xmm0, %xmm1
jbe 0x10423
divss 0x4f987(%rip), %xmm0    # 0x5fda8
jmp 0x10448
addss 0x4f971(%rip), %xmm0    # 0x5fd9c
divss 0x4f96d(%rip), %xmm0    # 0x5fda0
movss 0x4f969(%rip), %xmm1    # 0x5fda4
callq 0x11328
movss 0x4f950(%rip), %xmm1    # 0x5fd98
movss %xmm0, (%r14,%rbx,4)
incq %rbx
jmp 0x10408
incq %r15
addq $0x10, %r12
addq $0x10, %r14
jmp 0x10401
movl 0x19c(%r15), %eax
cmpl $0x186a0, %eax          # imm = 0x186A0
jne 0x104b8
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x30(%rsp), %r9
movq 0x20(%rsp), %rdi
movl 0xc(%rsp), %esi
movl 0x10(%rsp), %edx
movq 0x28(%rsp), %rcx
movl 0x8(%rsp), %r8d
callq 0x10232
movl %eax, %ebx
leaq 0x30(%rsp), %rdi
callq 0xf66b
movl %ebx, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %eax
cvtsi2ss %rax, %xmm0
movss 0x4f8cd(%rip), %xmm1    # 0x5fd94
divss %xmm0, %xmm1
movss %xmm1, 0x14(%rsp)
xorl %r14d, %r14d
xorps %xmm1, %xmm1
movq 0x20(%rsp), %r15
cmpq %r13, %r14
je 0x1046e
xorl %ebx, %ebx
cmpq $0x3, %rbx
je 0x1050d
movss (%r12,%rbx,4), %xmm0
ucomiss %xmm0, %xmm1
jae 0x10502
movss 0x14(%rsp), %xmm1
callq 0x11328
xorps %xmm1, %xmm1
movss %xmm0, (%r15,%rbx,4)
incq %rbx
jmp 0x104e3
incq %r14
addq $0x10, %r12
addq $0x10, %r15
jmp 0x104dc