// File: /workspace/github_cpp_makefile_star2_O2/lvandeve[P]lodepng/lodepng_util.cpp
// Function: lodepng::getChrm(float*, float*, unsigned int, lodepng::LodePNGICC const*, LodePNGInfo const*)
static unsigned getChrm(float m[9], float whitepoint[3], unsigned use_icc,
                        const LodePNGICC* icc, const LodePNGInfo* info) {
  size_t i;
  if(use_icc) {
    if(getICCChrm(m, whitepoint, icc)) return 1;  /* error in the matrix computations */
  } else if(info->chrm_defined && !info->srgb_defined) {
    float wx = info->chrm_white_x / 100000.0f, wy = info->chrm_white_y / 100000.0f;
    float rx = info->chrm_red_x / 100000.0f, ry = info->chrm_red_y / 100000.0f;
    float gx = info->chrm_green_x / 100000.0f, gy = info->chrm_green_y / 100000.0f;
    float bx = info->chrm_blue_x / 100000.0f, by = info->chrm_blue_y / 100000.0f;
    if(getChrmMatrixXY(m, wx, wy, rx, ry, gx, gy, bx, by)) return 1; /* returns if error */
    /* Output whitepoint, xyY to XYZ: */
    whitepoint[0] = wx / wy;
    whitepoint[1] = 1;
    whitepoint[2] = (1 - wx - wy) / wy;
  } else {
    /* the standard linear sRGB to XYZ matrix */
    static const float srgb[9] = {
        0.4124564f, 0.3575761f, 0.1804375f,
        0.2126729f, 0.7151522f, 0.0721750f,
        0.0193339f, 0.1191920f, 0.9503041f
    };
    for(i = 0; i < 9; i++) m[i] = srgb[i];
    /* sRGB's whitepoint xyY "0.3127,0.3290,1" in XYZ: */
    whitepoint[0] = 0.9504559270516716f;
    whitepoint[1] = 1;
    whitepoint[2] = 1.0890577507598784f;
  }
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
testl %edx, %edx
je 0x11777
movq %rcx, %r15
cmpl $0x2, (%rcx)
jne 0x117af
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x60(%rsp)
movl $0x3f800000, %eax       # imm = 0x3F800000
movl %eax, 0x50(%rsp)
movl %eax, 0x60(%rsp)
movl %eax, 0x70(%rsp)
cmpl $0x0, 0x1c(%r15)
je 0x11947
xorl %eax, %eax
cmpq $0x9, %rax
je 0x117f5
movss 0x20(%r15,%rax,4), %xmm0
movss %xmm0, 0x50(%rsp,%rax,4)
incq %rax
jmp 0x1175b
cmpl $0x0, 0xd0(%r8)
je 0x1178f
cmpl $0x0, 0xf4(%r8)
je 0x119bc
xorl %eax, %eax
leaq 0x4e568(%rip), %rcx     # 0x5fd00
cmpq $0x24, %rax
je 0x117dd
movss (%rax,%rcx), %xmm0
movss %xmm0, (%r14,%rax)
addq $0x4, %rax
jmp 0x11798
movl $0x3f800000, %eax       # imm = 0x3F800000
movl %eax, 0x20(%r14)
movss 0x4e5d0(%rip), %xmm0    # 0x5fd90
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
movl %eax, 0x8(%rbx)
movsd 0x4e69c(%rip), %xmm0    # 0x5fe70
movsd %xmm0, (%rbx)
jmp 0x119a6
movsd 0x4e6eb(%rip), %xmm0    # 0x5fed0
movsd %xmm0, (%rbx)
movl $0x3f8b663f, 0x8(%rbx)  # imm = 0x3F8B663F
jmp 0x119a6
leaq 0x50(%rsp), %r12
movq %r12, %rdi
callq 0x11bca
leaq 0x34(%rsp), %rsi
leaq 0x38(%rsp), %rdx
cvtss2sd 0x48(%r15), %xmm0
cvtss2sd 0x4c(%r15), %xmm1
cvtss2sd 0x50(%r15), %xmm2
leaq 0x30(%rsp), %rdi
movq %r12, %rcx
callq 0x11b49
leaq 0x90(%rsp), %rsi
leaq 0x94(%rsp), %rdx
cvtss2sd 0x58(%r15), %xmm0
cvtss2sd 0x5c(%r15), %xmm1
cvtss2sd 0x60(%r15), %xmm2
leaq 0x8c(%rsp), %r12
leaq 0x50(%rsp), %rbp
movq %r12, %rdi
movq %rbp, %rcx
callq 0x11b49
leaq 0x84(%rsp), %rsi
leaq 0x88(%rsp), %rdx
cvtss2sd 0x64(%r15), %xmm0
cvtss2sd 0x68(%r15), %xmm1
cvtss2sd 0x6c(%r15), %xmm2
leaq 0x80(%rsp), %r13
movq %r13, %rdi
movq %rbp, %rcx
callq 0x11b49
leaq 0x78(%rsp), %rsi
leaq 0x7c(%rsp), %rdx
cvtss2sd 0x70(%r15), %xmm0
cvtss2sd 0x74(%r15), %xmm1
cvtss2sd 0x78(%r15), %xmm2
leaq 0x74(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rcx
callq 0x11b49
movsd 0x30(%rsp), %xmm0
movaps %xmm0, %xmm1
shufps $0x55, %xmm0, %xmm1     # xmm1 = xmm1[1,1],xmm0[1,1]
movss 0x38(%rsp), %xmm2
movss (%r12), %xmm3
movss 0x4(%r12), %xmm4
movss 0x8(%r12), %xmm5
movss (%r13), %xmm6
movss 0x4(%r13), %xmm7
movss 0x8(%r13), %xmm10
movss (%r15), %xmm11
movss 0x4(%r15), %xmm8
movss 0x8(%r15), %xmm9
movss %xmm9, 0x18(%rsp)
movss %xmm8, 0x10(%rsp)
movss %xmm11, 0x8(%rsp)
movss %xmm10, (%rsp)
movq %r14, %rdi
movaps %xmm0, 0x40(%rsp)
movss %xmm2, 0x2c(%rsp)
callq 0x11eb5
testl %eax, %eax
je 0x11993
pushq $0x1
popq %rbp
jmp 0x119a8
movss 0x10(%r15), %xmm0
movss 0x14(%r15), %xmm1
movss 0x18(%r15), %xmm2
movss 0x48(%r15), %xmm3
movss 0x4c(%r15), %xmm4
movss 0x50(%r15), %xmm5
leaq 0x50(%rsp), %rdi
callq 0x11dad
xorl %eax, %eax
cmpq $0x3, %rax
je 0x1182b
movss 0x48(%r15,%rax,4), %xmm0
movss %xmm0, 0x30(%rsp,%rax,4)
incq %rax
jmp 0x11977
movaps 0x40(%rsp), %xmm0
movlps %xmm0, (%rbx)
movss 0x2c(%rsp), %xmm0
movss %xmm0, 0x8(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movd 0xf0(%r8), %xmm0
movd 0xe8(%r8), %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd 0xe0(%r8), %xmm2
movd 0xd8(%r8), %xmm8
punpckldq %xmm2, %xmm8    # xmm8 = xmm8[0],xmm2[0],xmm8[1],xmm2[1]
punpcklqdq %xmm1, %xmm8    # xmm8 = xmm8[0],xmm1[0]
movdqa 0x4e48a(%rip), %xmm1    # 0x5fe80
pand %xmm8, %xmm1
por 0x4e48d(%rip), %xmm1    # 0x5fe90
psrld $0x10, %xmm8
por 0x4e48e(%rip), %xmm8    # 0x5fea0
subps 0x4e496(%rip), %xmm8    # 0x5feb0
addps %xmm1, %xmm8
divps 0x4e49a(%rip), %xmm8    # 0x5fec0
xorps %xmm1, %xmm1
cmpeqps %xmm8, %xmm1
movmskps %xmm1, %eax
pushq $0x1
popq %rbp
testl %eax, %eax
jne 0x119a8
movl 0xd4(%r8), %eax
cvtsi2ss %rax, %xmm0
movl 0xdc(%r8), %eax
movss 0x4e33d(%rip), %xmm1    # 0x5fd94
divss %xmm1, %xmm0
movl 0xec(%r8), %ecx
cvtsi2ss %rcx, %xmm9
movl 0xe4(%r8), %ecx
cvtsi2ss %rcx, %xmm6
divss %xmm1, %xmm9
cvtsi2ss %rax, %xmm3
divss %xmm1, %xmm6
divss %xmm1, %xmm3
movss 0x4e303(%rip), %xmm1    # 0x5fd90
movaps %xmm1, %xmm2
subss %xmm0, %xmm2
divss %xmm8, %xmm0
subss %xmm8, %xmm2
divss %xmm8, %xmm2
movaps %xmm8, %xmm4
shufps $0x55, %xmm8, %xmm4     # xmm4 = xmm4[1,1],xmm8[1,1]
movaps %xmm1, %xmm5
subss %xmm3, %xmm5
divss %xmm4, %xmm3
subss %xmm4, %xmm5
divss %xmm4, %xmm5
movaps %xmm8, %xmm4
unpckhpd %xmm8, %xmm4            # xmm4 = xmm4[1],xmm8[1]
movaps %xmm1, %xmm7
subss %xmm6, %xmm7
divss %xmm4, %xmm6
subss %xmm4, %xmm7
divss %xmm4, %xmm7
shufps $0xff, %xmm8, %xmm8     # xmm8 = xmm8[3,3,3,3]
movaps %xmm1, %xmm4
subss %xmm9, %xmm4
divss %xmm8, %xmm9
subss %xmm8, %xmm4
divss %xmm8, %xmm4
movss %xmm9, 0x8(%rsp)
movss %xmm4, 0x18(%rsp)
movss %xmm7, (%rsp)
movl $0x3f800000, 0x10(%rsp) # imm = 0x3F800000
movq %r14, %rdi
movss %xmm0, 0x40(%rsp)
movss %xmm2, 0x2c(%rsp)
movaps %xmm1, %xmm4
movaps %xmm1, %xmm7
callq 0x11eb5
testl %eax, %eax
jne 0x119a8
movss 0x40(%rsp), %xmm0
movss %xmm0, (%rbx)
movl $0x3f800000, 0x4(%rbx)  # imm = 0x3F800000
jmp 0x1199b