// File: /workspace/github_c_makefile_star2_O0/seanpringle[P]xoat/./menubox.c
// Function: menubox_moveresize
void menubox_moveresize(Menubox *mb, short x, short y, short w, short h)
{
	int ow = w;

	if (mb->flags & MB_AUTOHEIGHT)
		h = (mb->box_count+1) * mb->line_height + (mb->padding*2);

	if (mb->flags & MB_AUTOWIDTH)
	{
		for (uint i = 0; i < mb->box_count; i++)
			w = MAX(mb->boxes[i]->extents.width, w);
		w += (mb->padding*2);
	}

	if (mb->flags & MB_MINWIDTH)
	{
		w = MAX(ow, w);
	}

	if (x != mb->x || y != mb->y || w != mb->w || h != mb->h)
	{
		mb->x = x; mb->y = y; mb->w = MAX(1, w); mb->h = MAX(1, h);
		XMoveResizeWindow(display, mb->window, mb->x, mb->y, mb->w, mb->h);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %r8w, %ax
movq %rdi, -0x8(%rbp)
movw %si, -0xa(%rbp)
movw %dx, -0xc(%rbp)
movw %cx, -0xe(%rbp)
movw %ax, -0x10(%rbp)
movswl -0xe(%rbp), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x527d
movq -0x8(%rbp), %rax
movl 0x50(%rax), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
movswl 0x20(%rcx), %ecx
imull %ecx, %eax
movq -0x8(%rbp), %rcx
movswl 0x22(%rcx), %ecx
shll %ecx
addl %ecx, %eax
movw %ax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0x5301
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x50(%rcx), %eax
jae 0x52ed
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl -0x18(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl 0x70(%rax), %eax
movswl -0xe(%rbp), %ecx
cmpl %ecx, %eax
jle 0x52d4
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl -0x18(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movzwl 0x70(%rax), %eax
movl %eax, -0x1c(%rbp)
jmp 0x52db
movswl -0xe(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movw %ax, -0xe(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x5295
movq -0x8(%rbp), %rax
movswl 0x22(%rax), %ecx
shll %ecx
movswl -0xe(%rbp), %eax
addl %ecx, %eax
movw %ax, -0xe(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
andq $0x8, %rax
cmpq $0x0, %rax
je 0x5333
movl -0x14(%rbp), %eax
movswl -0xe(%rbp), %ecx
cmpl %ecx, %eax
jle 0x5325
movl -0x14(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x532c
movswl -0xe(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movw %ax, -0xe(%rbp)
movswl -0xa(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0x18(%rcx), %ecx
cmpl %ecx, %eax
jne 0x5377
movswl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0x1a(%rcx), %ecx
cmpl %ecx, %eax
jne 0x5377
movswl -0xe(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0x1c(%rcx), %ecx
cmpl %ecx, %eax
jne 0x5377
movswl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movswl 0x1e(%rcx), %ecx
cmpl %ecx, %eax
je 0x541d
movw -0xa(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
movw -0xc(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1a(%rax)
movswl -0xe(%rbp), %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jle 0x53a6
movl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x53ad
movswl -0xe(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1c(%rax)
movswl -0x10(%rbp), %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jle 0x53d2
movl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x53d9
movswl -0x10(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x1e(%rax)
movq 0xe7b2(%rip), %rdi      # 0x13ba0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movswl 0x18(%rax), %edx
movq -0x8(%rbp), %rax
movswl 0x1a(%rax), %ecx
movq -0x8(%rbp), %rax
movswl 0x1c(%rax), %r8d
movq -0x8(%rbp), %rax
movswl 0x1e(%rax), %r9d
callq 0x3300
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)