// File: /workspace/github_c_makefile_star2_O2/tudurom[P]windowchef/wm.c
// Function: window_grab_button
static void
window_grab_button(xcb_window_t win, uint8_t button, uint16_t modifier)
{
#define GRAB(b, m)												   \
	xcb_grab_button(conn, false, win, XCB_EVENT_MASK_BUTTON_PRESS, \
	                XCB_GRAB_MODE_SYNC, XCB_GRAB_MODE_ASYNC, XCB_NONE, XCB_NONE, b, m)

	GRAB(button, modifier);
	if (num_lock != XCB_NO_SYMBOL && caps_lock != XCB_NO_SYMBOL && scroll_lock != XCB_NO_SYMBOL)
		GRAB(button, modifier | num_lock | caps_lock | scroll_lock);
	if (num_lock != XCB_NO_SYMBOL && caps_lock != XCB_NO_SYMBOL)
		GRAB(button, modifier | num_lock | caps_lock);
	if (caps_lock != XCB_NO_SYMBOL && scroll_lock != XCB_NO_SYMBOL)
		GRAB(button, modifier | caps_lock | scroll_lock);
	if (num_lock != XCB_NO_SYMBOL && scroll_lock != XCB_NO_SYMBOL)
		GRAB(button, modifier | num_lock | scroll_lock);
	if (num_lock != XCB_NO_SYMBOL)
		GRAB(button, modifier | num_lock);
	if (caps_lock != XCB_NO_SYMBOL)
		GRAB(button, modifier | caps_lock);
	if (scroll_lock != XCB_NO_SYMBOL)
		GRAB(button, modifier | scroll_lock);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %ebx
movq 0x6f4b(%rip), %rdi      # 0xc3b8
movl %edx, 0x18(%rsp)
andl $0x0, 0x8(%rsp)
movl %esi, 0x10(%rsp)
andl $0x0, (%rsp)
pushq $0x4
popq %rcx
pushq $0x1
popq %r9
xorl %esi, %esi
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x3330
movzwl 0x7350(%rip), %ecx      # 0xc7e8
testw %cx, %cx
setne %dl
movzwl 0x7345(%rip), %eax      # 0xc7ea
testw %ax, %ax
setne %sil
andb %dl, %sil
movzwl 0x7336(%rip), %edx      # 0xc7ec
testw %dx, %dx
setne %dil
andb %sil, %dil
movzbl %r14b, %r14d
cmpb $0x1, %dil
jne 0x550d
movq 0x6ee7(%rip), %rdi      # 0xc3b8
orl %ebp, %ecx
orl %eax, %edx
orl %ecx, %edx
movl %r14d, 0x10(%rsp)
movzwl %dx, %eax
andl $0x0, 0x8(%rsp)
movl %eax, 0x18(%rsp)
andl $0x0, (%rsp)
pushq $0x4
popq %rcx
pushq $0x1
popq %r9
xorl %esi, %esi
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x3330
movzwl 0x72e2(%rip), %ecx      # 0xc7e8
movzwl 0x72dd(%rip), %eax      # 0xc7ea
testw %cx, %cx
setne %dl
testw %ax, %ax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x555d
movq 0x6e8e(%rip), %rdi      # 0xc3b8
orl %ebp, %ecx
orl %ecx, %eax
movl %r14d, 0x10(%rsp)
movzwl %ax, %eax
andl $0x0, 0x8(%rsp)
movl %eax, 0x18(%rsp)
andl $0x0, (%rsp)
pushq $0x4
popq %rcx
pushq $0x1
popq %r9
xorl %esi, %esi
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x3330
movzwl 0x728d(%rip), %eax      # 0xc7ea
testw %ax, %ax
setne %dl
movzwl 0x7282(%rip), %ecx      # 0xc7ec
testw %cx, %cx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x55b4
movq 0x6e37(%rip), %rdi      # 0xc3b8
orl %ebp, %eax
orl %eax, %ecx
movl %r14d, 0x10(%rsp)
movzwl %cx, %eax
andl $0x0, 0x8(%rsp)
movl %eax, 0x18(%rsp)
andl $0x0, (%rsp)
pushq $0x4
popq %rcx
pushq $0x1
popq %r9
xorl %esi, %esi
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x3330
movzwl 0x7238(%rip), %ecx      # 0xc7ec
movzwl 0x722d(%rip), %eax      # 0xc7e8
testw %ax, %ax
setne %dl
testw %cx, %cx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x560b
movq 0x6de0(%rip), %rdi      # 0xc3b8
orl %ebp, %eax
orl %eax, %ecx
movl %r14d, 0x10(%rsp)
movzwl %cx, %eax
andl $0x0, 0x8(%rsp)
movl %eax, 0x18(%rsp)
andl $0x0, (%rsp)
pushq $0x4
popq %rcx
pushq $0x1
popq %r9
xorl %esi, %esi
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x3330
movzwl 0x71dd(%rip), %eax      # 0xc7e8
testw %ax, %ax
je 0x5641
movq 0x6da1(%rip), %rdi      # 0xc3b8
orl %ebp, %eax
movl %r14d, 0x10(%rsp)
movzwl %ax, %eax
andl $0x0, 0x8(%rsp)
movl %eax, 0x18(%rsp)
andl $0x0, (%rsp)
pushq $0x4
popq %rcx
pushq $0x1
popq %r9
xorl %esi, %esi
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x3330
movzwl 0x71a2(%rip), %eax      # 0xc7ea
testw %ax, %ax
je 0x567e
movq 0x6d64(%rip), %rdi      # 0xc3b8
orl %ebp, %eax
movl %r14d, 0x10(%rsp)
movzwl %ax, %eax
andl $0x0, 0x8(%rsp)
movl %eax, 0x18(%rsp)
andl $0x0, (%rsp)
pushq $0x4
popq %rcx
pushq $0x1
popq %r9
xorl %esi, %esi
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x3330
movzwl 0x7167(%rip), %eax      # 0xc7ec
testw %ax, %ax
je 0x56bb
movq 0x6d27(%rip), %rdi      # 0xc3b8
orl %ebp, %eax
movl %r14d, 0x10(%rsp)
movzwl %ax, %eax
andl $0x0, 0x8(%rsp)
movl %eax, 0x18(%rsp)
andl $0x0, (%rsp)
pushq $0x4
popq %rcx
pushq $0x1
popq %r9
xorl %esi, %esi
movl %ebx, %edx
xorl %r8d, %r8d
callq 0x3330
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq