// File: tomfunkhouser[P]gaps/pkgs/png/pngset.c
// Function: png_set_sRGB_gAMA_and_cHRM
void PNGAPI
png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
   int intent)
{
#ifdef PNG_gAMA_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
   float file_gamma;
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
   png_fixed_point int_file_gamma;
#endif
#endif
#ifdef PNG_cHRM_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
   float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y;
#endif
   png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x,
      int_green_y, int_blue_x, int_blue_y;
#endif
   png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM");

   if (png_ptr == NULL || info_ptr == NULL)
      return;

   png_set_sRGB(png_ptr, info_ptr, intent);

#ifdef PNG_gAMA_SUPPORTED
#ifdef PNG_FLOATING_POINT_SUPPORTED
   file_gamma = (float).45455;
   png_set_gAMA(png_ptr, info_ptr, file_gamma);
#endif
#ifdef PNG_FIXED_POINT_SUPPORTED
   int_file_gamma = 45455L;
   png_set_gAMA_fixed(png_ptr, info_ptr, int_file_gamma);
#endif
#endif

#ifdef PNG_cHRM_SUPPORTED
   int_white_x = 31270L;
   int_white_y = 32900L;
   int_red_x   = 64000L;
   int_red_y   = 33000L;
   int_green_x = 30000L;
   int_green_y = 60000L;
   int_blue_x  = 15000L;
   int_blue_y  =  6000L;

#ifdef PNG_FLOATING_POINT_SUPPORTED
   white_x = (float).3127;
   white_y = (float).3290;
   red_x   = (float).64;
   red_y   = (float).33;
   green_x = (float).30;
   green_y = (float).60;
   blue_x  = (float).15;
   blue_y  = (float).06;
#endif

#ifdef PNG_FIXED_POINT_SUPPORTED
   png_set_cHRM_fixed(png_ptr, info_ptr,
       int_white_x, int_white_y, int_red_x, int_red_y, int_green_x,
       int_green_y, int_blue_x, int_blue_y);
#endif
#ifdef PNG_FLOATING_POINT_SUPPORTED
   png_set_cHRM(png_ptr, info_ptr,
       white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y);
#endif
#endif /* cHRM */
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rdi, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movl %edx, 0x6c(%rsp)
cmpq $0x0, 0x78(%rsp)
je 0xfdb76
cmpq $0x0, 0x70(%rsp)
jne 0xfdb7b
jmp 0xfdd23
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movl 0x6c(%rsp), %edx
callq 0xfdb10
movss 0x3b21a(%rip), %xmm0    # 0x138db0
movss %xmm0, 0x68(%rsp)
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movss 0x68(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0xfd080
movl $0xb18f, 0x64(%rsp)     # imm = 0xB18F
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movl 0x64(%rsp), %edx
callq 0xfd160
movl $0x7a26, 0x40(%rsp)     # imm = 0x7A26
movl $0x8084, 0x3c(%rsp)     # imm = 0x8084
movl $0xfa00, 0x38(%rsp)     # imm = 0xFA00
movl $0x80e8, 0x34(%rsp)     # imm = 0x80E8
movl $0x7530, 0x30(%rsp)     # imm = 0x7530
movl $0xea60, 0x2c(%rsp)     # imm = 0xEA60
movl $0x3a98, 0x28(%rsp)     # imm = 0x3A98
movl $0x1770, 0x24(%rsp)     # imm = 0x1770
movss 0x3b194(%rip), %xmm0    # 0x138dac
movss %xmm0, 0x60(%rsp)
movss 0x3b182(%rip), %xmm0    # 0x138da8
movss %xmm0, 0x5c(%rsp)
movss 0x3b170(%rip), %xmm0    # 0x138da4
movss %xmm0, 0x58(%rsp)
movss 0x3b15e(%rip), %xmm0    # 0x138da0
movss %xmm0, 0x54(%rsp)
movss 0x3b14c(%rip), %xmm0    # 0x138d9c
movss %xmm0, 0x50(%rsp)
movss 0x3b13a(%rip), %xmm0    # 0x138d98
movss %xmm0, 0x4c(%rsp)
movss 0x3b128(%rip), %xmm0    # 0x138d94
movss %xmm0, 0x48(%rsp)
movss 0x3b116(%rip), %xmm0    # 0x138d90
movss %xmm0, 0x44(%rsp)
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movl 0x40(%rsp), %edx
movl 0x3c(%rsp), %ecx
movl 0x38(%rsp), %r8d
movl 0x34(%rsp), %r9d
movl 0x30(%rsp), %ebx
movl 0x2c(%rsp), %r11d
movl 0x28(%rsp), %r10d
movl 0x24(%rsp), %eax
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl %r10d, 0x10(%rsp)
movl %eax, 0x18(%rsp)
callq 0xfce50
movq 0x78(%rsp), %rdi
movq 0x70(%rsp), %rsi
movss 0x60(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movss 0x5c(%rsp), %xmm1
cvtss2sd %xmm1, %xmm1
movss 0x58(%rsp), %xmm2
cvtss2sd %xmm2, %xmm2
movss 0x54(%rsp), %xmm3
cvtss2sd %xmm3, %xmm3
movss 0x50(%rsp), %xmm4
cvtss2sd %xmm4, %xmm4
movss 0x4c(%rsp), %xmm5
cvtss2sd %xmm5, %xmm5
movss 0x48(%rsp), %xmm6
cvtss2sd %xmm6, %xmm6
movss 0x44(%rsp), %xmm7
cvtss2sd %xmm7, %xmm7
callq 0xfcbd0
addq $0x80, %rsp
popq %rbx
retq
nopl (%rax)