// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %edi, %r14d
movq 0x6216(%rip), %r15      # 0xc3b8
movq 0x662f(%rip), %rax      # 0xc7d8
movl (%rax), %esi
movq %r15, %rdi
callq 0x3500
xorl %ebx, %ebx
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3670
testq %rax, %rax
je 0x656d
movl 0xc(%rax), %ecx
leaq 0x44(%rsp), %rbx
movl %ecx, (%rbx)
movzwl 0x10(%rax), %ebp
movzwl 0x12(%rax), %r13d
movq %rax, %rdi
callq 0x32c0
movq %rbx, %rdi
callq 0x49ea
movb $0x1, %bl
testq %rax, %rax
je 0x656d
movq %rax, %r15
movl (%rax), %edi
callq 0x5944
cmpl $0x1, %r14d
jne 0x622d
cmpq 0x65d1(%rip), %r15      # 0xc7e0
je 0x6226
movq %r15, %rdi
callq 0x5936
cmpb $0x1, 0x65a6(%rip)      # 0xc7c6
jne 0x656d
xorl %ebx, %ebx
jmp 0x656d
movq %r15, %rdi
callq 0x4dab
testb %al, %al
jne 0x656d
movq 0x6174(%rip), %r12      # 0xc3b8
movq 0x658d(%rip), %rax      # 0xc7d8
movl (%rax), %edx
andl $0x0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
pushq $0x1
popq %r8
movq %r12, %rdi
xorl %esi, %esi
movl $0x2008, %ecx           # imm = 0x2008
movl %r8d, %r9d
callq 0x3190
movq %r12, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x33a0
testq %rax, %rax
je 0x6288
cmpb $0x0, 0x1(%rax)
je 0x6295
movq %rax, %rdi
callq 0x32c0
jmp 0x656d
movq %rax, %rdi
callq 0x32c0
movzwl 0x4(%r15), %eax
movq %rax, 0x28(%rsp)
movzwl 0x6(%r15), %eax
movq %rax, 0x20(%rsp)
movzwl 0x8(%r15), %eax
movl %eax, 0x1c(%rsp)
movzwl 0xa(%r15), %eax
movl %eax, 0x18(%rsp)
cmpl $0x3, %r14d
je 0x6307
cmpl $0x4, %r14d
jne 0x6334
movl %ebp, %eax
subl 0x28(%rsp), %eax
movl %r13d, %ecx
subl 0x20(%rsp), %ecx
cwtl
movl 0x18(%rsp), %edi
movl %edi, %edx
imull %eax, %edx
movswl %cx, %ecx
movl 0x1c(%rsp), %esi
imull %esi, %ecx
subl %eax, %esi
imull %edi, %esi
xorl %edi, %edi
cmpl %ecx, %esi
setle %dil
leal 0x2(%rdi), %eax
cmpl %ecx, %edx
cmovll %edi, %eax
jmp 0x6344
movl 0x1c(%rsp), %eax
shrl %eax
movq 0x28(%rsp), %rcx
addl %eax, %ecx
movl 0x18(%rsp), %eax
shrl %eax
movq 0x20(%rsp), %rdx
addl %edx, %eax
cmpw %ax, %r13w
jge 0x6339
xorl %eax, %eax
cmpw %cx, %bp
setl %al
xorl $0x5, %eax
jmp 0x6344
pushq $0x4
popq %rax
jmp 0x6344
xorl %eax, %eax
cmpw %cx, %bp
setl %al
xorl $0x7, %eax
leal -0x3(%r14), %ecx
movl %ecx, 0x34(%rsp)
xorl %r12d, %r12d
movl %eax, %eax
movq %rax, 0x38(%rsp)
movq %r12, %rdi
callq 0x32c0
movq 0x6053(%rip), %rdi      # 0xc3b8
callq 0x33c0
testq %rax, %rax
jne 0x637d
movq 0x6042(%rip), %rdi      # 0xc3b8
callq 0x33f0
jmp 0x635e
movq %rax, %r12
movzbl (%rax), %eax
andl $0x7f, %eax
cmpq $0x6, %rax
je 0x63ac
cmpl $0x5, %eax
je 0x6557
leaq 0x6044(%rip), %rcx      # 0xc3e0
movq (%rcx,%rax,8), %rax
testq %rax, %rax
je 0x6356
movq %r12, %rdi
callq *%rax
jmp 0x6356
movzwl 0x14(%r12), %esi
movzwl 0x16(%r12), %r10d
subl %ebp, %esi
subl %r13d, %r10d
cmpl $0x2, %r14d
jne 0x63ea
addl 0x28(%rsp), %esi
movw %si, 0x4(%r15)
addl 0x20(%rsp), %r10d
movw %r10w, 0x6(%r15)
movl (%r15), %edi
movswl %si, %esi
movswl %r10w, %edx
callq 0x4c44
jmp 0x6356
cmpl $0x1, 0x34(%rsp)
ja 0x6356
movzwl 0x4(%r15), %edi
movzwl 0x6(%r15), %ecx
movzwl 0x8(%r15), %r9d
movzwl 0xa(%r15), %r8d
cmpb $0x1, 0x63b1(%rip)      # 0xc7c1
jne 0x642b
movzwl 0x50(%r15), %r11d
movswl %si, %eax
cltd
idivl %r11d
subl %edx, %esi
movswl %r10w, %eax
cltd
idivl %r11d
subl %edx, %r10d
movq 0x38(%rsp), %rax
leaq 0x2c2d(%rip), %rdx      # 0x9064
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
movswl %si, %edx
movswl %r10w, %esi
jmpq *%rax
movq 0x28(%rsp), %rax
leal (%rdx,%rax), %r10d
movl 0x1c(%rsp), %r9d
subl %edx, %r9d
movl %ecx, %eax
jmp 0x64f0
movq 0x20(%rsp), %rax
addl %esi, %eax
movl 0x18(%rsp), %r8d
subl %esi, %r8d
movq 0x28(%rsp), %rsi
leal (%rdx,%rsi), %r10d
movl 0x1c(%rsp), %r9d
subl %edx, %r9d
jmp 0x64f0
movq 0x20(%rsp), %rax
addl %esi, %eax
movl 0x18(%rsp), %r8d
subl %esi, %r8d
movl %edi, %r10d
jmp 0x64f0
addl 0x1c(%rsp), %edx
movl %edi, %r10d
movl %ecx, %eax
jmp 0x64d1
addl 0x1c(%rsp), %edx
addl 0x18(%rsp), %esi
movl %edi, %r10d
movl %ecx, %eax
movl %edx, %r9d
jmp 0x64ed
addl 0x18(%rsp), %esi
movl %edi, %r10d
jmp 0x64eb
movq 0x20(%rsp), %rax
addl %esi, %eax
movl 0x18(%rsp), %r8d
subl %esi, %r8d
addl 0x1c(%rsp), %edx
movl %edi, %r10d
movl %edx, %r9d
jmp 0x64f0
movq 0x28(%rsp), %rax
leal (%rdx,%rax), %r10d
movl 0x1c(%rsp), %r9d
subl %edx, %r9d
addl 0x18(%rsp), %esi
movl %ecx, %eax
movl %esi, %r8d
movzwl 0x48(%r15), %esi
cmpl %esi, %r9d
cmovll %edi, %r10d
cmovgl %r9d, %esi
movzwl 0x4a(%r15), %edx
cmpl %edx, %r8d
cmovll %ecx, %eax
cmovgl %r8d, %edx
movw %r10w, 0x4(%r15)
movw %si, 0x8(%r15)
movw %dx, 0xa(%r15)
movw %ax, 0x6(%r15)
movl (%r15), %edi
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %esi
andl %eax, %edx
callq 0x4c9e
movl (%r15), %edi
movswl 0x4(%r15), %esi
movswl 0x6(%r15), %edx
callq 0x4c44
movq 0x5e6b(%rip), %rdi      # 0xc3b8
callq 0x33f0
jmp 0x6356
movq %r12, %rdi
callq 0x32c0
movq 0x5e52(%rip), %rdi      # 0xc3b8
xorl %esi, %esi
callq 0x3040
movl %ebx, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq