// File: /workspace/github_c_makefile_star2_O0/enzo1982[P]smooth/tools/designer/edit_component.cpp
// Function: Designer_EditComponent::AddObject(short)
Widget *Designer_EditComponent::AddObject(Short objid)
{
	Widget	*newobj;
	Widget	*registrar;
	Point	 pos;
	Size	 size;

	switch (objid)
	{
		case SMOOTH_BUTTON:
			registrar = wnd;

			pos.x	  = 100;
			pos.y	  = 100;
			size.cx	  = 0;
			size.cy	  = 0;

			newobj	  = new Button("Button", pos, size);

			break;
		case SMOOTH_LAYER:
			registrar = wnd;
			newobj	  = new Layer("Layer");

			break;
		case SMOOTH_MENUBAR:
			registrar = wnd;
			newobj	  = new Menubar();

			break;
		default:
			QuickMessage("Unknown object ID!", "Error", Message::Buttons::Ok, Message::Icon::Error);

			return NIL;
	}

	registrar->Add(newobj);

	objects.Add(newobj);

	return newobj;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xa6f0
leaq -0x38(%rbp), %rdi
callq 0xa710
movswl -0x12(%rbp), %eax
movl %eax, -0xb4(%rbp)
subl $0x1, %eax
je 0xa0e9
jmp 0xa0c4
movl -0xb4(%rbp), %eax
subl $0x2, %eax
je 0xa25f
jmp 0xa0d5
movl -0xb4(%rbp), %eax
subl $0x3, %eax
je 0xa1b6
jmp 0xa2c1
movq -0xc0(%rbp), %rax
movq 0x5b8(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x64, -0x30(%rbp)
movl $0x64, -0x2c(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x5c8, %edi            # imm = 0x5C8
callq 0x5260
movq %rax, -0xc8(%rbp)
movb $0x1, -0x5d(%rbp)
leaq 0x1f6b(%rip), %rsi      # 0xc09e
leaq -0x50(%rbp), %rdi
callq 0x5350
jmp 0xa13e
movq -0xc8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x30(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x5190
jmp 0xa158
movq -0xc8(%rbp), %rax
movb $0x0, -0x5d(%rbp)
movq %rax, -0x20(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5210
jmp 0xa35b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xa198
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x5210
testb $0x1, -0x5d(%rbp)
jne 0xa1a0
jmp 0xa1b1
movq -0xc8(%rbp), %rdi
movl $0x5c8, %esi            # imm = 0x5C8
callq 0x5050
jmp 0xa395
movq -0xc0(%rbp), %rax
movq 0x5b8(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x5b8, %edi            # imm = 0x5B8
callq 0x5260
movq %rax, -0xd0(%rbp)
movb $0x1, -0x79(%rbp)
leaq 0x1ec1(%rip), %rsi      # 0xc0a5
leaq -0x78(%rbp), %rdi
callq 0x5350
jmp 0xa1ef
movq -0xd0(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x5100
jmp 0xa201
movq -0xd0(%rbp), %rax
movb $0x0, -0x79(%rbp)
movq %rax, -0x20(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5210
jmp 0xa35b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xa241
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x5210
testb $0x1, -0x79(%rbp)
jne 0xa249
jmp 0xa25a
movq -0xd0(%rbp), %rdi
movl $0x5b8, %esi            # imm = 0x5B8
callq 0x5050
jmp 0xa395
movq -0xc0(%rbp), %rax
movq 0x5b8(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x688, %edi            # imm = 0x688
callq 0x5260
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xd8(%rbp)
callq 0x5140
jmp 0xa28f
movq -0xd8(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xa35b
movq -0xd8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
movl $0x688, %esi            # imm = 0x688
callq 0x5050
jmp 0xa395
leaq 0x1f85(%rip), %rsi      # 0xc24d
leaq -0x98(%rbp), %rdi
callq 0x5350
leaq 0x1f85(%rip), %rsi      # 0xc260
leaq -0xb0(%rbp), %rdi
callq 0x5350
jmp 0xa2e9
leaq -0x98(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
xorl %edx, %edx
movl $0x7f01, %ecx           # imm = 0x7F01
callq 0x51c0
jmp 0xa305
leaq -0xb0(%rbp), %rdi
callq 0x5210
leaq -0x98(%rbp), %rdi
callq 0x5210
movq $0x0, -0x8(%rbp)
jmp 0xa388
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0xa34d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x5210
leaq -0x98(%rbp), %rdi
callq 0x5210
jmp 0xa395
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq (%rdi), %rax
callq *0x30(%rax)
movq -0xc0(%rbp), %rdi
addq $0x5c8, %rdi            # imm = 0x5C8
leaq -0x20(%rbp), %rsi
callq 0xa500
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x5150
nop