// File: /workspace/github_c_makefile_star2_O3/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 0x784f(%rip), %r14      # 0xaff8
leaq 0x3c04(%rip), %r15      # 0x73b4
leaq 0x3c92(%rip), %r12      # 0x7449
leaq 0x3ce8(%rip), %r13      # 0x74a6
leaq 0x3cb2(%rip), %rbp      # 0x7477
movq %rbx, %rdi
xorl %eax, %eax
callq 0x3509
movl 0x8(%rsp), %edx
leal -0x4(%rdx), %eax
cmpl $0x1e, %eax
ja 0x38d5
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4ed0
jmp 0x37c5
movq (%r14), %rcx
movl $0x2e, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x2540
jmp 0x37c5
movq %rbx, %rdi
callq 0x3fa9
jmp 0x37c5
movq %rbx, %rdi
callq 0x4266
jmp 0x37c5
movq 0x30(%rsp), %rdi
callq 0x3d21
jmp 0x37c5
movq (%r14), %rcx
movl $0x2f, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x2540
jmp 0x37c5
movq %rbx, %rdi
callq 0x3c2e
jmp 0x37c5
movq (%r14), %rcx
movl $0x2d, %esi
movl $0x1, %edx
movq %r12, %rdi
callq 0x2540
jmp 0x37c5
movq %rbx, %rdi
callq 0x3cb4
jmp 0x37c5
movq %rbx, %rdi
callq 0x4202
jmp 0x37c5
movq %rbx, %rdi
callq 0x3a6a
jmp 0x37c5
movq %rbx, %rdi
callq 0x410d
jmp 0x37c5
movq %rbx, %rdi
callq 0x3f1c
jmp 0x37c5
movq %rbx, %rdi
callq 0x3d6d
jmp 0x37c5
movq (%r14), %rcx
movl $0x1e, %esi
movl $0x1, %edx
leaq 0x3c56(%rip), %rdi      # 0x7521
callq 0x2540
jmp 0x37c5
movq (%r14), %rdi
leaq 0x3b51(%rip), %rsi      # 0x7430
xorl %eax, %eax
callq 0x22c0
jmp 0x37c5
movq %rbx, %rdi
callq 0x38f8
jmp 0x37c5