// File: mikeakohn[P]cloudtari/build/../src/TIA.h
// Function: TIA::set_pixel(int, int, unsigned char)
inline void set_pixel(int x, int y, uint8_t color)
  {
    x = x * 3;
    y = y * 2;

    const int width = television->get_width();
    int ptr = y * width + x;

    if (bitsize == 8)
    {
      color = color >> 1;
      image_8[ptr + 0] = color;
      image_8[ptr + 1] = color;
      image_8[ptr + 2] = color;
      ptr += width;
      image_8[ptr + 0] = color;
      image_8[ptr + 1] = color;
      image_8[ptr + 2] = color;
    }
      else
    {
      int c = ColorTable::get_color(color);
      image_32[ptr + 0] = c;
      image_32[ptr + 1] = c;
      image_32[ptr + 2] = c;
      ptr += width;
      image_32[ptr + 0] = c;
      image_32[ptr + 1] = c;
      image_32[ptr + 2] = c;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
imull $0x3, -0xc(%rbp), %ecx
movl %ecx, -0xc(%rbp)
movl -0x10(%rbp), %ecx
shll %ecx
movl %ecx, -0x10(%rbp)
movq (%rax), %rdi
callq 0xbe60
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, -0x18(%rbp)
movl -0x10(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl -0xc(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
cmpl $0x8, 0x1e0(%rax)
jne 0xbd52
movq -0x28(%rbp), %rax
movzbl -0x11(%rbp), %ecx
sarl %ecx
movb %cl, -0x11(%rbp)
movb -0x11(%rbp), %sil
movq 0x1d8(%rax), %rcx
movl -0x1c(%rbp), %edx
addl $0x0, %edx
movslq %edx, %rdx
movb %sil, (%rcx,%rdx)
movb -0x11(%rbp), %sil
movq 0x1d8(%rax), %rcx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movb %sil, (%rcx,%rdx)
movb -0x11(%rbp), %sil
movq 0x1d8(%rax), %rcx
movl -0x1c(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movb %sil, (%rcx,%rdx)
movl -0x18(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movb -0x11(%rbp), %sil
movq 0x1d8(%rax), %rcx
movl -0x1c(%rbp), %edx
addl $0x0, %edx
movslq %edx, %rdx
movb %sil, (%rcx,%rdx)
movb -0x11(%rbp), %sil
movq 0x1d8(%rax), %rcx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movb %sil, (%rcx,%rdx)
movb -0x11(%rbp), %dl
movq 0x1d8(%rax), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
jmp 0xbdf1
movzbl -0x11(%rbp), %edi
callq 0x5540
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, -0x20(%rbp)
movl -0x20(%rbp), %esi
movq 0x1d0(%rax), %rcx
movl -0x1c(%rbp), %edx
addl $0x0, %edx
movslq %edx, %rdx
movl %esi, (%rcx,%rdx,4)
movl -0x20(%rbp), %esi
movq 0x1d0(%rax), %rcx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movl %esi, (%rcx,%rdx,4)
movl -0x20(%rbp), %esi
movq 0x1d0(%rax), %rcx
movl -0x1c(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movl %esi, (%rcx,%rdx,4)
movl -0x18(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movl %ecx, -0x1c(%rbp)
movl -0x20(%rbp), %esi
movq 0x1d0(%rax), %rcx
movl -0x1c(%rbp), %edx
addl $0x0, %edx
movslq %edx, %rdx
movl %esi, (%rcx,%rdx,4)
movl -0x20(%rbp), %esi
movq 0x1d0(%rax), %rcx
movl -0x1c(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
movl %esi, (%rcx,%rdx,4)
movl -0x20(%rbp), %edx
movq 0x1d0(%rax), %rax
movl -0x1c(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)