// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/graphics/backends/surfacebackend.cpp
// Function: smooth::GUI::SurfaceBackend::Bar(smooth::GUI::Point const&, smooth::GUI::Point const&, int)
S::Int S::GUI::SurfaceBackend::Bar(const Point &iP1, const Point &iP2, Int orientation)
{
	Point	 p1 = rightToLeft.TranslatePoint(iP1);
	Point	 p2 = rightToLeft.TranslatePoint(iP2);

	if (rightToLeft.GetRightToLeft())
	{
		if (orientation == OR_HORZ) { p1 = rightToLeft.TranslatePoint(iP2);	p2 = rightToLeft.TranslatePoint(iP1); }
		if (orientation == OR_VERT) { p1 -= Point(2, 0);			p2 -= Point(2, 0); }
	}

	Bool	 preRTL = rightToLeft.GetRightToLeft();

	rightToLeft.SetRightToLeft(False);

	if (orientation == OR_HORZ)
	{
		Line(p1, p2, Color(Math::Max(Setup::BackgroundColor.GetRed() - 64, 0), Math::Max(Setup::BackgroundColor.GetGreen() - 64, 0), Math::Max(Setup::BackgroundColor.GetBlue() - 64, 0)));
		p1.y++;
		p2.y++;
		Line(p1, p2, Color(Math::Min(Setup::BackgroundColor.GetRed() + 64, 255), Math::Min(Setup::BackgroundColor.GetGreen() + 64, 255), Math::Min(Setup::BackgroundColor.GetBlue() + 64, 255)));
	}
	else if (orientation == OR_VERT)
	{
		p2.y++;
		Line(p1, p2, Color(Math::Max(Setup::BackgroundColor.GetRed() - 64, 0), Math::Max(Setup::BackgroundColor.GetGreen() - 64, 0), Math::Max(Setup::BackgroundColor.GetBlue() - 64, 0)));
		p1.x++;
		p2.x++;
		Line(p1, p2, Color(Math::Min(Setup::BackgroundColor.GetRed() + 64, 255), Math::Min(Setup::BackgroundColor.GetGreen() + 64, 255), Math::Min(Setup::BackgroundColor.GetBlue() + 64, 255)));
	}

	rightToLeft.SetRightToLeft(preRTL);

	return Success();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %r15d
movq %rdx, %rbp
movq %rsi, %r13
movq %rdi, 0x20(%rsp)
leaq 0x28(%rdi), %rbx
movq %rbx, %rdi
callq 0x63dec
movq %rax, %r14
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x63dec
movq %rax, %r12
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x63e62
testb %al, %al
je 0x62255
cmpl $0x2, %r15d
je 0x62383
cmpl $0x1, %r15d
jne 0x62255
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x63dec
movq %rax, 0x18(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x63dec
movq %rax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x63e62
movl %eax, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x63e5c
jmp 0x6227d
movq %rbx, %rdi
callq 0x63e62
movl %eax, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x63e5c
cmpl $0x2, %r15d
je 0x6237c
cmpl $0x1, %r15d
jne 0x624a9
movb %bpl, 0xf(%rsp)
movq 0xff247(%rip), %rax     # 0x1614d0
movl 0x8(%rax), %eax
movl $0xff, %r14d
movl %eax, %ecx
andl %r14d, %ecx
cmpl $0x41, %ecx
pushq $0x40
popq %rdx
cmovbl %edx, %ecx
addl $-0x40, %ecx
movl %eax, %esi
shrl $0x8, %esi
andl %r14d, %esi
cmpl $0x41, %esi
cmovbl %edx, %esi
shrl $0x10, %eax
andl %r14d, %eax
cmpl $0x41, %eax
cmovbl %edx, %eax
shll $0x10, %eax
addl $0xffc00000, %eax       # imm = 0xFFC00000
shll $0x8, %esi
addl $0xffffc000, %esi       # imm = 0xFFFFC000
orl %ecx, %esi
orl %eax, %esi
leaq 0x28(%rsp), %r13
movq %rsi, 0x8(%r13)
andl $0x0, (%r13)
movq 0x20(%rsp), %rbp
movq (%rbp), %rax
leaq 0x18(%rsp), %r15
leaq 0x10(%rsp), %r12
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq *0x60(%rax)
incl 0x4(%r15)
incl 0x4(%r12)
movq 0xff1be(%rip), %rax     # 0x1614d0
movl 0x8(%rax), %eax
movl %eax, %ecx
andl %r14d, %ecx
movl $0xbf, %edx
cmpl %edx, %ecx
cmovael %edx, %ecx
addl $0x40, %ecx
movl %eax, %esi
shrl $0x8, %esi
andl %r14d, %esi
cmpl %edx, %esi
cmovael %edx, %esi
shrl $0x10, %eax
andl %r14d, %eax
cmpl %edx, %eax
cmovael %edx, %eax
shll $0x10, %eax
addl $0x400000, %eax         # imm = 0x400000
shll $0x8, %esi
addl $0x4000, %esi           # imm = 0x4000
orl %ecx, %esi
orl %eax, %esi
movq %rsi, 0x8(%r13)
andl $0x0, (%r13)
movq (%rbp), %rax
leaq 0x28(%rsp), %rcx
movq %rbp, %rdi
movb 0xf(%rsp), %bpl
movq %r15, %rsi
movq %r12, %rdx
callq *0x60(%rax)
jmp 0x624a9
movb %bpl, 0xf(%rsp)
jmp 0x623ab
addl $-0x2, %r14d
movl %r14d, 0x18(%rsp)
leal -0x2(%r12), %eax
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
callq 0x63e62
movb %al, 0xf(%rsp)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x63e5c
shrq $0x20, %r12
incl %r12d
leaq 0x10(%rsp), %r15
movl %r12d, 0x4(%r15)
movq 0xff10e(%rip), %rax     # 0x1614d0
movl 0x8(%rax), %eax
movl $0xff, %r14d
movl %eax, %ecx
andl %r14d, %ecx
cmpl $0x41, %ecx
pushq $0x40
popq %rdx
cmovbl %edx, %ecx
addl $-0x40, %ecx
movl %eax, %esi
shrl $0x8, %esi
andl %r14d, %esi
cmpl $0x41, %esi
cmovbl %edx, %esi
shrl $0x10, %eax
andl %r14d, %eax
cmpl $0x41, %eax
cmovbl %edx, %eax
shll $0x10, %eax
addl $0xffc00000, %eax       # imm = 0xFFC00000
shll $0x8, %esi
addl $0xffffc000, %esi       # imm = 0xFFFFC000
orl %ecx, %esi
orl %eax, %esi
leaq 0x28(%rsp), %r13
movq %rsi, 0x8(%r13)
andl $0x0, (%r13)
movq 0x20(%rsp), %rbp
movq (%rbp), %rax
leaq 0x18(%rsp), %r12
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq *0x60(%rax)
incl (%r12)
incl (%r15)
movq 0xff08c(%rip), %rax     # 0x1614d0
movl 0x8(%rax), %eax
movl %eax, %ecx
andl %r14d, %ecx
movl $0xbf, %edx
cmpl %edx, %ecx
cmovael %edx, %ecx
addl $0x40, %ecx
movl %eax, %esi
shrl $0x8, %esi
andl %r14d, %esi
cmpl %edx, %esi
cmovael %edx, %esi
shrl $0x10, %eax
andl %r14d, %eax
cmpl %edx, %eax
cmovael %edx, %eax
shll $0x10, %eax
addl $0x400000, %eax         # imm = 0x400000
shll $0x8, %esi
addl $0x4000, %esi           # imm = 0x4000
orl %ecx, %esi
orl %eax, %esi
movq %rsi, 0x8(%r13)
andl $0x0, (%r13)
movq (%rbp), %rax
leaq 0x28(%rsp), %rcx
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq *0x60(%rax)
movb 0xf(%rsp), %bpl
movzbl %bpl, %esi
movq %rbx, %rdi
callq 0x63e5c
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq