// File: /workspace/github_c_makefile_star2_O0/mati75[P]evilwm/client_move.c
// Function: client_maximise
void client_maximise(struct client *c, int action, int hv) {
	int monitor_x, monitor_y;
	int monitor_width, monitor_height;

	// Maximising to monitor or screen?
	if (hv & MAXIMISE_SCREEN) {
		monitor_x = monitor_y = 0;
		monitor_width = DisplayWidth(display.dpy, c->screen->screen);
		monitor_height = DisplayHeight(display.dpy, c->screen->screen);
	} else {
		struct monitor *monitor = client_monitor(c, NULL);
		monitor_x = monitor->x;
		monitor_y = monitor->y;
		monitor_width = monitor->width;
		monitor_height = monitor->height;
	}

	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(display.dpy, c->window, X_ATOM(_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(display.dpy, c->window, X_ATOM(_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(display.dpy, c->window, X_ATOM(_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(display.dpy, c->window, X_ATOM(_EVILWM_UNMAXIMISED_VERT),
						XA_CARDINAL, 32, PropModeReplace,
						(unsigned char *)&props, 2);
			}
		}
	}
	_Bool change_border = 0;
	if (c->oldw && c->oldh) {
		// maximised - remove border
		if (c->border) {
			c->border = 0;
			change_border = 1;
		}
	} else {
		// not maximised - add border
		if (!c->border && c->normal_border) {
			c->border = c->normal_border;
			change_border = 1;
		}
	}
	if (change_border) {
		XSetWindowBorderWidth(display.dpy, c->parent, c->border);
		ewmh_set_net_frame_extents(c->window, c->border);
	}
	ewmh_set_net_wm_state(c);
	client_moveresizeraise(c);
	discard_enter_events(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x10(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x79cf
movl $0x0, -0x18(%rbp)
movl $0x0, -0x14(%rbp)
leaq 0xb3fe(%rip), %rax      # 0x12d80
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), %eax
movl %eax, -0x1c(%rbp)
leaq 0xb3d5(%rip), %rax      # 0x12d80
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), %eax
movl %eax, -0x20(%rbp)
jmp 0x7a07
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5890
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x28(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x10(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x7b14
movq -0x8(%rbp), %rax
cmpl $0x0, 0x48(%rax)
je 0x7a79
cmpl $0x0, -0xc(%rbp)
je 0x7a2c
cmpl $0x2, -0xc(%rbp)
jne 0x7a74
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 0xb326(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0xb315(%rip), %rax      # 0x12d80
movq 0x30(%rax), %rdx
callq 0x42f0
jmp 0x7b12
cmpl $0x1, -0xc(%rbp)
je 0x7a89
cmpl $0x2, -0xc(%rbp)
jne 0x7b10
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)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x8(%rbp), %rax
movslq 0x40(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movslq 0x48(%rax), %rax
movq %rax, -0x38(%rbp)
leaq 0xb2a8(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0xb297(%rip), %rax      # 0x12d80
movq 0x30(%rax), %rdx
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
leaq -0x40(%rbp), %rax
movq %rax, (%rsp)
movl $0x2, 0x8(%rsp)
callq 0x4650
jmp 0x7b12
jmp 0x7b14
movl -0x10(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x7c21
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4c(%rax)
je 0x7b86
cmpl $0x0, -0xc(%rbp)
je 0x7b39
cmpl $0x2, -0xc(%rbp)
jne 0x7b81
movq -0x8(%rbp), %rax
movl 0x44(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4c(%rax)
leaq 0xb219(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0xb208(%rip), %rax      # 0x12d80
movq 0x38(%rax), %rdx
callq 0x42f0
jmp 0x7c1f
cmpl $0x1, -0xc(%rbp)
je 0x7b96
cmpl $0x2, -0xc(%rbp)
jne 0x7c1d
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0x8(%rbp), %rax
movl 0x34(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4c(%rax)
movl -0x18(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x34(%rax)
movq -0x8(%rbp), %rax
movslq 0x44(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movslq 0x4c(%rax), %rax
movq %rax, -0x48(%rbp)
leaq 0xb19b(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq 0xb18a(%rip), %rax      # 0x12d80
movq 0x38(%rax), %rdx
movl $0x6, %ecx
movl $0x20, %r8d
xorl %r9d, %r9d
leaq -0x50(%rbp), %rax
movq %rax, (%rsp)
movl $0x2, 0x8(%rsp)
callq 0x4650
jmp 0x7c1f
jmp 0x7c21
movb $0x0, -0x51(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x48(%rax)
je 0x7c54
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4c(%rax)
je 0x7c54
movq -0x8(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
je 0x7c52
movq -0x8(%rbp), %rax
movl $0x0, 0x3c(%rax)
movb $0x1, -0x51(%rbp)
jmp 0x7c7c
movq -0x8(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
jne 0x7c7a
movq -0x8(%rbp), %rax
cmpl $0x0, 0x38(%rax)
je 0x7c7a
movq -0x8(%rbp), %rax
movl 0x38(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x3c(%rax)
movb $0x1, -0x51(%rbp)
jmp 0x7c7c
testb $0x1, -0x51(%rbp)
je 0x7cb4
leaq 0xb0f7(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %edx
callq 0x45b0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movslq 0x3c(%rax), %rsi
callq 0xa4f0
movq -0x8(%rbp), %rdi
callq 0xa0f0
movq -0x8(%rbp), %rdi
callq 0x6f40
movq -0x8(%rbp), %rdi
callq 0xcfa0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)