LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: enter_notify
void enter_notify(xcb_generic_event_t *ev) {
	xcb_enter_notify_event_t *e = (xcb_enter_notify_event_t *)ev;

	window *found = search_ws(curws, TYPE_NORMAL, WIN_PARENT, e->event);
	if (state != RESIZE && found && found->normal && found != stack[curws].fwin && state != MOVE) {
		focus(found);
		return;
	}
	
	search_data data = search_range(curws, TYPE_NORMAL, WIN_COUNT, REGION_COUNT, e->event);
	if (data.win) {
		draw_region(data.win, data.index, PM_HOVER);
		return;
	}

	margin_enter_handler(ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0xa1a7(%rip), %r14      # 0xda70
movl (%r14), %edi
movl 0xc(%rbx), %ecx
movl $0x1, %esi
movl $0x1, %edx
callq 0x6b29
movl 0x9b60(%rip), %ecx      # 0xd444
cmpl $0x2, %ecx
setne %dl
testq %rax, %rax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x392d
cmpl $0x0, 0xc0(%rax)
je 0x392d
cmpl $0x1, %ecx
je 0x392d
movslq (%r14), %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
leaq 0xa016(%rip), %rdx      # 0xd930
cmpq 0x48(%rdx,%rcx), %rax
je 0x392d
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x514d
movl (%r14), %edi
movl 0xc(%rbx), %r8d
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %ecx
callq 0x6a77
testq %rax, %rax
je 0x3960
movq %rax, %rdi
movl %edx, %esi
movl $0x1, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x58d9
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x87f1
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: leave_notify
void leave_notify(xcb_generic_event_t *ev) {
	xcb_leave_notify_event_t *e = (xcb_leave_notify_event_t *)ev;

	//printf("left %d, mode: %d, detail: %d, state: %d\n", e->event, e->mode, e->detail, e->state);

	search_data data = search_range(curws, TYPE_NORMAL, WIN_COUNT, REGION_COUNT, e->event);
	if (data.win && e->mode == XCB_NOTIFY_MODE_NORMAL) {
		if (state == PRESS) {
			region_abort();
		}

		draw_region(data.win, data.index, PM_FOCUS);

		return;
	}

	margin_leave_handler(ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0xa0f0(%rip), %rax      # 0xda70
movl (%rax), %edi
movl 0xc(%r15), %r8d
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %ecx
callq 0x6a77
testq %rax, %rax
je 0x39a6
cmpb $0x0, 0x1e(%r15)
je 0x39b8
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x882d
movq %rax, %rbx
movl %edx, %r14d
cmpl $0x4, 0x9a7f(%rip)      # 0xd444
jne 0x39ce
xorl %eax, %eax
callq 0x71e1
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x58d9
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: die
void die() {
	//no need to preserve stack, could refactor forget_client
	for (int i = 0; i < NUM_WS; i++) {
		for (int j = 0; j < stack[i].lists[TYPE_ALL].count; j++) {
			forget_client(stack[i].lists[TYPE_ALL].last, i);
		}
	}

	xcb_ungrab_key(conn, XCB_GRAB_ANY, scr->root, XCB_MOD_MASK_ANY);
	xcb_key_symbols_free(keysyms);

	cursor_clean();

	for (int i = 0; i < LEN(controls); i++) {
		for (int j = 0; j < PM_COUNT; j++) {
			xcb_free_pixmap(conn, pixmaps[i][j]);
		}
	}
	
	for (int i = 0; i < LEN(fonts); i++) {
		XftFontClose(dpy, xfts[i]);
	}
	
	xcb_flush(conn);

	xcb_disconnect(conn);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
xorl %ebx, %ebx
leaq 0x9f37(%rip), %r14      # 0xd930
leaq (%rbx,%rbx,4), %r15
shlq $0x4, %r15
cmpl $0x0, 0x10(%r14,%r15)
jle 0x3a23
addq %r14, %r15
xorl %r12d, %r12d
movq 0x8(%r15), %rdi
movl %ebx, %esi
callq 0x5781
incl %r12d
cmpl 0x10(%r15), %r12d
jl 0x3a0f
incq %rbx
cmpq $0x4, %rbx
jne 0x39f9
movq 0x9a15(%rip), %rdi      # 0xd448
movq 0x9a16(%rip), %rax      # 0xd450
movl (%rax), %edx
xorl %ebx, %ebx
xorl %esi, %esi
movl $0x8000, %ecx           # imm = 0x8000
callq 0x33e0
movq 0x9a1f(%rip), %rdi      # 0xd470
callq 0x33f0
callq 0x5afa
leaq 0x9a1e(%rip), %r14      # 0xd480
xorl %r15d, %r15d
movq 0x99dc(%rip), %rdi      # 0xd448
movl (%r14,%r15,4), %esi
callq 0x34e0
incq %r15
cmpq $0x4, %r15
jne 0x3a65
leaq 0x1(%rbx), %rax
addq $0x10, %r14
testq %rbx, %rbx
movq %rax, %rbx
je 0x3a62
movq 0x9a0b(%rip), %rdi      # 0xd4a0
movq 0x9a0c(%rip), %rsi      # 0xd4a8
callq 0x30e0
movq 0x99a0(%rip), %rdi      # 0xd448
callq 0x3360
movq 0x9994(%rip), %rdi      # 0xd448
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3580
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: get_atoms
static void get_atoms(const char **names, xcb_atom_t *atoms, unsigned int count) {
	xcb_intern_atom_cookie_t cookies[count];
	for (int i = 0; i < count; i++) {
		cookies[i] = xcb_intern_atom(conn, 0, strlen(names[i]), names[i]);
	}
	for (int i = 0; i < count; i++) {
		xcb_intern_atom_reply_t *reply = xcb_intern_atom_reply(conn, cookies[i], NULL);
		if (reply) {
			atoms[i] = reply->atom;
			free(reply);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r12d
movq %rsp, %rbx
leaq 0xf(,%r12,4), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
testl %edx, %edx
je 0x434c
movq %rdi, %r13
movq %rsi, -0x30(%rbp)
xorl %r14d, %r14d
movq %rbx, -0x38(%rbp)
movq 0x9164(%rip), %r15      # 0xd448
movq %r12, %rbx
movq (%r13,%r14,8), %r12
movq %r12, %rdi
callq 0x3290
movzwl %ax, %edx
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rcx
movq %rbx, %r12
movq -0x38(%rbp), %rbx
callq 0x3130
movl %eax, (%rbx,%r14,4)
incq %r14
cmpq %r14, %r12
jne 0x42dd
xorl %r14d, %r14d
movq -0x30(%rbp), %r15
movq 0x9123(%rip), %rdi      # 0xd448
movl (%rbx,%r14,4), %esi
xorl %edx, %edx
callq 0x3370
testq %rax, %rax
je 0x4344
movl 0x8(%rax), %ecx
movl %ecx, (%r15,%r14,4)
movq %rax, %rdi
callq 0x3280
incq %r14
cmpq %r14, %r12
jne 0x431e
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: client_message
static void client_message(xcb_generic_event_t *ev) {
	xcb_client_message_event_t *e = (xcb_client_message_event_t *)ev;

	window *found = search_all(NULL, TYPE_ALL, WIN_CHILD, e->window);

	if (!found || !found->normal || e->type != ewmh->_NET_WM_STATE) {
		return;
	}	

	for (int i = 1; i < 3; i++) {
		if ((xcb_atom_t)e->data.data32[i] == ewmh->_NET_WM_STATE_FULLSCREEN) {
			switch (2 * e->data.data32[0] + found->is_e_full) {
				case 2 * XCB_EWMH_WM_STATE_ADD:
					ext_full(found);
					break;
				case 2 * XCB_EWMH_WM_STATE_REMOVE + 1:
					ext_full(found);
					break;
				case 2 * XCB_EWMH_WM_STATE_TOGGLE:
					/* fallthrough */
				case 2 * XCB_EWMH_WM_STATE_TOGGLE + 1:
					ext_full(found);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rdi), %ecx
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6b71
testq %rax, %rax
je 0x46b6
movq %rax, %r14
cmpl $0x0, 0xc0(%rax)
je 0x46b6
movl 0x8(%rbx), %eax
movq 0x8def(%rip), %rcx      # 0xd458
cmpl 0x84(%rcx), %eax
jne 0x46b6
xorl %r15d, %r15d
movl $0x36, %r12d
movl 0x10(%rbx,%r15,4), %eax
movq 0x8dd2(%rip), %rcx      # 0xd458
cmpl 0x128(%rcx), %eax
jne 0x46ad
movl 0xc(%rbx), %eax
addl %eax, %eax
addl 0x190(%r14), %eax
cmpl $0x5, %eax
ja 0x46ad
btl %eax, %r12d
jae 0x46ad
movq %r14, %rdi
callq 0x56d1
incq %r15
cmpq $0x2, %r15
jne 0x467a
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: key_press
static void key_press(xcb_generic_event_t *ev) {
	xcb_key_press_event_t *e = (xcb_key_press_event_t *)ev;
	xcb_keysym_t keysym = xcb_key_symbols_get_keysym(keysyms, e->detail, 0);

	if (keysym != XK_Tab && state == SELECT_WINDOW) {
		select_window_terminate();
	}

	for (int i = 0; i < LEN(keys); i++) {
		if (keysym == keys[i].key && keys[i].mod == e->state) {
			keys[i].function(keys[i].arg);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8c3f(%rip), %rdi      # 0xd470
movzbl 0x1(%rbx), %esi
xorl %edx, %edx
callq 0x31c0
movl %eax, %r14d
cmpl $0xff09, %eax           # imm = 0xFF09
je 0x4854
cmpl $0x3, 0x8bf7(%rip)      # 0xd444
jne 0x4854
callq 0x6cf0
movl $0x10, %eax
leaq 0x8280(%rip), %rcx      # 0xcae0
cmpl -0xc(%rax,%rcx), %r14d
jne 0x4872
movzwl -0x10(%rax,%rcx), %edx
cmpw 0x1c(%rbx), %dx
je 0x4883
addq $0x18, %rax
cmpq $0x190, %rax            # imm = 0x190
jne 0x4860
popq %rbx
popq %r14
popq %rbp
retq
movq (%rax,%rcx), %rdi
popq %rbx
popq %r14
popq %rbp
jmpq *-0x8(%rax,%rcx)
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: key_release
static void key_release(xcb_generic_event_t *ev) {
	xcb_key_release_event_t *e = (xcb_key_release_event_t *)ev;
	xcb_keysym_t keysym = xcb_key_symbols_get_keysym(keysyms, e->detail, 0);
	
	if (keysym == XK_Super_L && state == SELECT_WINDOW) {
		select_window_terminate();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8bd6(%rip), %rax      # 0xd470
movzbl 0x1(%rdi), %esi
movq %rax, %rdi
xorl %edx, %edx
callq 0x31c0
cmpl $0xffeb, %eax           # imm = 0xFFEB
jne 0x48be
cmpl $0x3, 0x8b8e(%rip)      # 0xd444
jne 0x48be
popq %rbp
jmp 0x6cf0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: unmap_notify
static void unmap_notify(xcb_generic_event_t *ev) {
	xcb_unmap_notify_event_t *e = (xcb_unmap_notify_event_t *)ev;

	window *found = search_ws(curws, TYPE_ALL, WIN_CHILD, e->window);
	if (!found) {
		return;
	}
	
	if (found->ignore_unmap) {
		found->ignore_unmap = 0;
		return;
	}

	forget_client(found, curws);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x9172(%rip), %rbx      # 0xda70
movl (%rbx), %eax
movl 0x8(%rdi), %ecx
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6b29
testq %rax, %rax
je 0x4926
cmpl $0x0, 0x194(%rax)
je 0x492d
movl $0x0, 0x194(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl (%rbx), %esi
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5781
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: destroy_notify
static void destroy_notify(xcb_generic_event_t *ev) {
	xcb_destroy_notify_event_t *e = (xcb_destroy_notify_event_t *)ev;

	int ws;
	window *found = search_all(&ws, TYPE_ALL, WIN_CHILD, e->window);
	
	if (found) {
		forget_client(found, ws);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl 0x8(%rdi), %ecx
leaq -0x4(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6b71
testq %rax, %rax
je 0x4965
movl -0x4(%rbp), %esi
movq %rax, %rdi
callq 0x5781
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: expose
static void expose(xcb_generic_event_t *ev) {
	xcb_expose_event_t *e = (xcb_expose_event_t *)ev;

	search_data data = search_range(curws, TYPE_NORMAL, WIN_COUNT, REGION_COUNT, e->window);
	if (!data.win) {
		return;
	}

	draw_region(data.win, data.index, data.win->last_pm[data.index - WIN_COUNT]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x90d0(%rip), %rax      # 0xda70
movl (%rax), %eax
movl 0x4(%rdi), %r8d
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %ecx
callq 0x6a77
testq %rax, %rax
je 0x49d8
movslq %edx, %rcx
movl 0xd4(%rax,%rcx,4), %ecx
movq %rax, %rdi
movl %edx, %esi
movl %ecx, %edx
popq %rbp
jmp 0x58d9
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: grab_keys
static void grab_keys() {
	xcb_key_symbols_free(keysyms);

	keysyms = xcb_key_symbols_alloc(conn);

	for (int i = 0; i < LEN(keys); i++) {
		xcb_keycode_t *keycode = xcb_key_symbols_get_keycode(keysyms, keys[i].key);
		xcb_grab_key(conn, 0, scr->root, keys[i].mod, *keycode, XCB_GRAB_MODE_ASYNC,
				XCB_GRAB_MODE_ASYNC);
		free(keycode);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq 0x8a74(%rip), %rdi      # 0xd470
callq 0x33f0
movq 0x8a40(%rip), %rdi      # 0xd448
callq 0x3300
movq %rax, 0x8a5c(%rip)      # 0xd470
movl $0x4, %r14d
leaq 0x80bf(%rip), %r15      # 0xcae0
movq 0x8a48(%rip), %rdi      # 0xd470
movl (%r14,%r15), %esi
callq 0x3040
movq %rax, %rbx
movq 0x8a0d(%rip), %rdi      # 0xd448
movq 0x8a0e(%rip), %rax      # 0xd450
movl (%rax), %edx
movzwl -0x4(%r14,%r15), %ecx
movzbl (%rbx), %r8d
movl $0x1, (%rsp)
xorl %esi, %esi
movl $0x1, %r9d
callq 0x3470
movq %rbx, %rdi
callq 0x3280
addq $0x18, %r14
cmpq $0x184, %r14            # imm = 0x184
jne 0x4a21
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: button_press_helper
static int button_press_helper(xcb_button_press_event_t *e, int len, const button list[],
		xcb_window_t win, uint32_t x, uint32_t y) {

	for (int i = 0; i < len; i++) {
		if (e->detail == list[i].button && list[i].mod == e->state) {
			if (list[i].press) {
				list[i].press(&(press_arg){ win, x, y });
			}
			return 1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
testl %esi, %esi
setg %bl
jle 0x4aef
movzbl 0x1(%rdi), %eax
movl %esi, %esi
addq $0x8, %rdx
movq %rsi, %r10
negq %r10
movl $0x1, %r11d
cmpl %eax, -0x4(%rdx)
jne 0x4abb
movzwl -0x8(%rdx), %r14d
cmpw 0x1c(%rdi), %r14w
je 0x4ad7
cmpq %rsi, %r11
setb %bl
addq $0x10, %rdx
leaq (%r10,%r11), %r14
incq %r14
incq %r11
cmpq $0x1, %r14
jne 0x4aaa
jmp 0x4aef
movq (%rdx), %rax
testq %rax, %rax
je 0x4aef
leaq -0x1c(%rbp), %rdi
movl %ecx, (%rdi)
movl %r8d, 0x4(%rdi)
movl %r9d, 0x8(%rdi)
callq *%rax
movzbl %bl, %eax
andl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/rounded.c
// Function: init_rounded_corners
void init_rounded_corners() {
	int last_res;
	int yoff = 0;
	int res = -1;
	for (float y = 0; y < 2 * RAD; y++) {
		last_res = res;
		float center_y = RAD - 1 - y + .5;
		res = round(sqrt(RAD * RAD - center_y * center_y));
	
		if (RAD - res == 0) {
			yoff = y + 1;
		}

		if (res == last_res) {
			rect_mask[rect_count].height++;
		} else {
			rect_count++;
			rect_mask[rect_count].height = 1;
			rect_mask[rect_count].x = RAD - res;
			rect_mask[rect_count].y = y - yoff;
		} 
	}

	rect_count++;

	corner_height = yoff - rect_mask[rect_count / 2].height;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
xorps %xmm3, %xmm3
xorl %ebx, %ebx
movss 0x45f3(%rip), %xmm2     # 0x9110
movss 0x45f3(%rip), %xmm1     # 0x9118
leaq 0x8da4(%rip), %r14      # 0xd8d0
movaps %xmm2, %xmm0
movss %xmm3, -0x1c(%rbp)
subss %xmm3, %xmm0
addss 0x45d4(%rip), %xmm0     # 0x9114
mulss %xmm0, %xmm0
subss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
ucomisd 0x45c9(%rip), %xmm0     # 0x9120
jb 0x4b5f
sqrtsd %xmm0, %xmm0
jmp 0x4b64
callq 0x3600
callq 0x3590
cvttsd2si %xmm0, %eax
movss -0x1c(%rbp), %xmm3
movaps %xmm3, %xmm0
movss 0x4593(%rip), %xmm2     # 0x9110
addss %xmm2, %xmm0
cmpl $0x2, %eax
jne 0x4b8a
cvttss2si %xmm0, %ebx
movslq 0x87b7(%rip), %rcx      # 0xd348
cmpl %eax, %r15d
jne 0x4b9e
incw 0x6(%r14,%rcx,8)
jmp 0x4bd1
leal 0x1(%rcx), %edx
movl %edx, 0x87a1(%rip)      # 0xd348
movw $0x1, 0xe(%r14,%rcx,8)
movl $0x2, %edx
subl %eax, %edx
movw %dx, 0x8(%r14,%rcx,8)
xorps %xmm1, %xmm1
cvtsi2ss %ebx, %xmm1
subss %xmm1, %xmm3
cvttss2si %xmm3, %edx
movw %dx, 0xa(%r14,%rcx,8)
movss 0x453f(%rip), %xmm1     # 0x9118
ucomiss %xmm0, %xmm1
movaps %xmm0, %xmm3
movl %eax, %r15d
ja 0x4b2c
movl 0x875a(%rip), %eax      # 0xd348
leal 0x1(%rax), %ecx
movl %ecx, 0x8751(%rip)      # 0xd348
shrl $0x1f, %ecx
addl %ecx, %eax
incl %eax
sarl %eax
cltq
movzwl 0x6(%r14,%rax,8), %eax
subl %eax, %ebx
movl %ebx, 0x8ce0(%rip)      # 0xd8f0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/rounded.c
// Function: rounded_corners
void rounded_corners(window *win) {
	int w = win->geom[GEOM_W];
	int h = win->geom[GEOM_H];

	xcb_rectangle_t win_rects[2 * RAD + 1];

	int half_rect_count = rect_count / 2;

	int i = 0;
	for (; i < half_rect_count; i++) {
		win_rects[i].x = rect_mask[i].x;
		win_rects[i].y = rect_mask[i].y;
		win_rects[i].width = w - 2 * rect_mask[i].x;
		win_rects[i].height = rect_mask[i].height;
	}

	win_rects[i].x = 0;
	win_rects[i].y = corner_height;
	win_rects[i].width = w;
	win_rects[i].height = h - 2 * corner_height;
	
	i++;

	for (; i < rect_count; i++) {
		win_rects[i].x = rect_mask[i].x;
		win_rects[i].y = h - corner_height + rect_mask[i].y;
		win_rects[i].width = w - 2 * rect_mask[i].x;
		win_rects[i].height = rect_mask[i].height;
	}

	xcb_shape_rectangles(conn, XCB_SHAPE_SO_SET, XCB_SHAPE_SK_BOUNDING,
			XCB_CLIP_ORDERING_Y_SORTED, win->windows[WIN_PARENT], 0, 0, rect_count,
			win_rects);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl 0x110(%rdi), %eax
movl 0x114(%rdi), %ecx
movl 0x8712(%rip), %r10d     # 0xd348
xorl %edx, %edx
cmpl $0x2, %r10d
jl 0x4c85
movl %r10d, %esi
shrl %esi
xorl %edx, %edx
leaq 0x8c84(%rip), %r8       # 0xd8d0
movl (%r8,%rdx,8), %r9d
movw %r9w, -0x30(%rbp,%rdx,8)
movzwl 0x2(%r8,%rdx,8), %r11d
movw %r11w, -0x2e(%rbp,%rdx,8)
addl %r9d, %r9d
movl %eax, %r11d
subl %r9d, %r11d
movw %r11w, -0x2c(%rbp,%rdx,8)
movzwl 0x6(%r8,%rdx,8), %r9d
movw %r9w, -0x2a(%rbp,%rdx,8)
incq %rdx
cmpq %rdx, %rsi
jne 0x4c4c
movl %edx, %esi
movw $0x0, -0x30(%rbp,%rsi,8)
movl 0x8c5b(%rip), %r8d      # 0xd8f0
movw %r8w, -0x2e(%rbp,%rsi,8)
movw %ax, -0x2c(%rbp,%rsi,8)
movl %ecx, %r11d
subl %r8d, %r11d
subl %r8d, %r11d
movw %r11w, -0x2a(%rbp,%rsi,8)
incl %edx
cmpl %r10d, %edx
jge 0x4d02
subl %r8d, %ecx
leaq -0x1(%r10), %rdx
leaq 0x8c0c(%rip), %r8       # 0xd8d0
movl 0x8(%r8,%rsi,8), %r9d
movw %r9w, -0x28(%rbp,%rsi,8)
movzwl 0xa(%r8,%rsi,8), %r11d
addw %cx, %r11w
movw %r11w, -0x26(%rbp,%rsi,8)
addl %r9d, %r9d
movl %eax, %r11d
subl %r9d, %r11d
movw %r11w, -0x24(%rbp,%rsi,8)
movzwl 0xe(%r8,%rsi,8), %r9d
movw %r9w, -0x22(%rbp,%rsi,8)
incq %rsi
cmpq %rsi, %rdx
jne 0x4cc4
leaq 0x873f(%rip), %rax      # 0xd448
movq (%rax), %rax
movl 0xd0(%rdi), %r8d
subq $0x8, %rsp
leaq -0x30(%rbp), %r11
movq %rax, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
xorl %r9d, %r9d
pushq %r11
pushq %r10
pushq $0x0
callq 0x3260
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: unfocus
void unfocus(window *win) {
	uint32_t val = UNFOCUSCOL;
	xcb_change_window_attributes(conn, win->windows[WIN_PARENT], XCB_CW_BACK_PIXEL, &val);
	
	xcb_clear_area(conn, 0, win->windows[WIN_PARENT], 0, 0, win->geom[GEOM_W],
			win->geom[GEOM_H]);

	xcb_set_input_focus(conn, XCB_INPUT_FOCUS_NONE, win->windows[WIN_CHILD],
			XCB_CURRENT_TIME);

	draw_regions(win, PM_UNFOCUS);
	
	ewmh_state(win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq -0x1c(%rbp), %rcx
movl $0xff302e2f, (%rcx)     # imm = 0xFF302E2F
leaq 0x8446(%rip), %r15      # 0xd448
movq (%r15), %rdi
movl 0xd0(%rbx), %esi
movl $0x2, %r14d
movl $0x2, %edx
callq 0x33b0
movq (%r15), %rdi
movl 0xd0(%rbx), %edx
movzwl 0x110(%rbx), %r9d
movzwl 0x114(%rbx), %eax
movl %eax, (%rsp)
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x33a0
movq (%r15), %rdi
movl 0xcc(%rbx), %edx
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x3150
movq %rbx, %rdi
movl %r14d, %esi
movl $0x3, %edx
callq 0x58d9
incl %r14d
cmpl $0x4, %r14d
jne 0x5054
movq %rbx, %rdi
callq 0x5080
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: ewmh_state
void ewmh_state(window *win) {
	xcb_atom_t atoms[5];
	int i = 0;

	if (win == stack[curws].fwin) {
		atoms[i++] = ewmh__NET_WM_STATE_FOCUSED;
	}
	if (win->is_i_full || win->is_e_full) {
		atoms[i++] = ewmh->_NET_WM_STATE_FULLSCREEN;
	}
	if (win->ignore_unmap) {
		atoms[i++] = ewmh->_NET_WM_STATE_HIDDEN;
	}

	if (i) {
		xcb_ewmh_set_wm_state(ewmh, win->windows[WIN_CHILD], i, atoms);
	} else {
		xcb_delete_property(conn, win->windows[WIN_CHILD], ewmh->_NET_WM_STATE);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x89e1(%rip), %rax      # 0xda70
movslq (%rax), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x888f(%rip), %rcx      # 0xd930
xorl %edx, %edx
cmpq %rdi, 0x48(%rcx,%rax)
jne 0x50bb
leaq 0x8413(%rip), %rax      # 0xd4c4
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl $0x1, %edx
cmpl $0x0, 0x18c(%rdi)
jne 0x50cd
cmpl $0x0, 0x190(%rdi)
je 0x50e5
leaq 0x8384(%rip), %rax      # 0xd458
movq (%rax), %rax
movl 0x128(%rax), %eax
movl %edx, %ecx
incl %edx
movl %eax, -0x20(%rbp,%rcx,4)
cmpl $0x0, 0x194(%rdi)
je 0x5106
leaq 0x8363(%rip), %rax      # 0xd458
movq (%rax), %rax
movl 0x124(%rax), %eax
movl %edx, %ecx
incl %edx
movl %eax, -0x20(%rbp,%rcx,4)
movl 0xcc(%rdi), %esi
testl %edx, %edx
je 0x5129
leaq 0x8341(%rip), %rax      # 0xd458
movq (%rax), %rdi
leaq -0x20(%rbp), %rcx
callq 0x34c0
addq $0x20, %rsp
popq %rbp
retq
leaq 0x8318(%rip), %rax      # 0xd448
movq (%rax), %rdi
leaq 0x831e(%rip), %rax      # 0xd458
movq (%rax), %rax
movl 0x84(%rax), %edx
addq $0x20, %rsp
popq %rbp
jmp 0x3500
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: focus
void focus(window *win) {
	if (stack[curws].fwin) {
		unfocus(stack[curws].fwin);
	}

	uint32_t mask = XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL;
	uint32_t vals[2];
	vals[0] = FOCUSCOL;
	vals[1] = FOCUSCOL;
	xcb_change_window_attributes(conn, win->windows[WIN_PARENT], mask, vals);

	xcb_clear_area(conn, 0, win->windows[WIN_PARENT], 0, 0, win->geom[GEOM_W],
			win->geom[GEOM_H]);
		
	xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, win->windows[WIN_CHILD],
			XCB_CURRENT_TIME);
	
	draw_regions(win, PM_FOCUS);

	stack[curws].fwin = win;
	
	ewmh_state(win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x890a(%rip), %r15      # 0xda70
movslq (%r15), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x87b8(%rip), %r12      # 0xd930
movq 0x48(%r12,%rax), %rdi
testq %rdi, %rdi
je 0x5187
callq 0x4fe1
movabsq $-0xc2c5c300c2c5c4, %rax # imm = 0xFF3D3A3CFF3D3A3C
leaq -0x28(%rbp), %rcx
movq %rax, (%rcx)
leaq 0x82a9(%rip), %r14      # 0xd448
movq (%r14), %rdi
movl 0xd0(%rbx), %esi
movl $0xa, %edx
callq 0x33b0
movq (%r14), %rdi
movl 0xd0(%rbx), %edx
movzwl 0x110(%rbx), %r9d
movzwl 0x114(%rbx), %eax
movl %eax, (%rsp)
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x33a0
movq (%r14), %rdi
movl 0xcc(%rbx), %edx
movl $0x1, %esi
xorl %ecx, %ecx
callq 0x3150
movl $0x2, %r14d
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
callq 0x58d9
incl %r14d
cmpl $0x4, %r14d
jne 0x51f4
movslq (%r15), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
movq %rbx, 0x48(%r12,%rax)
movq %rbx, %rdi
callq 0x5080
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: show_state
void show_state(window *win) {
	uint32_t vals[2];
	vals[0] = XCB_ICCCM_WM_STATE_NORMAL;
	vals[1] = XCB_NONE;
	
	xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win->windows[WIN_CHILD], wm_atoms[WM_STATE], 
			wm_atoms[WM_STATE], 32, 2, vals);
	
	win->ignore_unmap = 0;

	ewmh_state(win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq -0x10(%rbp), %rax
movq $0x1, (%rax)
leaq 0x81fe(%rip), %rcx      # 0xd448
movq (%rcx), %rdi
movl 0xcc(%rbx), %edx
leaq 0x8206(%rip), %rcx      # 0xd460
movl 0x8(%rcx), %ecx
xorl %esi, %esi
movl %ecx, %r8d
movl $0x20, %r9d
pushq %rax
pushq $0x2
callq 0x3530
addq $0x10, %rsp
movl $0x0, 0x194(%rbx)
movq %rbx, %rdi
callq 0x5080
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: show
void show(window *win) {
	if (win->sticky) {
		return;
	}

	xcb_map_window(conn, win->windows[WIN_CHILD]);	
	xcb_map_window(conn, win->windows[WIN_PARENT]);	

	show_state(win);
}

// Assembly:
cmpl $0x0, 0xc8(%rdi)
je 0x5297
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x81a0(%rip), %r14      # 0xd448
movq (%r14), %rdi
movl 0xcc(%rbx), %esi
callq 0x3240
movq (%r14), %rdi
movl 0xd0(%rbx), %esi
callq 0x3240
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x522f
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: hide
void hide(window *win) {
	if (win->sticky) {
		return;
	}

	xcb_unmap_window(conn, win->windows[WIN_CHILD]);
	xcb_unmap_window(conn, win->windows[WIN_PARENT]);
	
	uint32_t vals[2];
	vals[0] = XCB_ICCCM_WM_STATE_ICONIC;
	vals[1] = XCB_NONE;
	
	xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win->windows[WIN_CHILD], wm_atoms[WM_STATE], 
			wm_atoms[WM_STATE], 32, 2, vals);

	ewmh_state(win);
	
	win->ignore_unmap = 1;
}

// Assembly:
cmpl $0x0, 0xc8(%rdi)
je 0x52da
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8159(%rip), %r14      # 0xd448
movq (%r14), %rdi
movl 0xcc(%rbx), %esi
callq 0x3570
movq (%r14), %rdi
movl 0xd0(%rbx), %esi
callq 0x3570
leaq -0x18(%rbp), %rax
movq $0x3, (%rax)
movq (%r14), %rdi
movl 0xcc(%rbx), %edx
leaq 0x813a(%rip), %rcx      # 0xd460
movl 0x8(%rcx), %ecx
xorl %esi, %esi
movl %ecx, %r8d
movl $0x20, %r9d
pushq %rax
pushq $0x2
callq 0x3530
addq $0x10, %rsp
movq %rbx, %rdi
callq 0x5080
movl $0x1, 0x194(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: stick_helper
void stick_helper(window *win) {
	if (win->sticky) {
		win->sticky = 0;
		excise_from_all_but(curws, win);
		return;
	}

	win->sticky = 1;
	insert_into_all_but(curws, win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rsi
cmpl $0x0, 0xc8(%rdi)
je 0x53d2
movl $0x0, 0xc8(%rsi)
leaq 0x86a6(%rip), %rax      # 0xda70
movl (%rax), %edi
popq %rbp
jmp 0x69b4
movl $0x1, 0xc8(%rsi)
leaq 0x868d(%rip), %rax      # 0xda70
movl (%rax), %edi
popq %rbp
jmp 0x695d
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: full
void full(window *win) {
	uint32_t vals[4];
	vals[0] = - PAD;
	vals[1] = - PAD_N;
	vals[2] = scr->width_in_pixels + 2 * PAD;
	vals[3] = scr->height_in_pixels + PAD_N + PAD;
	update_geometry(win, MOVE_RESIZE_MASK, vals);

	ewmh_state(win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movabsq $-0x1f00000001, %rax    # imm = 0xFFFFFFE0FFFFFFFF
leaq -0x20(%rbp), %rdx
movq %rax, (%rdx)
leaq 0x7daf(%rip), %rax      # 0xd450
movq (%rax), %rax
movzwl 0x14(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x8(%rdx)
movzwl 0x16(%rax), %eax
addl $0x21, %eax
movl %eax, 0xc(%rdx)
movl $0xf, %esi
callq 0x5464
movq %rbx, %rdi
callq 0x5080
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: ext_full
void ext_full(window *subj) {
	subj->is_e_full = !subj->is_e_full;

	if (!subj->is_e_full) {
		if (!subj->is_i_full) {
			full_restore_state(subj);
		}

		return;
	}
		
	if (!subj->is_i_full) {
		full_save_state(subj);
	}

	full(stack[curws].fwin);	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
cmpl $0x0, 0x190(%rdi)
sete %al
movl %eax, 0x190(%rdi)
movl 0x18c(%rdi), %eax
je 0x56ff
testl %eax, %eax
je 0x574d
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
testl %eax, %eax
jne 0x5724
movq %rbx, %rdi
callq 0x4f9c
xorl %eax, %eax
movl 0x108(%rbx,%rax,4), %ecx
movl %ecx, 0x17c(%rbx,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x570d
leaq 0x8345(%rip), %rax      # 0xda70
movslq (%rax), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x81f3(%rip), %rcx      # 0xd930
movq 0x48(%rcx,%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x567d
leaq 0x17c(%rbx), %rdx
movq %rbx, %rdi
movl $0xf, %esi
callq 0x5464
leaq 0x8308(%rip), %rax      # 0xda70
movl (%rax), %edi
leaq -0x82b(%rip), %rdx      # 0x4f46
movl $0x2, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x664f
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: forget_client
void forget_client(window *win, int ws) {
	if (win->windows[WIN_PARENT] != XCB_WINDOW_NONE) {
		xcb_generic_error_t *error = NULL;
		error = xcb_request_check(conn, xcb_reparent_window_checked(conn,
				win->windows[WIN_CHILD], scr->root, win->geom[GEOM_X] + PAD,
				win->geom[GEOM_Y] + PAD_N));

		if (!error) {
			xcb_change_save_set(conn, XCB_SET_MODE_DELETE, win->windows[WIN_CHILD]);
		} else {
			free(error);
		}

		xcb_destroy_window(conn, win->windows[WIN_PARENT]);
	
		xcb_free_gc(conn, win->gc);
	}

	if ((state == MOVE || state == RESIZE) && win == stack[curws].fwin) {
		button_release(NULL);
	}

	if (win->sticky) {
		excise_from_all_but(ws, win);
	}
	
	excise_from(ws, win);

	free(win);
	
	if (ws != curws || stack[curws].fwin != win) {
		return;
	}
	
	stack[ws].fwin = NULL;

	refocus(ws);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
cmpl $0x0, 0xd0(%rdi)
je 0x582c
leaq 0x7ca3(%rip), %r12      # 0xd448
movq (%r12), %r15
leaq 0x7ca0(%rip), %rax      # 0xd450
movq (%rax), %rax
movl (%rax), %edx
movl 0xcc(%r14), %esi
movl 0x108(%r14), %eax
incl %eax
movl 0x10c(%r14), %edi
addl $0x20, %edi
movswl %ax, %ecx
movswl %di, %r8d
movq %r15, %rdi
callq 0x30f0
movq %r15, %rdi
movl %eax, %esi
callq 0x3550
testq %rax, %rax
je 0x57f7
movq %rax, %rdi
callq 0x3280
jmp 0x580c
movq (%r12), %rdi
movl 0xcc(%r14), %edx
movl $0x1, %esi
callq 0x3510
movq (%r12), %rdi
movl 0xd0(%r14), %esi
callq 0x30d0
movq (%r12), %rdi
movl 0x104(%r14), %esi
callq 0x31a0
leaq 0x7c11(%rip), %rax      # 0xd444
movl (%rax), %eax
decl %eax
cmpl $0x1, %eax
ja 0x5863
leaq 0x822d(%rip), %rax      # 0xda70
movslq (%rax), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x80db(%rip), %rcx      # 0xd930
cmpq %r14, 0x48(%rcx,%rax)
jne 0x5863
xorl %edi, %edi
callq 0x73a8
cmpl $0x0, 0xc8(%r14)
je 0x5877
movl %ebx, %edi
movq %r14, %rsi
callq 0x69b4
movl %ebx, %edi
movq %r14, %rsi
callq 0x689e
movq %r14, %rdi
callq 0x3280
leaq 0x81e0(%rip), %rax      # 0xda70
movslq (%rax), %rax
cmpl %ebx, %eax
jne 0x58ad
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
leaq 0x808a(%rip), %rax      # 0xd930
cmpq %r14, 0x48(%rax,%rcx)
je 0x58b6
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movslq %ebx, %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
movq $0x0, 0x48(%rax,%rcx)
movl %ebx, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6bd3
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: draw_region
void draw_region(window *win, int window_index, int pm_index) {
	int region_index = window_index - WIN_COUNT;
	xcb_copy_area_checked(conn, pixmaps[region_index][pm_index], win->windows[window_index],
			win->gc, 0, 0, 0, 0, controls[region_index].geom.width,
			controls[region_index].geom.height);

	win->last_pm[region_index] = pm_index;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq %esi, %r14
leaq -0x2(%r14), %rax
leaq 0x7b54(%rip), %rcx      # 0xd448
movq (%rcx), %rdi
leaq (%rax,%rax,4), %r8
shlq $0x4, %rax
addq 0x76e2(%rip), %rax      # 0xcfe8
movslq %edx, %r15
movl (%rax,%r15,4), %esi
movl 0xcc(%rbx,%r14,4), %edx
movl 0x104(%rbx), %ecx
shlq $0x4, %r8
leaq 0x735a(%rip), %rax      # 0xcc80
movzwl 0x4(%r8,%rax), %r10d
movzwl 0x6(%r8,%rax), %eax
xorl %r11d, %r11d
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %r10
pushq %r11
pushq %r11
callq 0x32e0
addq $0x20, %rsp
movl %r15d, 0xd4(%rbx,%r14,4)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: cursor_init
void cursor_init(void) {
	xcb_font_t cursor_font = xcb_generate_id(conn);
	xcb_open_font(conn, cursor_font, strlen("cursor"), "cursor");

	XRenderColor cursor_fg = hex_to_rgb(CURSOR_FG);
	XRenderColor cursor_bg = hex_to_rgb(CURSOR_BG);

	default_cursor = cursor_create(cursor_font, cursor_fg, cursor_bg, CURSOR_DEFAULT);
	
	for (int i = 0; i < 8; i++) {
		resize_cursors[i] = cursor_create(cursor_font, cursor_fg, cursor_bg, resize_cursor_indicies[i]);
	}

	xcb_close_font_checked(conn, cursor_font);

	xcb_change_window_attributes(conn, scr->root, XCB_CW_CURSOR, &default_cursor);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7ab6(%rip), %r14      # 0xd448
movq (%r14), %rdi
callq 0x3560
movl %eax, %ebx
movq (%r14), %rdi
leaq 0x380a(%rip), %rcx      # 0x91b0
movl %eax, %esi
movl $0x6, %edx
callq 0x3090
movl $0xffd7d7d7, %edi       # imm = 0xFFD7D7D7
callq 0x8890
movq %rax, %r14
movl $0xff242223, %edi       # imm = 0xFF242223
callq 0x8890
movq %rax, %r15
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
movl $0x44, %ecx
callq 0x5a58
movl %eax, 0x7f1c(%rip)      # 0xd900
leaq 0x7f25(%rip), %r13      # 0xd910
xorl %r12d, %r12d
leaq 0x376b(%rip), %rax      # 0x9160
movzwl (%r12,%rax), %ecx
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5a58
movl %eax, (%r13)
addq $0x4, %r13
addq $0x2, %r12
cmpq $0x10, %r12
jne 0x59ee
leaq 0x7a28(%rip), %r14      # 0xd448
movq (%r14), %rdi
movl %ebx, %esi
callq 0x3400
movq (%r14), %rdi
leaq 0x7a1c(%rip), %rax      # 0xd450
movq (%rax), %rax
movl (%rax), %esi
leaq 0x7ec0(%rip), %rcx      # 0xd900
movl $0x4000, %edx           # imm = 0x4000
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x33b0
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: cursor_create
static xcb_cursor_t cursor_create(xcb_font_t font, XRenderColor fg, XRenderColor bg, uint16_t index) {
	xcb_cursor_t cursor = xcb_generate_id(conn);
	xcb_create_glyph_cursor(conn, cursor, font, font, index, index + 1, fg.red, fg.green, fg.blue,
			bg.red, bg.green, bg.blue);
	return cursor;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, -0x38(%rbp)
movq %rdx, %r13
movq %rsi, %r15
movl %edi, -0x30(%rbp)
movl %r15d, %eax
shrl $0x10, %eax
movq %rax, -0x40(%rbp)
movq %rsi, %rbx
shrq $0x20, %rbx
movl %r13d, %r12d
shrl $0x10, %r12d
movq %rdx, %r14
shrq $0x20, %r14
leaq 0x79ac(%rip), %rax      # 0xd448
movq (%rax), %rdi
callq 0x3560
movl %eax, %esi
movl %eax, -0x2c(%rbp)
leaq 0x7998(%rip), %rax      # 0xd448
movq (%rax), %rdi
movq -0x38(%rbp), %r8
leal 0x1(%r8), %r9d
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %r14d
andl %eax, %r13d
andl %eax, %ebx
andl %eax, %r15d
andl %eax, %r9d
movl -0x30(%rbp), %ecx
movl %ecx, %edx
pushq %r14
pushq %r12
pushq %r13
pushq %rbx
pushq -0x40(%rbp)
pushq %r15
callq 0x35c0
addq $0x30, %rsp
movl -0x2c(%rbp), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: install_normal_hints
void install_normal_hints(window *win) {
	if (!xcb_icccm_get_wm_normal_hints_reply(conn, xcb_icccm_get_wm_normal_hints_unchecked(conn,
			win->windows[WIN_CHILD]), &win->hints, NULL)) {
		memset(&win->hints, 0, sizeof(xcb_size_hints_t));
		return;	
	}

#define MIN_WIDTH 160
#define MIN_HEIGHT 90

	if ((win->hints.flags & XCB_ICCCM_SIZE_HINT_BASE_SIZE) &&
			!(win->hints.flags & XCB_ICCCM_SIZE_HINT_P_MIN_SIZE)) {
		win->hints.min_width = win->hints.base_width;
		win->hints.min_height = win->hints.base_height;
	} else {
		win->hints.min_width = MIN_WIDTH;
		win->hints.min_height = MIN_HEIGHT;
	}

	if (!(win->hints.flags & XCB_ICCCM_SIZE_HINT_P_RESIZE_INC)) {
		win->hints.width_inc = 1;
		win->hints.height_inc = 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x78f0(%rip), %rax      # 0xd448
movq (%rax), %r15
movl 0xcc(%rdi), %esi
movq %r15, %rdi
callq 0x30c0
leaq 0x118(%rbx), %r14
movq %r15, %rdi
movl %eax, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x3630
testb %al, %al
je 0x5baa
movl (%r14), %eax
movl %eax, %ecx
andl $0x110, %ecx            # imm = 0x110
cmpl $0x100, %ecx            # imm = 0x100
jne 0x5bca
movl 0x154(%rbx), %edx
movl 0x158(%rbx), %ecx
movl %edx, 0x12c(%rbx)
jmp 0x5bd9
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
movq $0x0, 0x40(%r14)
jmp 0x5bf4
movl $0xa0, 0x12c(%rbx)
movl $0x5a, %ecx
movl %ecx, 0x130(%rbx)
testb $0x40, %al
jne 0x5bf4
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x13c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: create_window_new
void create_window_new(xcb_window_t child) {
	window *win = allocate_window(child);

	uint32_t w;
	uint32_t h;
	uint32_t x;
	uint32_t y;
	xcb_get_geometry_reply_t *geom = w_get_geometry(child);
	if (win->hints.flags & XCB_ICCCM_SIZE_HINT_US_POSITION) {
		w = geom->width;
		h = geom->height;
		x = geom->x;
		y = geom->y;
	} else {
		xcb_query_pointer_reply_t *ptr = w_query_pointer();
		w = size_helper(geom->width + 2 * PAD, scr->width_in_pixels);
		h = size_helper(geom->height + PAD_N + PAD, scr->height_in_pixels - TOP - BOT);
		x = place_helper(ptr->root_x, w, scr->width_in_pixels);
		y = TOP + place_helper(ptr->root_y - TOP, h, scr->height_in_pixels - TOP - BOT);
		free(ptr);
	}
	free(geom);

	create_window(win, x, y, w, h);
	
	insert_into(curws, win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %r14d
callq 0x5d24
movq %rax, %r12
leaq 0x7829(%rip), %r15      # 0xd448
movq (%r15), %rdi
movl %r14d, %esi
callq 0x3330
movq (%r15), %rdi
xorl %ebx, %ebx
movl %eax, %esi
xorl %edx, %edx
callq 0x3380
movq %rax, %r14
movq %r12, -0x30(%rbp)
testb $0x1, 0x118(%r12)
jne 0x5ca3
xorl %eax, %eax
callq 0x37bc
movzwl 0x10(%r14), %r12d
addl $0x2, %r12d
leaq 0x77ef(%rip), %rcx      # 0xd450
movq (%rcx), %rcx
movzwl 0x14(%rcx), %edx
cmpl %edx, %r12d
cmovael %edx, %r12d
movzwl 0x12(%r14), %r13d
addl $0x21, %r13d
movzwl 0x16(%rcx), %ecx
cmpl %ecx, %r13d
cmovael %ecx, %r13d
movswl 0x10(%rax), %edi
movl %r12d, %r8d
shrl %r8d
movl %edi, %esi
subl %r8d, %esi
jb 0x5cbb
addl %edi, %r8d
cmpl %edx, %r8d
jbe 0x5cb9
subl %r12d, %edx
movl %edx, %ebx
jmp 0x5cbb
movzwl 0x10(%r14), %r12d
movzwl 0x12(%r14), %r13d
movswl 0xc(%r14), %ebx
movswl 0xe(%r14), %r15d
jmp 0x5ce6
movl %esi, %ebx
movswl 0x12(%rax), %esi
movl %r13d, %edi
shrl %edi
xorl %r15d, %r15d
movl %esi, %edx
subl %edi, %edx
jb 0x5cde
addl %esi, %edi
cmpl %ecx, %edi
jbe 0x5cdb
subl %r13d, %ecx
movl %ecx, %r15d
jmp 0x5cde
movl %edx, %r15d
movq %rax, %rdi
callq 0x3280
movq %r14, %rdi
callq 0x3280
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %edx
movl %r12d, %ecx
movl %r13d, %r8d
callq 0x5dd4
leaq 0x7d64(%rip), %rax      # 0xda70
movl (%rax), %edi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x66a1
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: allocate_window
static window *allocate_window(xcb_window_t child) {
	window *win = malloc(sizeof(window));
	win->windows[WIN_PARENT] = XCB_WINDOW_NONE;
	win->windows[WIN_CHILD] = child;
	win->ignore_unmap = 0;
	win->is_roll = 0;
	win->snap_index = SNAP_NONE;
	win->is_e_full = 0;
	win->is_i_full = 0;
	win->sticky = 0;
	win->above = 0;
	win->normal = 1;

	window_property_helper(xcb_ewmh_get_wm_window_type(ewmh, child), win, test_window_type);
	window_property_helper(xcb_ewmh_get_wm_state(ewmh, child), win, test_window_state);

	install_normal_hints(win);

	return win;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %r14d
movl $0x198, %edi            # imm = 0x198
callq 0x3170
movq %rax, %rbx
xorl %eax, %eax
movl %eax, 0xd0(%rbx)
movl %r14d, 0xcc(%rbx)
movl %eax, 0x194(%rbx)
movl %eax, 0x164(%rbx)
movl $0x7, 0x178(%rbx)
movq $0x0, 0x18c(%rbx)
movl %eax, 0xc8(%rbx)
movq $0x1, 0xc0(%rbx)
leaq 0x76d2(%rip), %r15      # 0xd458
movq (%r15), %rdi
movl %r14d, %esi
callq 0x3080
leaq 0x6d5(%rip), %rdx       # 0x646d
movl %eax, %edi
movq %rbx, %rsi
callq 0x6400
movq (%r15), %rdi
movl %r14d, %esi
callq 0x3220
leaq 0x738(%rip), %rdx       # 0x64ec
movl %eax, %edi
movq %rbx, %rsi
callq 0x6400
movq %rbx, %rdi
callq 0x5b44
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: create_window_existing
void create_window_existing(xcb_window_t child) {
	window *win = allocate_window(child);

	xcb_get_geometry_reply_t *geom = w_get_geometry(child);
	uint32_t w = size_helper(geom->width + 2 * PAD, scr->width_in_pixels);
	uint32_t h = size_helper(geom->height + PAD_N + PAD, scr->height_in_pixels - TOP - BOT);
	uint32_t x = create_window_existing_place_helper(geom->x - PAD, w, scr->width_in_pixels);
	uint32_t y = TOP + create_window_existing_place_helper(geom->y - TOP - PAD_N, h, scr->height_in_pixels - TOP - BOT);
	free(geom);

	create_window(win, x, y, w, h);
	win->ignore_unmap = 1;
	
	insert_into(curws, win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %r14d
callq 0x5d24
movq %rax, %rbx
leaq 0x711e(%rip), %r15      # 0xd448
movq (%r15), %rdi
movl %r14d, %esi
callq 0x3330
movq (%r15), %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3380
movzwl 0x10(%rax), %r14d
addl $0x2, %r14d
leaq 0x70ff(%rip), %rcx      # 0xd450
movq (%rcx), %rcx
movzwl 0x14(%rcx), %edx
cmpl %edx, %r14d
cmovael %edx, %r14d
movzwl 0x12(%rax), %r15d
addl $0x21, %r15d
movzwl 0x16(%rcx), %ecx
cmpl %ecx, %r15d
cmovael %ecx, %r15d
movswl 0xc(%rax), %esi
leal -0x1(%rsi), %edi
leal (%rsi,%r14), %r8d
decl %r8d
movl %edx, %r12d
subl %r14d, %r12d
cmpl %edx, %r8d
cmovbel %edi, %r12d
testl %esi, %esi
movl $0x0, %r8d
cmovlel %r8d, %r12d
movswl 0xe(%rax), %edx
leal -0x20(%rdx), %esi
leal (%rdx,%r15), %edi
addl $-0x20, %edi
movl %ecx, %r13d
subl %r15d, %r13d
cmpl %ecx, %edi
cmovbel %esi, %r13d
cmpl $0x20, %edx
cmovll %r8d, %r13d
movq %rax, %rdi
callq 0x3280
movq %rbx, %rdi
movl %r12d, %esi
movl %r13d, %edx
movl %r14d, %ecx
movl %r15d, %r8d
callq 0x5dd4
movl $0x1, 0x194(%rbx)
leaq 0x7688(%rip), %rax      # 0xda70
movl (%rax), %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x66a1
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: window_property_helper
static void window_property_helper(xcb_get_property_cookie_t cookie, window *win, 
		void (*func)(window *, xcb_ewmh_get_atoms_reply_t, int)) {
	xcb_ewmh_get_atoms_reply_t type;
	if (!xcb_ewmh_get_wm_window_type_reply(ewmh, cookie, &type, NULL)) {
		return;
	}
	
	for (int i = 0; i < type.atoms_len; i++) {
		func(win, type, i);
	}
		
	xcb_ewmh_get_atoms_reply_wipe(&type);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %esi
leaq 0x703c(%rip), %rax      # 0xd458
movq (%rax), %rdi
leaq -0x30(%rbp), %rdx
xorl %ecx, %ecx
callq 0x3120
testb %al, %al
je 0x6462
cmpl $0x0, -0x30(%rbp)
je 0x6459
xorl %r15d, %r15d
movq -0x20(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x30(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
movl %r15d, %esi
callq *%rbx
incl %r15d
cmpl -0x30(%rbp), %r15d
jb 0x6437
leaq -0x30(%rbp), %rdi
callq 0x3620
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: test_window_type
static void test_window_type(window *win, xcb_ewmh_get_atoms_reply_t type, int i) {
	if (type.atoms[i] != ewmh->_NET_WM_WINDOW_TYPE_DOCK 
			&& type.atoms[i] != ewmh->_NET_WM_WINDOW_TYPE_TOOLBAR
			&& type.atoms[i] != ewmh->_NET_WM_WINDOW_TYPE_DESKTOP) {
		return;
	}

	win->normal = 0;

	uint32_t mask = XCB_CW_EVENT_MASK;
	uint32_t val = XCB_EVENT_MASK_STRUCTURE_NOTIFY;
	xcb_change_window_attributes(conn, win->windows[WIN_CHILD], mask, &val);

	xcb_map_window(conn, win->windows[WIN_CHILD]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x18(%rbp), %rax
movslq %esi, %rcx
movl (%rax,%rcx,4), %eax
leaq 0x6fcc(%rip), %rcx      # 0xd458
movq (%rcx), %rcx
cmpl 0xd4(%rcx), %eax
je 0x64a7
cmpl 0xd8(%rcx), %eax
je 0x64a7
cmpl 0xd0(%rcx), %eax
jne 0x64e3
movl $0x0, 0xc0(%rbx)
leaq -0x14(%rbp), %rcx
movl $0x20000, (%rcx)        # imm = 0x20000
leaq 0x6f86(%rip), %r14      # 0xd448
movq (%r14), %rdi
movl 0xcc(%rbx), %esi
movl $0x800, %edx            # imm = 0x800
callq 0x33b0
movq (%r14), %rdi
movl 0xcc(%rbx), %esi
callq 0x3240
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/window.c
// Function: test_window_state
static void test_window_state(window *win, xcb_ewmh_get_atoms_reply_t type, int i) {
	if (type.atoms[i] == ewmh->_NET_WM_STATE_STICKY) {
		stick_helper(win);
	}
	if (type.atoms[i] == ewmh->_NET_WM_STATE_ABOVE) {
		win->above = 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rbp), %r14
movslq %esi, %r15
movl (%r14,%r15,4), %eax
leaq 0x6f4c(%rip), %r12      # 0xd458
movq (%r12), %rcx
cmpl 0x10c(%rcx), %eax
jne 0x6520
movq %rbx, %rdi
callq 0x53a9
movl (%r14,%r15,4), %eax
movq (%r12), %rcx
cmpl 0x12c(%rcx), %eax
jne 0x653a
movl $0x1, 0xc4(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/workspace.c
// Function: print_stack
void print_stack(int ws, int type) {
	printf("workspace %x [fwin: %x]: ", ws, stack[ws].fwin ? stack[ws].fwin->windows[WIN_CHILD] : 0);
	for (window *list = stack[ws].lists[type].first; list; list = list->next[ws][type]) {
		printf("win %x -> ", list->windows[WIN_CHILD]);
	}
	printf("NULL\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movl %edi, %esi
movslq %edi, %r14
leaq (%r14,%r14,4), %rax
shlq $0x4, %rax
leaq 0x73cb(%rip), %rcx      # 0xd930
leaq (%rcx,%rax), %r12
movq 0x48(%rax,%rcx), %rax
testq %rax, %rax
je 0x657b
movl 0xcc(%rax), %edx
jmp 0x657d
xorl %edx, %edx
leaq 0x2c33(%rip), %rdi      # 0x91b7
xorl %eax, %eax
callq 0x3060
movslq %ebx, %r15
leaq (%r15,%r15,2), %rax
movq (%r12,%rax,8), %r12
testq %r12, %r12
je 0x65c5
leaq 0x2c2f(%rip), %rbx      # 0x91d1
leaq (%r14,%r14,2), %r14
movl 0xcc(%r12), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3060
leaq (%r12,%r14,8), %rax
movq (%rax,%r15,8), %r12
testq %r12, %r12
jne 0x65a6
leaq 0x2c3a(%rip), %rdi      # 0x9206
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3110
// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/workspace.c
// Function: safe_traverse
void safe_traverse(int ws, int type, void (*func)(window *)) {
	for (window *list = stack[ws].lists[type].first; list;) {
		window *temp = list->next[ws][type];
		func(list);
		list = temp;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movslq %edi, %rax
leaq (%rax,%rax,4), %rcx
shlq $0x4, %rcx
leaq 0x72c1(%rip), %rdx      # 0xd930
addq %rcx, %rdx
movslq %esi, %r14
leaq (%r14,%r14,2), %rcx
movq (%rdx,%rcx,8), %rdi
testq %rdi, %rdi
je 0x6698
leaq (%rax,%rax,2), %r15
leaq (%rdi,%r15,8), %rax
movq (%rax,%r14,8), %r12
callq *%rbx
movq %r12, %rdi
testq %r12, %r12
jne 0x6686
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq