// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/basic/titlebar.cpp
// Function: smooth::GUI::Titlebar::DragHitTest(smooth::GUI::Point const&)
S::Bool S::GUI::Titlebar::DragHitTest(const Point &mousePos)
{
	Surface	*surface    = GetDrawSurface();
	Window	*window	    = container->GetContainerWindow();

#ifdef __WIN32__
	static Bool	 flatStyle = Backends::BackendWin32::IsWindowsVersionAtLeast(VER_PLATFORM_WIN32_NT, 6, 2);
#else
	static Bool	 flatStyle = False;
#endif

	Rect	 titleFrame = Rect(Point(0,0), GetRealSize());
	Rect	 buttonRect = Rect(Point(titleFrame.right - Math::Round(4 * surface->GetSurfaceDPI() / 96.0) - Math::Round((5 + 10 * (Binary::IsFlagSet(flags, TB_MINBUTTON) || Binary::IsFlagSet(flags, TB_MAXBUTTON) ? 3 : 1)) * surface->GetSurfaceDPI() / 96.0) + (flatStyle ? 2 : 0), titleFrame.top + (flatStyle ? 4 : 3)),
				   Size(Math::Round((5 + 10 * (Binary::IsFlagSet(flags, TB_MINBUTTON) || Binary::IsFlagSet(flags, TB_MAXBUTTON) ? 3 : 1)) * surface->GetSurfaceDPI() / 96.0) - (flatStyle ? 5 : 1), titleFrame.GetHeight() - (flatStyle ? 9 : 6)));

	if (!flatStyle && window->GetIcon() != NIL) titleFrame.left += titleFrame.GetHeight() - 1;

	if (flatStyle && (Binary::IsFlagSet(flags, TB_MINBUTTON) || Binary::IsFlagSet(flags, TB_MAXBUTTON))) buttonRect.left -= 2;

	return ((mousePos.x >= titleFrame.left && mousePos.y >= titleFrame.top && mousePos.x <= titleFrame.right && mousePos.y <= titleFrame.bottom) &&
	       !(mousePos.x >= buttonRect.left && mousePos.y >= buttonRect.top && mousePos.x <= buttonRect.right && mousePos.y <= buttonRect.bottom));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x78(%rbp)
movq (%rdi), %rax
callq *0x40(%rax)
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, -0x18(%rbp)
movq 0x190(%rax), %rdi
callq 0x59bc0
movq %rax, -0x20(%rbp)
leaq -0x38(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x5c2c0
movq -0x78(%rbp), %rdi
movq (%rdi), %rax
callq *0x50(%rax)
movq %rax, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x59ff0
movslq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5d470
cwtl
shll $0x2, %eax
cvtsi2sd %eax, %xmm0
movsd 0xde757(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movq -0x80(%rbp), %rcx
movq %rax, %rdx
movq -0x78(%rbp), %rax
subq %rdx, %rcx
movq %rcx, -0x70(%rbp)
movl 0x30(%rax), %edi
movl $0x1, %esi
callq 0x5ce30
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x61(%rbp)
jne 0xa8db1
movq -0x78(%rbp), %rax
movl 0x30(%rax), %edi
movl $0x2, %esi
callq 0x5ce30
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %dl
movl $0x1, %eax
movl $0x3, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
imull $0xa, %eax, %eax
addl $0x5, %eax
movl %eax, -0x88(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5d470
movw %ax, %cx
movl -0x88(%rbp), %eax
movswl %cx, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xde6cc(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movq %rax, %rcx
movq -0x70(%rbp), %rax
subq %rcx, %rax
movb 0x1635fe(%rip), %sil    # 0x20c40c
xorl %ecx, %ecx
movl $0x2, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movl %eax, %esi
movl -0x2c(%rbp), %edx
movb 0x1635de(%rip), %dil    # 0x20c40c
movl $0x3, %eax
movl $0x4, %ecx
testb $0x1, %dil
cmovnel %ecx, %eax
addl %eax, %edx
leaq -0x58(%rbp), %rdi
callq 0x5c2c0
movq -0x78(%rbp), %rax
movl 0x30(%rax), %edi
movl $0x1, %esi
callq 0x5ce30
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x81(%rbp)
jne 0xa8e81
movq -0x78(%rbp), %rax
movl 0x30(%rax), %edi
movl $0x2, %esi
callq 0x5ce30
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %dl
movl $0x1, %eax
movl $0x3, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
imull $0xa, %eax, %eax
addl $0x5, %eax
movl %eax, -0x90(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5d470
movw %ax, %cx
movl -0x90(%rbp), %eax
movswl %cx, %ecx
imull %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd 0xde5f9(%rip), %xmm1    # 0x1874c0
divsd %xmm1, %xmm0
callq 0x5a970
movb 0x163535(%rip), %sil    # 0x20c40c
movl $0x1, %ecx
movl $0x5, %edx
testb $0x1, %sil
cmovnel %edx, %ecx
movslq %ecx, %rcx
subq %rcx, %rax
movl %eax, -0x8c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x591a0
movl -0x8c(%rbp), %esi
movl %eax, %edx
movb 0x163500(%rip), %dil    # 0x20c40c
movl $0x6, %eax
movl $0x9, %ecx
testb $0x1, %dil
cmovnel %ecx, %eax
subl %eax, %edx
leaq -0x60(%rbp), %rdi
callq 0x59260
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x59ff0
testb $0x1, 0x1634cc(%rip)    # 0x20c40c
jne 0xa8f6d
movq -0x20(%rbp), %rdi
callq 0x5a310
movq %rax, %rdi
xorl %esi, %esi
callq 0x5a830
testb $0x1, %al
jne 0xa8f5b
jmp 0xa8f6d
leaq -0x30(%rbp), %rdi
callq 0x591a0
subl $0x1, %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
testb $0x1, 0x163498(%rip)    # 0x20c40c
je 0xa8fab
movq -0x78(%rbp), %rax
movl 0x30(%rax), %edi
movl $0x1, %esi
callq 0x5ce30
testb $0x1, %al
jne 0xa8fa2
movq -0x78(%rbp), %rax
movl 0x30(%rax), %edi
movl $0x2, %esi
callq 0x5ce30
testb $0x1, %al
jne 0xa8fa2
jmp 0xa8fab
movl -0x50(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %ecx
xorl %eax, %eax
cmpl -0x30(%rbp), %ecx
movb %al, -0x91(%rbp)
jl 0xa905c
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
xorl %eax, %eax
cmpl -0x2c(%rbp), %ecx
movb %al, -0x91(%rbp)
jl 0xa905c
movq -0x10(%rbp), %rax
movl (%rax), %ecx
xorl %eax, %eax
cmpl -0x28(%rbp), %ecx
movb %al, -0x91(%rbp)
jg 0xa905c
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
xorl %eax, %eax
cmpl -0x24(%rbp), %ecx
movb %al, -0x91(%rbp)
jg 0xa905c
movq -0x10(%rbp), %rax
movl (%rax), %ecx
xorl %eax, %eax
cmpl -0x50(%rbp), %ecx
movb %al, -0x92(%rbp)
jl 0xa904e
movq -0x10(%rbp), %rax
movl 0x4(%rax), %ecx
xorl %eax, %eax
cmpl -0x4c(%rbp), %ecx
movb %al, -0x92(%rbp)
jl 0xa904e
movq -0x10(%rbp), %rax
movl (%rax), %ecx
xorl %eax, %eax
cmpl -0x48(%rbp), %ecx
movb %al, -0x92(%rbp)
jg 0xa904e
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
cmpl -0x44(%rbp), %eax
setle %al
movb %al, -0x92(%rbp)
movb -0x92(%rbp), %al
xorb $-0x1, %al
movb %al, -0x91(%rbp)
movb -0x91(%rbp), %al
andb $0x1, %al
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)