// File: /workspace/github_cpp_makefile_star2_O2/eggnot[P]pixel_camera/matrix/lib/framebuffer.cc
// Function: rgb_matrix::internal::Framebuffer::Fill(unsigned char, unsigned char, unsigned char)
void Framebuffer::Fill(uint8_t r, uint8_t g, uint8_t b) {
  const uint16_t red   = MapColor(r);
  const uint16_t green = MapColor(PANEL_SWAP_G_B_ ? b : g);
  const uint16_t blue  = MapColor(PANEL_SWAP_G_B_ ? g : b);

  for (int b = kBitPlanes - pwm_bits_; b < kBitPlanes; ++b) {
    uint16_t mask = 1 << b;
    IoBits plane_bits;
    plane_bits.raw = 0;
    plane_bits.bits.p0_r1 = plane_bits.bits.p0_r2 = (red & mask) == mask;
    plane_bits.bits.p0_g1 = plane_bits.bits.p0_g2 = (green & mask) == mask;
    plane_bits.bits.p0_b1 = plane_bits.bits.p0_b2 = (blue & mask) == mask;

#ifndef ONLY_SINGLE_CHAIN
    plane_bits.bits.p1_r1 = plane_bits.bits.p1_r2 =
      plane_bits.bits.p2_r1 = plane_bits.bits.p2_r2 = (red & mask) == mask;
    plane_bits.bits.p1_g1 = plane_bits.bits.p1_g2 =
      plane_bits.bits.p2_g1 = plane_bits.bits.p2_g2 = (green & mask) == mask;
    plane_bits.bits.p1_b1 = plane_bits.bits.p1_b2 =
      plane_bits.bits.p2_b1 = plane_bits.bits.p2_b2 = (blue & mask) == mask;
#endif
    for (int row = 0; row < double_rows_; ++row) {
      IoBits *row_data = ValueAt(row, 0, b);
      for (int col = 0; col < columns_; ++col) {
        (row_data++)->raw = plane_bits.raw;
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movl %edx, %r14d
movq %rdi, %rbx
callq 0x40b4
movl %eax, %r15d
movq %rbx, %rdi
movl %r14d, %esi
callq 0x40b4
movl %eax, %r14d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x40b4
movzbl 0x10(%rbx), %edx
pushq $0xb
popq %rcx
subl %edx, %ecx
movzwl %r15w, %edx
movzwl %r14w, %esi
movzwl %ax, %eax
pushq $0x1
popq %rdi
movl $0x900, %r8d            # imm = 0x900
cmpl $0xb, %ecx
je 0x3bf2
movl %edi, %r14d
shll %cl, %r14d
movzwl %r14w, %r15d
movl %r14d, %r10d
andl %edx, %r10d
xorl %r9d, %r9d
xorl %ebp, %ebp
cmpl %r15d, %r10d
sete %bpl
movl $0x0, %r10d
cmovel %r8d, %r10d
movl %r14d, %r12d
andl %esi, %r12d
xorl %r11d, %r11d
cmpl %r15d, %r12d
sete %r11b
movl %r11d, %r12d
shll $0x9, %r12d
orl %r10d, %r12d
movl %r11d, %r13d
shll $0x1b, %r13d
orl %r12d, %r13d
andl %eax, %r14d
xorl %r10d, %r10d
cmpl %r15d, %r14d
sete %r10b
movl %r10d, %r14d
shll $0xa, %r14d
orl %r13d, %r14d
movl %r10d, %r15d
shll $0x7, %r15d
orl %r14d, %r15d
movl %ebp, %r14d
shll $0x1a, %r14d
orl %r15d, %r14d
movl %ebp, %r15d
shll $0xe, %r15d
movl %ebp, %r12d
shll $0x13, %r12d
orl %r15d, %r12d
shll $0xc, %ebp
orl %r12d, %ebp
movl %r11d, %r15d
shll $0x10, %r15d
orl %ebp, %r15d
leal (,%r11,4), %ebp
orl %r15d, %ebp
movl %r11d, %r15d
shll $0xd, %r15d
orl %ebp, %r15d
orl %r14d, %r15d
shll $0x5, %r11d
movl %r10d, %ebp
shll $0x15, %ebp
orl %r11d, %ebp
leal (,%r10,8), %r11d
orl %ebp, %r11d
movl %r10d, %ebp
shll $0x14, %ebp
orl %r11d, %ebp
shll $0x6, %r10d
orl %ebp, %r10d
orl %r15d, %r10d
movl %ecx, %r11d
cmpl 0x14(%rbx), %r9d
jge 0x3beb
movl 0xc(%rbx), %ebp
movl %ebp, %r14d
imull %r11d, %r14d
movslq %r14d, %r14
shlq $0x2, %r14
addq 0x20(%rbx), %r14
xorl %r15d, %r15d
cmpl %ebp, %r15d
jge 0x3be2
movl %r10d, (%r14,%r15,4)
movl 0xc(%rbx), %ebp
incq %r15
jmp 0x3bd1
incl %r9d
addl $0xb, %r11d
jmp 0x3bb3
incl %ecx
jmp 0x3ace
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop