// File: /workspace/github_c_makefile_star2_O0/veltzer[P]xmeltdown/src/stickread.c
// Function: main
int main(int argc, char** argv)
{
	Skeleton** skellist;
	char* inputfile;
	int framecount;
	XGCValues my_gcvalues;
	XEvent my_event;
	if (argc < 2) {
		printf ("Usage: %s filename [framecount]\n", argv[0]);
		exit (1);
	}
	inputfile=argv[1];
	if (argc == 3)
		framecount=atoi(argv[2]);
	else
		framecount=10;
	Initialize(argc, argv);
	XSelectInput(dpy, win,
		ExposureMask|ButtonPressMask|KeyPressMask);
	my_gcvalues.line_width=3;
	my_gcvalues.line_style=LineSolid;
	my_gcvalues.function=GXset;

	set_gc=XCreateGC(dpy, win,
		GCFunction|GCLineWidth|GCLineStyle,
		&my_gcvalues);

	my_gcvalues.line_width=3;
	my_gcvalues.line_style=LineSolid;
	my_gcvalues.function=GXclear;

	unset_gc=XCreateGC(dpy, win,
		GCFunction|GCLineWidth|GCLineStyle,
		&my_gcvalues);

	my_gcvalues.line_width=3;
	my_gcvalues.line_style=LineSolid;
	my_gcvalues.function=GXnoop;

	noop_gc=XCreateGC(dpy, win,
		GCFunction|GCLineWidth|GCLineStyle,
		&my_gcvalues);

	my_gcvalues.line_width=3;
	my_gcvalues.line_style=LineSolid;
	my_gcvalues.function=GXinvert;

	neg_gc=XCreateGC(dpy, win,
		GCFunction|GCLineWidth|GCLineStyle,
		&my_gcvalues);

	skellist=ReadFile(inputfile);
	while (1) {
		XNextEvent (dpy, &my_event);
		if (my_event.type == KeyPress)
			HandleKeyPress((XKeyEvent*)&my_event);
		if (my_event.type == ButtonPress) {
			Interpolate(skellist, framecount);
			printf ("Beep.");
		}else if (my_event.type == Expose)
			Interpolate(skellist, framecount);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x12ee
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x1d43(%rip), %rdi      # 0x3020
movb $0x0, %al
callq 0x1030
movl $0x1, %edi
callq 0x1060
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
cmpl $0x3, -0x8(%rbp)
jne 0x1312
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1100
movl %eax, -0x24(%rbp)
jmp 0x1319
movl $0xa, -0x24(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x2510
leaq 0x3e54(%rip), %rax      # 0x5180
movq (%rax), %rdi
leaq 0x3e5a(%rip), %rax      # 0x5190
movq (%rax), %rsi
movl $0x8005, %edx           # imm = 0x8005
callq 0x1130
movl $0x3, -0x88(%rbp)
movl $0x0, -0x84(%rbp)
movl $0xf, -0xa8(%rbp)
leaq 0x3e18(%rip), %rax      # 0x5180
movq (%rax), %rdi
leaq 0x3e1e(%rip), %rax      # 0x5190
movq (%rax), %rsi
movl $0x31, %edx
leaq -0xa8(%rbp), %rcx
callq 0x1120
movq %rax, 0x3d6b(%rip)      # 0x50f8
movl $0x3, -0x88(%rbp)
movl $0x0, -0x84(%rbp)
movl $0x0, -0xa8(%rbp)
leaq 0x3dce(%rip), %rax      # 0x5180
movq (%rax), %rdi
leaq 0x3dd4(%rip), %rax      # 0x5190
movq (%rax), %rsi
movl $0x31, %edx
leaq -0xa8(%rbp), %rcx
callq 0x1120
movq %rax, 0x3d29(%rip)      # 0x5100
movl $0x3, -0x88(%rbp)
movl $0x0, -0x84(%rbp)
movl $0x5, -0xa8(%rbp)
leaq 0x3d84(%rip), %rax      # 0x5180
movq (%rax), %rdi
leaq 0x3d8a(%rip), %rax      # 0x5190
movq (%rax), %rsi
movl $0x31, %edx
leaq -0xa8(%rbp), %rcx
callq 0x1120
movq %rax, 0x3ce7(%rip)      # 0x5108
movl $0x3, -0x88(%rbp)
movl $0x0, -0x84(%rbp)
movl $0xa, -0xa8(%rbp)
leaq 0x3d3a(%rip), %rax      # 0x5180
movq (%rax), %rdi
leaq 0x3d40(%rip), %rax      # 0x5190
movq (%rax), %rsi
movl $0x31, %edx
leaq -0xa8(%rbp), %rcx
callq 0x1120
movq %rax, 0x3ca5(%rip)      # 0x5110
movq -0x20(%rbp), %rdi
callq 0x14f0
movq %rax, -0x18(%rbp)
leaq 0x3d01(%rip), %rax      # 0x5180
movq (%rax), %rdi
leaq -0x168(%rbp), %rsi
callq 0x10f0
cmpl $0x2, -0x168(%rbp)
jne 0x14a3
leaq -0x168(%rbp), %rdi
callq 0x17a0
cmpl $0x4, -0x168(%rbp)
jne 0x14c8
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x17c0
leaq 0x1b82(%rip), %rdi      # 0x3041
movb $0x0, %al
callq 0x1030
jmp 0x14df
cmpl $0xc, -0x168(%rbp)
jne 0x14dd
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x17c0
jmp 0x14df
jmp 0x1478
nopw %cs:(%rax,%rax)