// File: /workspace/github_c_makefile_star2_O0/tudurom[P]windowchef/wm.c
// Function: pointer_grab
static bool
pointer_grab(enum pointer_action pac)
{
	xcb_window_t win = XCB_NONE;
	xcb_point_t pos = (xcb_point_t) {0, 0};
	struct client *client;

	xcb_query_pointer_reply_t *qr =
		xcb_query_pointer_reply(conn, xcb_query_pointer(conn, scr->root), NULL);

	if (qr == NULL) {
		return false;
	}

	win = qr->child;
	pos = (xcb_point_t) {qr->root_x, qr->root_y};
	free(qr);

	client = find_client(&win);
	if (client == NULL)
		return true;

	raise_window(client->window);
	if (pac == POINTER_ACTION_FOCUS) {
		DMSG("grabbing pointer to focus on 0x%08x\n", client->window);
		if (client != focused_win) {
			set_focused(client);
			if (!conf.replay_click_on_focus)
				return true;
		}
		return false;
	}

	if (is_special(client)) {
		return true;
	}

	xcb_grab_pointer_reply_t *reply =
		xcb_grab_pointer_reply(conn, xcb_grab_pointer(conn, 0, scr->root, XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_BUTTON_MOTION, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_NONE, XCB_NONE, XCB_CURRENT_TIME), NULL);

	if (reply == NULL || reply->status != XCB_GRAB_STATUS_SUCCESS) {
		free(reply);
		return true;
	}
	free(reply);

	track_pointer(client, pac, pos);

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x3090
movq 0x750f(%rip), %rax      # 0xf3d8
movq %rax, -0x40(%rbp)
movq 0x7504(%rip), %rdi      # 0xf3d8
movq 0x791d(%rip), %rax      # 0xf7f8
movl (%rax), %esi
callq 0x3510
movq -0x40(%rbp), %rdi
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x3670
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x7f09
movb $0x0, -0x1(%rbp)
jmp 0x8050
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xc(%rbp)
movq -0x20(%rbp), %rax
movw 0x10(%rax), %ax
movw %ax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movw 0x12(%rax), %ax
movw %ax, -0x26(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x10(%rbp)
movq -0x20(%rbp), %rdi
callq 0x32d0
leaq -0xc(%rbp), %rdi
callq 0x4ff0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x7f57
movb $0x1, -0x1(%rbp)
jmp 0x8050
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x6a40
cmpl $0x1, -0x8(%rbp)
jne 0x7f9b
movq -0x18(%rbp), %rax
cmpq 0x788d(%rip), %rax      # 0xf800
je 0x7f92
movq -0x18(%rbp), %rdi
callq 0x6a10
testb $0x1, 0x7861(%rip)      # 0xf7e6
jne 0x7f90
movb $0x1, -0x1(%rbp)
jmp 0x8050
jmp 0x7f92
movb $0x0, -0x1(%rbp)
jmp 0x8050
movq -0x18(%rbp), %rdi
callq 0x5780
testb $0x1, %al
jne 0x7faa
jmp 0x7fb3
movb $0x1, -0x1(%rbp)
jmp 0x8050
movq 0x741e(%rip), %rax      # 0xf3d8
movq %rax, -0x48(%rbp)
movq 0x7413(%rip), %rdi      # 0xf3d8
movq 0x782c(%rip), %rax      # 0xf7f8
movl (%rax), %edx
xorl %esi, %esi
movl $0x2008, %ecx           # imm = 0x2008
movl $0x1, %r9d
movl %r9d, %r8d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
callq 0x31a0
movq -0x48(%rbp), %rdi
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x33b0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x8025
movq -0x30(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x8034
movq -0x30(%rbp), %rdi
callq 0x32d0
movb $0x1, -0x1(%rbp)
jmp 0x8050
movq -0x30(%rbp), %rdi
callq 0x32d0
movq -0x18(%rbp), %rdi
movl -0x8(%rbp), %esi
movl -0x10(%rbp), %edx
callq 0x8060
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)