// File: /workspace/github_cpp_makefile_star2_O3/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
movl %esi, %r15d
movq %rdi, %rbx
movb 0x11(%rdi), %cl
cmpb $0x1, %cl
jne 0x3bef
movb 0x460a(%rip), %al       # 0x81d0
testb %al, %al
je 0x3e1b
movzbl %r15b, %ecx
movzbl 0x12(%rbx), %eax
imulq $0xc8, %rcx, %rcx
addq 0x45e4(%rip), %rcx      # 0x81c8
movzwl -0x2(%rcx,%rax,2), %r15d
movb 0x11(%rbx), %cl
jmp 0x3c0f
movzbl %r15b, %edx
movzbl 0x12(%rbx), %eax
imull %eax, %edx
shrl $0x2, %edx
imull $0x147b, %edx, %r15d    # imm = 0x147B
shrl $0xe, %r15d
andl $0x7f8, %r15d           # imm = 0x7F8
testb $0x1, %cl
je 0x3c43
movb 0x45b6(%rip), %al       # 0x81d0
testb %al, %al
je 0x3e4c
movzbl %r14b, %ecx
movzbl 0x12(%rbx), %eax
imulq $0xc8, %rcx, %rcx
addq 0x4590(%rip), %rcx      # 0x81c8
movzwl -0x2(%rcx,%rax,2), %r14d
movb 0x11(%rbx), %cl
jmp 0x3c62
movzbl %r14b, %edx
movzbl %al, %esi
imull %edx, %esi
shrl $0x2, %esi
imull $0x147b, %esi, %r14d    # imm = 0x147B
shrl $0xe, %r14d
andl $0x7f8, %r14d           # imm = 0x7F8
testb $0x1, %cl
je 0x3c92
movb 0x4563(%rip), %al       # 0x81d0
testb %al, %al
je 0x3e7d
movzbl %bpl, %eax
movzbl 0x12(%rbx), %ecx
imulq $0xc8, %rax, %rax
addq 0x453d(%rip), %rax      # 0x81c8
movzwl -0x2(%rax,%rcx,2), %esi
jmp 0x3cae
movzbl %bpl, %ecx
movzbl %al, %eax
imull %ecx, %eax
shrl $0x2, %eax
imull $0x147b, %eax, %esi     # imm = 0x147B
shrl $0xe, %esi
andl $0x7f8, %esi            # imm = 0x7F8
movzbl 0x10(%rbx), %eax
testl %eax, %eax
je 0x3e0c
movl $0xb, %ecx
subl %eax, %ecx
movzwl %r15w, %eax
movzwl %r14w, %edx
movzwl %si, %esi
movl 0x14(%rbx), %r8d
movl $0x900, %edi            # imm = 0x900
movl $0x1, %r15d
shll %cl, %r15d
movzwl %r15w, %r13d
movl %r15d, %r9d
andl %eax, %r9d
xorl %r11d, %r11d
cmpl %r13d, %r9d
sete %bpl
movl $0x0, %r14d
cmovel %edi, %r14d
movl %r15d, %r9d
andl %edx, %r9d
xorl %r10d, %r10d
cmpl %r13d, %r9d
sete %r12b
andl %esi, %r15d
xorl %r9d, %r9d
cmpl %r13d, %r15d
sete %r15b
testl %r8d, %r8d
jle 0x3e01
movb %r12b, %r10b
movl %r10d, %r12d
shll $0x9, %r12d
orl %r12d, %r14d
movl %r10d, %r12d
shll $0x1b, %r12d
orl %r14d, %r12d
movb %r15b, %r9b
movl %r9d, %r14d
shll $0xa, %r14d
orl %r12d, %r14d
movl %r9d, %r15d
shll $0x7, %r15d
orl %r14d, %r15d
movb %bpl, %r11b
movl %r11d, %ebp
shll $0x1a, %ebp
orl %r15d, %ebp
movl %r11d, %r14d
shll $0xe, %r14d
movl %r11d, %r15d
shll $0x13, %r15d
orl %r14d, %r15d
shll $0xc, %r11d
orl %r15d, %r11d
movl %r10d, %r14d
shll $0x10, %r14d
orl %r11d, %r14d
leal (,%r10,4), %r11d
orl %r14d, %r11d
movl %r10d, %r14d
shll $0xd, %r14d
orl %r11d, %r14d
orl %ebp, %r14d
shll $0x5, %r10d
movl %r9d, %r11d
shll $0x15, %r11d
orl %r10d, %r11d
leal (,%r9,8), %r10d
orl %r11d, %r10d
movl %r9d, %r11d
shll $0x14, %r11d
orl %r10d, %r11d
shll $0x6, %r9d
orl %r11d, %r9d
orl %r14d, %r9d
movl 0xc(%rbx), %ebp
xorl %r10d, %r10d
movl %ecx, %r11d
testl %ebp, %ebp
jle 0x3df5
imull %r11d, %ebp
movslq %ebp, %r8
shlq $0x2, %r8
addq 0x20(%rbx), %r8
xorl %r14d, %r14d
movl %r9d, (%r8,%r14,4)
movl 0xc(%rbx), %ebp
incq %r14
cmpl %ebp, %r14d
jl 0x3de2
movl 0x14(%rbx), %r8d
incl %r10d
addl $0xb, %r11d
cmpl %r8d, %r10d
jl 0x3dcc
incl %ecx
cmpl $0xb, %ecx
jne 0x3cd5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x43ae(%rip), %rdi      # 0x81d0
callq 0x22c0
testl %eax, %eax
je 0x3bce
callq 0x4581
movq %rax, 0x438d(%rip)      # 0x81c8
leaq 0x438e(%rip), %rdi      # 0x81d0
callq 0x2100
jmp 0x3bce
leaq 0x437d(%rip), %rdi      # 0x81d0
callq 0x22c0
testl %eax, %eax
je 0x3c22
callq 0x4581
movq %rax, 0x435c(%rip)      # 0x81c8
leaq 0x435d(%rip), %rdi      # 0x81d0
callq 0x2100
jmp 0x3c22
leaq 0x434c(%rip), %rdi      # 0x81d0
callq 0x22c0
testl %eax, %eax
je 0x3c75
callq 0x4581
movq %rax, 0x432b(%rip)      # 0x81c8
leaq 0x432c(%rip), %rdi      # 0x81d0
callq 0x2100
jmp 0x3c75
jmp 0x3eb2
jmp 0x3eb2
movq %rax, %rbx
leaq 0x4314(%rip), %rdi      # 0x81d0
callq 0x20f0
movq %rbx, %rdi
callq 0x22a0
nop