// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/multi/menu/micromenu.cpp
// Function: smooth::GUI::MicroMenu::Paint(int)
S::Int S::GUI::MicroMenu::Paint(Int message)
{
	if (!IsRegistered()) return Error();
	if (!IsVisible())    return Success();

	Surface	*surface = GetDrawSurface();
	Rect	 frame	 = Rect(GetRealPosition(), GetRealSize());

	switch (message)
	{
		case SP_PAINT:
			surface->StartPaint(frame);

			if (IsBackgroundColorSet()) surface->Box(frame, GetBackgroundColor(), Rect::Filled);

			surface->Frame(frame, FRAME_UP);

			if (subtype == OR_HORZ)
			{
				Int	 size = Math::Round(3 * surface->GetSurfaceDPI() / 96.0);

				for (Int i = 0; i < size; i++)
				{
					Point	 lineStart = Point(frame.left + (frame.GetWidth() - size) / 2 + i, frame.top + frame.GetHeight() / 2 - size + 1 + i);
					Point	 lineEnd   = lineStart + Point(0, 2 * (size - i) - 1);

					if (IsActive())	surface->Line(lineStart, lineEnd, Setup::TextColor);
					else		surface->Line(lineStart, lineEnd, Setup::InactiveTextColor);
				}
			}
			else if (subtype == OR_VERT)
			{
				Int	 size = Math::Round(3 * surface->GetSurfaceDPI() / 96.0);

				for (Int i = 0; i < size; i++)
				{
					Point	 lineStart = Point(frame.left + frame.GetWidth() / 2 - size + 1 + (IsRightToLeft() ? 1 : 0) + i, frame.top + (frame.GetHeight() - size) / 2 + i);
					Point	 lineEnd   = lineStart + Point(2 * (size - i) - 1, 0);

					if (IsActive())	surface->Line(lineStart, lineEnd, Setup::TextColor);
					else		surface->Line(lineStart, lineEnd, Setup::InactiveTextColor);
				}
			}

			surface->EndPaint();

			break;
		case SP_MOUSEOUT:
			if (hotspot->IsActive()) surface->Frame(frame, FRAME_UP);

			break;
	}

	return Success();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0xbf7a4
leaq -0x28(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0xe0(%rbp), %rdi
callq 0x59680
movl %eax, -0xd4(%rbp)
jmp 0xbf773
movl -0xd4(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xbfca1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5b5b0
jmp 0xbfcad
movq -0xd0(%rbp), %rdi
movq (%rdi), %rax
callq *0x90(%rax)
testb $0x1, %al
jne 0xbf80d
leaq -0x48(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x5ca80
movq -0xf0(%rbp), %rdi
callq 0x59680
movl %eax, -0xe4(%rbp)
jmp 0xbf7dc
movl -0xe4(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xbfca1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x5a410
jmp 0xbfcad
movq -0xd0(%rbp), %rdi
movq (%rdi), %rax
movq 0x40(%rax), %rax
callq *%rax
movq -0xd0(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq (%rdi), %rax
movq 0x48(%rax), %rax
callq *%rax
movq -0xd0(%rbp), %rdi
movq %rax, -0x68(%rbp)
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
movq %rax, -0x70(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x59ff0
movl -0x14(%rbp), %eax
movl %eax, -0xf4(%rbp)
testl %eax, %eax
je 0xbf87d
jmp 0xbf869
movl -0xf4(%rbp), %eax
subl $0x3, %eax
je 0xbfc1b
jmp 0xbfc49
movq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x591b0
movq -0xd0(%rbp), %rdi
movq (%rdi), %rax
callq *0x148(%rax)
testb $0x1, %al
jne 0xbf8a0
jmp 0xbf8ff
movq -0xd0(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0x108(%rbp)
movq (%rdi), %rax
callq *0x140(%rax)
movq %rax, -0x100(%rbp)
movq 0x1496d7(%rip), %rax    # 0x208fa0
movl (%rax), %eax
movl %eax, -0xf8(%rbp)
leaq -0x78(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x59260
movq -0x108(%rbp), %rdi
movq -0x100(%rbp), %rdx
movl -0xf8(%rbp), %ecx
leaq -0x60(%rbp), %rsi
leaq -0x78(%rbp), %r8
callq 0x5c110
movq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %rsi
xorl %edx, %edx
callq 0x5c050
movq -0xd0(%rbp), %rax
movswl 0x1a0(%rax), %eax
cmpl $0x1, %eax
jne 0xbfa66
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
imull $0x3, %eax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc7b82(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movl %eax, -0x7c(%rbp)
movl $0x0, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x7c(%rbp), %eax
jge 0xbfa61
movl -0x60(%rbp), %eax
movl %eax, -0x114(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5a5a0
subl -0x7c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x114(%rbp), %eax
addl %ecx, %eax
addl -0x80(%rbp), %eax
movl %eax, -0x110(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x10c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl -0x110(%rbp), %esi
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x10c(%rbp), %edx
addl %eax, %edx
subl -0x7c(%rbp), %edx
addl $0x1, %edx
addl -0x80(%rbp), %edx
leaq -0x88(%rbp), %rdi
callq 0x5c2c0
movl -0x7c(%rbp), %edx
subl -0x80(%rbp), %edx
shll %edx
subl $0x1, %edx
leaq -0x98(%rbp), %rdi
xorl %esi, %esi
callq 0x5c2c0
leaq -0x88(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x5ca20
movq -0xd0(%rbp), %rdi
movq %rax, -0x90(%rbp)
movq (%rdi), %rax
callq *0x98(%rax)
testb $0x1, %al
jne 0xbfa13
jmp 0xbfa33
movq -0x50(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0x90(%rbp), %rdx
movq 0x148f9c(%rip), %rcx    # 0x2089c8
callq 0x5cce0
jmp 0xbfa51
movq -0x50(%rbp), %rdi
leaq -0x88(%rbp), %rsi
leaq -0x90(%rbp), %rdx
movq 0x148ee4(%rip), %rcx    # 0x208930
callq 0x5cce0
jmp 0xbfa53
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
jmp 0xbf951
jmp 0xbfc10
movq -0xd0(%rbp), %rax
movswl 0x1a0(%rax), %eax
cmpl $0x2, %eax
jne 0xbfc0e
movq -0x50(%rbp), %rdi
callq 0x5d470
cwtl
imull $0x3, %eax, %eax
cvtsi2sd %eax, %xmm0
movsd 0xc7a2a(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movl %eax, -0x9c(%rbp)
movl $0x0, -0xa0(%rbp)
movl -0xa0(%rbp), %eax
cmpl -0x9c(%rbp), %eax
jge 0xbfc0c
movl -0x60(%rbp), %eax
movl %eax, -0x124(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5a5a0
movq -0xd0(%rbp), %rdi
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x124(%rbp), %eax
addl %ecx, %eax
subl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x120(%rbp)
movq (%rdi), %rax
callq *0x160(%rax)
movb %al, %sil
movl -0x120(%rbp), %eax
xorl %ecx, %ecx
movl $0x1, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
addl %ecx, %eax
addl -0xa0(%rbp), %eax
movl %eax, -0x11c(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x118(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x591a0
movl -0x11c(%rbp), %esi
subl -0x9c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x118(%rbp), %edx
addl %eax, %edx
addl -0xa0(%rbp), %edx
leaq -0xa8(%rbp), %rdi
callq 0x5c2c0
movl -0x9c(%rbp), %esi
subl -0xa0(%rbp), %esi
shll %esi
subl $0x1, %esi
leaq -0xb8(%rbp), %rdi
xorl %edx, %edx
callq 0x5c2c0
leaq -0xa8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x5ca20
movq -0xd0(%rbp), %rdi
movq %rax, -0xb0(%rbp)
movq (%rdi), %rax
callq *0x98(%rax)
testb $0x1, %al
jne 0xbfbb8
jmp 0xbfbd8
movq -0x50(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
movq 0x148df7(%rip), %rcx    # 0x2089c8
callq 0x5cce0
jmp 0xbfbf6
movq -0x50(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
movq 0x148d3f(%rip), %rcx    # 0x208930
callq 0x5cce0
jmp 0xbfbf8
movl -0xa0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa0(%rbp)
jmp 0xbfaaf
jmp 0xbfc0e
jmp 0xbfc10
movq -0x50(%rbp), %rdi
callq 0x5d270
jmp 0xbfc49
movq -0xd0(%rbp), %rax
movq 0x688(%rax), %rdi
movq (%rdi), %rax
callq *0x98(%rax)
testb $0x1, %al
jne 0xbfc38
jmp 0xbfc47
movq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %rsi
xorl %edx, %edx
callq 0x5c050
jmp 0xbfc49
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x5ca80
movq -0x130(%rbp), %rdi
callq 0x59680
movl %eax, -0x128(%rbp)
jmp 0xbfc70
movl -0x128(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x5a410
jmp 0xbfca1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x5a410
jmp 0xbfcad
movl -0x4(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x5b6b0
nopw %cs:(%rax,%rax)