// File: /workspace/github_c_makefile_star2_O0/yugecin[P]evilwm/screen.c
// Function: maximise_client
void maximise_client(Client *c, int action, int hv) {
	if (hv & MAXIMISE_GAPS) {
		c->gapindex++;
		if (c->gapindex >= opt_numgaps) {
			c->gapindex = -1;
		} else if (c->gapindex) {
			// it's already maximised, just need to apply gaps
			c->x = 0;
			c->width = DisplayWidth(dpy, c->screen->screen);
			c->y = 0;
			c->height = DisplayHeight(dpy, c->screen->screen);
			goto skip_wm_state;
		}
	}

	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);
				c->gapindex = -1;
			}
		} 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 = 0;
				c->width = DisplayWidth(dpy, c->screen->screen);
				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);
				c->gapindex = -1;
			}
		} 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 = 0;
				c->height = DisplayHeight(dpy, c->screen->screen);
				props[0] = c->oldy;
				props[1] = c->oldh;
				XChangeProperty(dpy, c->window, xa_evilwm_unmaximised_vert,
						XA_CARDINAL, 32, PropModeReplace,
						(unsigned char *)&props, 2);
			}
		}
	}
	ewmh_set_net_wm_state(c);
skip_wm_state:
	if (hv & MAXIMISE_GAPS) {
		apply_gaps(c);
	}
	moveresize(c);
	discard_enter_events(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x10(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xa023
movq -0x8(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
leaq 0x5a94(%rip), %rcx      # 0xfa20
cmpl (%rcx), %eax
jl 0x9fa0
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x38(%rax) # imm = 0xFFFFFFFF
jmp 0xa021
movq -0x8(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0xa01f
movq -0x8(%rbp), %rax
movl $0x0, 0x24(%rax)
leaq 0x5ad4(%rip), %rax      # 0xfa90
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x28(%rax)
leaq 0x5a9c(%rip), %rax      # 0xfa90
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0xa2a0
jmp 0xa021
jmp 0xa023
movl -0x10(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xa15d
movq -0x8(%rbp), %rax
cmpl $0x0, 0x44(%rax)
je 0xa09f
cmpl $0x0, -0xc(%rbp)
je 0xa048
cmpl $0x2, -0xc(%rbp)
jne 0xa09a
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x8(%rbp), %rax
movl 0x44(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x44(%rax)
leaq 0x5a1a(%rip), %rax      # 0xfa90
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0x5829(%rip), %rax      # 0xf8b0
movq (%rax), %rdx
callq 0x3240
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x38(%rax) # imm = 0xFFFFFFFF
jmp 0xa15b
cmpl $0x1, -0xc(%rbp)
je 0xa0af
cmpl $0x2, -0xc(%rbp)
jne 0xa159
movq -0x8(%rbp), %rax
movl 0x24(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x24(%rax)
leaq 0x59b3(%rip), %rax      # 0xfa90
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x8(%rbp), %rax
movslq 0x3c(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movslq 0x44(%rax), %rax
movq %rax, -0x18(%rbp)
leaq 0x596e(%rip), %rax      # 0xfa90
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0x577d(%rip), %rax      # 0xf8b0
movq (%rax), %rdx
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
leaq -0x20(%rbp), %rax
movq %rax, (%rsp)
movl $0x2, 0x8(%rsp)
callq 0x3480
jmp 0xa15b
jmp 0xa15d
movl -0x10(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xa297
movq -0x8(%rbp), %rax
cmpl $0x0, 0x48(%rax)
je 0xa1d9
cmpl $0x0, -0xc(%rbp)
je 0xa182
cmpl $0x2, -0xc(%rbp)
jne 0xa1d4
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x8(%rbp), %rax
movl 0x48(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x48(%rax)
leaq 0x58e0(%rip), %rax      # 0xfa90
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0x56f7(%rip), %rax      # 0xf8b8
movq (%rax), %rdx
callq 0x3240
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x38(%rax) # imm = 0xFFFFFFFF
jmp 0xa295
cmpl $0x1, -0xc(%rbp)
je 0xa1e9
cmpl $0x2, -0xc(%rbp)
jne 0xa293
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x28(%rax)
leaq 0x5879(%rip), %rax      # 0xfa90
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x8(%rbp), %rax
movslq 0x40(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movslq 0x48(%rax), %rax
movq %rax, -0x28(%rbp)
leaq 0x5834(%rip), %rax      # 0xfa90
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0x564b(%rip), %rax      # 0xf8b8
movq (%rax), %rdx
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
leaq -0x30(%rbp), %rax
movq %rax, (%rsp)
movl $0x2, 0x8(%rsp)
callq 0x3480
jmp 0xa295
jmp 0xa297
movq -0x8(%rbp), %rdi
callq 0x6bf0
movl -0x10(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xa2b4
movq -0x8(%rbp), %rdi
callq 0xa760
movq -0x8(%rbp), %rdi
callq 0x98f0
movq -0x8(%rbp), %rdi
callq 0x8180
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)