// File: /workspace/github_c_makefile_star2_O3/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 0x2236
leaq 0x405a(%rip), %r15      # 0x52e0
movq (%r15), %rdi
leaq 0x4070(%rip), %r12      # 0x5300
movq (%r12), %rsi
callq 0x1070
movq (%r15), %rdi
leaq 0x404d(%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, 0x3f48(%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, 0x3f20(%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, 0x3f03(%rip)      # 0x5258
movq (%r15), %rdi
movq (%r12), %rsi
callq 0x1040
movq 0x3ef0(%rip), %rsi      # 0x5258
movq (%r12), %rdx
leaq 0x3d55(%rip), %rbx      # 0x50c8
movq %rbx, %rdi
callq 0x1848
leaq 0x8(%rsp), %r14
movq (%r15), %rdi
movq %r14, %rsi
callq 0x10f0
movl 0x8(%rsp), %eax
cmpl $0x2, %eax
jne 0x13a0
movq %r14, %rdi
callq 0x140f
movl 0x8(%rsp), %eax
cmpl $0x4, %eax
jne 0x13b1
movq %r14, %rdi
callq 0x1460
movl 0x8(%rsp), %eax
cmpl $0x5, %eax
jne 0x13d7
movl $0x0, 0x3ea0(%rip)      # 0x5260
movq 0x3e91(%rip), %rsi      # 0x5258
movq (%r12), %rdx
movq %rbx, %rdi
callq 0x1848
movl 0x8(%rsp), %eax
cmpl $0xc, %eax
je 0x13eb
cmpl $0x6, %eax
jne 0x1380
movq %r14, %rdi
callq 0x1566
jmp 0x1380
movq (%r15), %rdi
movq (%r12), %rsi
callq 0x1040
movq 0x3e5a(%rip), %rsi      # 0x5258
movq (%r12), %rdx
movq %rbx, %rdi
callq 0x1848
jmp 0x1380