// File: /workspace/github_c_makefile_star2_O2/enzo1982[P]smooth/classes/gui/widgets/basic/divider.cpp
// Function: smooth::GUI::Divider::UpdateMetrics()
S::Void S::GUI::Divider::UpdateMetrics()
{
	Window	*wnd = GetContainerWindow();
	Rect	 rect;

	if (wnd == NIL) return;

	if (Binary::IsFlagSet(flags, OR_VERT))
	{
		Bool	 afterMe = False;

		if (container->GetObjectType() == Window::classID)
		{
			if (Binary::IsFlagSet(flags, OR_RIGHT))	rect.left = ((Window *) container)->GetClientRect().right - position;
			else					rect.left = ((Window *) container)->GetClientRect().left + position;

			rect.top	= wnd->GetClientRect().top;
			rect.bottom	= wnd->GetClientRect().bottom;
		}
		else
		{
			if (Binary::IsFlagSet(flags, OR_RIGHT))	rect.left = container->GetWidth() - position;
			else					rect.left = position;

			rect.top	= 3;
			rect.bottom	= container->GetHeight() - 3;
		}

		rect.right = rect.left + 2;

		for (Int i = container->GetNOfObjects() - 1; i >= 0; i--)
		{
			if (container->GetNthObject(i)->GetObjectType() != classID) continue;

			Divider	*divider = (Divider *) container->GetNthObject(i);

			if (afterMe && !Binary::IsFlagSet(divider->flags, OR_VERT))
			{
				if (Binary::IsFlagSet(divider->flags, OR_BOTTOM))
				{
					if (container->GetHeight() - divider->GetY() <= rect.bottom + 1) rect.bottom = container->GetHeight() - divider->GetY() - 2;
				}
				else
				{
					if (divider->GetY() >= rect.top - 2) rect.top = divider->GetY() + 3;
				}
			}

			if (divider == this) afterMe = True;
		}
	}
	else
	{
		Bool	 afterMe = False;

		if (container->GetObjectType() == Window::classID)
		{
			if (Binary::IsFlagSet(flags, OR_BOTTOM)) rect.top = ((Window *) container)->GetClientRect().bottom - position;
			else					 rect.top = ((Window *) container)->GetClientRect().top	   + position;

			rect.left	= wnd->GetClientRect().left;
			rect.right	= wnd->GetClientRect().right;
		}
		else
		{
			if (Binary::IsFlagSet(flags, OR_BOTTOM)) rect.top = container->GetHeight() - position;
			else					 rect.top = 			     position;

			rect.left	= 3;
			rect.right	= container->GetWidth() - 3;
		}

		rect.bottom = rect.top + 2;

		for (Int i = container->GetNOfObjects() - 1; i >= 0; i--)
		{
			if (container->GetNthObject(i)->GetObjectType() != classID) continue;

			Divider	*divider = (Divider *) container->GetNthObject(i);

			if (afterMe && Binary::IsFlagSet(divider->flags, OR_VERT))
			{
				if (Binary::IsFlagSet(divider->flags, OR_RIGHT))
				{
					if (container->GetWidth() - divider->GetX() <= rect.right + 1) rect.right = container->GetWidth() - divider->GetX() - 2;
				}
				else
				{
					if (divider->GetX() >= rect.left - 2) rect.left = divider->GetX() + 3;
				}
			}

			if (divider == this) afterMe = True;
		}
	}

	SetMetrics(rect.GetPosition(), rect.GetSize());

	if (Binary::IsFlagSet(flags, OR_VERT))	dragHotspot->SetMetrics(Point(-1, 0), rect.GetSize() + Size(2, 1));
	else					dragHotspot->SetMetrics(Point(0, -1), rect.GetSize() + Size(1, 2));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
callq 0x56a50
testq %rax, %rax
je 0x74c77
movq %rax, %r12
movl 0x30(%rbx), %edi
pushq $0x2
popq %rsi
callq 0x596b0
movl %eax, %ebp
movq 0x190(%rbx), %rdi
addq $0x20, %rdi
movq 0xecf3b(%rip), %rax     # 0x161828
movswl (%rax), %esi
callq 0x58720
movl %eax, %r14d
movl 0x30(%rbx), %edi
testb %bpl, %bpl
je 0x7495e
pushq $0x20
popq %rsi
callq 0x596b0
movl %eax, %ebp
testb %r14b, %r14b
je 0x749ba
movq 0x190(%rbx), %rdi
callq 0x57420
movl 0x5c8(%rbx), %ecx
addl %ecx, %eax
subl %ecx, %edx
testb %bpl, %bpl
cmovel %eax, %edx
movq %rdx, 0x8(%rsp)
movq %r12, %rdi
callq 0x57420
movq %rax, %r14
shrq $0x20, %r14
movq %r12, %rdi
callq 0x57420
movq %rdx, %r13
shrq $0x20, %r13
movq 0x190(%rbx), %rax
jmp 0x74a18
pushq $0x8
popq %rsi
callq 0x596b0
movl %eax, %ebp
testb %r14b, %r14b
je 0x749d4
movq 0x190(%rbx), %rdi
callq 0x57420
movq %rax, %r14
movl 0x5c8(%rbx), %eax
shrq $0x20, %rdx
subl %eax, %edx
shrq $0x20, %r14
addl %eax, %r14d
testb %bpl, %bpl
cmovnel %edx, %r14d
movq %r12, %rdi
callq 0x57420
movq %rax, 0x8(%rsp)
movq %r12, %rdi
callq 0x57420
movq %rdx, %r12
movq 0x190(%rbx), %rax
jmp 0x74b0e
testb %bpl, %bpl
je 0x749f7
movq 0x190(%rbx), %rax
movl 0xb0(%rax), %ecx
subl 0x5c8(%rbx), %ecx
jmp 0x74a04
testb %bpl, %bpl
je 0x74aed
movq 0x190(%rbx), %rax
movl 0xb4(%rax), %r14d
subl 0x5c8(%rbx), %r14d
jmp 0x74afb
movl 0x5c8(%rbx), %ecx
movq 0x190(%rbx), %rax
movq %rcx, 0x8(%rsp)
movl 0xb4(%rax), %r13d
addl $-0x3, %r13d
pushq $0x3
popq %r14
movl 0x40(%rax), %ebp
xorl %r12d, %r12d
movq 0xed0c3(%rip), %r15     # 0x161ae8
testl %ebp, %ebp
jle 0x74adf
decl %ebp
movq 0x190(%rbx), %rdi
movl %ebp, %esi
callq 0x58c90
leaq 0x20(%rax), %rdi
movswl (%r15), %esi
callq 0x5a150
testb %al, %al
jne 0x74a25
movq 0x190(%rbx), %rdi
movl %ebp, %esi
callq 0x58c90
movl %r12d, %ecx
movq %rax, %r12
movl %ecx, 0x14(%rsp)
testb $0x1, %cl
je 0x74acc
movl 0x30(%r12), %edi
pushq $0x2
popq %rsi
callq 0x596b0
testb %al, %al
jne 0x74acc
movl 0x30(%r12), %edi
pushq $0x8
popq %rsi
callq 0x596b0
testb %al, %al
je 0x74ab4
movq 0x190(%rbx), %rax
movl 0xb4(%rax), %eax
subl 0xac(%r12), %eax
leal 0x1(%r13), %ecx
leal -0x2(%rax), %edx
cmpl %ecx, %eax
cmovgl %r13d, %edx
movl %edx, %r13d
jmp 0x74acc
movl 0xac(%r12), %eax
leal -0x2(%r14), %ecx
leal 0x3(%rax), %edx
cmpl %ecx, %eax
cmovll %r14d, %edx
movl %edx, %r14d
cmpq %rbx, %r12
sete %al
movl 0x14(%rsp), %r12d
orb %al, %r12b
jmp 0x74a25
movq 0x8(%rsp), %rdx
leal 0x2(%rdx), %r12d
jmp 0x74be2
movl 0x5c8(%rbx), %r14d
movq 0x190(%rbx), %rax
movl 0xb0(%rax), %r12d
addl $-0x3, %r12d
pushq $0x3
popq %rcx
movq %rcx, 0x8(%rsp)
movl 0x40(%rax), %ebp
xorl %r13d, %r13d
movq 0xecfcd(%rip), %r15     # 0x161ae8
testl %ebp, %ebp
jle 0x74bd9
decl %ebp
movq 0x190(%rbx), %rdi
movl %ebp, %esi
callq 0x58c90
leaq 0x20(%rax), %rdi
movswl (%r15), %esi
callq 0x5a150
testb %al, %al
jne 0x74b1b
movq 0x190(%rbx), %rdi
movl %ebp, %esi
callq 0x58c90
movl %r13d, %ecx
movq %rax, %r13
movl %ecx, 0x14(%rsp)
testb $0x1, %cl
je 0x74bc6
movl 0x30(%r13), %edi
pushq $0x2
popq %rsi
callq 0x596b0
testb %al, %al
je 0x74bc6
movl 0x30(%r13), %edi
pushq $0x20
popq %rsi
callq 0x596b0
testb %al, %al
je 0x74ba8
movq 0x190(%rbx), %rax
movl 0xb0(%rax), %eax
subl 0xa8(%r13), %eax
leal 0x1(%r12), %ecx
leal -0x2(%rax), %edx
cmpl %ecx, %eax
cmovgl %r12d, %edx
movl %edx, %r12d
jmp 0x74bc6
movl 0xa8(%r13), %eax
movq 0x8(%rsp), %rsi
leal -0x2(%rsi), %ecx
leal 0x3(%rax), %edx
cmpl %ecx, %eax
cmovll %esi, %edx
movl %edx, %eax
movq %rax, 0x8(%rsp)
cmpq %rbx, %r13
sete %al
movl 0x14(%rsp), %r13d
orb %al, %r13b
jmp 0x74b1b
leal 0x2(%r14), %r13d
movq 0x8(%rsp), %rdx
movq %r14, %rax
shlq $0x20, %rax
movl %edx, %ecx
orq %rax, %rcx
leaq 0x20(%rsp), %rsi
movq %rcx, (%rsi)
subl %edx, %r12d
subl %r14d, %r13d
movq %r13, %rax
shlq $0x20, %rax
addq %r12, %rax
leaq 0x18(%rsp), %rdx
movq %rax, (%rdx)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
movl 0x30(%rbx), %edi
pushq $0x2
popq %rsi
callq 0x596b0
movq 0x5d0(%rbx), %rdi
testb %al, %al
je 0x74c46
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
addl $0x2, %r12d
incl %r13d
jmp 0x74c5f
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
leaq 0x20(%rsp), %rsi
movq %rax, (%rsi)
incl %r12d
addl $0x2, %r13d
shlq $0x20, %r13
orq %r13, %r12
leaq 0x18(%rsp), %rdx
movq %r12, (%rdx)
movq (%rdi), %rax
callq *0x150(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq