// File: /workspace/github_c_makefile_star2_O0/kaiserschmarrn0[P]mywm/mywm.c
// Function: button_press
static void button_press(xcb_generic_event_t *ev) {
	xcb_button_press_event_t *e = (xcb_button_press_event_t *)ev;

	search_data ret = search_helper(curws, TYPE_NORMAL, e->event, search_resize_regions);
	if (ret.win) {
		switch(ret.index) {
			case 0: mouse_resize_north_west(&(press_arg){ stack[curws].fwin->windows[WIN_PARENT], e->root_x, e->root_y }); break;
			case 1: mouse_resize_north(&(press_arg){ stack[curws].fwin->windows[WIN_PARENT], e->root_x, e->root_y }); break;
			case 2: mouse_resize_north_east(&(press_arg){ stack[curws].fwin->windows[WIN_PARENT], e->root_x, e->root_y }); break;
			case 3: mouse_resize_east(&(press_arg){ stack[curws].fwin->windows[WIN_PARENT], e->root_x, e->root_y }); break;
			case 4: mouse_resize_south_east(&(press_arg){ stack[curws].fwin->windows[WIN_PARENT], e->root_x, e->root_y }); break;
			case 5: mouse_resize_south(&(press_arg){ stack[curws].fwin->windows[WIN_PARENT], e->root_x, e->root_y }); break;
			case 6: mouse_resize_south_west(&(press_arg){ stack[curws].fwin->windows[WIN_PARENT], e->root_x, e->root_y }); break;
			case 7: mouse_resize_west(&(press_arg){ stack[curws].fwin->windows[WIN_PARENT], e->root_x, e->root_y }); break;
		}
		return;
	}

	if (stack[curws].fwin) {
		for (int i = WIN_COUNT; i < REGION_COUNT; i++) {
			if (stack[curws].fwin->windows[i] == e->child) {
				draw_region(stack[curws].fwin, i, PM_PRESS);
				button_press_helper(e, controls[i - WIN_COUNT].buttons_len,
						controls[i - WIN_COUNT].buttons, e->event,
						e->event_x, e->event_y);
				return;
			}
		}
	}

	if (button_press_helper(e, LEN(parent_buttons), parent_buttons, e->event, e->root_x,
			e->root_y)) {
		return;
	}
	if (button_press_helper(e, LEN(grab_buttons), grab_buttons, e->child, e->event_x,
			e->event_y)) {
		return;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0xc142(%rip), %rax      # 0x10a70
movl (%rax), %edi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
movl $0x1, %esi
leaq 0x216d(%rip), %rcx      # 0x6ab0
callq 0x85f0
movq %rax, -0x20(%rbp)
movl %edx, -0x18(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x4bca
movl -0x18(%rbp), %eax
movq %rax, -0x90(%rbp)
subq $0x7, %rax
ja 0x4bc5
movq -0x90(%rbp), %rax
leaq 0x7688(%rip), %rcx      # 0xc004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xc0e4(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbf9a(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movl 0xd0(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movl %eax, -0x24(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0x9e30
jmp 0x4bc5
leaq 0xc09b(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbf51(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movl 0xd0(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movl %eax, -0x30(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x9ae0
jmp 0x4bc5
leaq 0xc052(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbf08(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movl 0xd0(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movl %eax, -0x3c(%rbp)
leaq -0x44(%rbp), %rdi
callq 0x9ef0
jmp 0x4bc5
leaq 0xc009(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbebf(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movl 0xd0(%rax), %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movl %eax, -0x48(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x9d80
jmp 0x4bc5
leaq 0xbfc0(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbe76(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movl 0xd0(%rax), %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %eax
movl %eax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movl %eax, -0x54(%rbp)
leaq -0x5c(%rbp), %rdi
callq 0x9870
jmp 0x4bc5
leaq 0xbf77(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbe2d(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movl 0xd0(%rax), %eax
movl %eax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %eax
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movl %eax, -0x60(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x9a30
jmp 0x4bc5
leaq 0xbf2e(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbde4(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movl 0xd0(%rax), %eax
movl %eax, -0x74(%rbp)
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movl %eax, -0x6c(%rbp)
leaq -0x74(%rbp), %rdi
callq 0x9fb0
jmp 0x4bc5
leaq 0xbee8(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbd9e(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movl 0xd0(%rax), %eax
movl %eax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %eax
movl %eax, -0x7c(%rbp)
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %eax
movl %eax, -0x78(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x9c30
jmp 0x4d4f
leaq 0xbe9f(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbd55(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x48(%rax)
je 0x4ce5
movl $0x2, -0x84(%rbp)
movslq -0x84(%rbp), %rax
cmpq $0x4, %rax
jae 0x4ce3
leaq 0xbe61(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbd17(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movslq -0x84(%rbp), %rcx
movl 0xcc(%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jne 0x4ccd
leaq 0xbe2a(%rip), %rax      # 0x10a70
movslq (%rax), %rcx
leaq 0xbce0(%rip), %rax      # 0x10930
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rdi
movl -0x84(%rbp), %esi
movl $0x2, %edx
callq 0x69e0
movq -0x10(%rbp), %rdi
movl -0x84(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0xad7e(%rip), %rax      # 0xfa00
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movl 0x28(%rax), %esi
movl -0x84(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0xad61(%rip), %rax      # 0xfa00
imulq $0x50, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rdx
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x10(%rbp), %rax
movswl 0x18(%rax), %r8d
movq -0x10(%rbp), %rax
movswl 0x1a(%rax), %r9d
callq 0x5480
jmp 0x4d4f
jmp 0x4ccf
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x4bf7
jmp 0x4ce5
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x10(%rbp), %rax
movswl 0x14(%rax), %r8d
movq -0x10(%rbp), %rax
movswl 0x16(%rax), %r9d
movl $0x2, %esi
leaq 0xaf52(%rip), %rdx      # 0xfc60
callq 0x5480
cmpl $0x0, %eax
je 0x4d1a
jmp 0x4d4f
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x10(%rbp), %rax
movswl 0x18(%rax), %r8d
movq -0x10(%rbp), %rax
movswl 0x1a(%rax), %r9d
movl $0x2, %esi
leaq 0xad5d(%rip), %rdx      # 0xfaa0
callq 0x5480
cmpl $0x0, %eax
je 0x4d4f
jmp 0x4d4f
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax,%rax)