// File: /workspace/github_c_makefile_star2_O0/kaugm[P]mmwm/mmwm.c
// Function: buttonpress
void buttonpress(xcb_generic_event_t *e)
{
    xcb_button_press_event_t *ev = (xcb_button_press_event_t *)e;
    DEBUGP("xcb: button press: %d state: %d\n", ev->detail, ev->state);

    client *c = wintoclient(ev->event);

	if (CLICK_TO_FOCUS && M_CURRENT != c && ev->detail == XCB_BUTTON_INDEX_1) {
		update_current(c);
	}

	for (unsigned int i = 0; i < LENGTH(buttons); i++)
		if (buttons[i].func && buttons[i].button == ev->detail &&
			CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) {
			if (M_CURRENT != c)
				update_current(c);
			if (buttons[i].root_only) {
				if (ev->event == ev->root && ev->child == 0)
					buttons[i].func(&(buttons[i].arg));
			}
			else {
				buttons[i].func(&(buttons[i].arg));
			}
		}

    if (CLICK_TO_FOCUS) {
        xcb_allow_events(dis, XCB_ALLOW_REPLAY_POINTER, ev->time);
        xcb_flush(dis);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x88d0
movq %rax, -0x18(%rbp)
movq 0x7075(%rip), %rax      # 0xd7d0
movq 0x30(%rax), %rax
cmpq -0x18(%rbp), %rax
je 0x677b
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x1, %eax
jne 0x677b
movq -0x18(%rbp), %rdi
callq 0x4010
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpq $0x5, %rax
jae 0x68d1
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6f45(%rip), %rax      # 0xd6e0
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x68c1
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6f27(%rip), %rax      # 0xd6e0
shlq $0x5, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
cmpl %ecx, %eax
jne 0x68c1
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6f01(%rip), %rax      # 0xd6e0
shlq $0x5, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl 0x6fc2(%rip), %ecx      # 0xd7b0
orl $0x2, %ecx
xorl $-0x1, %ecx
andl %ecx, %eax
movq -0x10(%rbp), %rcx
movzwl 0x1c(%rcx), %ecx
movl 0x6fac(%rip), %edx      # 0xd7b0
orl $0x2, %edx
xorl $-0x1, %edx
andl %edx, %ecx
cmpl %ecx, %eax
jne 0x68c1
movq 0x6fb5(%rip), %rax      # 0xd7d0
movq 0x30(%rax), %rax
cmpq -0x18(%rbp), %rax
je 0x682e
movq -0x18(%rbp), %rdi
callq 0x4010
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6ea6(%rip), %rax      # 0xd6e0
shlq $0x5, %rcx
addq %rcx, %rax
testb $0x1, 0x18(%rax)
je 0x6891
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x688f
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x688f
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6e73(%rip), %rax      # 0xd6e0
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
leaq 0x6e5e(%rip), %rdi      # 0xd6e0
shlq $0x5, %rcx
addq %rcx, %rdi
addq $0x10, %rdi
callq *%rax
jmp 0x68bf
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x6e43(%rip), %rax      # 0xd6e0
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movl -0x1c(%rbp), %ecx
leaq 0x6e2e(%rip), %rdi      # 0xd6e0
shlq $0x5, %rcx
addq %rcx, %rdi
addq $0x10, %rdi
callq *%rax
jmp 0x68c1
jmp 0x68c3
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6782
movq 0x6ec8(%rip), %rdi      # 0xd7a0
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
movl $0x2, %esi
callq 0x3160
movl %eax, -0x20(%rbp)
movq 0x6ead(%rip), %rdi      # 0xd7a0
callq 0x3190
addq $0x20, %rsp
popq %rbp
retq
nop