// File: /workspace/github_c_makefile_star2_O2/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 0x1d39
leaq 0x305a(%rip), %r15      # 0x42e0
movq (%r15), %rdi
leaq 0x3070(%rip), %r12      # 0x4300
movq (%r12), %rsi
callq 0x1070
movq (%r15), %rdi
leaq 0x304d(%rip), %rax      # 0x42f0
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
leaq 0xc8(%rsp), %rbx
andq $0x0, 0x20(%rbx)
andl $0x0, (%rbx)
movq (%r15), %rdi
movq (%r12), %rsi
pushq $0x31
popq %r14
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1110
movabsq $0x100000000, %rcx      # imm = 0x100000000
movq %rcx, 0x20(%rbx)
andl $0x0, (%rbx)
andl $0x0, 0x28(%rbx)
movq %rax, 0x2f33(%rip)      # 0x4248
movq (%r15), %rdi
movq (%r12), %rsi
pushq $0x71
popq %rdx
movq %rbx, %rcx
callq 0x1110
andq $0x0, 0x20(%rbx)
movq %rax, 0x2f1d(%rip)      # 0x4250
movl $0xf, (%rbx)
movq (%r15), %rdi
movq (%r12), %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x1110
movq %rax, 0x2f06(%rip)      # 0x4258
movq (%r15), %rdi
movq (%r12), %rsi
callq 0x1040
movq 0x2ef3(%rip), %rsi      # 0x4258
movq (%r12), %rdx
leaq 0x2d58(%rip), %rbx      # 0x40c8
movq %rbx, %rdi
callq 0x17a6
leaq 0x8(%rsp), %r14
movq (%r15), %rdi
movq %r14, %rsi
callq 0x10f0
movl 0x8(%rsp), %eax
cmpl $0x2, %eax
jne 0x139d
movq %r14, %rdi
callq 0x13f1
movl 0x8(%rsp), %eax
cmpl $0x4, %eax
jne 0x13ae
movq %r14, %rdi
callq 0x143b
movl 0x8(%rsp), %eax
cmpl $0x5, %eax
jne 0x13bc
callq 0x14e4
movl 0x8(%rsp), %eax
cmpl $0xc, %eax
je 0x13d0
cmpl $0x6, %eax
jne 0x137d
movq %r14, %rdi
callq 0x1508
jmp 0x137d
movq (%r15), %rdi
movq (%r12), %rsi
callq 0x1040
movq 0x2e75(%rip), %rsi      # 0x4258
movq (%r12), %rdx
movq %rbx, %rdi
callq 0x17a6
jmp 0x137d