// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/graphics/backends/xlib/bitmapxlib.cpp
// Function: smooth::GUI::BitmapXLib::SetPixel(smooth::GUI::Point const&, smooth::GUI::Color const&)
S::Bool S::GUI::BitmapXLib::SetPixel(const Point &iPoint, const Color &iColor)
{
	if (bitmap == NIL) return Error();

	Color	 color	= iColor.ConvertTo(Color::RGBA);

	if	(depth == 16) XPutPixel(bitmap, iPoint.x, iPoint.y, 			       ((color.GetRed() >> 3) << 11) | ((color.GetGreen() >> 2) << 5) | (color.GetBlue() >> 3));
	else if (depth == 24) XPutPixel(bitmap, iPoint.x, iPoint.y, 			       ( color.GetRed()	      << 16) | ( color.GetGreen()       << 8) | (color.GetBlue()     ));
	else if (depth == 32) XPutPixel(bitmap, iPoint.x, iPoint.y, (color.GetAlpha() << 24) | ( color.GetRed()	      << 16) | ( color.GetGreen()	<< 8) | (color.GetBlue()     ));

	return True;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, 0x28(%rax)
jne 0x1207cc
leaq -0x30(%rbp), %rdi
movq %rdi, -0x68(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0x68(%rbp), %rdi
callq 0x59680
movl %eax, -0x5c(%rbp)
jmp 0x120796
movl -0x5c(%rbp), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x1(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5b5b0
jmp 0x1209fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5b5b0
jmp 0x120a0a
movq -0x20(%rbp), %rsi
leaq -0x50(%rbp), %rdi
movl $0x1, %edx
callq 0x5c5e0
movq -0x58(%rbp), %rax
movsbl 0xa(%rax), %eax
cmpl $0x10, %eax
jne 0x12087f
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rcx
movq 0x70(%rcx), %rcx
movq %rcx, -0x70(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x78(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x74(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x59f20
sarl $0x3, %eax
shll $0xb, %eax
movl %eax, -0x88(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5d920
movl %eax, %ecx
movl -0x88(%rbp), %eax
sarl $0x2, %ecx
shll $0x5, %ecx
orl %ecx, %eax
movl %eax, -0x84(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5b650
movl -0x84(%rbp), %ecx
movq -0x80(%rbp), %rdi
movl -0x78(%rbp), %esi
movl -0x74(%rbp), %edx
movl %eax, %r8d
movq -0x70(%rbp), %rax
sarl $0x3, %r8d
orl %r8d, %ecx
movslq %ecx, %rcx
callq *%rax
jmp 0x1209f8
movq -0x58(%rbp), %rax
movsbl 0xa(%rax), %eax
cmpl $0x18, %eax
jne 0x12092e
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rcx
movq 0x70(%rcx), %rcx
movq %rcx, -0x90(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x98(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x94(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x59f20
shll $0x10, %eax
movl %eax, -0xa8(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5d920
movl %eax, %ecx
movl -0xa8(%rbp), %eax
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0xa4(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5b650
movl -0xa4(%rbp), %ecx
movq -0xa0(%rbp), %rdi
movl -0x98(%rbp), %esi
movl -0x94(%rbp), %edx
movl %eax, %r8d
movq -0x90(%rbp), %rax
orl %r8d, %ecx
movslq %ecx, %rcx
callq *%rax
jmp 0x1209f6
movq -0x58(%rbp), %rax
movsbl 0xa(%rax), %eax
cmpl $0x20, %eax
jne 0x1209f4
movq -0x58(%rbp), %rax
movq 0x28(%rax), %rcx
movq 0x70(%rcx), %rcx
movq %rcx, -0xb0(%rbp)
movq 0x28(%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xb8(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xb4(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5bac0
shll $0x18, %eax
movl %eax, -0xcc(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x59f20
movl %eax, %ecx
movl -0xcc(%rbp), %eax
shll $0x10, %ecx
orl %ecx, %eax
movl %eax, -0xc8(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5d920
movl %eax, %ecx
movl -0xc8(%rbp), %eax
shll $0x8, %ecx
orl %ecx, %eax
movl %eax, -0xc4(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5b650
movl -0xc4(%rbp), %ecx
movq -0xc0(%rbp), %rdi
movl -0xb8(%rbp), %esi
movl -0xb4(%rbp), %edx
movl %eax, %r8d
movq -0xb0(%rbp), %rax
orl %r8d, %ecx
movslq %ecx, %rcx
callq *%rax
jmp 0x1209f6
jmp 0x1209f8
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)