LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: event_map_notify
static void
event_map_notify(xcb_generic_event_t *ev)
{
	xcb_map_notify_event_t *e = (xcb_map_notify_event_t *)ev;
	struct client *client = find_client(&e->window);

	if (client != NULL) {
		client->mapped = true;
		set_focused(client);
		update_window_status(client);
	}
}

// Assembly:
pushq %rbx
addq $0x8, %rdi
callq 0x49ea
testq %rax, %rax
je 0x4731
movq %rax, %rbx
movb $0x1, 0x54(%rax)
movq %rax, %rdi
callq 0x5936
movq %rbx, %rdi
popq %rbx
jmp 0x4fb8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: event_unmap_notify
static void
event_unmap_notify(xcb_generic_event_t *ev)
{
	xcb_map_request_event_t *e = (xcb_map_request_event_t *)ev;
	struct client *client = NULL;

	client = find_client(&e->window);
	if (client == NULL)
		return;

	client->mapped = false;

	if (conf.last_window_focusing && focused_win != NULL && client->window == focused_win->window) {
		focused_win = NULL;
		set_focused_last_best();
	}

	update_client_list();
	update_window_status(client);
}

// Assembly:
pushq %rbx
addq $0x8, %rdi
callq 0x49ea
testq %rax, %rax
je 0x4782
movq %rax, %rbx
movb $0x0, 0x54(%rax)
movq 0x8090(%rip), %rax      # 0xc7e0
testq %rax, %rax
setne %cl
andb 0x8068(%rip), %cl       # 0xc7c4
cmpb $0x1, %cl
jne 0x4774
movl (%rbx), %ecx
cmpl (%rax), %ecx
jne 0x4774
andq $0x0, 0x8071(%rip)      # 0xc7e0
callq 0x590a
callq 0x5738
movq %rbx, %rdi
popq %rbx
jmp 0x4fb8
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: event_client_message
static void
event_client_message(xcb_generic_event_t *ev)
{
	xcb_client_message_event_t *e = (xcb_client_message_event_t *)ev;
	uint32_t ipc_command;
	uint32_t *data;
	struct client *client;

	if (e->type == ATOMS[_IPC_ATOM_COMMAND] && e->format == 32) {
		/* Message from the client */
		data = e->data.data32;
		ipc_command = data[0];
		if (ipc_handlers[ipc_command] != NULL)
			(ipc_handlers[ipc_command])(data + 1);
		DMSG("IPC Command %u with arguments %u %u %u\n", ipc_command, data[1], data[2], data[3]);
	} else {
		client = find_client(&e->window);
		if (client == NULL)
			return;
		if (e->type == ewmh->_NET_WM_STATE) {
			DMSG("got _NET_WM_STATE for 0x%08x\n", client->window);
			handle_wm_state(client, e->data.data32[1], e->data.data32[0]);
			handle_wm_state(client, e->data.data32[2], e->data.data32[0]);
		} else if (e->type == ewmh->_NET_ACTIVE_WINDOW) {
			DMSG("got _NET_ACTIVE_WINDOW for 0x%08x\n", client->window);
			set_focused(client);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %ebp
cmpl 0x8064(%rip), %ebp      # 0xc7f8
jne 0x47bc
cmpb $0x20, 0x1(%rbx)
jne 0x47bc
movl 0xc(%rbx), %eax
leaq 0x807a(%rip), %rcx      # 0xc820
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x480d
addq $0x10, %rbx
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmpq *%rax
leaq 0x4(%rbx), %rdi
callq 0x49ea
testq %rax, %rax
je 0x480d
movq %rax, %r14
movq 0x7bec(%rip), %rax      # 0xc3c0
cmpl 0x84(%rax), %ebp
jne 0x47fc
movl 0xc(%rbx), %edx
movl 0x10(%rbx), %esi
movq %r14, %rdi
callq 0x5bef
movl 0xc(%rbx), %edx
movl 0x14(%rbx), %esi
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5bef
cmpl 0x40(%rax), %ebp
jne 0x480d
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5936
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: event_configure_notify
static void
event_configure_notify(xcb_generic_event_t *ev)
{
	xcb_configure_notify_event_t *e = (xcb_configure_notify_event_t *)ev;
	struct client *client;
	struct list_item *item;

	/* The root window changes its geometry when the
	 * user adds/removes/tilts screens */
	if (e->window == scr->root) {
		if (e->width != scr->width_in_pixels
				|| e->height != scr->height_in_pixels) {
			scr->width_in_pixels = e->width;
			scr->height_in_pixels = e->height;

			if (randr_base != -1) {
				get_randr();
				for (item = win_list; item != NULL; item = item->next) {
					client = item->data;
					fit_on_screen(client);
				}
			}
		}
	} else {
		client = find_client(&e->window);
		if (client != NULL) {
			client->monitor = find_monitor_by_coord(client->geom.x, client->geom.y);
			update_current_desktop(client);
		}
	}
}

// Assembly:
pushq %rbx
movl 0x8(%rdi), %ecx
movq 0x7fbb(%rip), %rax      # 0xc7d8
cmpl (%rax), %ecx
jne 0x4868
movzwl 0x14(%rdi), %ecx
movzwl 0x16(%rdi), %edx
cmpw 0x14(%rax), %cx
jne 0x4835
cmpw 0x16(%rax), %dx
je 0x4893
movw %cx, 0x14(%rax)
movw %dx, 0x16(%rax)
cmpl $-0x1, 0x7fc8(%rip)     # 0xc80c
je 0x4893
callq 0x5e32
leaq 0x7b76(%rip), %rbx      # 0xc3c8
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x4893
movq (%rbx), %rdi
callq 0x4a0a
addq $0x10, %rbx
jmp 0x4852
addq $0x8, %rdi
callq 0x49ea
testq %rax, %rax
je 0x4893
movq %rax, %rbx
movswl 0x4(%rax), %edi
movswl 0x6(%rax), %esi
callq 0x5a1f
movq %rax, 0x40(%rbx)
movq %rbx, %rdi
popq %rbx
jmp 0x5b20
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: event_focus_in
static void
event_focus_in(xcb_generic_event_t *ev)
{
	xcb_focus_in_event_t *e = (xcb_focus_in_event_t *)ev;
	xcb_window_t win = e->event;
	struct client *client = find_client(&win);

	if (client != NULL)
		update_current_desktop(client);
}

// Assembly:
pushq %rax
movl 0x4(%rdi), %eax
leaq 0x4(%rsp), %rdi
movl %eax, (%rdi)
callq 0x49ea
testq %rax, %rax
je 0x48ca
movq %rax, %rdi
popq %rax
jmp 0x5b20
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: event_focus_out
static void
event_focus_out(xcb_generic_event_t *ev)
{
	(void)(ev);
	xcb_get_input_focus_reply_t *focus = xcb_get_input_focus_reply(conn,
			xcb_get_input_focus(conn), NULL);
	struct client *client = NULL;

	if (focused_win != NULL && focus->focus == focused_win->window)
		return;

	if (focus->focus == scr->root) {
		focused_win = NULL;
	} else {
		client = find_client(&focus->focus);
		if (client != NULL)
			set_focused_no_raise(client);
	}
}

// Assembly:
pushq %rbx
movq 0x7ae4(%rip), %rbx      # 0xc3b8
movq %rbx, %rdi
callq 0x3600
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x36e0
movq 0x7ef1(%rip), %rdx      # 0xc7e0
movl 0x8(%rax), %ecx
testq %rdx, %rdx
je 0x48fb
cmpl (%rdx), %ecx
je 0x492a
movq 0x7ed6(%rip), %rdx      # 0xc7d8
cmpl (%rdx), %ecx
jne 0x4910
andq $0x0, 0x7ed2(%rip)      # 0xc7e0
jmp 0x492a
addq $0x8, %rax
movq %rax, %rdi
callq 0x49ea
testq %rax, %rax
je 0x492a
movq %rax, %rdi
popq %rbx
jmp 0x4e56
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: event_button_press
static void
event_button_press(xcb_generic_event_t *ev)
{
	xcb_button_press_event_t *e = (xcb_button_press_event_t *)ev;
	bool replay = false;

	for (int i = 0; i < NR_BUTTONS; i++) {
		if (e->detail != mouse_buttons[i])
			continue;
		if ((conf.click_to_focus == (int8_t) XCB_BUTTON_INDEX_ANY ||
			 conf.click_to_focus == (int8_t) mouse_buttons[i]) &&
			(e->state & ~(num_lock | scroll_lock | caps_lock)) == XCB_NONE) {

			replay = !pointer_grab(POINTER_ACTION_FOCUS);
		} else {
			pointer_grab(conf.pointer_actions[i]);
		}
	}
	xcb_allow_events(conn, replay ? XCB_ALLOW_REPLAY_POINTER : XCB_ALLOW_SYNC_POINTER, e->time);
	xcb_flush(conn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0x47ec(%rip), %r12      # 0x9130
pushq $0x1
popq %rbp
leaq 0x7e52(%rip), %r13      # 0xc7a0
xorl %r14d, %r14d
cmpq $0xc, %r15
je 0x49b8
movzbl 0x1(%rbx), %eax
cmpl %eax, (%r15,%r12)
jne 0x49a2
movb 0x7e6f(%rip), %cl       # 0xc7d6
testb %cl, %cl
setne %dl
cmpb %cl, %al
setne %al
testb %al, %dl
jne 0x4998
movzwl 0x1c(%rbx), %eax
movzwl 0x7e6c(%rip), %ecx      # 0xc7ec
movzwl 0x7e61(%rip), %edx      # 0xc7e8
orl %ecx, %edx
movzwl 0x7e5a(%rip), %ecx      # 0xc7ea
orl %edx, %ecx
notl %ecx
testl %eax, %ecx
je 0x49a8
movl 0x28(%r15,%r13), %edi
callq 0x618a
addq $0x4, %r15
jmp 0x4951
movl %ebp, %edi
callq 0x618a
movl %eax, %r14d
xorb $0x1, %r14b
jmp 0x49a2
movq 0x79f9(%rip), %rdi      # 0xc3b8
movl 0x4(%rbx), %edx
movzbl %r14b, %esi
andl $0x1, %esi
incl %esi
callq 0x30d0
movq 0x79e1(%rip), %rdi      # 0xc3b8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x33f0
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: teleport_window
static void
teleport_window(xcb_window_t win, int16_t x, int16_t y)
{
	uint32_t values[2] = {x, y};

	if (win == scr->root || win == 0)
		return;

	xcb_configure_window(conn, win, XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y, values);
	update_window_status(find_client(&win));

	xcb_flush(conn);
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0xc(%rsp)
movl %esi, 0x10(%rsp)
movl %edx, 0x14(%rsp)
testl %edi, %edi
je 0x4c99
movl %edi, %eax
movq 0x7b77(%rip), %rcx      # 0xc7d8
cmpl %edi, (%rcx)
je 0x4c99
movq 0x774c(%rip), %rdi      # 0xc3b8
pushq $0x3
popq %rdx
leaq 0x10(%rsp), %rcx
movl %eax, %esi
callq 0x31f0
leaq 0xc(%rsp), %rdi
callq 0x49ea
movq %rax, %rdi
callq 0x4fb8
movq 0x7724(%rip), %rdi      # 0xc3b8
callq 0x33f0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: resize_window_absolute
static void
resize_window_absolute(xcb_window_t win, uint16_t w, uint16_t h)
{
	uint32_t val[2];
	uint32_t mask = XCB_CONFIG_WINDOW_WIDTH
				  | XCB_CONFIG_WINDOW_HEIGHT;

	val[0] = w;
	val[1] = h;

	xcb_configure_window(conn, win, mask, val);
	update_window_status(find_client(&win));
	refresh_borders();
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %eax
leaq 0x4(%rsp), %rbx
movl %edi, (%rbx)
leaq 0x8(%rsp), %rcx
movl %esi, (%rcx)
movl %edx, 0x4(%rcx)
movq 0x76fb(%rip), %rdi      # 0xc3b8
pushq $0xc
popq %rdx
movl %eax, %esi
callq 0x31f0
movq %rbx, %rdi
callq 0x49ea
movq %rax, %rdi
callq 0x4fb8
callq 0x56c4
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: maximize_window
static void
maximize_window(struct client *client, int16_t mon_x, int16_t mon_y, uint16_t mon_width, uint16_t mon_height)
{
	uint32_t values[1];
	if (client == NULL)
		return;

	if (is_special(client))
		reset_window(client);

	client->maxed = true;

	/* maximized windows don't have borders */
	values[0] = 0;
	if (client->geom.width != mon_width || client->geom.height != mon_height)
		client->orig_geom = client->geom;
	xcb_configure_window(conn, client->window, XCB_CONFIG_WINDOW_BORDER_WIDTH,
			values);

	client->geom.x = mon_x;
	client->geom.y = mon_y;
	client->geom.width = mon_width;
	client->geom.height = mon_height;

	teleport_window(client->window, client->geom.x, client->geom.y);
	resize_window_absolute(client->window, client->geom.width, client->geom.height);
	set_focused_no_raise(client);

	update_ewmh_wm_state(client);
	update_window_status(client);
}

// Assembly:
testq %rdi, %rdi
je 0x4daa
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r8d, %r15d
movl %ecx, %r12d
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
callq 0x4dab
testb %al, %al
je 0x4d16
movq %rbx, %rdi
callq 0x4dc9
movb $0x1, 0x24(%rbx)
andl $0x0, 0xc(%rsp)
cmpw %r12w, 0x8(%rbx)
jne 0x4d2d
cmpw %r15w, 0xa(%rbx)
je 0x4d40
leaq 0x4(%rbx), %rax
movzwl 0x8(%rax), %ecx
movw %cx, 0x16(%rbx)
movq (%rax), %rax
movq %rax, 0xe(%rbx)
movq 0x7671(%rip), %rdi      # 0xc3b8
movl (%rbx), %esi
pushq $0x10
popq %rdx
leaq 0xc(%rsp), %rcx
callq 0x31f0
movw %r14w, 0x4(%rbx)
movw %bp, 0x6(%rbx)
movw %r12w, 0x8(%rbx)
movw %r15w, 0xa(%rbx)
movl (%rbx), %edi
movswl %r14w, %esi
movswl %bp, %edx
callq 0x4c44
movl (%rbx), %edi
movzwl 0x8(%rbx), %esi
movzwl 0xa(%rbx), %edx
callq 0x4c9e
movq %rbx, %rdi
callq 0x4e56
movq %rbx, %rdi
callq 0x4f61
movq %rbx, %rdi
callq 0x4fb8
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: is_special
static bool
is_special(struct client *client)
{
	if (client == NULL)
		return false;

	return client->maxed
		|| client->vmaxed
		|| client->hmaxed
		|| client->monocled
		|| client->gridded;
}

// Assembly:
movb $0x1, %al
cmpb $0x0, 0x24(%rdi)
jne 0x4dc8
cmpb $0x0, 0x26(%rdi)
jne 0x4dc8
cmpb $0x0, 0x25(%rdi)
jne 0x4dc8
cmpb $0x0, 0x27(%rdi)
jne 0x4dc8
movb 0x28(%rdi), %al
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: reset_window
static void
reset_window(struct client *client)
{
	xcb_atom_t state[] = {
		XCB_ICCCM_WM_STATE_NORMAL,
		XCB_NONE
	};
	client->geom.x = client->orig_geom.x;
	client->geom.y = client->orig_geom.y;
	client->geom.width = client->orig_geom.width;
	client->geom.height = client->orig_geom.height;
	client->maxed = client->hmaxed
		= client->vmaxed = client->monocled = client->gridded = false;

	teleport_window(client->window, client->geom.x, client->geom.y);
	resize_window_absolute(client->window, client->geom.width, client->geom.height);
	set_borders(client, conf.unfocus_color, conf.internal_unfocus_color);

	xcb_change_property(conn, XCB_PROP_MODE_REPLACE, client->window,
			ewmh->_NET_WM_STATE, ewmh->_NET_WM_STATE, 32, 2, state);
	update_window_status(client);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq %rsp, %r14
movq $0x1, (%r14)
movq 0xe(%rdi), %rax
movq %rax, 0x4(%rdi)
andl $0x0, 0x24(%rdi)
movb $0x0, 0x28(%rdi)
movl (%rdi), %edi
movl %eax, %edx
sarl $0x10, %edx
movswl %ax, %esi
callq 0x4c44
movl (%rbx), %edi
movzwl 0x8(%rbx), %esi
movzwl 0xa(%rbx), %edx
callq 0x4c9e
movl 0x799e(%rip), %esi      # 0xc7ac
movl 0x79a0(%rip), %edx      # 0xc7b4
movq %rbx, %rdi
callq 0x5117
movq 0x7595(%rip), %rdi      # 0xc3b8
movl (%rbx), %edx
movq 0x7594(%rip), %rax      # 0xc3c0
movl 0x84(%rax), %ecx
pushq $0x20
popq %r9
xorl %esi, %esi
movl %ecx, %r8d
pushq %r14
pushq $0x2
callq 0x35a0
popq %rcx
popq %rdx
movq %rbx, %rdi
callq 0x4fb8
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: set_focused_no_raise
static void
set_focused_no_raise(struct client *client)
{
	long data[] = {
		XCB_ICCCM_WM_STATE_NORMAL,
		XCB_NONE,
	};
	if (client == NULL)
		return;

	/* show window if hidden */
	xcb_map_window(conn, client->window);

	if (!client->maxed)
		set_borders(client, conf.focus_color, conf.internal_focus_color);

	/* focus the window */
	xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT,
			client->window, XCB_CURRENT_TIME);

	/* set ewmh property */
	xcb_change_property(conn, XCB_PROP_MODE_REPLACE, scr->root,
			ewmh->_NET_ACTIVE_WINDOW, XCB_ATOM_WINDOW, 32, 1, &client->window);

	/* set window state */
	xcb_change_property(conn, XCB_PROP_MODE_REPLACE, client->window,
						ewmh->_NET_WM_STATE, ewmh->_NET_WM_STATE, 32, 2, data);

	/* set the focus state to inactive on the previously focused window */
	if (client != focused_win) {
		if (focused_win != NULL && !focused_win->maxed)
			set_borders(focused_win, conf.unfocus_color, conf.internal_unfocus_color);
	}

	if (client->focus_item != NULL)
		list_move_to_head(&focus_list, client->focus_item);

	focused_win = client;

	window_grab_buttons(focused_win->window);
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movaps 0x41dd(%rip), %xmm0     # 0x9040
movaps %xmm0, (%rsp)
testq %rdi, %rdi
je 0x4f5a
movq %rdi, %rbx
movq 0x753e(%rip), %rdi      # 0xc3b8
movl (%rbx), %esi
callq 0x3270
cmpb $0x0, 0x24(%rbx)
jne 0x4e9b
movl 0x791b(%rip), %esi      # 0xc7a8
movl 0x791d(%rip), %edx      # 0xc7b0
movq %rbx, %rdi
callq 0x5117
movq 0x7516(%rip), %rdi      # 0xc3b8
movl (%rbx), %edx
pushq $0x1
popq %rsi
xorl %ecx, %ecx
callq 0x3150
movq 0x7503(%rip), %rdi      # 0xc3b8
movq 0x791c(%rip), %rax      # 0xc7d8
movl (%rax), %edx
movq 0x74fb(%rip), %rax      # 0xc3c0
movl 0x40(%rax), %ecx
pushq $0x21
popq %r8
pushq $0x20
popq %rbp
xorl %esi, %esi
movl %ebp, %r9d
pushq %rbx
pushq $0x1
callq 0x35a0
popq %rcx
popq %rdx
movq 0x74d3(%rip), %rdi      # 0xc3b8
movl (%rbx), %edx
movq 0x74d2(%rip), %rax      # 0xc3c0
movl 0x84(%rax), %ecx
movq %rsp, %rax
xorl %esi, %esi
movl %ecx, %r8d
movl %ebp, %r9d
pushq %rax
pushq $0x2
callq 0x35a0
popq %rcx
popq %rdx
movq 0x78d0(%rip), %rdi      # 0xc7e0
cmpq %rbx, %rdi
sete %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x4f37
cmpb $0x0, 0x24(%rdi)
jne 0x4f37
movl 0x7880(%rip), %esi      # 0xc7ac
movl 0x7882(%rip), %edx      # 0xc7b4
callq 0x5117
movq 0x38(%rbx), %rsi
testq %rsi, %rsi
je 0x4f4c
leaq 0x7489(%rip), %rdi      # 0xc3d0
callq 0x7f26
movq %rbx, 0x788d(%rip)      # 0xc7e0
movl (%rbx), %edi
callq 0x53e3
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: update_ewmh_wm_state
static void
update_ewmh_wm_state(struct client *client)
{
	int i;
	uint32_t values[12];

	if (client == NULL)
		return;
#define HANDLE_WM_STATE(s) \
	values[i] = ewmh->_NET_WM_STATE_##s; \
	i++; \
	DMSG("ewmh net_wm_state %s present\n", #s);

	i = 0;
	if (client->maxed) {
		HANDLE_WM_STATE(FULLSCREEN);
	}
	if (client->vmaxed) {
		HANDLE_WM_STATE(MAXIMIZED_VERT);
	}
	if (client->hmaxed) {
		HANDLE_WM_STATE(MAXIMIZED_HORZ);
	}

	xcb_ewmh_set_wm_state(ewmh, client->window, i, values);
}

// Assembly:
subq $0x38, %rsp
movq %rdi, %rax
xorl %edx, %edx
movq 0x744f(%rip), %rdi      # 0xc3c0
cmpb $0x1, 0x24(%rax)
jne 0x4f83
movl 0x128(%rdi), %ecx
movl %ecx, (%rsp)
pushq $0x1
popq %rdx
cmpb $0x1, 0x26(%rax)
jne 0x4f96
movl 0x110(%rdi), %ecx
movl %edx, %esi
movl %ecx, (%rsp,%rsi,4)
incl %edx
cmpb $0x1, 0x25(%rax)
jne 0x4fa9
movl 0x114(%rdi), %ecx
movl %edx, %esi
movl %ecx, (%rsp,%rsi,4)
incl %edx
movl (%rax), %esi
movq %rsp, %rcx
callq 0x3550
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: window_grab_buttons
static void
window_grab_buttons(xcb_window_t win)
{
	for (int i = 0; i < NR_BUTTONS; i++) {
		if (conf.click_to_focus == (int8_t) XCB_BUTTON_INDEX_ANY ||
			conf.click_to_focus == (int8_t) mouse_buttons[i])
			window_grab_button(win, mouse_buttons[i], XCB_NONE);
		if (conf.pointer_actions[i] != POINTER_ACTION_NOTHING)
			window_grab_button(win, mouse_buttons[i], conf.pointer_modifier);
	}
	DMSG("grabbed buttons on 0x%08x\n", win);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
xorl %r14d, %r14d
leaq 0x3d39(%rip), %r15      # 0x9130
leaq 0x73a2(%rip), %r12      # 0xc7a0
cmpq $0xc, %r14
je 0x544e
movsbl 0x73cb(%rip), %eax      # 0xc7d6
testl %eax, %eax
je 0x541d
movl (%r14,%r15), %ebp
movsbl %bpl, %ecx
cmpl %eax, %ecx
je 0x5421
jmp 0x542e
movl (%r14,%r15), %ebp
movzbl %bpl, %esi
movl %ebx, %edi
xorl %edx, %edx
callq 0x5457
cmpl $0x0, 0x28(%r14,%r12)
je 0x5448
movzwl 0x7397(%rip), %edx      # 0xc7d4
movzbl %bpl, %esi
movl %ebx, %edi
callq 0x5457
addq $0x4, %r14
jmp 0x53fe
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: refresh_borders
static void
refresh_borders(void)
{
	if (!conf.apply_settings)
		return;

	struct list_item *item;
	struct client *client;

	for (item = win_list; item != NULL; item = item->next) {
		client = item->data;
		if (client->maxed)
			continue;

		if (client == focused_win)
			set_borders(client, conf.focus_color, conf.internal_focus_color);
		else
			set_borders(client, conf.unfocus_color, conf.internal_unfocus_color);
	}
}

// Assembly:
cmpb $0x1, 0x70fa(%rip)      # 0xc7c5
jne 0x5737
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
leaq 0x6ceb(%rip), %rbx      # 0xc3c8
leaq 0x70c4(%rip), %r14      # 0xc7a8
leaq 0x70c1(%rip), %r15      # 0xc7ac
leaq 0x70be(%rip), %r12      # 0xc7b0
leaq 0x70bb(%rip), %r13      # 0xc7b4
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x572e
movq (%rbx), %rdi
cmpb $0x0, 0x24(%rdi)
jne 0x5728
cmpq 0x70cf(%rip), %rdi      # 0xc7e0
movq %r15, %rax
cmoveq %r14, %rax
movl (%rax), %esi
movq %r13, %rax
cmoveq %r12, %rax
movl (%rax), %edx
callq 0x5117
addq $0x10, %rbx
jmp 0x56f9
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: update_client_list
static void
update_client_list(void)
{
	xcb_window_t *children;
	struct client *client;
	uint32_t len;

	xcb_query_tree_reply_t *reply = xcb_query_tree_reply(conn,
			xcb_query_tree(conn, scr->root), NULL);
	xcb_delete_property(conn, scr->root, ewmh->_NET_CLIENT_LIST);
	xcb_delete_property(conn, scr->root, ewmh->_NET_CLIENT_LIST_STACKING);

	if (reply == NULL) {
		add_to_client_list(0);
		return;
	}

	len = xcb_query_tree_children_length(reply);
	children = xcb_query_tree_children(reply);

	for (unsigned int i = 0; i < len; i++) {
		client = find_client(&children[i]);
		if (client != NULL)
			add_to_client_list(client->window);
	}

	free(reply);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x6c72(%rip), %rbx      # 0xc3b8
movq 0x708b(%rip), %rax      # 0xc7d8
movl (%rax), %esi
movq %rbx, %rdi
callq 0x3220
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3370
movq %rax, %rbx
movq 0x6c4b(%rip), %rdi      # 0xc3b8
movq 0x7064(%rip), %rax      # 0xc7d8
movl (%rax), %esi
movq 0x6c43(%rip), %rax      # 0xc3c0
movl 0x24(%rax), %edx
callq 0x3580
movq 0x6c2c(%rip), %rdi      # 0xc3b8
movq 0x7045(%rip), %rax      # 0xc7d8
movl (%rax), %esi
movq 0x6c24(%rip), %rax      # 0xc3c0
movl 0x28(%rax), %edx
callq 0x3580
testq %rbx, %rbx
je 0x57f3
movq %rbx, %rdi
callq 0x36b0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x34b0
movq %rax, %r14
movl %ebp, %r15d
subq $0x1, %r15
jb 0x57e1
movq %r14, %rdi
callq 0x49ea
testq %rax, %rax
je 0x57db
movl (%rax), %edi
callq 0x5960
addq $0x4, %r14
jmp 0x57c1
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x32c0
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5960
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: update_group_list
static void update_group_list(void)
{
	struct list_item *item;
	struct client *client;
	bool first = true;
	uint32_t data[1];

	for (unsigned int i = 0; i < conf.groups; i++) {
		/* deactivate group if no window in group */
		item = win_list;
		while (item != NULL && (client = item->data)->group != i)
			item = item->next;
		if (item == NULL)
			group_in_use[i] = false;

		if (group_in_use[i]) {
			uint8_t mode = XCB_PROP_MODE_APPEND;
			data[0] = i + 1;
			if (first) {
				mode = XCB_PROP_MODE_REPLACE;
				first = false;
			}
			xcb_change_property(conn, mode, scr->root, ATOMS[WINDOWCHEF_ACTIVE_GROUPS], XCB_ATOM_INTEGER, 32, 1, data);
		}
	}

	if (first) {
		data[0] = 0;
		xcb_change_property(conn, XCB_PROP_MODE_REPLACE, scr->root, ATOMS[WINDOWCHEF_ACTIVE_GROUPS], XCB_ATOM_INTEGER, 32, 1, data);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, %al
movl 0x6fa5(%rip), %ecx      # 0xc7bc
xorl %r15d, %r15d
leaq 0x6ba7(%rip), %r12      # 0xc3c8
pushq $0x13
popq %rbx
pushq $0x20
popq %rbp
xorl %r13d, %r13d
movl %ecx, %edx
cmpq %rdx, %r13
jae 0x58c3
movq %r12, %rdx
movq (%rdx), %rdx
testq %rdx, %rdx
je 0x58af
movq (%rdx), %rsi
movl 0x58(%rsi), %esi
addq $0x10, %rdx
cmpq %rsi, %r13
jne 0x5838
movq 0x6faa(%rip), %rdx      # 0xc800
testb $0x1, (%rdx,%r13)
je 0x58bb
leal 0x1(%r13), %ecx
movl %ecx, 0x4(%rsp)
movzbl %al, %r14d
testb $0x1, %al
cmovnel %r15d, %r14d
movq 0x6b42(%rip), %rdi      # 0xc3b8
movq 0x6f5b(%rip), %rcx      # 0xc7d8
movl (%rcx), %edx
movl 0x6f6f(%rip), %ecx      # 0xc7f4
notb %al
movzbl %al, %esi
andl $0x1, %esi
addl %esi, %esi
movl %ebx, %r8d
movl %ebp, %r9d
leaq 0x4(%rsp), %rax
pushq %rax
pushq $0x1
callq 0x35a0
popq %rcx
popq %rdx
movl 0x6f12(%rip), %ecx      # 0xc7bc
movl %r14d, %eax
jmp 0x58bb
movq 0x6f4a(%rip), %rdx      # 0xc800
movb $0x0, (%rdx,%r13)
incq %r13
jmp 0x582a
testb $0x1, %al
je 0x58fb
andl $0x0, 0x4(%rsp)
movq 0x6ae5(%rip), %rdi      # 0xc3b8
movq 0x6efe(%rip), %rax      # 0xc7d8
movl (%rax), %edx
movl 0x6f12(%rip), %ecx      # 0xc7f4
pushq $0x13
popq %r8
pushq $0x20
popq %r9
xorl %esi, %esi
leaq 0x4(%rsp), %rax
pushq %rax
pushq $0x1
callq 0x35a0
popq %rcx
popq %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: group_add_window
static void
group_add_window(struct client *client, uint32_t group)
{
	if (client != NULL && group < conf.groups) {
		client->group = group;
		group_in_use[group] = true;
		update_wm_desktop(client);
		update_group_list();
		update_current_desktop(client);
		update_window_status(client);
	}
}

// Assembly:
cmpl %esi, 0x6dcf(%rip)      # 0xc7bc
jbe 0x5a1e
pushq %rbx
movq %rdi, %rbx
movl %esi, 0x58(%rdi)
movq 0x6e03(%rip), %rax      # 0xc800
movl %esi, %ecx
movb $0x1, (%rax,%rcx)
callq 0x5bd5
callq 0x5804
movq %rbx, %rdi
callq 0x5b20
movq %rbx, %rdi
popq %rbx
jmp 0x4fb8
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: find_monitor_by_coord
static struct monitor *
find_monitor_by_coord(int16_t x, int16_t y)
{
	struct list_item *item;
	struct monitor *m, *ret;

	m = ret = NULL;
	item = mon_list;
	while (item != NULL) {
		m = item->data;
		if (x >= m->x && x <= m->x + m->width
			&& y >= m->y && y <= m->y + m->height)
			ret = m;

		item = item->next;
	}

	return ret;
}

// Assembly:
leaq 0x6dea(%rip), %rcx      # 0xc810
xorl %eax, %eax
movq (%rcx), %rcx
testq %rcx, %rcx
je 0x5a6b
movq (%rcx), %rdx
movswl 0x10(%rdx), %r8d
cmpw %di, %r8w
jg 0x5a65
movzwl 0x14(%rdx), %r9d
addl %r8d, %r9d
cmpl %edi, %r9d
jl 0x5a65
movswl 0x12(%rdx), %r8d
cmpw %si, %r8w
jg 0x5a65
movzwl 0x16(%rdx), %r9d
addl %r8d, %r9d
cmpl %esi, %r9d
cmovgeq %rdx, %rax
addq $0x10, %rcx
jmp 0x5a28
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: center_pointer
static void
center_pointer(struct client *client)
{
	int16_t cur_x, cur_y;

	cur_x = cur_y = 0;

	switch (conf.cursor_position) {
	case TOP_LEFT:
		cur_x = -conf.border_width;
		cur_y = -conf.border_width;
		break;
	case TOP_RIGHT:
		cur_x = client->geom.width + conf.border_width;
		cur_y = 0 - conf.border_width;
		break;
	case BOTTOM_LEFT:
		cur_x = 0 - conf.border_width;
		cur_y = client->geom.height + conf.border_width;
		break;
	case BOTTOM_RIGHT:
		cur_x = client->geom.width + conf.border_width;
		cur_y = client->geom.height + conf.border_width;
		break;
	case CENTER:
		cur_x = client->geom.width / 2;
		cur_y = client->geom.height / 2;
		break;
	default: break;
	}

	xcb_warp_pointer(conn, XCB_NONE, client->window, 0, 0, 0, 0, cur_x, cur_y);
	xcb_flush(conn);
}

// Assembly:
movl 0x6d46(%rip), %eax      # 0xc7b8
cmpq $0x4, %rax
ja 0x5adb
leaq 0x35d1(%rip), %rcx      # 0x9050
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movsbl 0x6d11(%rip), %esi      # 0xc7a0
movzwl 0xa(%rdi), %ecx
addw %si, %cx
negl %esi
jmp 0x5adf
movzwl 0x8(%rdi), %esi
shrl %esi
movzwl 0xa(%rdi), %ecx
shrl %ecx
jmp 0x5adf
movsbl 0x6cf1(%rip), %ecx      # 0xc7a0
negl %ecx
movl %ecx, %esi
jmp 0x5adf
movsbl 0x6ce4(%rip), %ecx      # 0xc7a0
movzwl 0x8(%rdi), %esi
addw %cx, %si
negl %ecx
jmp 0x5adf
movsbl 0x6cd2(%rip), %ecx      # 0xc7a0
movzwl 0x8(%rdi), %esi
addw %cx, %si
addw 0xa(%rdi), %cx
jmp 0x5adf
xorl %ecx, %ecx
xorl %esi, %esi
subq $0x18, %rsp
movq 0x68ce(%rip), %rax      # 0xc3b8
movl (%rdi), %edx
movswl %cx, %ecx
movl %ecx, 0x10(%rsp)
andl $0x0, (%rsp)
movswl %si, %ecx
movl %ecx, 0x8(%rsp)
movq %rax, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x32a0
movq 0x68a1(%rip), %rdi      # 0xc3b8
addq $0x18, %rsp
jmp 0x33f0
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: get_geometry
static bool
get_geometry(xcb_window_t *win, int16_t *x, int16_t *y, uint16_t *width, uint16_t *height, uint8_t *depth)
{
	xcb_get_geometry_reply_t *reply = xcb_get_geometry_reply(conn, xcb_get_geometry(conn, *win), NULL);

	if (reply == NULL)
		return false;
	if (x != NULL)
		*x = reply->x;
	if (y != NULL)
		*y = reply->y;
	if (width != NULL)
		*width = reply->width;
	if (height != NULL)
		*height = reply->height;
	if (depth != NULL)
		*depth = reply->depth;

	free(reply);
	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq 0x6863(%rip), %rbp      # 0xc3b8
movl (%rdi), %esi
movq %rbp, %rdi
callq 0x3380
movq %rbp, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3410
testq %rax, %rax
je 0x5bc6
testq %r13, %r13
je 0x5b7e
movzwl 0xc(%rax), %ecx
movw %cx, (%r13)
testq %r12, %r12
je 0x5b8c
movzwl 0xe(%rax), %ecx
movw %cx, (%r12)
testq %r15, %r15
je 0x5b99
movzwl 0x10(%rax), %ecx
movw %cx, (%r15)
testq %r14, %r14
je 0x5ba6
movzwl 0x12(%rax), %ecx
movw %cx, (%r14)
testq %rbx, %rbx
je 0x5bb0
movb 0x1(%rax), %cl
movb %cl, (%rbx)
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x32c0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: handle_wm_state
static void
handle_wm_state(struct client *client, xcb_atom_t state, unsigned int action)
{
	int16_t mon_x, mon_y;
	uint16_t mon_w, mon_h;

	get_monitor_size(client, &mon_x, &mon_y, &mon_w, &mon_h);

	if (state == ewmh->_NET_WM_STATE_FULLSCREEN) {
		if (action == XCB_EWMH_WM_STATE_ADD) {
			maximize_window(client, mon_x, mon_y, mon_w, mon_h);
		} else if (action == XCB_EWMH_WM_STATE_REMOVE && client->maxed) {
			reset_window(client);
			set_focused(client);
		} else if (action == XCB_EWMH_WM_STATE_TOGGLE) {
			if (client->maxed) {
				reset_window(client);
				set_focused(client);
			} else {
				maximize_window(client, mon_x, mon_y, mon_w, mon_h);
			}
		}
	} else if (state == ewmh->_NET_WM_STATE_MAXIMIZED_VERT) {
		if (action == XCB_EWMH_WM_STATE_ADD) {
			vmaximize_window(client, mon_y, mon_h);
		} else if (action == XCB_EWMH_WM_STATE_REMOVE) {
			if (client->vmaxed)
				reset_window(client);
		} else if (action == XCB_EWMH_WM_STATE_TOGGLE) {
			if (client->vmaxed)
				reset_window(client);
			else
				vmaximize_window(client, mon_y, mon_h);
		}
	} else if (state == ewmh->_NET_WM_STATE_MAXIMIZED_HORZ) {
		if (action == XCB_EWMH_WM_STATE_ADD) {
			hmaximize_window(client, mon_y, mon_h);
		} else if (action == XCB_EWMH_WM_STATE_REMOVE) {
			if (client->hmaxed)
				reset_window(client);
		} else if (action == XCB_EWMH_WM_STATE_TOGGLE) {
			if (client->hmaxed)
				reset_window(client);
			else
				hmaximize_window(client, mon_x, mon_w);
		}
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x5c0b
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x5c0b
movzwl 0x10(%rdi), %ecx
movzwl 0x12(%rdi), %eax
jmp 0x5c16
movq 0x6bc6(%rip), %rdi      # 0xc7d8
xorl %eax, %eax
xorl %ecx, %ecx
movzwl 0x14(%rdi), %r8d
movzwl 0x16(%rdi), %edi
movq 0x679a(%rip), %r9       # 0xc3c0
cmpl %esi, 0x128(%r9)
jne 0x5c42
testl %edx, %edx
je 0x5c9e
cmpl $0x2, %edx
je 0x5c81
cmpl $0x1, %edx
je 0x5c87
jmp 0x5cf4
cmpl %esi, 0x110(%r9)
jne 0x5c5e
testl %edx, %edx
je 0x5cc7
cmpl $0x2, %edx
je 0x5cb5
cmpl $0x1, %edx
je 0x5cbb
jmp 0x5cf4
cmpl %esi, 0x114(%r9)
jne 0x5cf4
testl %edx, %edx
je 0x5ce5
cmpl $0x2, %edx
je 0x5ccf
cmpl $0x1, %edx
jne 0x5cf4
movswl %ax, %esi
movzwl %di, %edx
jmp 0x5cdc
cmpb $0x1, 0x24(%rbx)
je 0x5ca4
movswl %cx, %esi
movswl %ax, %edx
movzwl %r8w, %ecx
movzwl %di, %r8d
movq %rbx, %rdi
popq %rbx
jmp 0x4ce2
cmpb $0x1, 0x24(%rbx)
jne 0x5cf4
movq %rbx, %rdi
callq 0x4dc9
movq %rbx, %rdi
popq %rbx
jmp 0x5936
cmpb $0x1, 0x26(%rbx)
je 0x5ceb
movswl %ax, %esi
movzwl %di, %edx
movq %rbx, %rdi
popq %rbx
jmp 0x5cf6
cmpb $0x1, 0x26(%rbx)
je 0x5ceb
jmp 0x5cf4
cmpb $0x1, 0x25(%rbx)
je 0x5ceb
movswl %cx, %esi
movzwl %r8w, %edx
movq %rbx, %rdi
popq %rbx
jmp 0x5d94
cmpb $0x1, 0x25(%rbx)
jne 0x5cf4
movq %rbx, %rdi
popq %rbx
jmp 0x4dc9
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: vmaximize_window
static void
vmaximize_window(struct client *client, int16_t mon_y, uint16_t mon_height)
{
	if (client == NULL)
		return;

	if (is_special(client))
		reset_window(client);

	if (client->geom.height != mon_height)
		client->orig_geom = client->geom;

	client->geom.y = mon_y + conf.gap_up;
	client->geom.height = mon_height - conf.gap_up - conf.gap_down - 2 * conf.border_width;

	teleport_window(client->window, client->geom.x, client->geom.y);
	resize_window_absolute(client->window, client->geom.width, client->geom.height);
	client->vmaxed = true;

	update_ewmh_wm_state(client);
	update_window_status(client);
}

// Assembly:
testq %rdi, %rdi
je 0x5d93
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
callq 0x4dab
testb %al, %al
je 0x5d1c
movq %rbx, %rdi
callq 0x4dc9
cmpw %r14w, 0xa(%rbx)
je 0x5d36
leaq 0x4(%rbx), %rax
movzwl 0x8(%rax), %ecx
movw %cx, 0x16(%rbx)
movq (%rax), %rax
movq %rax, 0xe(%rbx)
movsbl 0x6a68(%rip), %eax      # 0xc7a5
addl %eax, %ebp
movw %bp, 0x6(%rbx)
movsbl 0x6a5a(%rip), %ecx      # 0xc7a4
movsbl 0x6a4f(%rip), %edx      # 0xc7a0
addl %eax, %ecx
leal (%rcx,%rdx,2), %eax
subl %eax, %r14d
movw %r14w, 0xa(%rbx)
movl (%rbx), %edi
movswl 0x4(%rbx), %esi
movswl %bp, %edx
callq 0x4c44
movl (%rbx), %edi
movzwl 0x8(%rbx), %esi
movzwl 0xa(%rbx), %edx
callq 0x4c9e
movb $0x1, 0x26(%rbx)
movq %rbx, %rdi
callq 0x4f61
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4fb8
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: hmaximize_window
static void
hmaximize_window(struct client *client, int16_t mon_x, uint16_t mon_width)
{
	if (client == NULL)
		return;

	if (is_special(client))
		reset_window(client);

	if (client->geom.width != mon_width)
		client->orig_geom = client->geom;
	client->geom.x = mon_x + conf.gap_left;
	client->geom.width = mon_width - conf.gap_left - conf.gap_right - 2 * conf.border_width;

	teleport_window(client->window, client->geom.x, client->geom.y);
	resize_window_absolute(client->window, client->geom.width, client->geom.height);
	client->hmaxed = true;

	update_ewmh_wm_state(client);
	update_window_status(client);
}

// Assembly:
testq %rdi, %rdi
je 0x5e31
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
callq 0x4dab
testb %al, %al
je 0x5dba
movq %rbx, %rdi
callq 0x4dc9
cmpw %r14w, 0x8(%rbx)
je 0x5dd4
leaq 0x4(%rbx), %rax
movzwl 0x8(%rax), %ecx
movw %cx, 0x16(%rbx)
movq (%rax), %rax
movq %rax, 0xe(%rbx)
movsbl 0x69c8(%rip), %eax      # 0xc7a3
addl %eax, %ebp
movw %bp, 0x4(%rbx)
movsbl 0x69be(%rip), %ecx      # 0xc7a6
movsbl 0x69b1(%rip), %edx      # 0xc7a0
addl %eax, %ecx
leal (%rcx,%rdx,2), %eax
subl %eax, %r14d
movw %r14w, 0x8(%rbx)
movl (%rbx), %edi
movswl 0x6(%rbx), %edx
movswl %bp, %esi
callq 0x4c44
movl (%rbx), %edi
movzwl 0x8(%rbx), %esi
movzwl 0xa(%rbx), %edx
callq 0x4c9e
movb $0x1, 0x25(%rbx)
movq %rbx, %rdi
callq 0x4f61
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x4fb8
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: get_randr
static void
get_randr(void)
{
	int len;
	xcb_randr_get_screen_resources_current_cookie_t c
		= xcb_randr_get_screen_resources_current(conn, scr->root);
	xcb_randr_get_screen_resources_current_reply_t *r
		= xcb_randr_get_screen_resources_current_reply(conn, c, NULL);

	if (r == NULL)
		return;

	xcb_timestamp_t timestamp = r->config_timestamp;
	len = xcb_randr_get_screen_resources_current_outputs_length(r);
	xcb_randr_output_t *outputs
		= xcb_randr_get_screen_resources_current_outputs(r);

	/* Request information for all outputs */
	get_outputs(outputs, len, timestamp);
	free(r);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x657b(%rip), %rdi      # 0xc3b8
movq 0x6994(%rip), %rax      # 0xc7d8
movl (%rax), %esi
callq 0x3080
movq 0x6566(%rip), %rdi      # 0xc3b8
movl %eax, %esi
xorl %edx, %edx
callq 0x3350
testq %rax, %rax
je 0x5e92
movq %rax, %rbx
movl 0xc(%rax), %ebp
movq %rax, %rdi
callq 0x3340
movl %eax, %r14d
movq %rbx, %rdi
callq 0x3510
movq %rax, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x5e97
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x32c0
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: ipc_window_move
static void
ipc_window_move(uint32_t *d)
{
	int16_t x, y;

	if (focused_win == NULL)
		return;

	if (is_special(focused_win)) {
		reset_window(focused_win);
		set_focused(focused_win);
	}

	x = d[2];
	y = d[3];
	if (d[0])
		x = -x;
	if (d[1])
		y = -y;

	focused_win->geom.x += x;
	focused_win->geom.y += y;

	move_window(focused_win->window, x, y);
	center_pointer(focused_win);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq 0x6251(%rip), %rbx      # 0xc7e0
testq %rbx, %rbx
je 0x66a6
movq %rdi, %r14
movq %rbx, %rdi
callq 0x4dab
testb %al, %al
je 0x65c2
movq %rbx, %rdi
callq 0x4dc9
movq 0x622a(%rip), %rdi      # 0xc7e0
callq 0x5936
movq 0x621e(%rip), %rbx      # 0xc7e0
movq 0x8(%r14), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movq (%r14), %xmm2
pxor %xmm1, %xmm1
pcmpeqd %xmm1, %xmm2
packssdw %xmm2, %xmm2
psubw %xmm0, %xmm1
pand %xmm2, %xmm0
pandn %xmm1, %xmm2
por %xmm0, %xmm2
movd 0x4(%rbx), %xmm0
movdqa %xmm2, 0x10(%rsp)
paddw %xmm2, %xmm0
movd %xmm0, 0x4(%rbx)
movl (%rbx), %ebx
movl %ebx, 0x4(%rsp)
movq 0x5da9(%rip), %r14      # 0xc3b8
movq %r14, %rdi
movl %ebx, %esi
callq 0x34e0
movq %r14, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x32f0
testq %rax, %rax
je 0x669a
movb 0x1a(%rax), %bpl
movq %rax, %rdi
callq 0x32c0
cmpb $0x2, %bpl
jne 0x669a
movq 0x6195(%rip), %rax      # 0xc7d8
cmpl %ebx, (%rax)
je 0x669a
leaq 0x4(%rsp), %rdi
leaq 0xe(%rsp), %r14
leaq 0xc(%rsp), %r15
leaq 0xa(%rsp), %rcx
leaq 0x8(%rsp), %r8
movq %r14, %rsi
movq %r15, %rdx
xorl %r9d, %r9d
callq 0x5b34
movdqa 0x10(%rsp), %xmm0
movd %xmm0, %eax
addw (%r14), %ax
pextrw $0x1, %xmm0, %ecx
addw (%r15), %cx
movw %ax, (%r14)
movw %cx, (%r15)
movswl %ax, %esi
movswl %cx, %edx
movl %ebx, %edi
callq 0x4c44
movq 0x613f(%rip), %rdi      # 0xc7e0
callq 0x5a6c
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: ipc_window_move_absolute
static void
ipc_window_move_absolute(uint32_t *d)
{
	int16_t x, y;

	if (focused_win == NULL)
		return;

	if (is_special(focused_win)) {
		reset_window(focused_win);
		set_focused(focused_win);
	}

	x = d[2];
	y = d[3];

	if (d[0] == IPC_MUL_MINUS)
		x = -x;
	if (d[1] == IPC_MUL_MINUS)
		y = -y;

	focused_win->geom.x = x;
	focused_win->geom.y = y;

	teleport_window(focused_win->window, x, y);
	center_pointer(focused_win);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x6124(%rip), %rbx      # 0xc7e0
testq %rbx, %rbx
je 0x674d
movq %rdi, %r14
movq %rbx, %rdi
callq 0x4dab
testb %al, %al
je 0x66ef
movq %rbx, %rdi
callq 0x4dc9
movq 0x60fd(%rip), %rdi      # 0xc7e0
callq 0x5936
movq 0x60f1(%rip), %rbx      # 0xc7e0
movq 0x8(%r14), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movq (%r14), %xmm1
pcmpeqd 0x2919(%rip), %xmm1     # 0x9020
packssdw %xmm1, %xmm1
pxor %xmm2, %xmm2
psubw %xmm0, %xmm2
pand %xmm1, %xmm2
pandn %xmm0, %xmm1
por %xmm2, %xmm1
movd %xmm1, 0x4(%rbx)
movd %xmm1, %eax
movl (%rbx), %edi
pextrw $0x1, %xmm1, %ecx
movswl %ax, %esi
movswl %cx, %edx
callq 0x4c44
movq 0x609f(%rip), %rdi      # 0xc7e0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5a6c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: ipc_window_resize
static void
ipc_window_resize(uint32_t *d)
{
	int16_t w, h;

	if (focused_win == NULL)
		return;

	if (is_special(focused_win)) {
		reset_window(focused_win);
		set_focused(focused_win);
	}

	w = d[2];
	h = d[3];

	if (d[0] == IPC_MUL_MINUS)
		w = -w;
	if (d[1] == IPC_MUL_MINUS)
		h = -h;

	resize_window(focused_win->window, w, h);
	center_pointer(focused_win);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x6079(%rip), %r14      # 0xc7e0
testq %r14, %r14
je 0x687d
movq %rdi, %rbx
movq %r14, %rdi
callq 0x4dab
testb %al, %al
je 0x679a
movq %r14, %rdi
callq 0x4dc9
movq 0x6052(%rip), %rdi      # 0xc7e0
callq 0x5936
movq 0x6046(%rip), %r14      # 0xc7e0
movl 0x8(%rbx), %ebp
movl 0xc(%rbx), %r12d
movl (%rbx), %r15d
movl 0x4(%rbx), %r13d
movl (%r14), %ebx
leaq 0x4(%rsp), %rdi
movl %ebx, (%rdi)
callq 0x49ea
testq %rax, %rax
je 0x6867
movq %rax, %rcx
movl %r12d, %eax
negl %eax
cmpl $0x1, %r13d
cmovnel %r12d, %eax
movl %ebp, %edx
negl %edx
cmpl $0x1, %r15d
cmovnel %ebp, %edx
movzwl 0x8(%rcx), %esi
movzwl 0xa(%rcx), %edi
movswl %dx, %edx
addl %esi, %edx
testl %edx, %edx
cmovlel %esi, %edx
cwtl
addl %edi, %eax
testl %eax, %eax
cmovlel %edi, %eax
movzwl 0x48(%rcx), %edi
cmpl %edi, %edx
movl %edi, %esi
cmovgl %edx, %esi
testl %edi, %edi
cmovel %edx, %esi
movzwl 0x4a(%rcx), %edx
cmpl %edx, %eax
movl %edx, %r8d
cmovgl %eax, %r8d
testl %edx, %edx
cmovel %eax, %r8d
movzbl 0x5fa2(%rip), %edi      # 0xc7c1
movzwl 0x50(%rcx), %r9d
movl %esi, %eax
xorl %edx, %edx
divl %r9d
imull %edi, %edx
subl %edx, %esi
movw %si, 0x8(%rcx)
movzwl 0x52(%rcx), %r9d
movl %r8d, %eax
xorl %edx, %edx
divl %r9d
imull %edi, %edx
subl %edx, %r8d
movw %r8w, 0xa(%rcx)
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %esi
andl %eax, %r8d
movl %ebx, %edi
movl %r8d, %edx
callq 0x4c9e
movq 0x5f79(%rip), %r14      # 0xc7e0
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x5a6c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: ipc_window_resize_absolute
static void
ipc_window_resize_absolute(uint32_t *d)
{
	int16_t w, h;

	if (focused_win == NULL)
		return;

	if (is_special(focused_win)) {
		reset_window(focused_win);
		set_focused(focused_win);
	}

	w = d[0];
	h = d[1];

	if (focused_win->min_width != 0 && w < focused_win->min_width)
		w = focused_win->min_width;

	if (focused_win->min_height != 0 && h < focused_win->min_height)
		h = focused_win->min_height;

	focused_win->geom.width = w;
	focused_win->geom.height = h;

	resize_window_absolute(focused_win->window, w, h);
	center_pointer(focused_win);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x5f49(%rip), %rbx      # 0xc7e0
testq %rbx, %rbx
je 0x6940
movq %rdi, %r14
movq %rbx, %rdi
callq 0x4dab
testb %al, %al
je 0x68ca
movq %rbx, %rdi
callq 0x4dc9
movq 0x5f22(%rip), %rdi      # 0xc7e0
callq 0x5936
movq 0x5f16(%rip), %rbx      # 0xc7e0
movq (%r14), %xmm0
pshuflw $0xe8, %xmm0, %xmm1     # xmm1 = xmm0[0,2,2,3,4,5,6,7]
movq 0x48(%rbx), %xmm2
pxor %xmm3, %xmm3
movdqa %xmm2, %xmm4
pcmpeqw %xmm3, %xmm4
movdqa %xmm2, %xmm5
punpcklwd %xmm3, %xmm5    # xmm5 = xmm5[0],xmm3[0],xmm5[1],xmm3[1],xmm5[2],xmm3[2],xmm5[3],xmm3[3]
pslld $0x10, %xmm0
psrad $0x10, %xmm0
pcmpgtd %xmm0, %xmm5
packssdw %xmm5, %xmm5
pand %xmm5, %xmm2
pandn %xmm1, %xmm5
por %xmm2, %xmm5
pand %xmm4, %xmm1
pandn %xmm5, %xmm4
por %xmm1, %xmm4
movd %xmm4, 0x8(%rbx)
movl (%rbx), %edi
pextrw $0x0, %xmm4, %esi
pextrw $0x1, %xmm4, %edx
callq 0x4c9e
movq 0x5eac(%rip), %rdi      # 0xc7e0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5a6c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: ipc_window_maximize
static void
ipc_window_maximize(uint32_t *d)
{
	(void)(d);
	int16_t mon_x, mon_y;
	uint16_t mon_w, mon_h;

	if (focused_win == NULL)
		return;

	if (focused_win->maxed) {
		reset_window(focused_win);
	} else {
		get_monitor_size(focused_win, &mon_x, &mon_y, &mon_w, &mon_h);
		maximize_window(focused_win, mon_x, mon_y, mon_w, mon_h);
	}

	set_focused(focused_win);

	xcb_flush(conn);
}

// Assembly:
movq 0x5e91(%rip), %rdi      # 0xc7e0
testq %rdi, %rdi
je 0x6962
pushq %rax
cmpb $0x1, 0x24(%rdi)
jne 0x6963
callq 0x4dc9
jmp 0x6995
retq
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x6976
movzwl 0x10(%rax), %esi
movzwl 0x12(%rax), %edx
jmp 0x6981
movq 0x5e5b(%rip), %rax      # 0xc7d8
xorl %edx, %edx
xorl %esi, %esi
movzwl 0x14(%rax), %ecx
movzwl 0x16(%rax), %r8d
movswl %si, %esi
movswl %dx, %edx
callq 0x4ce2
movq 0x5e44(%rip), %rdi      # 0xc7e0
callq 0x5936
movq 0x5a10(%rip), %rdi      # 0xc3b8
popq %rax
jmp 0x33f0
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: ipc_window_unmaximize
static void
ipc_window_unmaximize(uint32_t *d)
{
	(void)(d);

	if (focused_win == NULL)
		return;

	if (is_special(focused_win)) {
		reset_window(focused_win);
		set_focused(focused_win);
	}

	xcb_flush(conn);
}

// Assembly:
pushq %rbx
movq 0x5e2a(%rip), %rbx      # 0xc7e0
testq %rbx, %rbx
je 0x69e8
movq %rbx, %rdi
callq 0x4dab
testb %al, %al
je 0x69db
movq %rbx, %rdi
callq 0x4dc9
movq 0x5e0a(%rip), %rdi      # 0xc7e0
callq 0x5936
movq 0x59d6(%rip), %rdi      # 0xc3b8
popq %rbx
jmp 0x33f0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: ipc_window_hor_maximize
static void
ipc_window_hor_maximize(uint32_t *d)
{
	(void)(d);
	int16_t mon_x, mon_y;
	uint16_t mon_w;

	if (focused_win == NULL)
		return;

	if (focused_win->hmaxed) {
		reset_window(focused_win);
	} else {
		get_monitor_size(focused_win, &mon_x, &mon_y, &mon_w, NULL);
		hmaximize_window(focused_win, mon_x, mon_w);
	}

	set_focused(focused_win);

	xcb_flush(conn);
}

// Assembly:
movq 0x5def(%rip), %rdi      # 0xc7e0
testq %rdi, %rdi
je 0x6a04
pushq %rax
cmpb $0x1, 0x25(%rdi)
jne 0x6a05
callq 0x4dc9
jmp 0x6a29
retq
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x6a14
movzwl 0x10(%rax), %ecx
jmp 0x6a1d
movq 0x5dbd(%rip), %rax      # 0xc7d8
xorl %ecx, %ecx
movzwl 0x14(%rax), %edx
movswl %cx, %esi
callq 0x5d94
movq 0x5db0(%rip), %rdi      # 0xc7e0
callq 0x5936
movq 0x597c(%rip), %rdi      # 0xc3b8
popq %rax
jmp 0x33f0
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: ipc_window_ver_maximize
static void
ipc_window_ver_maximize(uint32_t *d)
{
	(void)(d);
	int16_t mon_x, mon_y;
	uint16_t mon_h;

	if (focused_win == NULL)
		return;

	if (focused_win->vmaxed) {
		reset_window(focused_win);
	} else {
		get_monitor_size(focused_win, &mon_x, &mon_y, NULL, &mon_h);
		vmaximize_window(focused_win, mon_y, mon_h);
	}

	set_focused(focused_win);

	xcb_flush(conn);
}

// Assembly:
movq 0x5d97(%rip), %rdi      # 0xc7e0
testq %rdi, %rdi
je 0x6a5c
pushq %rax
cmpb $0x1, 0x26(%rdi)
jne 0x6a5d
callq 0x4dc9
jmp 0x6a81
retq
movq 0x40(%rdi), %rax
testq %rax, %rax
je 0x6a6c
movzwl 0x12(%rax), %ecx
jmp 0x6a75
movq 0x5d65(%rip), %rax      # 0xc7d8
xorl %ecx, %ecx
movzwl 0x16(%rax), %edx
movswl %cx, %esi
callq 0x5cf6
movq 0x5d58(%rip), %rdi      # 0xc7e0
callq 0x5936
movq 0x5924(%rip), %rdi      # 0xc3b8
popq %rax
jmp 0x33f0
// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: ipc_window_monocle
static void
ipc_window_monocle(uint32_t *d)
{
	(void)(d);
	int16_t mon_x, mon_y;
	uint16_t mon_w, mon_h;

	if (focused_win == NULL)
		return;

	if (focused_win->monocled) {
		reset_window(focused_win);
	} else {
		get_monitor_size(focused_win, &mon_x, &mon_y, &mon_w, &mon_h);
		monocle_window(focused_win, mon_x, mon_y, mon_w, mon_h);
	}

	set_focused(focused_win);

	xcb_flush(conn);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq 0x5d37(%rip), %rbx      # 0xc7e0
testq %rbx, %rbx
je 0x6ac1
cmpb $0x1, 0x27(%rbx)
jne 0x6aca
movq %rbx, %rdi
callq 0x4dc9
jmp 0x6b9e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x40(%rbx), %rax
testq %rax, %rax
je 0x6ade
movzwl 0x10(%rax), %r14d
movzwl 0x12(%rax), %ebp
jmp 0x6aea
movq 0x5cf3(%rip), %rax      # 0xc7d8
xorl %ebp, %ebp
xorl %r14d, %r14d
movzwl 0x14(%rax), %r12d
movzwl 0x16(%rax), %r15d
movq %rbx, %rdi
callq 0x4dab
testb %al, %al
je 0x6b08
movq %rbx, %rdi
callq 0x4dc9
movzwl 0xc(%rbx), %eax
movw %ax, 0x16(%rbx)
movq 0x4(%rbx), %rax
movq %rax, 0xe(%rbx)
movsbl 0x5c84(%rip), %eax      # 0xc7a3
addl %eax, %r14d
movw %r14w, 0x4(%rbx)
movsbl 0x5c77(%rip), %ecx      # 0xc7a5
addl %ecx, %ebp
movw %bp, 0x6(%rbx)
movsbl 0x5c65(%rip), %edx      # 0xc7a0
addl %edx, %edx
movsbl 0x5c62(%rip), %esi      # 0xc7a6
subl %edx, %r12d
addl %eax, %esi
subl %esi, %r12d
movw %r12w, 0x8(%rbx)
movsbl 0x5c4c(%rip), %eax      # 0xc7a4
subl %edx, %r15d
addl %ecx, %eax
subl %eax, %r15d
movw %r15w, 0xa(%rbx)
movl (%rbx), %edi
movswl %r14w, %esi
movswl %bp, %edx
callq 0x4c44
movl (%rbx), %edi
movzwl 0x8(%rbx), %esi
movzwl 0xa(%rbx), %edx
callq 0x4c9e
movb $0x1, 0x27(%rbx)
movq %rbx, %rdi
callq 0x4e56
movq %rbx, %rdi
callq 0x4f61
movq %rbx, %rdi
callq 0x4fb8
movq 0x5c3b(%rip), %rdi      # 0xc7e0
callq 0x5936
movq 0x5807(%rip), %rdi      # 0xc3b8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x33f0