// File: /workspace/github_c_makefile_star2_O3/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 0x7793
movq %rax, %r14
movl 0x40(%rbx), %eax
testl %eax, %eax
je 0x84d8
testb $0x1, %bpl
sete %cl
testl $0xfffffffd, %r15d      # imm = 0xFFFFFFFD
setne %dl
movb $0x1, %r12b
orb %cl, %dl
jne 0x8546
movl 0x38(%rbx), %ecx
movl %ecx, 0x24(%rbx)
movl %eax, 0x2c(%rbx)
movl $0x0, 0x40(%rbx)
leaq 0x6367(%rip), %rax      # 0xe828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x61d2(%rip), %rax      # 0xe6a0
movq (%rax), %rdx
callq 0x32c0
jmp 0x8546
cmpl $0x0, 0x44(%rbx)
setne %r12b
leal -0x1(%r15), %eax
cmpl $0x2, %eax
setb %al
testb %bpl, %al
je 0x8546
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 0x630d(%rip), %rax      # 0xe828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x6178(%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 0x85f3
movl 0x44(%rbx), %eax
testl %eax, %eax
je 0x8592
testl $0xfffffffd, %r15d      # imm = 0xFFFFFFFD
jne 0x85f3
movl 0x3c(%rbx), %ecx
movl %ecx, 0x28(%rbx)
movl %eax, 0x30(%rbx)
movl $0x0, 0x44(%rbx)
leaq 0x62ad(%rip), %rax      # 0xe828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x6120(%rip), %rax      # 0xe6a8
movq (%rax), %rdx
callq 0x32c0
jmp 0x85f3
decl %r15d
cmpl $0x1, %r15d
ja 0x85f3
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 0x6260(%rip), %rax      # 0xe828
movq (%rax), %rdi
movq (%rbx), %rsi
leaq 0x60d3(%rip), %rax      # 0xe6a8
movq (%rax), %rdx
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
pushq $0x2
pushq %r10
callq 0x3660
addq $0x10, %rsp
movl 0x40(%rbx), %eax
testb %r12b, %r12b
je 0x860d
testl %eax, %eax
jne 0x8639
cmpl $0x0, 0x44(%rbx)
jne 0x8639
movl 0x74(%rbx), %edx
movl %edx, 0x34(%rbx)
jmp 0x8626
testl %eax, %eax
jne 0x8617
cmpl $0x0, 0x44(%rbx)
je 0x8639
movl 0x34(%rbx), %eax
movl %eax, 0x74(%rbx)
movl $0x0, 0x34(%rbx)
xorl %edx, %edx
leaq 0x61fb(%rip), %rax      # 0xe828
movq (%rax), %rdi
movq 0x8(%rbx), %rsi
callq 0x35b0
movq %rbx, %rdi
callq 0x6014
movq %rbx, %rdi
callq 0x7b5a
movq %rbx, %rdi
callq 0x6c6d
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq