// File: /workspace/github_c_makefile_star2_O1/enzo1982[P]smooth/classes/gui/widgets/multi/menu/menubarentry.cpp
// Function: smooth::GUI::MenubarEntry::MenubarEntry(smooth::String const&, smooth::GUI::Bitmap const&, smooth::GUI::PopupMenu*, bool*, int*, int)
S::GUI::MenubarEntry::MenubarEntry(const String &iText, const Bitmap &iBitmap, PopupMenu *iPopup, Bool *ibVar, Int *iiVar, Int iiCode) : MenuEntry(iText, iBitmap, iPopup, ibVar, iiVar, iiCode)
{
	type		= classID;

	if	(text == NIL && bitmap == NIL) SetSize(Size(4, 15));
	else if (text != NIL && bitmap == NIL) SetSize(Size(unscaledTextSize.cx + 7, 16));
	else if (text == NIL && bitmap != NIL) SetSize(bitmap.GetSize() + Size(4 + (popup != NIL ? 12 : 0), 4));

	hotspot		= NIL;
	actionHotspot	= NIL;

	if (text != NIL || bitmap != NIL)
	{
		hotspot	= new HotspotSimpleButton(Point(), GetSize());
		hotspot->onMouseOver.Connect(&MenubarEntry::OnMouseOver, this);
		hotspot->onLeftButtonDown.Connect(&MenubarEntry::OpenPopupMenu, this);

		actionHotspot = new Hotspot(Point(), GetSize() - Size((text == NIL && bitmap != NIL && popup != NIL ? 12 : 0), 0));
		actionHotspot->onLeftButtonClick.Connect(&onAction);

		if (text == NIL && bitmap != NIL && popup != NIL) actionHotspot->onLeftButtonDown.Connect(&MenubarEntry::ClosePopupMenu, this);

		Add(hotspot);
		Add(actionHotspot);
	}

	popupMenuClosed	= 0;

	onChangeSize.Connect(&MenubarEntry::OnChangeSize, this);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x40(%rsp), %eax
movl %eax, (%rsp)
callq 0x568d0
movq 0xe393b(%rip), %rax     # 0x16cb50
addq $0x10, %rax
movq %rax, (%rbx)
movq 0xe32d5(%rip), %rax     # 0x16c4f8
movzwl (%rax), %eax
movw %ax, 0x20(%rbx)
leaq 0xf0(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x8927b
leaq 0x5c0(%rbx), %rdi
xorl %esi, %esi
callq 0x57e30
testb %al, %al
je 0x8927b
movabsq $0xf00000004, %rax      # imm = 0xF00000004
leaq 0x8(%rsp), %rdx
movq %rax, (%rdx)
leaq 0xa8(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
jmp 0x89331
movq %r14, %rdi
xorl %esi, %esi
callq 0x56bd0
testb %al, %al
je 0x892c7
leaq 0x5c0(%rbx), %rdi
xorl %esi, %esi
callq 0x57e30
testb %al, %al
je 0x892c7
movl 0x180(%rbx), %eax
addl $0x7, %eax
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movl $0x10, 0x4(%rdx)
leaq 0xa8(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
jmp 0x89331
movq %r14, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x89331
leaq 0x5c0(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x89331
movq %r15, %rdi
callq 0x58410
cmpq $0x0, 0x5b8(%rbx)
movl $0x4, %ecx
movl $0x10, %esi
cmovel %ecx, %esi
addl (%rax), %esi
movl 0x4(%rax), %eax
addl $0x4, %eax
shlq $0x20, %rax
orq %rax, %rsi
leaq 0x8(%rsp), %rdx
movq %rsi, (%rdx)
leaq 0xa8(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x150(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x5f8(%rbx)
movq %r14, %rdi
xorl %esi, %esi
callq 0x56bd0
testb %al, %al
jne 0x8935f
leaq 0x5c0(%rbx), %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x894c6
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x556b0
movq %rax, %r15
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
leaq 0xb0(%rbx), %rdx
movq %rax, %rdi
callq 0x55a60
movq %r15, 0x5f8(%rbx)
addq $0x2b8, %r15            # imm = 0x2B8
movq 0xe3c34(%rip), %rsi     # 0x16cfd0
movq %r15, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8a890
movl $0x2f8, %edi            # imm = 0x2F8
addq 0x5f8(%rbx), %rdi
movq 0xe306c(%rip), %rsi     # 0x16c428
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8a94e
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x556b0
movq %rax, %r15
movq $0x0, 0x8(%rsp)
xorl %r12d, %r12d
movq %r14, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x89416
leaq 0x5c0(%rbx), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x89416
xorl %eax, %eax
cmpq $0x0, 0x5b8(%rbx)
movl $0xfffffff4, %r12d      # imm = 0xFFFFFFF4
cmovel %eax, %r12d
addl 0xb0(%rbx), %r12d
movl 0xb4(%rbx), %eax
shlq $0x20, %rax
orq %rax, %r12
leaq 0x10(%rsp), %rdx
movq %r12, (%rdx)
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x55a30
movq %r15, 0x600(%rbx)
addq $0x338, %r15            # imm = 0x338
leaq 0x478(%rbx), %rsi
movq %r15, %rdi
callq 0x71a12
movq %r14, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x894a6
leaq 0x5c0(%rbx), %rdi
xorl %esi, %esi
callq 0x563f0
cmpq $0x0, 0x5b8(%rbx)
setne %cl
andb %cl, %al
cmpb $0x1, %al
jne 0x894a6
movl $0x2f8, %edi            # imm = 0x2F8
addq 0x600(%rbx), %rdi
movq 0xe39e4(%rip), %rsi     # 0x16ce80
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8a94e
movq 0x5f8(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq 0x600(%rbx), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x30(%rax)
movq $0x0, 0x5f0(%rbx)
leaq 0x298(%rbx), %rdi
movq 0xe38e9(%rip), %rsi     # 0x16cdc8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8aa0c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x89511
jmp 0x89511
jmp 0x89511
jmp 0x89511
jmp 0x894ff
movq %rax, %r14
movl $0x5b8, %esi            # imm = 0x5B8
movq %r15, %rdi
callq 0x55480
jmp 0x89514
movq %rax, %r14
movq %rbx, %rdi
callq 0x560a0
movq %r14, %rdi
callq 0x57090