// File: /workspace/github_c_makefile_star2_O0/zenlinux[P]cwm/menu.c
// Function: menu_draw
static void
menu_draw(struct screen_ctx *sc, struct menu_ctx *mc, struct menu_q *menuq,
    struct menu_q *resultq)
{
	struct menu		*mi;
	XineramaScreenInfo	*xine;
	int			 xmin, xmax, ymin, ymax;
	int			 n, xsave, ysave;

	if (mc->list) {
		if (TAILQ_EMPTY(resultq) && mc->list) {
			/* Copy them all over. */
			TAILQ_FOREACH(mi, menuq, entry)
				TAILQ_INSERT_TAIL(resultq, mi,
				    resultentry);

			mc->listing = 1;
		} else if (mc->changed)
			mc->listing = 0;
	}

	mc->num = 0;
	mc->width = 0;
	mc->height = 0;
	if (mc->hasprompt) {
		(void)snprintf(mc->dispstr, sizeof(mc->dispstr), "%s%s%s",
		    mc->promptstr, mc->searchstr, PROMPT_ECHAR);
		mc->width = font_width(sc, mc->dispstr, strlen(mc->dispstr));
		mc->height = font_height(sc);
		mc->num = 1;
	}

	TAILQ_FOREACH(mi, resultq, resultentry) {
		char *text;

		if (mc->print != NULL) {
			(*mc->print)(mi, mc->listing);
			text = mi->print;
		} else {
			mi->print[0] = '\0';
			text = mi->text;
		}

		mc->width = MAX(mc->width, font_width(sc, text,
		    MIN(strlen(text), MENU_MAXENTRY)));
		mc->height += font_height(sc);
		mc->num++;
	}

	xine = screen_find_xinerama(sc, mc->x, mc->y);
	if (xine) {
		xmin = xine->x_org;
		xmax = xine->x_org + xine->width;
		ymin = xine->y_org;
		ymax = xine->y_org + xine->height;
	} else {
		xmin = ymin = 0;
		xmax = sc->view.w;
		ymax = sc->view.h;
	}

	xsave = mc->x;
	ysave = mc->y;

	/* Never hide the top, or left side, of the menu. */
	if (mc->x + mc->width >= xmax)
		mc->x = xmax - mc->width;
	if (mc->x < xmin) {
		mc->x = xmin;
		mc->width = xmax - xmin;
	}
	if (mc->y + mc->height >= ymax)
		mc->y = ymax - mc->height;
	if (mc->y < ymin) {
		mc->y = ymin;
		mc->height = ymax - ymin;
	}

	if (mc->x != xsave || mc->y != ysave)
		xu_ptr_setpos(sc->rootwin, mc->x, mc->y);

	XClearWindow(X_Dpy, sc->menuwin);
	XMoveResizeWindow(X_Dpy, sc->menuwin, mc->x, mc->y,
	    mc->width, mc->height);

	if (mc->hasprompt) {
		font_draw(sc, mc->dispstr, strlen(mc->dispstr), sc->menuwin,
		    0, font_ascent(sc) + 1);
		n = 1;
	} else
		n = 0;

	TAILQ_FOREACH(mi, resultq, resultentry) {
		char *text = mi->print[0] != '\0' ?
		    mi->print : mi->text;
		int y = n * font_height(sc) + font_ascent(sc) + 1;

		/* Stop drawing when menu doesn't fit inside the screen. */
		if (mc->y + y > ymax)
			break;

		font_draw(sc, text, MIN(strlen(text), MENU_MAXENTRY),
		    sc->menuwin, 0, y);
		n++;
	}

	if (mc->hasprompt && n > 1 && (mc->searchstr[0] != '\0'))
		XFillRectangle(X_Dpy, sc->menuwin, sc->gc,
		    0, font_height(sc), mc->width, font_height(sc));

	if (mc->noresult)
		XFillRectangle(X_Dpy, sc->menuwin, sc->gc,
		    0, 0, mc->width, font_height(sc));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0xd0(%rax)
je 0x9460
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x9441
movq -0x10(%rbp), %rax
cmpl $0x0, 0xd0(%rax)
je 0x9441
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x9431
jmp 0x93e7
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
addq $0x10, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x9424
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x93de
movq -0x10(%rbp), %rax
movl $0x1, 0xd4(%rax)
jmp 0x945e
movq -0x10(%rbp), %rax
cmpl $0x0, 0xd8(%rax)
je 0x945c
movq -0x10(%rbp), %rax
movl $0x0, 0xd4(%rax)
jmp 0x945e
jmp 0x9460
movq -0x10(%rbp), %rax
movl $0x0, 0xf0(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xec(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0xe8(%rax)
movq -0x10(%rbp), %rax
cmpl $0x0, 0xcc(%rax)
je 0x952b
movq -0x10(%rbp), %rdi
addq $0x33, %rdi
movq -0x10(%rbp), %rcx
addq $0x98, %rcx
movq -0x10(%rbp), %r8
movl $0x65, %esi
leaq 0xadd5(%rip), %rdx      # 0x14293
leaq 0xadd5(%rip), %r9       # 0x1429a
movb $0x0, %al
callq 0x50b0
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
addq $0x33, %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rdi
addq $0x33, %rdi
callq 0x5320
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rsi
movl %eax, %edx
callq 0x10af0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xec(%rax)
movq -0x8(%rbp), %rdi
callq 0x109b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xe8(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0xf0(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x96cb
movq -0x10(%rbp), %rax
cmpq $0x0, 0x108(%rax)
je 0x9578
movq -0x10(%rbp), %rax
movq 0x108(%rax), %rax
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl 0xd4(%rcx), %esi
callq *%rax
movq -0x28(%rbp), %rax
addq $0x53, %rax
movq %rax, -0x58(%rbp)
jmp 0x958c
movq -0x28(%rbp), %rax
movb $0x0, 0x53(%rax)
movq -0x28(%rbp), %rax
addq $0x20, %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movl 0xec(%rax), %eax
movl %eax, -0x8c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x58(%rbp), %rdi
callq 0x5320
cmpq $0x32, %rax
jae 0x95d0
movq -0x58(%rbp), %rdi
callq 0x5320
movq %rax, -0x98(%rbp)
jmp 0x95de
movl $0x32, %eax
movq %rax, -0x98(%rbp)
jmp 0x95de
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdi
movq -0x98(%rbp), %rax
movl %eax, %edx
callq 0x10af0
movl %eax, %ecx
movl -0x8c(%rbp), %eax
cmpl %ecx, %eax
jle 0x9615
movq -0x10(%rbp), %rax
movl 0xec(%rax), %eax
movl %eax, -0x9c(%rbp)
jmp 0x967c
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x58(%rbp), %rdi
callq 0x5320
cmpq $0x32, %rax
jae 0x964c
movq -0x58(%rbp), %rdi
callq 0x5320
movq %rax, -0xb8(%rbp)
jmp 0x965a
movl $0x32, %eax
movq %rax, -0xb8(%rbp)
jmp 0x965a
movq -0xa8(%rbp), %rsi
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rax
movl %eax, %edx
callq 0x10af0
movl %eax, -0x9c(%rbp)
movl -0x9c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xec(%rax)
movq -0x8(%rbp), %rdi
callq 0x109b0
movl %eax, %ecx
movq -0x10(%rbp), %rax
addl 0xe8(%rax), %ecx
movl %ecx, 0xe8(%rax)
movq -0x10(%rbp), %rax
movl 0xf0(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xf0(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x9536
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xf4(%rax), %esi
movq -0x10(%rbp), %rax
movl 0xf8(%rax), %edx
callq 0x6170
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x9735
movq -0x30(%rbp), %rax
movswl 0x4(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x30(%rbp), %rax
movswl 0x4(%rax), %eax
movq -0x30(%rbp), %rcx
movswl 0x8(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movswl 0x6(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x30(%rbp), %rax
movswl 0x6(%rax), %eax
movq -0x30(%rbp), %rcx
movswl 0xa(%rcx), %ecx
addl %ecx, %eax
movl %eax, -0x40(%rbp)
jmp 0x975d
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x8(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0xb0(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movl 0xf4(%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movl 0xf8(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movl 0xf4(%rax), %eax
movq -0x10(%rbp), %rcx
addl 0xec(%rcx), %eax
cmpl -0x38(%rbp), %eax
jl 0x97a7
movl -0x38(%rbp), %ecx
movq -0x10(%rbp), %rax
subl 0xec(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf4(%rax)
movq -0x10(%rbp), %rax
movl 0xf4(%rax), %eax
cmpl -0x34(%rbp), %eax
jge 0x97d3
movl -0x34(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf4(%rax)
movl -0x38(%rbp), %ecx
subl -0x34(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xec(%rax)
movq -0x10(%rbp), %rax
movl 0xf8(%rax), %eax
movq -0x10(%rbp), %rcx
addl 0xe8(%rcx), %eax
cmpl -0x40(%rbp), %eax
jl 0x9803
movl -0x40(%rbp), %ecx
movq -0x10(%rbp), %rax
subl 0xe8(%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf8(%rax)
movq -0x10(%rbp), %rax
movl 0xf8(%rax), %eax
cmpl -0x3c(%rbp), %eax
jge 0x982f
movl -0x3c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf8(%rax)
movl -0x40(%rbp), %ecx
subl -0x3c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xe8(%rax)
movq -0x10(%rbp), %rax
movl 0xf4(%rax), %eax
cmpl -0x48(%rbp), %eax
jne 0x984d
movq -0x10(%rbp), %rax
movl 0xf8(%rax), %eax
cmpl -0x4c(%rbp), %eax
je 0x986e
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0xf4(%rax), %esi
movq -0x10(%rbp), %rax
movl 0xf8(%rax), %edx
callq 0xac50
leaq 0x12f33(%rip), %rax     # 0x1c7a8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x50a0
leaq 0x12f1c(%rip), %rax     # 0x1c7a8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0xf4(%rax), %edx
movq -0x10(%rbp), %rax
movl 0xf8(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0xec(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0xe8(%rax), %r9d
callq 0x5440
movq -0x10(%rbp), %rax
cmpl $0x0, 0xcc(%rax)
je 0x994b
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rax
addq $0x33, %rax
movq %rax, -0xd0(%rbp)
movq -0x10(%rbp), %rdi
addq $0x33, %rdi
callq 0x5320
movl %eax, -0xc4(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10970
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movl -0xc4(%rbp), %edx
movq -0xc0(%rbp), %rcx
movl %eax, %r9d
addl $0x1, %r9d
xorl %r8d, %r8d
callq 0x10b40
movl $0x1, -0x44(%rbp)
jmp 0x9952
movl $0x0, -0x44(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x9a7d
movq -0x28(%rbp), %rax
movsbl 0x53(%rax), %eax
cmpl $0x0, %eax
je 0x9986
movq -0x28(%rbp), %rax
addq $0x53, %rax
movq %rax, -0xe0(%rbp)
jmp 0x9995
movq -0x28(%rbp), %rax
addq $0x20, %rax
movq %rax, -0xe0(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0xe8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x109b0
movl %eax, %ecx
movl -0xe8(%rbp), %eax
imull %ecx, %eax
movl %eax, -0xe4(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10970
movl %eax, %ecx
movl -0xe4(%rbp), %eax
addl %ecx, %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rax
movl 0xf8(%rax), %eax
addl -0x64(%rbp), %eax
cmpl -0x40(%rbp), %eax
jle 0x99f3
jmp 0x9a7d
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x60(%rbp), %rdi
callq 0x5320
cmpq $0x32, %rax
jae 0x9a2a
movq -0x60(%rbp), %rdi
callq 0x5320
movq %rax, -0x100(%rbp)
jmp 0x9a38
movl $0x32, %eax
movq %rax, -0x100(%rbp)
jmp 0x9a38
movq -0xf0(%rbp), %rsi
movq -0xf8(%rbp), %rdi
movq -0x100(%rbp), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rcx
movl -0x64(%rbp), %r9d
xorl %r8d, %r8d
callq 0x10b40
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x995d
movq -0x10(%rbp), %rax
cmpl $0x0, 0xcc(%rax)
je 0x9b2f
cmpl $0x1, -0x44(%rbp)
jle 0x9b2f
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x9b2f
leaq 0x12cf9(%rip), %rax     # 0x1c7a8
movq (%rax), %rax
movq %rax, -0x120(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x118(%rbp)
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x110(%rbp)
movq -0x8(%rbp), %rdi
callq 0x109b0
movl %eax, -0x108(%rbp)
movq -0x10(%rbp), %rax
movl 0xec(%rax), %eax
movl %eax, -0x104(%rbp)
movq -0x8(%rbp), %rdi
callq 0x109b0
movq -0x120(%rbp), %rdi
movq -0x118(%rbp), %rsi
movq -0x110(%rbp), %rdx
movl -0x108(%rbp), %r8d
movl -0x104(%rbp), %r9d
xorl %ecx, %ecx
movl %eax, (%rsp)
callq 0x53a0
movq -0x10(%rbp), %rax
cmpl $0x0, 0xdc(%rax)
je 0x9bb1
leaq 0x12c65(%rip), %rax     # 0x1c7a8
movq (%rax), %rax
movq %rax, -0x140(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x138(%rbp)
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x130(%rbp)
movq -0x10(%rbp), %rax
movl 0xec(%rax), %eax
movl %eax, -0x124(%rbp)
movq -0x8(%rbp), %rdi
callq 0x109b0
movq -0x140(%rbp), %rdi
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
movl -0x124(%rbp), %r9d
xorl %r8d, %r8d
movl %r8d, %ecx
movl %eax, (%rsp)
callq 0x53a0
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw (%rax,%rax)