// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %r15d
movl %edi, %ebx
movq 0x6df9(%rip), %rdi      # 0xc3b8
xorl %r12d, %r12d
xorl %esi, %esi
movl %ebx, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %r14
pushq %r15
pushq %r12
pushq %r12
callq 0x3340
addq $0x20, %rsp
movzwl 0x71fc(%rip), %ecx      # 0xc7e8
testw %cx, %cx
setne %dl
movzwl 0x71f1(%rip), %eax      # 0xc7ea
testw %ax, %ax
setne %sil
andb %dl, %sil
movzwl 0x71e2(%rip), %edx      # 0xc7ec
testw %dx, %dx
setne %dil
andb %sil, %dil
movzbl %r15b, %r15d
cmpb $0x1, %dil
jne 0x565f
movq 0x6d93(%rip), %rdi      # 0xc3b8
orl %r14d, %ecx
orl %eax, %edx
orl %ecx, %edx
movzwl %dx, %eax
xorl %esi, %esi
movl %ebx, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %rax
pushq %r15
pushq %r12
pushq %r12
callq 0x3340
addq $0x20, %rsp
movzwl 0x7190(%rip), %ecx      # 0xc7e8
movzwl 0x718b(%rip), %eax      # 0xc7ea
testw %cx, %cx
setne %dl
testw %ax, %ax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x56b0
movq 0x6d3c(%rip), %rdi      # 0xc3b8
orl %r14d, %ecx
orl %ecx, %eax
xorl %r10d, %r10d
movzwl %ax, %eax
xorl %esi, %esi
movl %ebx, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %rax
pushq %r15
pushq %r10
pushq %r10
callq 0x3340
addq $0x20, %rsp
movzwl 0x713a(%rip), %eax      # 0xc7ea
testw %ax, %ax
setne %dl
movzwl 0x712f(%rip), %ecx      # 0xc7ec
testw %cx, %cx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x5707
movq 0x6ce4(%rip), %rdi      # 0xc3b8
orl %r14d, %eax
orl %eax, %ecx
xorl %eax, %eax
movzwl %cx, %r10d
xorl %esi, %esi
movl %ebx, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %r10
pushq %r15
pushq %rax
pushq %rax
callq 0x3340
addq $0x20, %rsp
movzwl 0x70e5(%rip), %ecx      # 0xc7ec
movzwl 0x70da(%rip), %eax      # 0xc7e8
testw %ax, %ax
setne %dl
testw %cx, %cx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x575e
movq 0x6c8d(%rip), %rdi      # 0xc3b8
orl %r14d, %eax
orl %eax, %ecx
xorl %eax, %eax
movzwl %cx, %r10d
xorl %esi, %esi
movl %ebx, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %r10
pushq %r15
pushq %rax
pushq %rax
callq 0x3340
addq $0x20, %rsp
movzwl 0x708a(%rip), %eax      # 0xc7e8
testw %ax, %ax
je 0x5795
movq 0x6c4e(%rip), %rdi      # 0xc3b8
orl %r14d, %eax
xorl %r10d, %r10d
movzwl %ax, %eax
xorl %esi, %esi
movl %ebx, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %rax
pushq %r15
pushq %r10
pushq %r10
callq 0x3340
addq $0x20, %rsp
movzwl 0x704e(%rip), %eax      # 0xc7ea
testw %ax, %ax
je 0x57d3
movq 0x6c10(%rip), %rdi      # 0xc3b8
orl %r14d, %eax
xorl %r10d, %r10d
movzwl %ax, %eax
xorl %esi, %esi
movl %ebx, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %rax
pushq %r15
pushq %r10
pushq %r10
callq 0x3340
addq $0x20, %rsp
movzwl 0x7012(%rip), %eax      # 0xc7ec
testw %ax, %ax
je 0x5813
movq 0x6bd2(%rip), %rdi      # 0xc3b8
orl %r14d, %eax
xorl %r10d, %r10d
movzwl %ax, %eax
xorl %esi, %esi
movl %ebx, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
pushq %rax
pushq %r15
pushq %r10
pushq %r10
callq 0x3340
addq $0x28, %rsp
jmp 0x5817
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq