// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xe0, %rsp
movb 0xa0a3(%rip), %al       # 0x12f24
xorb $-0x1, %al
testb $0x1, %al
jne 0x8e8c
jmp 0x9076
leaq -0xc0(%rbp), %rdi
callq 0xce50
cmpl $0x0, %eax
je 0x8ff3
movl -0xc0(%rbp), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0xe0(%rbp)
subl $0x20, %eax
ja 0x8f88
movq -0xe0(%rbp), %rax
leaq 0x597e(%rip), %rcx      # 0xe848
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq -0xc0(%rbp), %rdi
callq 0x5340
jmp 0x8ff1
leaq -0xc0(%rbp), %rdi
callq 0x5470
jmp 0x8ff1
leaq -0xc0(%rbp), %rdi
callq 0x9080
jmp 0x8ff1
leaq -0xc0(%rbp), %rdi
callq 0x90b0
jmp 0x8ff1
leaq -0xc0(%rbp), %rdi
callq 0x91d0
jmp 0x8ff1
leaq -0xc0(%rbp), %rdi
callq 0x9290
jmp 0x8ff1
leaq -0xc0(%rbp), %rdi
callq 0x92f0
jmp 0x8ff1
leaq -0xc0(%rbp), %rdi
callq 0x9370
jmp 0x8ff1
leaq -0xc0(%rbp), %rdi
callq 0x9410
jmp 0x8ff1
leaq -0xc0(%rbp), %rdi
callq 0x9470
jmp 0x8ff1
leaq -0xc0(%rbp), %rdi
callq 0x94e0
jmp 0x8ff1
leaq 0x9df1(%rip), %rax      # 0x12d80
cmpl $0x0, 0x178(%rax)
je 0x8fb9
movl -0xc0(%rbp), %eax
leaq 0x9ddb(%rip), %rcx      # 0x12d80
cmpl 0x17c(%rcx), %eax
jne 0x8fb9
leaq -0xc0(%rbp), %rdi
callq 0x9810
leaq 0x9dc0(%rip), %rax      # 0x12d80
cmpl $0x0, 0x180(%rax)
je 0x8fef
movl -0xc0(%rbp), %eax
leaq 0x9daa(%rip), %rcx      # 0x12d80
movl 0x184(%rcx), %ecx
addl $0x0, %ecx
cmpl %ecx, %eax
jne 0x8fef
leaq -0xc0(%rbp), %rdi
callq 0x9850
jmp 0x8ff1
jmp 0x8ff3
cmpl $0x0, 0x9f26(%rip)      # 0x12f20
je 0x9071
movl $0x0, 0x9f1a(%rip)      # 0x12f20
leaq 0x9d53(%rip), %rax      # 0x12d60
movq (%rax), %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xc8(%rbp)
je 0x906f
movq -0xc8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0xd8(%rbp), %rax
cmpl $0x0, 0x68(%rax)
je 0x905d
movq -0xd8(%rbp), %rdi
callq 0x60c0
jmp 0x905f
movq -0xd0(%rbp), %rax
movq %rax, -0xc8(%rbp)
jmp 0x9017
jmp 0x9071
jmp 0x8e7b
addq $0xe0, %rsp
popq %rbp
retq
nop