// File: /workspace/github_c_makefile_star2_O3/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 0xe2e5b(%rip), %rax     # 0x16bb50
addq $0x10, %rax
movq %rax, (%rbx)
movq 0xe27f5(%rip), %rax     # 0x16b4f8
movzwl (%rax), %eax
movw %ax, 0x20(%rbx)
leaq 0xf0(%rbx), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x88d5b
leaq 0x5c0(%rbx), %rdi
xorl %esi, %esi
callq 0x57e30
testb %al, %al
je 0x88d5b
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 0x88e11
movq %r14, %rdi
xorl %esi, %esi
callq 0x56bd0
testb %al, %al
je 0x88da7
leaq 0x5c0(%rbx), %rdi
xorl %esi, %esi
callq 0x57e30
testb %al, %al
je 0x88da7
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 0x88e11
movq %r14, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x88e11
leaq 0x5c0(%rbx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x88e11
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 0x88e3f
leaq 0x5c0(%rbx), %rdi
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x88fa6
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 0xe3154(%rip), %rsi     # 0x16bfd0
movq %r15, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8a30a
movl $0x2f8, %edi            # imm = 0x2F8
addq 0x5f8(%rbx), %rdi
movq 0xe258c(%rip), %rsi     # 0x16b428
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8a3ca
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 0x88ef6
leaq 0x5c0(%rbx), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
callq 0x563f0
testb %al, %al
je 0x88ef6
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 0x71712
movq %r14, %rdi
xorl %esi, %esi
callq 0x55260
testb %al, %al
je 0x88f86
leaq 0x5c0(%rbx), %rdi
xorl %esi, %esi
callq 0x563f0
cmpq $0x0, 0x5b8(%rbx)
setne %cl
andb %cl, %al
cmpb $0x1, %al
jne 0x88f86
movl $0x2f8, %edi            # imm = 0x2F8
addq 0x600(%rbx), %rdi
movq 0xe2f04(%rip), %rsi     # 0x16be80
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8a3ca
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 0xe2e09(%rip), %rsi     # 0x16bdc8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x8a48a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x88ff1
jmp 0x88ff1
jmp 0x88ff1
jmp 0x88ff1
jmp 0x88fdf
movq %rax, %r14
movl $0x5b8, %esi            # imm = 0x5B8
movq %r15, %rdi
callq 0x55480
jmp 0x88ff4
movq %rax, %r14
movq %rbx, %rdi
callq 0x560a0
movq %r14, %rdi
callq 0x57090