// File: /workspace/github_c_makefile_star2_O1/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 0x77e7
movq %rax, %r14
movl 0x40(%rbx), %eax
movb $0x1, %r12b
testl %eax, %eax
jne 0x84ac
cmpl $0x0, 0x44(%rbx)
setne %r12b
testb $0x1, %bpl
je 0x8555
testl %eax, %eax
je 0x84f5
testl $0xfffffffd, %r15d      # imm = 0xFFFFFFFD
jne 0x8555
movl 0x38(%rbx), %ecx
movl %ecx, 0x24(%rbx)
movl %eax, 0x2c(%rbx)
movl $0x0, 0x40(%rbx)
leaq 0x634a(%rip), %rax      # 0xe828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x61b5(%rip), %rax      # 0xe6a0
movq (%rax), %rdx
callq 0x32c0
jmp 0x8555
leal -0x1(%r15), %eax
cmpl $0x1, %eax
ja 0x8555
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 0x62fe(%rip), %rax      # 0xe828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x6169(%rip), %rax      # 0xe6a0
movq (%rax), %rdx
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq $0x2
pushq %r10
callq 0x3660
addq $0x10, %rsp
testb $0x2, %bpl
je 0x8602
movl 0x44(%rbx), %eax
testl %eax, %eax
je 0x85a1
testl $0xfffffffd, %r15d      # imm = 0xFFFFFFFD
jne 0x8602
movl 0x3c(%rbx), %ecx
movl %ecx, 0x28(%rbx)
movl %eax, 0x30(%rbx)
movl $0x0, 0x44(%rbx)
leaq 0x629e(%rip), %rax      # 0xe828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x6111(%rip), %rax      # 0xe6a8
movq (%rax), %rdx
callq 0x32c0
jmp 0x8602
decl %r15d
cmpl $0x1, %r15d
ja 0x8602
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 0x6251(%rip), %rax      # 0xe828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x60c4(%rip), %rax      # 0xe6a8
movq (%rax), %rdx
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq $0x2
pushq %r10
callq 0x3660
addq $0x10, %rsp
testb %r12b, %r12b
je 0x861b
cmpl $0x0, 0x40(%rbx)
jne 0x8649
cmpl $0x0, 0x44(%rbx)
jne 0x8649
movl 0x74(%rbx), %edx
movl %edx, 0x34(%rbx)
jmp 0x8636
cmpl $0x0, 0x40(%rbx)
jne 0x8627
cmpl $0x0, 0x44(%rbx)
je 0x866e
movl 0x34(%rbx), %eax
movl %eax, 0x74(%rbx)
movl $0x0, 0x34(%rbx)
xorl %edx, %edx
leaq 0x61eb(%rip), %rax      # 0xe828
movq (%rax), %rdi
movq 0x8(%rbx), %rsi
callq 0x35b0
movq %rbx, %rdi
callq 0x6050
movq %rbx, %rdi
callq 0x7baa
movq %rbx, %rdi
callq 0x6cb0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
testb %r12b, %r12b
jne 0x8607
jmp 0x8649