// File: Lut99[P]RayTracer/src/lib/LodePNG.cpp
// Function: readChunk_cHRM(LodePNGInfo*, unsigned char const*, unsigned long)
static unsigned readChunk_cHRM(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) {
  if(chunkLength != 32) return 97; /*invalid cHRM chunk size*/

  info->chrm_defined = 1;
  info->chrm_white_x = 16777216u * data[ 0] + 65536u * data[ 1] + 256u * data[ 2] + data[ 3];
  info->chrm_white_y = 16777216u * data[ 4] + 65536u * data[ 5] + 256u * data[ 6] + data[ 7];
  info->chrm_red_x   = 16777216u * data[ 8] + 65536u * data[ 9] + 256u * data[10] + data[11];
  info->chrm_red_y   = 16777216u * data[12] + 65536u * data[13] + 256u * data[14] + data[15];
  info->chrm_green_x = 16777216u * data[16] + 65536u * data[17] + 256u * data[18] + data[19];
  info->chrm_green_y = 16777216u * data[20] + 65536u * data[21] + 256u * data[22] + data[23];
  info->chrm_blue_x  = 16777216u * data[24] + 65536u * data[25] + 256u * data[26] + data[27];
  info->chrm_blue_y  = 16777216u * data[28] + 65536u * data[29] + 256u * data[30] + data[31];

  return 0; /* OK */
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq %rdx, -0x20(%rsp)
cmpq $0x20, -0x20(%rsp)
je 0x145ce4
movl $0x61, -0x4(%rsp)
jmp 0x145eea
movq -0x10(%rsp), %rax
movl $0x1, 0xbc(%rax)
movq -0x18(%rsp), %rax
movzbl (%rax), %ecx
shll $0x18, %ecx
movq -0x18(%rsp), %rax
movzbl 0x1(%rax), %eax
shll $0x10, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x2(%rax), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x3(%rax), %eax
addl %eax, %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0xc0(%rax)
movq -0x18(%rsp), %rax
movzbl 0x4(%rax), %ecx
shll $0x18, %ecx
movq -0x18(%rsp), %rax
movzbl 0x5(%rax), %eax
shll $0x10, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x6(%rax), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x7(%rax), %eax
addl %eax, %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0xc4(%rax)
movq -0x18(%rsp), %rax
movzbl 0x8(%rax), %ecx
shll $0x18, %ecx
movq -0x18(%rsp), %rax
movzbl 0x9(%rax), %eax
shll $0x10, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0xa(%rax), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0xb(%rax), %eax
addl %eax, %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0xc8(%rax)
movq -0x18(%rsp), %rax
movzbl 0xc(%rax), %ecx
shll $0x18, %ecx
movq -0x18(%rsp), %rax
movzbl 0xd(%rax), %eax
shll $0x10, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0xe(%rax), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0xf(%rax), %eax
addl %eax, %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0xcc(%rax)
movq -0x18(%rsp), %rax
movzbl 0x10(%rax), %ecx
shll $0x18, %ecx
movq -0x18(%rsp), %rax
movzbl 0x11(%rax), %eax
shll $0x10, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x12(%rax), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x13(%rax), %eax
addl %eax, %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0xd0(%rax)
movq -0x18(%rsp), %rax
movzbl 0x14(%rax), %ecx
shll $0x18, %ecx
movq -0x18(%rsp), %rax
movzbl 0x15(%rax), %eax
shll $0x10, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x16(%rax), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x17(%rax), %eax
addl %eax, %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0xd4(%rax)
movq -0x18(%rsp), %rax
movzbl 0x18(%rax), %ecx
shll $0x18, %ecx
movq -0x18(%rsp), %rax
movzbl 0x19(%rax), %eax
shll $0x10, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x1a(%rax), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x1b(%rax), %eax
addl %eax, %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0xd8(%rax)
movq -0x18(%rsp), %rax
movzbl 0x1c(%rax), %ecx
shll $0x18, %ecx
movq -0x18(%rsp), %rax
movzbl 0x1d(%rax), %eax
shll $0x10, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x1e(%rax), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x18(%rsp), %rax
movzbl 0x1f(%rax), %eax
addl %eax, %ecx
movq -0x10(%rsp), %rax
movl %ecx, 0xdc(%rax)
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nop