// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsp, %rbx
leaq 0x8579(%rip), %r12      # 0xf708
leaq 0x8592(%rip), %r13      # 0xf728
leaq 0x376f(%rip), %rbp      # 0xa90c
cmpb $0x0, 0x8728(%rip)      # 0xf8cc
jne 0x7727
movq %rbx, %rdi
callq 0x936d
testl %eax, %eax
je 0x7662
movl (%rsp), %eax
leal -0x12(%rax), %ecx
cmpl $0x10, %ecx
ja 0x71f7
movslq (%rbp,%rcx,4), %rcx
addq %rbp, %rcx
jmpq *%rcx
movq 0x28(%rsp), %rdi
callq 0x50fc
testq %rax, %rax
je 0x7662
movl 0x24(%rax), %ecx
testl %ecx, %ecx
je 0x7586
decl %ecx
movl %ecx, 0x24(%rax)
jmp 0x7662
cmpl $0x7, %eax
je 0x744f
cmpl $0x4, %eax
je 0x7497
cmpl $0x2, %eax
jne 0x721b
movq %rbx, %rdi
callq 0x4eac
jmp 0x7662
cmpl $0x0, 0x178(%r13)
je 0x7245
cmpl 0x17c(%r13), %eax
jne 0x7245
movq 0x20(%rsp), %rdi
callq 0x50fc
testq %rax, %rax
je 0x7245
movq %rax, %rdi
callq 0x57fb
cmpl $0x0, 0x180(%r13)
je 0x7662
movl (%rsp), %eax
cmpl 0x184(%r13), %eax
jne 0x7662
movq 0x28(%rsp), %rdi
callq 0x90d7
movq %rax, %r15
movq %rax, %rdi
callq 0x8f4d
movq %rbx, %rdi
callq 0x44f0
movq %r15, %rdi
callq 0x8c6d
movq %r15, %rdi
callq 0x8fc9
movq %r15, %rdi
callq 0x78d4
jmp 0x7662
movq 0x20(%rsp), %rdi
callq 0x50fc
testq %rax, %rax
je 0x7662
movq %rax, %r15
movq 0x28(%rsp), %rax
cmpq $0x28, %rax
jne 0x7540
movq %r15, %rdi
callq 0x4fe4
jmp 0x7662
movq 0x28(%rsp), %rdi
callq 0x50fc
testq %rax, %rax
je 0x74e9
movq %rax, %r15
movl 0x20(%rax), %esi
cmpl $-0x1, %esi
je 0x72fb
movq 0x10(%r15), %rdi
cmpl 0x60(%rdi), %esi
je 0x72fb
callq 0x8e46
movq %r15, %rdi
callq 0x533d
movq %r15, %rdi
callq 0x5360
jmp 0x7662
movq %rbx, %rdi
callq 0x4100
cmpl $0x1, 0x28(%rsp)
jne 0x7662
xorl %r15d, %r15d
xorl %r14d, %r14d
movslq 0x188(%r13), %rax
cmpq %rax, %r14
jge 0x7662
movq 0x190(%r13), %rdi
addq %r15, %rdi
callq 0x4c5e
incq %r14
addq $0x78, %r15
jmp 0x7329
movq 0x20(%rsp), %rdi
callq 0x50fc
testq %rax, %rax
je 0x7662
cmpl $0x0, 0x30(%rsp)
je 0x7662
movq 0x28(%rsp), %rsi
movq %rsi, 0x18(%rax)
movq (%r13), %rdi
callq 0x4590
jmp 0x7662
movq 0x28(%rsp), %rdi
callq 0x50fc
jmp 0x7662
movq 0x28(%rsp), %rdi
callq 0x50fc
movq %rax, %r15
movups 0x30(%rsp), %xmm0
movaps %xmm0, 0xc0(%rsp)
andl $0x0, 0xd0(%rsp)
movq 0x48(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
movl 0x50(%rsp), %eax
movl %eax, 0xe0(%rsp)
testq %r15, %r15
je 0x7521
movl 0x58(%rsp), %eax
notl %eax
testb $0x60, %al
jne 0x73f8
callq 0x50fc
testq %rax, %rax
je 0x73f8
movq 0x8(%rax), %rax
movq %rax, 0xd8(%rsp)
movl 0x58(%rsp), %edi
leaq 0xc0(%rsp), %rsi
movq %r15, %rdx
xorl %ecx, %ecx
callq 0x7739
leaq 0x830b(%rip), %rax      # 0xf720
cmpq (%rax), %r15
jne 0x7662
movq %r15, %rdi
callq 0x9438
jmp 0x7662
callq 0x910f
movq %rax, %r15
movq 0x28(%rsp), %rax
cmpq 0x70(%r13), %rax
jne 0x74a4
movl 0x38(%rsp), %esi
movq %r15, %rdi
callq 0x8e46
jmp 0x7662
movq 0x20(%rsp), %rdi
callq 0x50fc
testq %rax, %rax
je 0x7662
movq %rax, %r15
movl 0x20(%rax), %eax
cmpl $-0x1, %eax
je 0x747a
movq 0x10(%r15), %rcx
cmpl 0x60(%rcx), %eax
jne 0x7662
movq %r15, %rdi
callq 0x54cf
movq (%r12), %rdi
movq %r15, %rsi
callq 0x8282
movq %rax, (%r12)
jmp 0x7662
movq %rbx, %rdi
callq 0x4f53
jmp 0x7662
movq 0x20(%rsp), %rdi
callq 0x50fc
movq 0x28(%rsp), %rcx
testq %rax, %rax
je 0x7592
cmpq 0x78(%r13), %rcx
jne 0x75bb
cmpq $0x2, 0x38(%rsp)
jne 0x7662
cmpq %r15, 0x10(%rax)
jne 0x7662
movq %rax, %rdi
callq 0x54cf
jmp 0x7662
movq (%r13), %rdi
movq 0x28(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x4630
movq 0x28(%rsp), %r15
movq 0xe0(%rsp), %rdi
callq 0x90d7
movq %r15, %rdi
movq %rax, %rsi
callq 0x6768
jmp 0x7662
movq (%r13), %rdi
movq 0x28(%rsp), %rsi
movl 0x58(%rsp), %edx
leaq 0xc0(%rsp), %rcx
callq 0x40e0
jmp 0x7662
cmpq 0xc0(%r13), %rax
jne 0x7662
movq %r15, %rdi
callq 0x50d7
cmpl $0x0, 0x94(%r15)
jne 0x7662
movl 0x20(%r15), %eax
cmpl $-0x1, %eax
je 0x7579
movq 0x10(%r15), %rcx
cmpl 0x60(%rcx), %eax
jne 0x7662
movq %r15, %rdi
callq 0x533d
jmp 0x7662
movl $0x1, 0x68(%rax)
jmp 0x766f
cmpq 0xa8(%r13), %rcx
jne 0x7662
movq 0x20(%rsp), %rdi
callq 0x931b
movq 0x20(%rsp), %rdi
movslq %eax, %rsi
callq 0x7dd8
jmp 0x7662
cmpq 0x90(%r13), %rcx
jne 0x75df
cmpq $0x2, 0x40(%rsp)
jne 0x7662
movq %rax, %rdi
xorl %esi, %esi
callq 0x5724
jmp 0x7662
cmpq 0x98(%r13), %rcx
jne 0x7620
movq 0x38(%rsp), %rcx
movl %ecx, %edx
andl $0x3000, %edx           # imm = 0x3000
cmpl $0x2000, %edx           # imm = 0x2000
jne 0x7662
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 0x7652
cmpq 0xa0(%r13), %rcx
jne 0x769d
cmpq $0x2, 0x38(%rsp)
jne 0x7662
movq 0x40(%rsp), %rcx
movq %rcx, 0xd8(%rsp)
movl 0x48(%rsp), %ecx
movl %ecx, 0xe0(%rsp)
movl 0x90(%rax), %ecx
pushq $0x60
popq %rdi
leaq 0xc0(%rsp), %rsi
movq %rax, %rdx
callq 0x7739
cmpl $0x0, 0x825f(%rip)      # 0xf8c8
je 0x719d
andl $0x0, 0x8252(%rip)      # 0xf8c8
movq (%r12), %rax
testq %rax, %rax
je 0x719d
movq (%rax), %r14
movq 0x8(%rax), %rdi
cmpl $0x0, 0x68(%rdi)
movq %r14, %rax
je 0x767a
callq 0x55c2
movq %r14, %rax
jmp 0x767a
cmpq 0xb8(%r13), %rcx
jne 0x76bc
cmpq $0x2, 0x40(%rsp)
jne 0x7662
movl 0x38(%rsp), %esi
movq %rax, %rdi
callq 0x5573
jmp 0x7662
cmpq 0xe0(%r13), %rcx
jne 0x7662
movq 0xe8(%r13), %rcx
movq 0xf0(%r13), %rsi
movq 0x100(%r13), %rdi
xorl %r8d, %r8d
xorl %edx, %edx
pushq $0x3
popq %r10
cmpq $0x2, %r8
je 0x770e
movq 0x40(%rsp,%r8,8), %r9
cmpq %rcx, %r9
jne 0x76f8
orl $0x2, %edx
jmp 0x7709
cmpq %rsi, %r9
jne 0x7702
orl $0x1, %edx
jmp 0x7709
cmpq %rdi, %r9
cmovel %r10d, %edx
incq %r8
jmp 0x76e3
testl %edx, %edx
je 0x7662
movl 0x38(%rsp), %esi
movq %rax, %rdi
callq 0x64d6
jmp 0x7662
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq