// File: /workspace/github_c_makefile_star2_O2/jonof[P]jftekwar/jfbuild/src/rg_etc1.cpp
// Function: rg_etc1::etc1_block::get_diff_subblock_colors(rg_etc1::color_quad_u8*, unsigned short, unsigned short, unsigned int)
bool etc1_block::get_diff_subblock_colors(color_quad_u8* pDst, uint16 packed_color5, uint16 packed_delta3, uint table_idx)
   {
      RG_ETC1_ASSERT(table_idx < cETC1IntenModifierValues);
      const int *pInten_modifer_table = &g_etc1_inten_tables[table_idx][0];

      uint r, g, b;
      bool success = unpack_color5(r, g, b, packed_color5, packed_delta3, true);

      const int ir = static_cast<int>(r), ig = static_cast<int>(g), ib = static_cast<int>(b);

      const int y0 = pInten_modifer_table[0];
      pDst[0].set(ir + y0, ig + y0, ib + y0);

      const int y1 = pInten_modifer_table[1];
      pDst[1].set(ir + y1, ig + y1, ib + y1);

      const int y2 = pInten_modifer_table[2];
      pDst[2].set(ir + y2, ig + y2, ib + y2);

      const int y3 = pInten_modifer_table[3];
      pDst[3].set(ir + y3, ig + y3, ib + y3);

      return success;
   }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x8, %ecx
jae 0x5ec81
movq %rdi, %rbx
movl %ecx, %r13d
shlq $0x4, %r13
movl $0xff, %ebp
movl %ebp, (%rsp)
movzwl %si, %ecx
movzwl %dx, %r8d
leaq 0x14(%rsp), %r14
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r12
pushq $0x1
popq %r9
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5e74a
movl (%r14), %edx
movl (%r15), %ecx
movl (%r12), %edi
leaq 0x1306e(%rip), %r14     # 0x71bc0
movl (%r13,%r14), %r8d
leal (%r8,%rdx), %r10d
leal (%r8,%rcx), %r11d
addl %edi, %r8d
xorl %esi, %esi
testl %r10d, %r10d
cmovlel %esi, %r10d
cmpl %ebp, %r10d
cmovgel %ebp, %r10d
testl %r11d, %r11d
cmovlel %esi, %r11d
cmpl %ebp, %r11d
cmovgel %ebp, %r11d
movl 0x4(%r13,%r14), %r9d
testl %r8d, %r8d
cmovlel %esi, %r8d
movb %r10b, (%rbx)
cmpl %ebp, %r8d
cmovgel %ebp, %r8d
movb %r11b, 0x1(%rbx)
movb %r8b, 0x2(%rbx)
leal (%r9,%rdx), %r10d
leal (%r9,%rcx), %r11d
addl %edi, %r9d
testl %r10d, %r10d
cmovlel %esi, %r10d
movb $-0x1, %r8b
cmpl %ebp, %r10d
cmovgel %ebp, %r10d
movb %r8b, 0x3(%rbx)
testl %r11d, %r11d
cmovlel %esi, %r11d
movb %r10b, 0x4(%rbx)
cmpl %ebp, %r11d
cmovgel %ebp, %r11d
movb %r11b, 0x5(%rbx)
testl %r9d, %r9d
cmovlel %esi, %r9d
cmpl %ebp, %r9d
cmovgel %ebp, %r9d
movb %r9b, 0x6(%rbx)
movb %r8b, 0x7(%rbx)
movl 0x8(%r13,%r14), %r9d
leal (%r9,%rdx), %r10d
leal (%r9,%rcx), %r11d
addl %edi, %r9d
testl %r10d, %r10d
cmovlel %esi, %r10d
cmpl %ebp, %r10d
cmovgel %ebp, %r10d
testl %r11d, %r11d
cmovlel %esi, %r11d
movb %r10b, 0x8(%rbx)
cmpl %ebp, %r11d
cmovgel %ebp, %r11d
movb %r11b, 0x9(%rbx)
testl %r9d, %r9d
cmovlel %esi, %r9d
cmpl %ebp, %r9d
cmovgel %ebp, %r9d
movb %r9b, 0xa(%rbx)
movb %r8b, 0xb(%rbx)
movl 0xc(%r13,%r14), %r9d
addl %r9d, %edx
addl %r9d, %ecx
addl %edi, %r9d
testl %edx, %edx
cmovlel %esi, %edx
cmpl %ebp, %edx
cmovgel %ebp, %edx
testl %ecx, %ecx
cmovlel %esi, %ecx
cmpl %ebp, %ecx
cmovgel %ebp, %ecx
testl %r9d, %r9d
cmovlel %esi, %r9d
movb %dl, 0xc(%rbx)
cmpl %ebp, %r9d
cmovgel %ebp, %r9d
movb %cl, 0xd(%rbx)
movb %r9b, 0xe(%rbx)
movb %r8b, 0xf(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12863(%rip), %rdi     # 0x714eb
leaq 0x127a0(%rip), %rsi     # 0x7142f
leaq 0x128d3(%rip), %rcx     # 0x71569
movl $0x455, %edx            # imm = 0x455
callq 0x61b0