// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/graphics/backends/surfacebackend.cpp
// Function: smooth::GUI::SurfaceBackend::Frame(smooth::GUI::Rect const&, short)
S::Int S::GUI::SurfaceBackend::Frame(const Rect &iRect, Short style)
{
	Rect	 rect = rightToLeft.TranslateRect(iRect);

	Point	 p1 = Point(rect.left,	    rect.top);
	Point	 p2 = Point(rect.right - 1, rect.top);
	Point	 p3 = Point(rect.left,	    rect.bottom - 1);
	Point	 p4 = Point(rect.right - 1, rect.bottom - 1);

	Long	 color1 = 0;
	Long	 color2 = 0;

	switch (style)
	{
		case FRAME_UP:
			color1 = Color(Math::Min(Setup::BackgroundColor.GetRed() + 64, 255), Math::Min(Setup::BackgroundColor.GetGreen() + 64, 255), Math::Min(Setup::BackgroundColor.GetBlue() + 64, 255));
			color2 = Color(Math::Max(Setup::BackgroundColor.GetRed() - 64, 0), Math::Max(Setup::BackgroundColor.GetGreen() - 64, 0), Math::Max(Setup::BackgroundColor.GetBlue() - 64, 0));

			break;
		case FRAME_DOWN:
			color1 = Color(Math::Max(Setup::BackgroundColor.GetRed() - 64, 0), Math::Max(Setup::BackgroundColor.GetGreen() - 64, 0), Math::Max(Setup::BackgroundColor.GetBlue() - 64, 0));
			color2 = Color(Math::Min(Setup::BackgroundColor.GetRed() + 64, 255), Math::Min(Setup::BackgroundColor.GetGreen() + 64, 255), Math::Min(Setup::BackgroundColor.GetBlue() + 64, 255));

			break;
	}

	Bool	 preRTL = rightToLeft.GetRightToLeft();

	rightToLeft.SetRightToLeft(False);

	StartPaint(rect);

	Line(p1, p2, color1);
	Line(p1, p3, color1);
	Line(p2, p4, color2);
	Line(p3, p4, color2);

	SetPixel(p4, color2);

	EndPaint();

	rightToLeft.SetRightToLeft(preRTL);

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movw %dx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x118(%rbp)
addq $0x28, %rdi
movq -0x10(%rbp), %rsi
callq 0x73390
movq %rax, -0x24(%rbp)
movq %rdx, -0x1c(%rbp)
movl -0x24(%rbp), %esi
movl -0x20(%rbp), %edx
leaq -0x2c(%rbp), %rdi
callq 0x5c2c0
movl -0x20(%rbp), %edx
movl -0x1c(%rbp), %esi
decl %esi
leaq -0x34(%rbp), %rdi
callq 0x5c2c0
movl -0x24(%rbp), %esi
movl -0x18(%rbp), %edx
decl %edx
leaq -0x3c(%rbp), %rdi
callq 0x5c2c0
movl -0x1c(%rbp), %esi
movl -0x18(%rbp), %edx
decl %esi
decl %edx
leaq -0x44(%rbp), %rdi
callq 0x5c2c0
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movswl -0x12(%rbp), %eax
movl %eax, -0x110(%rbp)
testl %eax, %eax
je 0x6e9f2
jmp 0x6e9de
movl -0x110(%rbp), %eax
subl $0x1, %eax
je 0x6eaf6
jmp 0x6ec01
movq 0x199aaf(%rip), %rdi    # 0x2084a8
callq 0x59f20
movl %eax, %edi
addl $0x40, %edi
movl $0xff, %esi
callq 0x5ce90
movl %eax, -0x128(%rbp)
movq 0x199a8e(%rip), %rdi    # 0x2084a8
callq 0x5d920
movl %eax, %edi
addl $0x40, %edi
movl $0xff, %esi
callq 0x5ce90
movl %eax, -0x124(%rbp)
movq 0x199a6d(%rip), %rdi    # 0x2084a8
callq 0x5b650
movl %eax, %edi
addl $0x40, %edi
movl $0xff, %esi
callq 0x5ce90
movl -0x128(%rbp), %esi
movl -0x124(%rbp), %edx
movl %eax, %ecx
leaq -0x68(%rbp), %rdi
xorl %r8d, %r8d
callq 0x5a6b0
leaq -0x68(%rbp), %rdi
callq 0x59210
movq %rax, -0x50(%rbp)
movq 0x199a2b(%rip), %rdi    # 0x2084a8
callq 0x59f20
movl %eax, %edi
subl $0x40, %edi
xorl %esi, %esi
callq 0x5aae0
movl %eax, -0x120(%rbp)
movq 0x199a0d(%rip), %rdi    # 0x2084a8
callq 0x5d920
movl %eax, %edi
subl $0x40, %edi
xorl %esi, %esi
callq 0x5aae0
movl %eax, -0x11c(%rbp)
movq 0x1999ef(%rip), %rdi    # 0x2084a8
callq 0x5b650
movl %eax, %edi
subl $0x40, %edi
xorl %esi, %esi
callq 0x5aae0
movl -0x120(%rbp), %esi
movl -0x11c(%rbp), %edx
movl %eax, %ecx
leaq -0x78(%rbp), %rdi
xorl %r8d, %r8d
callq 0x5a6b0
leaq -0x78(%rbp), %rdi
callq 0x59210
movq %rax, -0x58(%rbp)
jmp 0x6ec01
movq 0x1999ab(%rip), %rdi    # 0x2084a8
callq 0x59f20
movl %eax, %edi
subl $0x40, %edi
xorl %esi, %esi
callq 0x5aae0
movl %eax, -0x138(%rbp)
movq 0x19998d(%rip), %rdi    # 0x2084a8
callq 0x5d920
movl %eax, %edi
subl $0x40, %edi
xorl %esi, %esi
callq 0x5aae0
movl %eax, -0x134(%rbp)
movq 0x19996f(%rip), %rdi    # 0x2084a8
callq 0x5b650
movl %eax, %edi
subl $0x40, %edi
xorl %esi, %esi
callq 0x5aae0
movl -0x138(%rbp), %esi
movl -0x134(%rbp), %edx
movl %eax, %ecx
leaq -0x88(%rbp), %rdi
xorl %r8d, %r8d
callq 0x5a6b0
leaq -0x88(%rbp), %rdi
callq 0x59210
movq %rax, -0x50(%rbp)
movq 0x19992a(%rip), %rdi    # 0x2084a8
callq 0x59f20
movl %eax, %edi
addl $0x40, %edi
movl $0xff, %esi
callq 0x5ce90
movl %eax, -0x130(%rbp)
movq 0x199909(%rip), %rdi    # 0x2084a8
callq 0x5d920
movl %eax, %edi
addl $0x40, %edi
movl $0xff, %esi
callq 0x5ce90
movl %eax, -0x12c(%rbp)
movq 0x1998e8(%rip), %rdi    # 0x2084a8
callq 0x5b650
movl %eax, %edi
addl $0x40, %edi
movl $0xff, %esi
callq 0x5ce90
movl -0x130(%rbp), %esi
movl -0x12c(%rbp), %edx
movl %eax, %ecx
leaq -0x98(%rbp), %rdi
xorl %r8d, %r8d
callq 0x5a6b0
leaq -0x98(%rbp), %rdi
callq 0x59210
movq %rax, -0x58(%rbp)
movq -0x118(%rbp), %rdi
addq $0x28, %rdi
movq %rdi, -0x150(%rbp)
callq 0x73480
movq -0x150(%rbp), %rdi
movb %al, -0x99(%rbp)
xorl %esi, %esi
movl %esi, -0x164(%rbp)
callq 0x73460
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
leaq -0x24(%rbp), %rsi
callq *%rax
movl -0x164(%rbp), %edx
movq -0x50(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x59be0
movq -0x1a0(%rbp), %rcx
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
movq 0x60(%rax), %rax
leaq -0x2c(%rbp), %rsi
movq %rsi, -0x198(%rbp)
leaq -0x34(%rbp), %rdx
movq %rdx, -0x188(%rbp)
callq *%rax
movl -0x164(%rbp), %edx
movq -0x50(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
movq %rdi, -0x190(%rbp)
callq 0x59be0
movq -0x198(%rbp), %rsi
movq -0x190(%rbp), %rcx
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
movq 0x60(%rax), %rax
leaq -0x3c(%rbp), %rdx
movq %rdx, -0x178(%rbp)
callq *%rax
movl -0x164(%rbp), %edx
movq -0x58(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x59be0
movq -0x188(%rbp), %rsi
movq -0x180(%rbp), %rcx
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
movq 0x60(%rax), %rax
leaq -0x44(%rbp), %rdx
movq %rdx, -0x160(%rbp)
callq *%rax
movl -0x164(%rbp), %edx
movq -0x58(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x170(%rbp)
callq 0x59be0
movq -0x178(%rbp), %rsi
movq -0x170(%rbp), %rcx
movq -0x160(%rbp), %rdx
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
movq 0x60(%rax), %rax
callq *%rax
movl -0x164(%rbp), %edx
movq -0x58(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x59be0
movq -0x160(%rbp), %rsi
movq -0x158(%rbp), %rdx
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
movq 0x58(%rax), %rax
callq *%rax
movq -0x118(%rbp), %rdi
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
movq -0x150(%rbp), %rdi
movzbl -0x99(%rbp), %esi
andl $0x1, %esi
callq 0x73460
leaq -0x100(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x5ca80
movq -0x148(%rbp), %rdi
callq 0x59680
movl %eax, -0x13c(%rbp)
jmp 0x6ede6
leaq -0x100(%rbp), %rdi
callq 0x5a410
movl -0x13c(%rbp), %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x5a410
movq -0x108(%rbp), %rdi
callq 0x5b6b0
nopl (%rax,%rax)