// File: /workspace/github_c_makefile_star2_O1/veltzer[P]xmeltdown/src/stickman.c
// Function: main
int main(int argc, char** argv)
{
	XGCValues my_gcvalues;
	XEvent my_event;

	Initialize(argc, argv);
	XRaiseWindow(dpy, buffer[0]);

	XSelectInput(dpy, win,
		ExposureMask|ButtonPressMask|ButtonReleaseMask|
		ButtonMotionMask|KeyPressMask);

	XSelectInput(dpy, buffer[0],
		ExposureMask|ButtonPressMask|ButtonReleaseMask|
		ButtonMotionMask|KeyPressMask);

	XSelectInput(dpy, buffer[1],
		ExposureMask|ButtonPressMask|ButtonReleaseMask|
		ButtonMotionMask|KeyPressMask);

	my_gcvalues.line_width=0;
	my_gcvalues.line_style=LineSolid;

#ifdef NOCOLOR
	my_gcvalues.function=GXset;
#else
	my_gcvalues.function=GXclear;
#endif

	set_gc=XCreateGC(dpy, buffer[0],
		GCFunction|GCLineWidth|GCLineStyle,
		&my_gcvalues);

	my_gcvalues.line_width=0;
	my_gcvalues.line_style=LineOnOffDash;
	my_gcvalues.function=GXclear;
	my_gcvalues.cap_style=CapNotLast;

	dotted_gc=XCreateGC(dpy, buffer[0],
		GCFunction|GCLineWidth|GCLineStyle|GCCapStyle,
		&my_gcvalues);

	my_gcvalues.line_width=0;
	my_gcvalues.line_style=LineSolid;

#ifdef NOCOLOR
	my_gcvalues.function=GXclear;
#else
	my_gcvalues.function=GXset;
#endif

	unset_gc=XCreateGC(dpy, buffer[0],
		GCFunction|GCLineWidth|GCLineStyle,
		&my_gcvalues);

	XClearWindow(dpy, buffer[0]);
	DrawSkel(&bones, unset_gc, buffer[0]);
	while (1) {
		XNextEvent (dpy, &my_event);
		if (my_event.type == KeyPress)
			HandleKeyPress((XKeyEvent*)&my_event);
		if (my_event.type == ButtonPress)
			HandleButtonPress((XButtonEvent*)&my_event);
		if (my_event.type == ButtonRelease)
			HandleButtonRelease((XButtonEvent*)&my_event);
		if (my_event.type == MotionNotify)
			HandleMotion((XMotionEvent*)&my_event);
		else if (my_event.type == Expose) {
			XClearWindow(dpy, buffer[0]);
			DrawSkel(&bones, unset_gc, buffer[0]);
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
callq 0x22f7
leaq 0x404a(%rip), %r15      # 0x52e0
movq (%r15), %rdi
leaq 0x4060(%rip), %r12      # 0x5300
movq (%r12), %rsi
callq 0x1070
movq (%r15), %rdi
leaq 0x403d(%rip), %rax      # 0x52f0
movq (%rax), %rsi
movl $0xa00d, %edx           # imm = 0xA00D
callq 0x1120
movq (%r15), %rdi
movq (%r12), %rsi
movl $0xa00d, %edx           # imm = 0xA00D
callq 0x1120
movq (%r15), %rdi
movq 0x8(%r12), %rsi
movl $0xa00d, %edx           # imm = 0xA00D
callq 0x1120
xorl %r14d, %r14d
leaq 0xc8(%rsp), %rbx
movq %r14, 0x20(%rbx)
movl %r14d, (%rbx)
movq (%r15), %rdi
movq (%r12), %rsi
movl $0x31, %edx
movq %rbx, %rcx
callq 0x1110
movq %rax, 0x3f38(%rip)      # 0x5248
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x20(%rbx)
movl %r14d, (%rbx)
movl %r14d, 0x28(%rbx)
movq (%r15), %rdi
movq (%r12), %rsi
movl $0x71, %edx
movq %rbx, %rcx
callq 0x1110
movq %rax, 0x3f10(%rip)      # 0x5250
movq %r14, 0x20(%rbx)
movl $0xf, (%rbx)
movq (%r15), %rdi
movq (%r12), %rsi
movl $0x31, %edx
movq %rbx, %rcx
callq 0x1110
movq %rax, 0x3ef3(%rip)      # 0x5258
movq (%r15), %rdi
movq (%r12), %rsi
callq 0x1040
movq 0x3ee0(%rip), %rsi      # 0x5258
movq (%r12), %rdx
leaq 0x3d4d(%rip), %rbx      # 0x50d0
movq %rbx, %rdi
callq 0x18b0
leaq 0x8(%rsp), %r14
movq (%r15), %rdi
movq %r14, %rsi
callq 0x10f0
cmpl $0x2, 0x8(%rsp)
jne 0x13aa
movq %r14, %rdi
callq 0x1419
cmpl $0x4, 0x8(%rsp)
jne 0x13b9
movq %r14, %rdi
callq 0x146a
cmpl $0x5, 0x8(%rsp)
jne 0x13dd
movl $0x0, 0x3e96(%rip)      # 0x5260
movq 0x3e87(%rip), %rsi      # 0x5258
movq (%r12), %rdx
movq %rbx, %rdi
callq 0x18b0
movl 0x8(%rsp), %eax
cmpl $0xc, %eax
je 0x13f5
cmpl $0x6, %eax
jne 0x1390
movq %r14, %rdi
callq 0x1570
jmp 0x1390
movq (%r15), %rdi
movq (%r12), %rsi
callq 0x1040
movq 0x3e50(%rip), %rsi      # 0x5258
movq (%r12), %rdx
movq %rbx, %rdi
callq 0x18b0
jmp 0x1390