// File: /workspace/github_c_makefile_star2_O0/seanpringle[P]xoat/./menubox.c
// Function: menubox_create
Menubox* menubox_create(Window parent, unsigned long flags, short x, short y, short w, short h, short padding, char *font, char *fg_focus, char *bg_focus, char *fg_blur, char *bg_blur)
{
	Menubox *mb = calloc(1, sizeof(Menubox));
	mb->boxes = (Textbox**) calloc(1, sizeof(Textbox));
	mb->ids = (int*) calloc(1, sizeof(int));
	mb->show = (int*) calloc(1, sizeof(int));

	mb->flags = flags;
	mb->parent = parent;
	mb->font = font;
	mb->fg_focus = fg_focus;
	mb->fg_blur = fg_blur;
	mb->bg_focus = bg_focus;
	mb->bg_blur = bg_blur;
	mb->padding = padding;
	mb->box_active = 0;

	mb->x = x; mb->y = y; mb->w = MAX(1, w); mb->h = MAX(1, h);

	XColor color; Colormap map = DefaultColormap(display, DefaultScreen(display));
	unsigned int cp = XAllocNamedColor(display, map, bg_blur, &color, &color) ? color.pixel: None;

	mb->window = XCreateSimpleWindow(display, mb->parent, mb->x, mb->y, mb->w, mb->h, 0, None, cp);

	// calc line height
	mb->input = textbox_create(mb->window, TB_AUTOHEIGHT|TB_EDITABLE, mb->padding, mb->padding, mb->w, 0, mb->font, mb->fg_blur, mb->bg_blur, "", "> ");
	mb->line_height = mb->input->h;

	// auto height/width modes get handled here
	menubox_moveresize(mb, mb->x, mb->y, mb->w, mb->h);

	return mb;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movl %r8d, -0x64(%rbp)
movl %ecx, %eax
movl -0x64(%rbp), %ecx
movl %eax, -0x60(%rbp)
movl %edx, %eax
movl -0x60(%rbp), %edx
movl %eax, -0x5c(%rbp)
movq %rsi, %rax
movl -0x5c(%rbp), %esi
movq %rax, -0x58(%rbp)
movq %rdi, %r8
movq -0x58(%rbp), %rdi
movw %r9w, %ax
movq 0x38(%rbp), %r9
movq 0x30(%rbp), %r9
movq 0x28(%rbp), %r9
movq 0x20(%rbp), %r9
movq 0x18(%rbp), %r9
movw 0x10(%rbp), %r9w
movq %r8, -0x18(%rbp)
movq %rdi, -0x20(%rbp)
movw %si, -0x22(%rbp)
movw %dx, -0x24(%rbp)
movw %cx, -0x26(%rbp)
movw %ax, -0x28(%rbp)
movl $0x1, %edi
movl $0x78, %esi
callq 0x3500
movq %rax, -0x30(%rbp)
movl $0x1, %edi
movl $0x80, %esi
callq 0x3500
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x58(%rax)
movl $0x1, %edi
movl $0x4, %esi
callq 0x3500
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x60(%rax)
movl $0x1, %edi
movl $0x4, %esi
callq 0x3500
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
movq 0x18(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x28(%rax)
movq 0x20(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x30(%rax)
movq 0x30(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x40(%rax)
movq 0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq 0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x48(%rax)
movw 0x10(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x22(%rax)
movq -0x30(%rbp), %rax
movl $0x0, 0x54(%rax)
movw -0x22(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x18(%rax)
movw -0x24(%rbp), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x1a(%rax)
movswl -0x26(%rbp), %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jle 0x5042
movl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x5049
movswl -0x26(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movw %ax, %cx
movq -0x30(%rbp), %rax
movw %cx, 0x1c(%rax)
movswl -0x28(%rbp), %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jle 0x506e
movl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x5075
movswl -0x28(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movw %ax, %cx
movq -0x30(%rbp), %rax
movw %cx, 0x1e(%rax)
movq 0xeb16(%rip), %rax      # 0x13ba0
movq 0xe8(%rax), %rax
movq 0xeb08(%rip), %rcx      # 0x13ba0
movslq 0xe0(%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x50(%rax), %rax
movq %rax, -0x48(%rbp)
movq 0xeaeb(%rip), %rdi      # 0x13ba0
movq -0x48(%rbp), %rsi
movq 0x38(%rbp), %rdx
leaq -0x40(%rbp), %r8
movq %r8, %rcx
callq 0x31a0
cmpl $0x0, %eax
je 0x50d8
movq -0x40(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x50e0
xorl %eax, %eax
movq %rax, -0x78(%rbp)
jmp 0x50e0
movq -0x78(%rbp), %rax
movl %eax, -0x4c(%rbp)
movq 0xeab2(%rip), %rdi      # 0x13ba0
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x30(%rbp), %rax
movswl 0x18(%rax), %edx
movq -0x30(%rbp), %rax
movswl 0x1a(%rax), %ecx
movq -0x30(%rbp), %rax
movswl 0x1c(%rax), %r8d
movq -0x30(%rbp), %rax
movswl 0x1e(%rax), %r9d
movl -0x4c(%rbp), %eax
xorl %r10d, %r10d
xorl %r10d, %r10d
movl $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x31e0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x30(%rbp), %rax
movw 0x22(%rax), %dx
movq -0x30(%rbp), %rax
movw 0x22(%rax), %cx
movq -0x30(%rbp), %rax
movw 0x1c(%rax), %r8w
movq -0x30(%rbp), %rax
movq 0x28(%rax), %r14
movq -0x30(%rbp), %rax
movq 0x40(%rax), %rbx
movq -0x30(%rbp), %rax
movq 0x48(%rax), %r11
movl $0x80001, %esi          # imm = 0x80001
xorl %r9d, %r9d
leaq 0xa478(%rip), %r10      # 0xf606
leaq 0xa112(%rip), %rax      # 0xf2a7
movswl %dx, %edx
movswl %cx, %ecx
movswl %r8w, %r8d
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x3c30
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x30(%rbp), %rax
movq 0x70(%rax), %rax
movw 0x1e(%rax), %cx
movq -0x30(%rbp), %rax
movw %cx, 0x20(%rax)
movq -0x30(%rbp), %rdi
movq -0x30(%rbp), %rax
movw 0x18(%rax), %si
movq -0x30(%rbp), %rax
movw 0x1a(%rax), %dx
movq -0x30(%rbp), %rax
movw 0x1c(%rax), %cx
movq -0x30(%rbp), %rax
movswl %si, %esi
movswl %dx, %edx
movswl %cx, %ecx
movswl 0x1e(%rax), %r8d
callq 0x5220
movq -0x30(%rbp), %rax
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop