// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
cmpl $0x1, %edi
jg 0x1380
movq (%r15), %rsi
leaq 0x1cb1(%rip), %rdi      # 0x3020
xorl %eax, %eax
callq 0x1030
movl $0x1, %edi
callq 0x1090
movl %edi, %ebp
movq 0x8(%r15), %rbx
movl $0xa, %eax
cmpl $0x2, %edi
je 0x1399
movq 0x10(%r15), %rdi
callq 0x1120
movl %eax, 0x3d91(%rip)      # 0x5130
cmpl $0x4, %ebp
jne 0x13aa
movq 0x18(%r15), %r14
jmp 0x13ad
xorl %r14d, %r14d
leaq 0x3d8c(%rip), %rax      # 0x5140
xorl %ecx, %ecx
leaq 0x41d3(%rip), %rdx      # 0x5590
movq %rax, (%rcx,%rdx)
addq $0x8, %rcx
addq $0x170, %rax            # imm = 0x170
cmpq $0x18, %rcx
jne 0x13bd
movl %ebp, %edi
movq %r15, %rsi
callq 0x28cf
leaq 0x429e(%rip), %r13      # 0x5680
movq (%r13), %rdi
leaq 0x42a3(%rip), %rbp      # 0x5690
movq (%rbp), %rsi
movl $0x8005, %edx           # imm = 0x8005
callq 0x1160
xorl %r15d, %r15d
leaq 0x8(%rsp), %r12
movq %r15, 0x20(%r12)
movl $0x0, (%r12)
movq (%r13), %rdi
movq (%rbp), %rsi
movl $0x31, %edx
movq %r12, %rcx
callq 0x1150
movq %rax, 0x417c(%rip)      # 0x55a8
movq %r15, 0x20(%r12)
movl $0xf, (%r12)
movq (%r13), %rdi
movq (%rbp), %rsi
movl $0x31, %edx
movq %r12, %rcx
callq 0x1150
movq %rax, 0x415b(%rip)      # 0x55b0
movq %r15, 0x20(%r12)
movl $0x5, (%r12)
movq (%r13), %rdi
movq (%rbp), %rsi
movl $0x31, %edx
movq %r12, %rcx
callq 0x1150
movq %rax, 0x413a(%rip)      # 0x55b8
movq %r15, 0x20(%r12)
movl $0xa, (%r12)
movq (%r13), %rdi
movq (%rbp), %rsi
movl $0x31, %edx
movq %r12, %rcx
callq 0x1150
movq %rax, 0x4119(%rip)      # 0x55c0
movq %rbx, %rdi
callq 0x14ce
movq %rax, 0x4112(%rip)      # 0x55c8
testq %r14, %r14
je 0x14c6
movq %r14, %rdi
callq 0x185d
movq %rax, %r15
movq %r15, %rdi
callq 0x18f5