// File: /workspace/github_c_makefile_star2_O0/veltzer[P]xmeltdown/src/dance.c
// Function: main
int main(int argc, char** argv)
{
	char* posefile;
	char* routinefile;
	XGCValues my_gcvalues;
	int i;
	int* routine=NULL;
	if (argc < 2) {
		printf ("Usage: %s posefile [framecount [routinefile]\n", argv[0]);
		exit (1);
	}
	posefile=argv[1];
	if (argc >= 3)
		steps=atoi(argv[2]);
	else
		steps=10;
	if (argc == 4)
		routinefile=argv[3];
	else
		routinefile=NULL;
	for (i=0; i < PLAYERS; i++)
		tweenskel[i]=&tween[i];
	Initialize(argc, argv);
	XSelectInput(dpy, win,
		ExposureMask|ButtonPressMask|KeyPressMask);
	my_gcvalues.line_width=LINE_WIDTH;
	my_gcvalues.line_style=LineSolid;

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

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

	my_gcvalues.line_width=LINE_WIDTH;
	my_gcvalues.line_style=LineSolid;

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

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

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

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

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

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

	skellist=ReadFile(posefile);
	if (routinefile)
		routine=ReadRoutineFile(routinefile);
	DanceMainLoop(routine);
	return(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0xb0(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x1339
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x1cf8(%rip), %rdi      # 0x3020
movb $0x0, %al
callq 0x1030
movl $0x1, %edi
callq 0x1080
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
cmpl $0x3, -0x8(%rbp)
jl 0x1360
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1110
movl %eax, 0x3dc2(%rip)      # 0x5120
jmp 0x136a
movl $0xa, 0x3db6(%rip)      # 0x5120
cmpl $0x4, -0x8(%rbp)
jne 0x137e
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x1386
movq $0x0, -0x20(%rbp)
movl $0x0, -0xa4(%rbp)
cmpl $0x3, -0xa4(%rbp)
jge 0x13d4
movslq -0xa4(%rbp), %rax
leaq 0x3d89(%rip), %rdx      # 0x5130
imulq $0x170, %rax, %rax      # imm = 0x170
addq %rax, %rdx
movslq -0xa4(%rbp), %rcx
leaq 0x41c1(%rip), %rax      # 0x5580
movq %rdx, (%rax,%rcx,8)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x1390
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x2990
leaq 0x4289(%rip), %rax      # 0x5670
movq (%rax), %rdi
leaq 0x428f(%rip), %rax      # 0x5680
movq (%rax), %rsi
movl $0x8005, %edx           # imm = 0x8005
callq 0x1150
movl $0x0, -0x80(%rbp)
movl $0x0, -0x7c(%rbp)
movl $0x0, -0xa0(%rbp)
leaq 0x4253(%rip), %rax      # 0x5670
movq (%rax), %rdi
leaq 0x4259(%rip), %rax      # 0x5680
movq (%rax), %rsi
movl $0x31, %edx
leaq -0xa0(%rbp), %rcx
callq 0x1140
movq %rax, 0x4156(%rip)      # 0x5598
movl $0x0, -0x80(%rbp)
movl $0x0, -0x7c(%rbp)
movl $0xf, -0xa0(%rbp)
leaq 0x420f(%rip), %rax      # 0x5670
movq (%rax), %rdi
leaq 0x4215(%rip), %rax      # 0x5680
movq (%rax), %rsi
movl $0x31, %edx
leaq -0xa0(%rbp), %rcx
callq 0x1140
movq %rax, 0x411a(%rip)      # 0x55a0
movl $0x0, -0x80(%rbp)
movl $0x0, -0x7c(%rbp)
movl $0x5, -0xa0(%rbp)
leaq 0x41cb(%rip), %rax      # 0x5670
movq (%rax), %rdi
leaq 0x41d1(%rip), %rax      # 0x5680
movq (%rax), %rsi
movl $0x31, %edx
leaq -0xa0(%rbp), %rcx
callq 0x1140
movq %rax, 0x40de(%rip)      # 0x55a8
movl $0x0, -0x80(%rbp)
movl $0x0, -0x7c(%rbp)
movl $0xa, -0xa0(%rbp)
leaq 0x4187(%rip), %rax      # 0x5670
movq (%rax), %rdi
leaq 0x418d(%rip), %rax      # 0x5680
movq (%rax), %rsi
movl $0x31, %edx
leaq -0xa0(%rbp), %rcx
callq 0x1140
movq %rax, 0x40a2(%rip)      # 0x55b0
movq -0x18(%rbp), %rdi
callq 0x1550
movq %rax, 0x409a(%rip)      # 0x55b8
cmpq $0x0, -0x20(%rbp)
je 0x1535
movq -0x20(%rbp), %rdi
callq 0x1810
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rdi
callq 0x1900
xorl %eax, %eax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)