// File: /workspace/github_c_makefile_star2_O2/kasymovga[P]devilwm/screen.c
// Function: maximise_client
void maximise_client(Client *c, int action, int hv) {
	Monitor *monitor = find_monitor(c);
	int was_fullscreen = (c->oldw || c->oldh);
	if (hv & MAXIMISE_HORZ) {
		if (c->oldw) {
			if (action == NET_WM_STATE_REMOVE
					|| action == NET_WM_STATE_TOGGLE) {
				c->x = c->oldx;
				c->width = c->oldw;
				c->oldw = 0;
				XDeleteProperty(dpy, c->window, xa_evilwm_unmaximised_horz);
			}
		} else {
			if (action == NET_WM_STATE_ADD
					|| action == NET_WM_STATE_TOGGLE) {
				unsigned long props[2];
				c->oldx = c->x;
				c->oldw = c->width;
				c->x = monitor->x;
				c->width = monitor->width;
				props[0] = c->oldx;
				props[1] = c->oldw;
				XChangeProperty(dpy, c->window, xa_evilwm_unmaximised_horz,
						XA_CARDINAL, 32, PropModeReplace,
						(unsigned char *)&props, 2);
			}
		}
	}
	if (hv & MAXIMISE_VERT) {
		if (c->oldh) {
			if (action == NET_WM_STATE_REMOVE
					|| action == NET_WM_STATE_TOGGLE) {
				c->y = c->oldy;
				c->height = c->oldh;
				c->oldh = 0;
				XDeleteProperty(dpy, c->window, xa_evilwm_unmaximised_vert);
			}
		} else {
			if (action == NET_WM_STATE_ADD
					|| action == NET_WM_STATE_TOGGLE) {
				unsigned long props[2];
				c->oldy = c->y;
				c->oldh = c->height;
				c->y = monitor->y;
				c->height = monitor->height;
				props[0] = c->oldy;
				props[1] = c->oldh;
				XChangeProperty(dpy, c->window, xa_evilwm_unmaximised_vert,
						XA_CARDINAL, 32, PropModeReplace,
						(unsigned char *)&props, 2);
			}
		}
	}
	if (!was_fullscreen && (c->oldw || c->oldh)) {
		c->nomaxborder = c->border;
		c->border = 0;
		XSetWindowBorderWidth(dpy, c->parent, c->border);
	} else if (was_fullscreen && !c->oldw && !c->oldh) {
		c->border = c->nomaxborder;
		XSetWindowBorderWidth(dpy, c->parent, c->border);
	}
	ewmh_set_net_wm_state(c);
	moveresize(c);
	discard_enter_events(c);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %rbx
callq 0x7443
movq %rax, %r14
movl 0x40(%rbx), %eax
testl %eax, %eax
je 0x8143
testb $0x1, %bpl
sete %cl
testl $0xfffffffd, %r15d      # imm = 0xFFFFFFFD
setne %dl
movb $0x1, %r12b
orb %cl, %dl
jne 0x81ab
movl 0x38(%rbx), %ecx
movl %ecx, 0x24(%rbx)
movl %eax, 0x2c(%rbx)
andl $0x0, 0x40(%rbx)
leaq 0x56fc(%rip), %rax      # 0xd828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x5567(%rip), %rax      # 0xd6a0
movq (%rax), %rdx
callq 0x32c0
jmp 0x81ab
cmpl $0x0, 0x44(%rbx)
setne %r12b
leal -0x1(%r15), %eax
cmpl $0x2, %eax
setb %al
testb %bpl, %al
je 0x81ab
movslq 0x24(%rbx), %rax
movl %eax, 0x38(%rbx)
movslq 0x2c(%rbx), %rcx
movl %ecx, 0x40(%rbx)
movl (%r14), %edx
movl %edx, 0x24(%rbx)
movl 0x8(%r14), %edx
movl %edx, 0x2c(%rbx)
movq %rsp, %r10
movq %rax, (%r10)
movq %rcx, 0x8(%r10)
leaq 0x56a2(%rip), %rax      # 0xd828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x550d(%rip), %rax      # 0xd6a0
movq (%rax), %rdx
pushq $0x6
popq %rcx
pushq $0x20
popq %r8
xorl %r9d, %r9d
pushq $0x2
pushq %r10
callq 0x3660
popq %rcx
popq %rdx
testb $0x2, %bpl
je 0x824f
movl 0x44(%rbx), %eax
testl %eax, %eax
je 0x81f4
testl $0xfffffffd, %r15d      # imm = 0xFFFFFFFD
jne 0x824f
movl 0x3c(%rbx), %ecx
movl %ecx, 0x28(%rbx)
movl %eax, 0x30(%rbx)
andl $0x0, 0x44(%rbx)
leaq 0x564b(%rip), %rax      # 0xd828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x54be(%rip), %rax      # 0xd6a8
movq (%rax), %rdx
callq 0x32c0
jmp 0x824f
decl %r15d
cmpl $0x1, %r15d
ja 0x824f
movslq 0x28(%rbx), %rax
movl %eax, 0x3c(%rbx)
movslq 0x30(%rbx), %rcx
movl %ecx, 0x44(%rbx)
movl 0x4(%r14), %edx
movl %edx, 0x28(%rbx)
movl 0xc(%r14), %edx
movl %edx, 0x30(%rbx)
movq %rsp, %r10
movq %rax, (%r10)
movq %rcx, 0x8(%r10)
leaq 0x55fe(%rip), %rax      # 0xd828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x5471(%rip), %rax      # 0xd6a8
movq (%rax), %rdx
pushq $0x6
popq %rcx
pushq $0x20
popq %r8
xorl %r9d, %r9d
pushq $0x2
pushq %r10
callq 0x3660
popq %rcx
popq %rdx
movl 0x40(%rbx), %eax
testb %r12b, %r12b
je 0x8269
testl %eax, %eax
jne 0x8292
cmpl $0x0, 0x44(%rbx)
jne 0x8292
movl 0x74(%rbx), %edx
movl %edx, 0x34(%rbx)
jmp 0x827f
testl %eax, %eax
jne 0x8273
cmpl $0x0, 0x44(%rbx)
je 0x8292
movl 0x34(%rbx), %eax
movl %eax, 0x74(%rbx)
andl $0x0, 0x34(%rbx)
xorl %edx, %edx
leaq 0x55a2(%rip), %rax      # 0xd828
movq (%rax), %rdi
movq 0x8(%rbx), %rsi
callq 0x35b0
movq %rbx, %rdi
callq 0x5d14
movq %rbx, %rdi
callq 0x77f3
movq %rbx, %rdi
callq 0x692a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq