// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/classes/gui/widgets/basic/tabwidget.cpp
// Function: smooth::GUI::TabWidget::Add(smooth::GUI::Widget*, smooth::GUI::Bitmap const&)
S::Int S::GUI::TabWidget::Add(Widget *widget, const Bitmap &bitmap)
{
	if (widget == NIL) return Error();

	if (!widget->IsRegistered())
	{
		widget->Hide();

		if (Widget::Add(widget) == Success())
		{
			bitmaps.Add(bitmap, widget->GetHandle());

			widget->SetMetrics(Point(2, 21), GetSize() - Size(3, 22));

			if (GetNOfObjects() == 1) SelectTab(widget);

			return Success();
		}
	}

	return Error();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xa5d53
leaq -0x30(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0xa0(%rbp), %rdi
callq 0x59680
movl %eax, -0x94(%rbp)
jmp 0xa5d22
movl -0x94(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5b5b0
jmp 0xa5f64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5b5b0
jmp 0xa5f70
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
callq *0x88(%rax)
testb $0x1, %al
jne 0xa5f07
movq -0x18(%rbp), %rdi
movq (%rdi), %rax
movq 0x60(%rax), %rax
callq *%rax
movq -0x90(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5c510
movl %eax, -0xb4(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x5ca80
movq -0xb0(%rbp), %rdi
callq 0x59680
movl %eax, -0xa4(%rbp)
jmp 0xa5daf
leaq -0x50(%rbp), %rdi
callq 0x5a410
movl -0xa4(%rbp), %ecx
movl -0xb4(%rbp), %eax
cmpl %ecx, %eax
jne 0xa5f05
movq -0x90(%rbp), %rax
addq $0x5c0, %rax            # imm = 0x5C0
movq %rax, -0xd8(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5d050
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movl %eax, %edx
callq 0xa6590
movq -0x18(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x58(%rbp), %rdi
movl $0x2, %esi
movl $0x15, %edx
callq 0x5c2c0
movq -0x90(%rbp), %rdi
callq 0x5bf70
movq %rax, -0xc8(%rbp)
leaq -0x68(%rbp), %rdi
movl $0x3, %esi
movl $0x16, %edx
callq 0x59260
movq -0xc8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x5db90
movq -0xc0(%rbp), %rdi
movq %rax, -0x60(%rbp)
movq (%rdi), %rax
leaq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq *0x150(%rax)
movq -0x90(%rbp), %rdi
callq 0x5b470
cmpl $0x1, %eax
jne 0xa5eb6
movq -0x90(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5a890
jmp 0xa5eb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5a410
jmp 0xa5f70
leaq -0x78(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x5ca80
movq -0xe8(%rbp), %rdi
callq 0x59680
movl %eax, -0xdc(%rbp)
jmp 0xa5eda
movl -0xdc(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5a410
jmp 0xa5f64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5a410
jmp 0xa5f70
jmp 0xa5f07
leaq -0x88(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x5a9c0
movq -0xf8(%rbp), %rdi
callq 0x59680
movl %eax, -0xec(%rbp)
jmp 0xa5f33
movl -0xec(%rbp), %eax
movl %eax, -0x4(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5b5b0
jmp 0xa5f64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x5b5b0
jmp 0xa5f70
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x5b6b0
nopl (%rax)