LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/kaiserschmarrn0[P]mywm/mywm.c
// Function: close_helper
void close_helper(xcb_window_t win) {
	xcb_icccm_get_wm_protocols_reply_t pro;
	xcb_get_property_cookie_t cookie;
	cookie = xcb_icccm_get_wm_protocols_unchecked(conn, win, ewmh->WM_PROTOCOLS);
	if (!xcb_icccm_get_wm_protocols_reply(conn, cookie, &pro, NULL)) {
		xcb_kill_client(conn, win);
		return;
	}

	for (int i = 0; i < pro.atoms_len; i++) {
		if (pro.atoms[i] == wm_atoms[WM_DELETE_WINDOW]) {
			xcb_icccm_get_wm_protocols_reply_wipe(&pro);
			goto a;
		}
	}
	xcb_icccm_get_wm_protocols_reply_wipe(&pro);
	xcb_kill_client(conn, win);
	return;

	a:;
	
	xcb_client_message_event_t ev;
	ev.response_type = XCB_CLIENT_MESSAGE;
	ev.format = 32;
	ev.sequence = 0;
	ev.window = win;
	ev.type = wm_atoms[WM_PROTOCOLS];
	ev.data.data32[0] = wm_atoms[WM_DELETE_WINDOW];
	ev.data.data32[1] = XCB_CURRENT_TIME;
	uint32_t mask = XCB_EVENT_MASK_NO_EVENT;
	xcb_send_event(conn, 0, win, mask, (char *)&ev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movl %edi, %ebx
movq 0x9c50(%rip), %rdi      # 0xd448
movq 0x9c59(%rip), %rax      # 0xd458
movl 0xc8(%rax), %edx
movl %ebx, %esi
callq 0x31d0
movq 0x9c35(%rip), %rdi      # 0xd448
leaq -0x20(%rbp), %rdx
movl %eax, %esi
xorl %ecx, %ecx
callq 0x31b0
testb %al, %al
je 0x384e
movl -0x20(%rbp), %eax
testq %rax, %rax
je 0x3845
movq -0x18(%rbp), %rcx
movl 0x9c2e(%rip), %edx      # 0xd464
xorl %esi, %esi
cmpl %edx, (%rcx,%rsi,4)
je 0x3863
incq %rsi
cmpq %rsi, %rax
jne 0x3838
leaq -0x20(%rbp), %rdi
callq 0x3420
movq 0x9bf3(%rip), %rdi      # 0xd448
movl %ebx, %esi
callq 0x3610
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
leaq -0x20(%rbp), %rdi
callq 0x3420
leaq -0x40(%rbp), %r8
movl $0x2021, (%r8)          # imm = 0x2021
movl %ebx, 0x4(%r8)
movq 0x9bde(%rip), %rax      # 0xd460
movq %rax, 0x8(%r8)
movl $0x0, 0x10(%r8)
movq 0x9bb3(%rip), %rdi      # 0xd448
xorl %esi, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x3350
jmp 0x385c
// File: /workspace/github_c_makefile_star2_O3/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 0xa1bd(%rip), %r14      # 0xda70
movl (%r14), %edi
movl 0xc(%rbx), %ecx
movl $0x1, %esi
movl $0x1, %edx
callq 0x6b13
movl 0x9b76(%rip), %ecx      # 0xd444
cmpl $0x2, %ecx
setne %dl
testq %rax, %rax
setne %sil
testb %sil, %dl
je 0x3916
cmpl $0x0, 0xc0(%rax)
movl (%r14), %edi
je 0x3919
cmpl $0x1, %ecx
je 0x3919
movslq %edi, %rcx
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
leaq 0xa02d(%rip), %rdx      # 0xd930
cmpq 0x48(%rdx,%rcx), %rax
je 0x3919
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x5181
movl (%r14), %edi
movl 0xc(%rbx), %r8d
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %ecx
callq 0x6ab0
testq %rax, %rax
je 0x3949
movq %rax, %rdi
movl %edx, %esi
movl $0x1, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x58ef
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x87dd
// File: /workspace/github_c_makefile_star2_O3/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 0xa107(%rip), %rax      # 0xda70
movl (%rax), %edi
movl 0xc(%r15), %r8d
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %ecx
callq 0x6ab0
testq %rax, %rax
je 0x398f
cmpb $0x0, 0x1e(%r15)
je 0x39a1
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x8819
movq %rax, %rbx
movl %edx, %r14d
cmpl $0x4, 0x9a96(%rip)      # 0xd444
jne 0x39b7
xorl %eax, %eax
callq 0x71d3
movq %rbx, %rdi
movl %r14d, %esi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x58ef
// File: /workspace/github_c_makefile_star2_O3/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 0x9f4e(%rip), %r14      # 0xd930
leaq (%rbx,%rbx,4), %r15
shlq $0x4, %r15
cmpl $0x0, 0x10(%r14,%r15)
jle 0x3a0c
addq %r14, %r15
xorl %r12d, %r12d
movq 0x8(%r15), %rdi
movl %ebx, %esi
callq 0x579d
incl %r12d
cmpl 0x10(%r15), %r12d
jl 0x39f8
incq %rbx
cmpq $0x4, %rbx
jne 0x39e2
movq 0x9a2c(%rip), %rdi      # 0xd448
movq 0x9a2d(%rip), %rax      # 0xd450
movl (%rax), %edx
xorl %ebx, %ebx
xorl %esi, %esi
movl $0x8000, %ecx           # imm = 0x8000
callq 0x33e0
movq 0x9a36(%rip), %rdi      # 0xd470
callq 0x33f0
callq 0x5af9
movb $0x1, %r14b
leaq 0x9a32(%rip), %r15      # 0xd480
shlq $0x4, %rbx
xorl %r12d, %r12d
movq 0x99ec(%rip), %rdi      # 0xd448
leaq (%rbx,%r12,4), %rax
movl (%r15,%rax), %esi
callq 0x34e0
incq %r12
cmpq $0x4, %r12
jne 0x3a55
movl $0x1, %ebx
testb $0x1, %r14b
movl $0x0, %r14d
jne 0x3a4e
movq 0x9a16(%rip), %rdi      # 0xd4a0
movq 0x9a17(%rip), %rsi      # 0xd4a8
callq 0x30e0
movq 0x99ab(%rip), %rdi      # 0xd448
callq 0x3360
movq 0x999f(%rip), %rdi      # 0xd448
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3580
// File: /workspace/github_c_makefile_star2_O3/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, %r14d
movq %rsp, %rbx
leaq 0xf(,%r14,4), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
testl %edx, %edx
je 0x4360
movl %edx, -0x2c(%rbp)
movq %rsi, -0x38(%rbp)
xorl %r15d, %r15d
movq %rbx, -0x40(%rbp)
movq 0x915b(%rip), %r12      # 0xd448
movq (%rdi,%r15,8), %r13
movq %r14, %rbx
movq %rdi, %r14
movq %r13, %rdi
callq 0x3290
movzwl %ax, %edx
movq %r12, %rdi
xorl %esi, %esi
movq %r13, %rcx
callq 0x3130
movq %r14, %rdi
movq %rbx, %r14
movq -0x40(%rbp), %rbx
movl %eax, (%rbx,%r15,4)
incq %r15
cmpq %r15, %r14
jne 0x42e6
cmpl $0x0, -0x2c(%rbp)
movq -0x38(%rbp), %r12
je 0x4360
xorl %r15d, %r15d
movq 0x910f(%rip), %rdi      # 0xd448
movl (%rbx,%r15,4), %esi
xorl %edx, %edx
callq 0x3370
testq %rax, %rax
je 0x4358
movl 0x8(%rax), %ecx
movl %ecx, (%r12,%r15,4)
movq %rax, %rdi
callq 0x3280
incq %r15
cmpq %r15, %r14
jne 0x4332
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x6b60
testq %rax, %rax
je 0x46de
movq %rax, %r14
cmpl $0x0, 0xc0(%rax)
je 0x46de
movl 0x8(%rbx), %eax
movq 0x8dc7(%rip), %rcx      # 0xd458
cmpl 0x84(%rcx), %eax
jne 0x46de
xorl %r15d, %r15d
movl $0x36, %r12d
movl 0x10(%rbx,%r15,4), %eax
movq 0x8daa(%rip), %rcx      # 0xd458
cmpl 0x128(%rcx), %eax
jne 0x46d5
movl 0xc(%rbx), %eax
addl %eax, %eax
addl 0x190(%r14), %eax
cmpl $0x5, %eax
ja 0x46d5
btl %eax, %r12d
jae 0x46d5
movq %r14, %rdi
callq 0x56ed
incq %r15
cmpq $0x2, %r15
jne 0x46a2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x8c17(%rip), %rdi      # 0xd470
movzbl 0x1(%rbx), %esi
xorl %edx, %edx
callq 0x31c0
movl %eax, %r14d
cmpl $0xff09, %eax           # imm = 0xFF09
je 0x487c
cmpl $0x3, 0x8bcf(%rip)      # 0xd444
jne 0x487c
callq 0x6cdc
movl $0x10, %eax
leaq 0x8258(%rip), %rcx      # 0xcae0
cmpl -0xc(%rax,%rcx), %r14d
jne 0x489a
movzwl -0x10(%rax,%rcx), %edx
cmpw 0x1c(%rbx), %dx
je 0x48ab
addq $0x18, %rax
cmpq $0x190, %rax            # imm = 0x190
jne 0x4888
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_O3/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 0x8bae(%rip), %rax      # 0xd470
movzbl 0x1(%rdi), %esi
movq %rax, %rdi
xorl %edx, %edx
callq 0x31c0
cmpl $0xffeb, %eax           # imm = 0xFFEB
jne 0x48e6
cmpl $0x3, 0x8b66(%rip)      # 0xd444
jne 0x48e6
popq %rbp
jmp 0x6cdc
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x914a(%rip), %rbx      # 0xda70
movl (%rbx), %eax
movl 0x8(%rdi), %ecx
movl %eax, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x6b13
testq %rax, %rax
je 0x494e
cmpl $0x0, 0x194(%rax)
je 0x4955
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 0x579d
// File: /workspace/github_c_makefile_star2_O3/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 0x6b60
testq %rax, %rax
je 0x498d
movl -0x4(%rbp), %esi
movq %rax, %rdi
callq 0x579d
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x90a8(%rip), %rax      # 0xda70
movl (%rax), %eax
movl 0x4(%rdi), %r8d
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %ecx
callq 0x6ab0
testq %rax, %rax
je 0x4a00
movslq %edx, %rcx
movl 0xd4(%rax,%rcx,4), %ecx
movq %rax, %rdi
movl %edx, %esi
movl %ecx, %edx
popq %rbp
jmp 0x58ef
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x8a4c(%rip), %rdi      # 0xd470
callq 0x33f0
movq 0x8a18(%rip), %rdi      # 0xd448
callq 0x3300
movq %rax, 0x8a34(%rip)      # 0xd470
movl $0x4, %r14d
leaq 0x8097(%rip), %r15      # 0xcae0
movq 0x8a20(%rip), %rdi      # 0xd470
movl (%r14,%r15), %esi
callq 0x3040
movq %rax, %rbx
movq 0x89e5(%rip), %rdi      # 0xd448
movq 0x89e6(%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 0x4a49
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
jle 0x4afc
movzbl 0x1(%rdi), %eax
movl %esi, %esi
addq $0x8, %rdx
movq %rsi, %r10
negq %r10
movb $0x1, %bl
movl $0x1, %r11d
cmpl %eax, -0x4(%rdx)
jne 0x4ae2
movzwl -0x8(%rdx), %r14d
cmpw 0x1c(%rdi), %r14w
je 0x4b0d
cmpq %rsi, %r11
setb %bl
addq $0x10, %rdx
leaq (%r10,%r11), %r14
incq %r14
incq %r11
cmpq $0x1, %r14
jne 0x4ad1
xorl %ebx, %ebx
movzbl %bl, %eax
andl $0x1, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq (%rdx), %rax
testq %rax, %rax
je 0x4afe
leaq -0x1c(%rbp), %rdi
movl %ecx, (%rdi)
movl %r8d, 0x4(%rdi)
movl %r9d, 0x8(%rdi)
callq *%rax
jmp 0x4afe
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x45cb(%rip), %xmm2     # 0x9110
movss 0x45cb(%rip), %xmm1     # 0x9118
leaq 0x8d7c(%rip), %r14      # 0xd8d0
movaps %xmm2, %xmm0
movss %xmm3, -0x1c(%rbp)
subss %xmm3, %xmm0
addss 0x45ac(%rip), %xmm0     # 0x9114
mulss %xmm0, %xmm0
subss %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
ucomisd 0x45a1(%rip), %xmm0     # 0x9120
jb 0x4b87
sqrtsd %xmm0, %xmm0
jmp 0x4b8c
callq 0x3600
callq 0x3590
cvttsd2si %xmm0, %eax
movss -0x1c(%rbp), %xmm3
movaps %xmm3, %xmm0
movss 0x456b(%rip), %xmm2     # 0x9110
addss %xmm2, %xmm0
cmpl $0x2, %eax
jne 0x4bb2
cvttss2si %xmm0, %ebx
movl 0x8790(%rip), %ecx      # 0xd348
movslq %ecx, %rdx
cmpl %eax, %r15d
jne 0x4bc8
incw 0x6(%r14,%rdx,8)
jmp 0x4bfe
movq %rdx, %rcx
incq %rcx
movl %ecx, 0x8774(%rip)      # 0xd348
movw $0x1, 0xe(%r14,%rdx,8)
movl $0x2, %esi
subl %eax, %esi
movw %si, 0x8(%r14,%rdx,8)
xorps %xmm1, %xmm1
cvtsi2ss %ebx, %xmm1
subss %xmm1, %xmm3
cvttss2si %xmm3, %esi
movw %si, 0xa(%r14,%rdx,8)
movss 0x4512(%rip), %xmm1     # 0x9118
ucomiss %xmm0, %xmm1
movaps %xmm0, %xmm3
movl %eax, %r15d
ja 0x4b54
leal 0x1(%rcx), %eax
movl %eax, 0x872a(%rip)      # 0xd348
shrl $0x1f, %eax
addl %ecx, %eax
incl %eax
sarl %eax
cltq
movzwl 0x6(%r14,%rax,8), %eax
subl %eax, %ebx
movl %ebx, 0x8cb9(%rip)      # 0xd8f0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
subq $0x28, %rsp
movl 0x110(%rdi), %eax
movl 0x114(%rdi), %ecx
movl 0x86ea(%rip), %r10d     # 0xd348
xorl %edx, %edx
cmpl $0x2, %r10d
jl 0x4cb5
movl %r10d, %edx
shrl $0x1f, %edx
addl %r10d, %edx
sarl %edx
movl %edx, %esi
xorl %r8d, %r8d
leaq 0x8c53(%rip), %r9       # 0xd8d0
movl (%r9,%r8,8), %r11d
movw %r11w, -0x30(%rbp,%r8,8)
movzwl 0x2(%r9,%r8,8), %ebx
movw %bx, -0x2e(%rbp,%r8,8)
addl %r11d, %r11d
movl %eax, %ebx
subl %r11d, %ebx
movw %bx, -0x2c(%rbp,%r8,8)
movzwl 0x6(%r9,%r8,8), %r11d
movw %r11w, -0x2a(%rbp,%r8,8)
incq %r8
cmpq %r8, %rsi
jne 0x4c7d
movl %edx, %esi
movw $0x0, -0x30(%rbp,%rsi,8)
movl 0x8c2b(%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 0x4d32
subl %r8d, %ecx
leaq -0x1(%r10), %rdx
leaq 0x8bdc(%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 0x4cf4
leaq 0x870f(%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 $0x48, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x8416(%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 0x58ef
incl %r14d
cmpl $0x4, %r14d
jne 0x5084
movq %rbx, %rdi
callq 0x50b0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x89b1(%rip), %rax      # 0xda70
movslq (%rax), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x885f(%rip), %rcx      # 0xd930
xorl %edx, %edx
cmpq %rdi, 0x48(%rcx,%rax)
jne 0x50eb
leaq 0x83e3(%rip), %rax      # 0xd4c4
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl $0x1, %edx
cmpl $0x0, 0x18c(%rdi)
jne 0x50fd
cmpl $0x0, 0x190(%rdi)
je 0x5115
leaq 0x8354(%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 0x5138
leaq 0x8333(%rip), %rax      # 0xd458
movq (%rax), %rax
movl 0x124(%rax), %ecx
movl %edx, %esi
incl %edx
movl %ecx, -0x20(%rbp,%rsi,4)
jmp 0x5146
leaq 0x8319(%rip), %rax      # 0xd458
movq (%rax), %rax
testl %edx, %edx
je 0x515e
movl 0xcc(%rdi), %esi
leaq -0x20(%rbp), %rcx
movq %rax, %rdi
callq 0x34c0
addq $0x20, %rsp
popq %rbp
retq
leaq 0x82e3(%rip), %rcx      # 0xd448
movq (%rcx), %rcx
movl 0xcc(%rdi), %esi
movl 0x84(%rax), %edx
movq %rcx, %rdi
addq $0x20, %rsp
popq %rbp
jmp 0x3500
// File: /workspace/github_c_makefile_star2_O3/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 0x88d6(%rip), %r15      # 0xda70
movslq (%r15), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x8784(%rip), %r12      # 0xd930
movq 0x48(%r12,%rax), %rdi
testq %rdi, %rdi
je 0x51bb
callq 0x5011
movabsq $-0xc2c5c300c2c5c4, %rax # imm = 0xFF3D3A3CFF3D3A3C
leaq -0x28(%rbp), %rcx
movq %rax, (%rcx)
leaq 0x8275(%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 0x58ef
incl %r14d
cmpl $0x4, %r14d
jne 0x5228
movslq (%r15), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
movq %rbx, 0x48(%r12,%rax)
movq %rbx, %rdi
callq 0x50b0
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x81ca(%rip), %rcx      # 0xd448
movq (%rcx), %rdi
movl 0xcc(%rbx), %edx
leaq 0x81d2(%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 0x50b0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x52cb
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x816c(%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 0x5263
// File: /workspace/github_c_makefile_star2_O3/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 0x530e
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x8125(%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 0x8106(%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 0x50b0
movl $0x1, 0x194(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5406
movl $0x0, 0xc8(%rsi)
leaq 0x8672(%rip), %rax      # 0xda70
movl (%rax), %edi
popq %rbp
jmp 0x69e7
movl $0x1, 0xc8(%rsi)
leaq 0x8659(%rip), %rax      # 0xda70
movl (%rax), %edi
popq %rbp
jmp 0x6990
// File: /workspace/github_c_makefile_star2_O3/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 0x7d93(%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 0x5498
movq %rbx, %rdi
callq 0x50b0
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x571b
testl %eax, %eax
je 0x5769
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
testl %eax, %eax
jne 0x5740
movq %rbx, %rdi
callq 0x4fcc
xorl %eax, %eax
movl 0x108(%rbx,%rax,4), %ecx
movl %ecx, 0x17c(%rbx,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x5729
leaq 0x8329(%rip), %rax      # 0xda70
movslq (%rax), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x81d7(%rip), %rcx      # 0xd930
movq 0x48(%rcx,%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x5699
leaq 0x17c(%rbx), %rdx
movq %rbx, %rdi
movl $0xf, %esi
callq 0x5498
leaq 0x82ec(%rip), %rax      # 0xda70
movl (%rax), %edi
leaq -0x817(%rip), %rdx      # 0x4f76
movl $0x2, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x6633
// File: /workspace/github_c_makefile_star2_O3/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 0x5848
leaq 0x7c87(%rip), %r12      # 0xd448
movq (%r12), %r15
leaq 0x7c84(%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 0x5813
movq %rax, %rdi
callq 0x3280
jmp 0x5828
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 0x7bf5(%rip), %rax      # 0xd444
movl (%rax), %eax
decl %eax
cmpl $0x1, %eax
ja 0x587f
leaq 0x8211(%rip), %rax      # 0xda70
movslq (%rax), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x80bf(%rip), %rcx      # 0xd930
cmpq %r14, 0x48(%rcx,%rax)
jne 0x587f
xorl %edi, %edi
callq 0x7394
cmpl $0x0, 0xc8(%r14)
je 0x5893
movl %ebx, %edi
movq %r14, %rsi
callq 0x69e7
movl %ebx, %edi
movq %r14, %rsi
callq 0x687a
movq %r14, %rdi
callq 0x3280
leaq 0x81c4(%rip), %rax      # 0xda70
cmpl %ebx, (%rax)
jne 0x58c9
movslq %ebx, %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x806e(%rip), %rcx      # 0xd930
cmpq %r14, 0x48(%rcx,%rax)
je 0x58d2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
addq %rcx, %rax
addq $0x48, %rax
movq $0x0, (%rax)
movl %ebx, %edi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x6bbd
// File: /workspace/github_c_makefile_star2_O3/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 0x7b3e(%rip), %rcx      # 0xd448
movq (%rcx), %rdi
shlq $0x4, %rax
addq 0x76d0(%rip), %rax      # 0xcfe8
movslq %edx, %r15
movl (%rax,%r15,4), %esi
movl 0xcc(%rbx,%r14,4), %edx
movl 0x104(%rbx), %ecx
movl $0x20, %eax
xorl %r10d, %r10d
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rax
pushq %r10
pushq %r10
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_O3/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 0x7ab7(%rip), %r14      # 0xd448
movq (%r14), %rdi
callq 0x3560
movl %eax, %ebx
movq (%r14), %rdi
leaq 0x381b(%rip), %rcx      # 0x91c0
movl %eax, %esi
movl $0x6, %edx
callq 0x3090
movl $0xffd7d7d7, %edi       # imm = 0xFFD7D7D7
callq 0x887c
movq %rax, %r14
movl $0xff242223, %edi       # imm = 0xFF242223
callq 0x887c
movq %rax, %r15
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
movl $0x44, %ecx
callq 0x5a57
movl %eax, 0x7f1d(%rip)      # 0xd900
leaq 0x7f26(%rip), %r13      # 0xd910
xorl %r12d, %r12d
leaq 0x377c(%rip), %rax      # 0x9170
movzwl (%r12,%rax), %ecx
movl %ebx, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x5a57
movl %eax, (%r13)
addq $0x4, %r13
addq $0x2, %r12
cmpq $0x10, %r12
jne 0x59ed
leaq 0x7a29(%rip), %r14      # 0xd448
movq (%r14), %rdi
movl %ebx, %esi
callq 0x3400
movq (%r14), %rdi
leaq 0x7a1d(%rip), %rax      # 0xd450
movq (%rax), %rax
movl (%rax), %esi
leaq 0x7ec1(%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_O3/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 0x79ad(%rip), %rax      # 0xd448
movq (%rax), %rdi
callq 0x3560
movl %eax, %esi
movl %eax, -0x2c(%rbp)
leaq 0x7999(%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_O3/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 0x78f1(%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 0x5ba3
movl (%r14), %eax
movl %eax, %ecx
andl $0x110, %ecx            # imm = 0x110
cmpl $0x100, %ecx            # imm = 0x100
jne 0x5bc3
movl 0x154(%rbx), %edx
movl 0x158(%rbx), %ecx
jmp 0x5bcd
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
movq $0x0, 0x40(%r14)
jmp 0x5bee
movl $0x5a, %ecx
movl $0xa0, %edx
movl %edx, 0x12c(%rbx)
movl %ecx, 0x130(%rbx)
testb $0x40, %al
jne 0x5bee
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_O3/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 0x5d1e
movq %rax, %r12
leaq 0x782f(%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 0x5c9d
xorl %eax, %eax
callq 0x37bc
movzwl 0x10(%r14), %r12d
addl $0x2, %r12d
leaq 0x77f5(%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 0x5cb5
addl %edi, %r8d
cmpl %edx, %r8d
jbe 0x5cb3
subl %r12d, %edx
movl %edx, %ebx
jmp 0x5cb5
movzwl 0x10(%r14), %r12d
movzwl 0x12(%r14), %r13d
movswl 0xc(%r14), %ebx
movswl 0xe(%r14), %r15d
jmp 0x5ce0
movl %esi, %ebx
movswl 0x12(%rax), %esi
movl %r13d, %edi
shrl %edi
xorl %r15d, %r15d
movl %esi, %edx
subl %edi, %edx
jb 0x5cd8
addl %esi, %edi
cmpl %ecx, %edi
jbe 0x5cd5
subl %r13d, %ecx
movl %ecx, %r15d
jmp 0x5cd8
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 0x5dce
leaq 0x7d6a(%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 0x6685
// File: /workspace/github_c_makefile_star2_O3/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 0x76d8(%rip), %r15      # 0xd458
movq (%r15), %rdi
movl %r14d, %esi
callq 0x3080
leaq 0x6be(%rip), %rdx       # 0x6450
movl %eax, %edi
movq %rbx, %rsi
callq 0x63e3
movq (%r15), %rdi
movl %r14d, %esi
callq 0x3220
leaq 0x721(%rip), %rdx       # 0x64cf
movl %eax, %edi
movq %rbx, %rsi
callq 0x63e3
movq %rbx, %rdi
callq 0x5b43
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x5d1e
movq %rax, %rbx
leaq 0x713b(%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 0x711c(%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 0x5dce
movl $0x1, 0x194(%rbx)
leaq 0x76a5(%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 0x6685
// File: /workspace/github_c_makefile_star2_O3/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 0x7059(%rip), %rax      # 0xd458
movq (%rax), %rdi
leaq -0x30(%rbp), %rdx
xorl %ecx, %ecx
callq 0x3120
testb %al, %al
je 0x6445
cmpl $0x0, -0x30(%rbp)
je 0x643c
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 0x641a
leaq -0x30(%rbp), %rdi
callq 0x3620
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x6fe9(%rip), %rcx      # 0xd458
movq (%rcx), %rcx
cmpl 0xd4(%rcx), %eax
je 0x648a
cmpl 0xd8(%rcx), %eax
je 0x648a
cmpl 0xd0(%rcx), %eax
jne 0x64c6
movl $0x0, 0xc0(%rbx)
leaq -0x14(%rbp), %rcx
movl $0x20000, (%rcx)        # imm = 0x20000
leaq 0x6fa3(%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_O3/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 0x6f69(%rip), %r12      # 0xd458
movq (%r12), %rcx
cmpl 0x10c(%rcx), %eax
jne 0x650b
movq %rbx, %rdi
callq 0x53dd
movl (%r14,%r15,4), %eax
movq (%r12), %rcx
cmpl 0x12c(%rcx), %eax
jne 0x651d
movl $0x1, 0xc4(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop