// File: /workspace/github_c_makefile_star2_O3/mati75[P]evilwm/events.c
// Function: event_main_loop
void event_main_loop(void) {
	// XEvent is a big union of all the core event types, but we also need
	// to handle events about extensions, so make a union of the union...
	union {
		XEvent xevent;
#ifdef SHAPE
		XShapeEvent xshape;
#endif
#ifdef RANDR
		XRRScreenChangeNotifyEvent xrandr;
#endif
	} ev;

	// Main event loop
	while (!end_event_loop) {
		if (interruptibleXNextEvent(&ev.xevent)) {
			switch (ev.xevent.type) {
			case KeyPress:
				bind_handle_key(&ev.xevent.xkey);
				break;
			case ButtonPress:
				bind_handle_button(&ev.xevent.xbutton);
				break;
			case ConfigureNotify:
				handle_configure_notify(&ev.xevent.xconfigure);
				break;
			case ConfigureRequest:
				handle_configure_request(&ev.xevent.xconfigurerequest);
				break;
			case MapRequest:
				handle_map_request(&ev.xevent.xmaprequest);
				break;
			case ColormapNotify:
				handle_colormap_change(&ev.xevent.xcolormap);
				break;
			case EnterNotify:
				handle_enter_event(&ev.xevent.xcrossing);
				break;
			case PropertyNotify:
				handle_property_change(&ev.xevent.xproperty);
				break;
			case UnmapNotify:
				handle_unmap_event(&ev.xevent.xunmap);
				break;
			case MappingNotify:
				handle_mappingnotify_event(&ev.xevent.xmapping);
				break;
			case ClientMessage:
				handle_client_message(&ev.xevent.xclient);
				break;
			default:
#ifdef SHAPE
				if (display.have_shape
				    && ev.xevent.type == display.shape_event) {
					handle_shape_event(&ev.xshape);
				}
#endif
#ifdef RANDR
				if (display.have_randr && ev.xevent.type == display.randr_event_base + RRScreenChangeNotify) {
					handle_randr_event(&ev.xrandr);
				}
#endif
				break;
			}
		}

		// Scan list for clients flagged to be removed
		if (need_client_tidy) {
			struct list *iter, *niter;
			need_client_tidy = 0;
			for (iter = clients_tab_order; iter; iter = niter) {
				struct client *c = iter->data;
				niter = iter->next;
				if (c->remove)
					remove_client(c);
			}
		}
	}
}

// Assembly:
cmpb $0x0, 0x83fd(%rip)      # 0xf8cc
jne 0x7ab6
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsp, %rbx
leaq 0x8218(%rip), %r12      # 0xf708
leaq 0x8231(%rip), %r13      # 0xf728
leaq 0x340e(%rip), %rbp      # 0xa90c
movq %rbx, %rdi
callq 0x982c
testl %eax, %eax
je 0x79d9
movl (%rsp), %eax
cmpl $0x11, %eax
jle 0x7554
leal -0x12(%rax), %ecx
cmpl $0x10, %ecx
ja 0x7797
movslq (%rbp,%rcx,4), %rcx
addq %rbp, %rcx
jmpq *%rcx
movq 0x28(%rsp), %rdi
callq 0x534f
testq %rax, %rax
je 0x79d9
movl 0x24(%rax), %ecx
testl %ecx, %ecx
je 0x78fb
decl %ecx
movl %ecx, 0x24(%rax)
jmp 0x79d9
cmpl $0x2, %eax
je 0x777d
cmpl $0x4, %eax
je 0x778a
cmpl $0x7, %eax
jne 0x7797
movq 0x20(%rsp), %rdi
callq 0x534f
testq %rax, %rax
je 0x79d9
movq %rax, %r15
movl 0x20(%rax), %eax
cmpl $-0x1, %eax
je 0x759a
movq 0x10(%r15), %rcx
cmpl 0x60(%rcx), %eax
jne 0x79d9
movq %r15, %rdi
callq 0x5780
movq (%r12), %rdi
movq %r15, %rsi
callq 0x86c8
movq %rax, (%r12)
jmp 0x79d9
movq 0x20(%rsp), %rdi
callq 0x534f
testq %rax, %rax
je 0x79d9
movq %rax, %r15
movq 0x28(%rsp), %rax
cmpq $0x28, %rax
jne 0x78b5
movq %r15, %rdi
callq 0x5234
jmp 0x79d9
callq 0x95cb
movq %rax, %r15
movq 0x28(%rsp), %rax
cmpq 0x70(%r13), %rax
jne 0x7819
movl 0x38(%rsp), %esi
movq %r15, %rdi
callq 0x92d8
jmp 0x79d9
movq 0x28(%rsp), %rdi
callq 0x534f
jmp 0x79d9
movq 0x28(%rsp), %rdi
callq 0x534f
testq %rax, %rax
je 0x785e
movq %rax, %r15
movl 0x20(%rax), %esi
cmpl $-0x1, %esi
je 0x764c
movq 0x10(%r15), %rdi
cmpl 0x60(%rdi), %esi
je 0x764c
callq 0x92d8
movq %r15, %rdi
callq 0x55bc
movq %r15, %rdi
callq 0x5611
jmp 0x79d9
movq 0x28(%rsp), %rdi
callq 0x534f
movq %rax, %r15
movups 0x30(%rsp), %xmm0
movaps %xmm0, 0xc0(%rsp)
movl $0x0, 0xd0(%rsp)
movq 0x48(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
movl 0x50(%rsp), %eax
movl %eax, 0xe0(%rsp)
testq %r15, %r15
je 0x7896
movl 0x58(%rsp), %eax
notl %eax
testb $0x60, %al
jne 0x76c7
callq 0x534f
testq %rax, %rax
je 0x76c7
movq 0x8(%rax), %rax
movq %rax, 0xd8(%rsp)
movl 0x58(%rsp), %edi
leaq 0xc0(%rsp), %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x7ab7
leaq 0x803c(%rip), %rax      # 0xf720
cmpq (%rax), %r15
jne 0x79d9
movq %r15, %rdi
callq 0x9911
jmp 0x79d9
movq %rbx, %rdi
callq 0x4100
cmpl $0x1, 0x28(%rsp)
jne 0x79d9
cmpl $0x0, 0x188(%r13)
jle 0x79d9
xorl %r15d, %r15d
xorl %r14d, %r14d
movq 0x190(%r13), %rdi
addq %r15, %rdi
callq 0x4e74
incq %r14
movslq 0x188(%r13), %rax
addq $0x78, %r15
cmpq %rax, %r14
jl 0x7721
jmp 0x79d9
movq 0x20(%rsp), %rdi
callq 0x534f
testq %rax, %rax
je 0x79d9
cmpl $0x0, 0x30(%rsp)
je 0x79d9
movq 0x28(%rsp), %rsi
movq %rsi, 0x18(%rax)
movq (%r13), %rdi
callq 0x4590
jmp 0x79d9
movq %rbx, %rdi
callq 0x50ee
jmp 0x79d9
movq %rbx, %rdi
callq 0x519a
jmp 0x79d9
cmpl $0x0, 0x178(%r13)
je 0x77c1
cmpl 0x17c(%r13), %eax
jne 0x77c1
movq 0x20(%rsp), %rdi
callq 0x534f
testq %rax, %rax
je 0x77c1
movq %rax, %rdi
callq 0x5aea
cmpl $0x0, 0x180(%r13)
je 0x79d9
movl (%rsp), %eax
cmpl 0x184(%r13), %eax
jne 0x79d9
movq 0x28(%rsp), %rdi
callq 0x959f
movq %rax, %r15
movq %rax, %rdi
callq 0x93ec
movq %rbx, %rdi
callq 0x44f0
movq %r15, %rdi
callq 0x90ee
movq %r15, %rdi
callq 0x946e
movq %r15, %rdi
callq 0x7c5c
jmp 0x79d9
movq 0x20(%rsp), %rdi
callq 0x534f
movq 0x28(%rsp), %rcx
testq %rax, %rax
je 0x7907
cmpq 0x78(%r13), %rcx
jne 0x7930
cmpq $0x2, 0x38(%rsp)
jne 0x79d9
cmpq %r15, 0x10(%rax)
jne 0x79d9
movq %rax, %rdi
callq 0x5780
jmp 0x79d9
movq (%r13), %rdi
movq 0x28(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x4630
movq 0x28(%rsp), %r15
movq 0xe0(%rsp), %rdi
callq 0x959f
movq %r15, %rdi
movq %rax, %rsi
callq 0x6aac
jmp 0x79d9
movq (%r13), %rdi
movq 0x28(%rsp), %rsi
movl 0x58(%rsp), %edx
leaq 0xc0(%rsp), %rcx
callq 0x40e0
jmp 0x79d9
cmpq 0xc0(%r13), %rax
jne 0x79d9
movq %r15, %rdi
callq 0x532a
cmpl $0x0, 0x94(%r15)
jne 0x79d9
movl 0x20(%r15), %eax
cmpl $-0x1, %eax
je 0x78ee
movq 0x10(%r15), %rcx
cmpl 0x60(%rcx), %eax
jne 0x79d9
movq %r15, %rdi
callq 0x55bc
jmp 0x79d9
movl $0x1, 0x68(%rax)
jmp 0x79e2
cmpq 0xa8(%r13), %rcx
jne 0x79d9
movq 0x20(%rsp), %rdi
callq 0x97da
movq 0x20(%rsp), %rdi
movslq %eax, %rsi
callq 0x81c9
jmp 0x79d9
cmpq 0x90(%r13), %rcx
jne 0x7954
cmpq $0x2, 0x40(%rsp)
jne 0x79d9
movq %rax, %rdi
xorl %esi, %esi
callq 0x5a0a
jmp 0x79d9
cmpq 0x98(%r13), %rcx
jne 0x7995
movq 0x38(%rsp), %rcx
movl %ecx, %edx
andl $0x3000, %edx           # imm = 0x3000
cmpl $0x2000, %edx           # imm = 0x2000
jne 0x79d9
movl %ecx, %edi
shrl $0x8, %edi
andl $0xf, %edi
movzbl %cl, %ecx
movups 0x40(%rsp), %xmm0
movups 0x50(%rsp), %xmm1
shufps $0x88, %xmm1, %xmm0     # xmm0 = xmm0[0,2],xmm1[0,2]
movaps %xmm0, 0xc0(%rsp)
jmp 0x79c9
cmpq 0xa0(%r13), %rcx
jne 0x7a1b
cmpq $0x2, 0x38(%rsp)
jne 0x79d9
movq 0x40(%rsp), %rcx
movq %rcx, 0xd8(%rsp)
movl 0x48(%rsp), %ecx
movl %ecx, 0xe0(%rsp)
movl 0x90(%rax), %ecx
movl $0x60, %edi
leaq 0xc0(%rsp), %rsi
movq %rax, %rdx
callq 0x7ab7
cmpl $0x0, 0x7ee8(%rip)      # 0xf8c8
je 0x7a09
movl $0x0, 0x7edc(%rip)      # 0xf8c8
movq (%r12), %r14
testq %r14, %r14
je 0x7a09
movq 0x8(%r14), %rdi
movq (%r14), %r14
cmpl $0x0, 0x68(%rdi)
je 0x79f0
callq 0x5875
jmp 0x79f0
cmpb $0x1, 0x7ebc(%rip)      # 0xf8cc
jne 0x74fe
jmp 0x7aa5
cmpq 0xb8(%r13), %rcx
jne 0x7a3a
cmpq $0x2, 0x40(%rsp)
jne 0x79d9
movl 0x38(%rsp), %esi
movq %rax, %rdi
callq 0x5826
jmp 0x79d9
cmpq 0xe0(%r13), %rcx
jne 0x79d9
movq 0xe8(%r13), %rcx
movq 0xf0(%r13), %rsi
movq 0x100(%r13), %rdi
xorl %r8d, %r8d
xorl %edx, %edx
movl $0x3, %r10d
movq 0x40(%rsp,%r8,8), %r9
cmpq %rcx, %r9
jne 0x7a72
orl $0x2, %edx
jmp 0x7a83
cmpq %rsi, %r9
jne 0x7a7c
orl $0x1, %edx
jmp 0x7a83
cmpq %rdi, %r9
cmovel %r10d, %edx
incq %r8
cmpq $0x2, %r8
jne 0x7a63
testl %edx, %edx
je 0x79d9
movl 0x38(%rsp), %esi
movq %rax, %rdi
callq 0x6800
jmp 0x79d9
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq