// File: /workspace/github_c_makefile_star2_O1/9wm[P]9wm/event.c
// Function: mainloop
void
mainloop(int shape_event)
{
	XEvent ev;

	for (;;) {
		getevent(&ev);

#ifdef	DEBUG_EV
		if (debug) {
			ShowEvent(&ev);
			printf("\n");
		}
#endif
		switch (ev.type) {
		default:
#ifdef	SHAPE
			if (shape && ev.type == shape_event)
				shapenotify((XShapeEvent *) & ev);
			else
#endif
				fprintf(stderr, "9wm: unknown ev.type %d\n", ev.type);
			break;
		case ButtonPress:
			button(&ev.xbutton);
			break;
		case ButtonRelease:
			break;
		case MapRequest:
			mapreq(&ev.xmaprequest);
			break;
		case ConfigureRequest:
			configurereq(&ev.xconfigurerequest);
			break;
		case CirculateRequest:
			circulatereq(&ev.xcirculaterequest);
			break;
		case UnmapNotify:
			unmap(&ev.xunmap);
			break;
		case CreateNotify:
			newwindow(&ev.xcreatewindow);
			break;
		case DestroyNotify:
			destroy(ev.xdestroywindow.window);
			break;
		case ClientMessage:
			clientmesg(&ev.xclient);
			break;
		case ColormapNotify:
			cmap(&ev.xcolormap);
			break;
		case PropertyNotify:
			property(&ev.xproperty);
			break;
		case SelectionClear:
			fprintf(stderr, "9wm: SelectionClear (this should not happen)\n");
			break;
		case SelectionNotify:
			fprintf(stderr, "9wm: SelectionNotify (this should not happen)\n");
			break;
		case SelectionRequest:
			fprintf(stderr, "9wm: SelectionRequest (this should not happen)\n");
			break;
		case EnterNotify:
			enter(&ev.xcrossing);
			break;
		case ReparentNotify:
			reparent(&ev.xreparent);
			break;
		case FocusIn:
			focusin(&ev.xfocus);
			break;
		case MotionNotify:
		case Expose:
		case FocusOut:
		case ConfigureNotify:
		case MapNotify:
		case MappingNotify:
			/*
			 * not interested 
			 */
			trace("ignore", 0, &ev);
			break;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
leaq 0x8(%rsp), %rbx
movq 0x77cb(%rip), %r14      # 0xaff8
leaq 0x3b80(%rip), %r15      # 0x73b4
leaq 0x3c0e(%rip), %r12      # 0x7449
leaq 0x3c64(%rip), %r13      # 0x74a6
leaq 0x3c2e(%rip), %rbp      # 0x7477
movq %rbx, %rdi
xorl %eax, %eax
callq 0x35ab
movl 0x8(%rsp), %edx
leal -0x4(%rdx), %eax
cmpl $0x1e, %eax
ja 0x3959
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4eec
jmp 0x3849
movq (%r14), %rcx
movl $0x2e, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2530
jmp 0x3849
movq %rbx, %rdi
callq 0x3fe8
jmp 0x3849
movq %rbx, %rdi
callq 0x42c5
jmp 0x3849
movq 0x30(%rsp), %rdi
callq 0x3d5f
jmp 0x3849
movq (%r14), %rcx
movl $0x2f, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2530
jmp 0x3849
movq %rbx, %rdi
callq 0x3c59
jmp 0x3849
movq (%r14), %rcx
movl $0x2d, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2530
jmp 0x3849
movq %rbx, %rdi
callq 0x3cdf
jmp 0x3849
movq %rbx, %rdi
callq 0x4261
jmp 0x3849
movq %rbx, %rdi
callq 0x3b0b
jmp 0x3849
movq %rbx, %rdi
callq 0x414c
jmp 0x3849
movq %rbx, %rdi
callq 0x3f5b
jmp 0x3849
movq %rbx, %rdi
callq 0x3dab
jmp 0x3849
movq (%r14), %rcx
movl $0x1e, %esi
movl $0x1, %edx
leaq 0x3bd2(%rip), %rdi      # 0x7521
callq 0x2530
jmp 0x3849
movq (%r14), %rdi
leaq 0x3acd(%rip), %rsi      # 0x7430
xorl %eax, %eax
callq 0x22b0
jmp 0x3849
movq %rbx, %rdi
callq 0x397c
jmp 0x3849