// File: /workspace/github_c_makefile_star2_O1/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 0x6d43(%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 0x7146(%rip), %eax      # 0xc7e8
testw %ax, %ax
setne %dl
movzwl 0x713b(%rip), %ecx      # 0xc7ea
testw %cx, %cx
setne %sil
andb %dl, %sil
movzwl 0x712c(%rip), %edx      # 0xc7ec
testw %dx, %dx
setne %dil
andb %sil, %dil
movzbl %r15b, %r15d
cmpb $0x1, %dil
jne 0x5707
movq 0x6cdd(%rip), %rdi      # 0xc3b8
orl %r14d, %eax
orl %ecx, %edx
orl %eax, %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 0x70da(%rip), %ecx      # 0xc7e8
testw %cx, %cx
setne %dl
movzwl 0x70cf(%rip), %eax      # 0xc7ea
testw %ax, %ax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x575f
movq 0x6c86(%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 0x7084(%rip), %ecx      # 0xc7ea
testw %cx, %cx
setne %dl
movzwl 0x7079(%rip), %eax      # 0xc7ec
testw %ax, %ax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x57b7
movq 0x6c2e(%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 0x702a(%rip), %ecx      # 0xc7e8
testw %cx, %cx
setne %dl
movzwl 0x7021(%rip), %eax      # 0xc7ec
testw %ax, %ax
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x580f
movq 0x6bd6(%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 0x6fd2(%rip), %eax      # 0xc7e8
testw %ax, %ax
je 0x584d
movq 0x6b96(%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 0x6f96(%rip), %eax      # 0xc7ea
testw %ax, %ax
je 0x588b
movq 0x6b58(%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 0x6f5a(%rip), %eax      # 0xc7ec
testw %ax, %ax
je 0x58cb
movq 0x6b1a(%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 0x58cf
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq