// File: /workspace/github_c_makefile_star2_O0/zenlinux[P]cwm/client.c
// Function: client_maximize
void
client_maximize(struct client_ctx *cc)
{
	struct screen_ctx	*sc = cc->sc;
	int			 x_org, y_org, xmax, ymax;
	XineramaScreenInfo	*xine;

	if (cc->flags & CLIENT_FREEZE)
		return;

	if ((cc->flags & CLIENT_MAXFLAGS) == CLIENT_MAXIMIZED) {
		cc->flags &= ~CLIENT_MAXIMIZED;
		cc->geom = cc->savegeom;
		cc->bwidth = Conf.bwidth;
		goto resize;
	}

	if ((cc->flags & CLIENT_VMAXIMIZED) == 0) {
		cc->savegeom.h = cc->geom.h;
		cc->savegeom.y = cc->geom.y;
	}

	if ((cc->flags & CLIENT_HMAXIMIZED) == 0) {
		cc->savegeom.w = cc->geom.w;
		cc->savegeom.x = cc->geom.x;
	}

	/*
	 * pick screen that the middle of the window is on.
	 * that's probably more fair than if just the origin of
	 * a window is poking over a boundary
	 */
	xine = screen_find_xinerama(sc,
	    cc->geom.x + cc->geom.w / 2,
	    cc->geom.y + cc->geom.h / 2);
	if (xine) {
		x_org = xine->x_org;
		y_org = xine->y_org;
		xmax = xine->width;
		ymax = xine->height;
	} else {
		x_org = y_org = 0;
		xmax = sc->view.w;
		ymax = sc->view.h;
	}

	cc->geom.x = x_org + sc->gap.left;
	cc->geom.y = y_org + sc->gap.top;
	cc->geom.h = ymax - (sc->gap.top + sc->gap.bottom);
	cc->geom.w = xmax - (sc->gap.left + sc->gap.right);
	cc->bwidth = 0;
	cc->flags |= CLIENT_MAXIMIZED;

resize:
	client_resize(cc, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x7b2f
jmp 0x7d0f
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %eax
andl $0xc, %eax
cmpl $0xc, %eax
jne 0x7b82
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %ecx
andl $-0xd, %ecx
movl %ecx, 0xa8(%rax)
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x64(%rcx), %rdx
movq %rdx, 0x54(%rax)
movq 0x6c(%rcx), %rcx
movq %rcx, 0x5c(%rax)
leaq 0x12b4d(%rip), %rax     # 0x1a6c0
movl 0x54(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
jmp 0x7d04
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x7bb0
movq -0x8(%rbp), %rax
movl 0x60(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x70(%rax)
movq -0x8(%rbp), %rax
movl 0x58(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x68(%rax)
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x7bde
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x6c(%rax)
movq -0x8(%rbp), %rax
movl 0x54(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x64(%rax)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %esi
movq -0x8(%rbp), %rax
movl 0x5c(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
addl %eax, %esi
movq -0x8(%rbp), %rax
movl 0x58(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x2c(%rbp), %edx
addl %eax, %edx
callq 0x6170
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x7c56
movq -0x28(%rbp), %rax
movswl 0x4(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x28(%rbp), %rax
movswl 0x6(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movswl 0x8(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x28(%rbp), %rax
movswl 0xa(%rax), %eax
movl %eax, -0x20(%rbp)
jmp 0x7c7e
movl $0x0, -0x18(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0xac(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0xb0(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0xcc(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x54(%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0xc4(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x58(%rax)
movl -0x20(%rbp), %ecx
movq -0x10(%rbp), %rax
movl 0xc4(%rax), %eax
movq -0x10(%rbp), %rdx
addl 0xc8(%rdx), %eax
subl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x60(%rax)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl 0xcc(%rax), %eax
movq -0x10(%rbp), %rdx
addl 0xd0(%rdx), %eax
subl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x5c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x50(%rax)
movq -0x8(%rbp), %rax
movl 0xa8(%rax), %ecx
orl $0xc, %ecx
movl %ecx, 0xa8(%rax)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x7d20
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)