// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x10, %rsp
cmpl $0x8, %ecx
jae 0x69ab7
movq %rdi, %rbx
movl %ecx, %r15d
shlq $0x4, %r15
leaq 0x13406(%rip), %r12     # 0x7cd60
movzwl %si, %esi
movzwl %dx, %edx
leaq 0xc(%rsp), %r14
movl $0xff, %ebp
movq %r14, %rdi
movl $0x1, %ecx
movl $0xff, %r8d
callq 0x693dc
movzbl (%r14), %edx
movzbl 0x1(%r14), %ecx
movzbl 0x2(%r14), %edi
movl (%r15,%r12), %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(%r15,%r12), %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(%r15,%r12), %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(%r15,%r12), %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 $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x12cdd(%rip), %rdi     # 0x7c79b
leaq 0x12c1a(%rip), %rsi     # 0x7c6df
leaq 0x12d4d(%rip), %rcx     # 0x7c819
movl $0x455, %edx            # imm = 0x455
callq 0x61b0