// File: /workspace/github_c_makefile_star2_O2/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 0x132e
movq (%r15), %rsi
leaq 0x1d01(%rip), %rdi      # 0x3020
xorl %eax, %eax
callq 0x1030
pushq $0x1
popq %rdi
callq 0x1090
movl %edi, %ebp
movq 0x8(%r15), %rbx
cmpl $0x2, %edi
jne 0x1345
movl $0xa, 0x3ded(%rip)      # 0x5130
jmp 0x135f
movq 0x10(%r15), %rdi
callq 0x1120
movl %eax, 0x3ddc(%rip)      # 0x5130
cmpl $0x4, %ebp
jne 0x135f
movq 0x18(%r15), %r14
jmp 0x1362
xorl %r14d, %r14d
leaq 0x3dd7(%rip), %rax      # 0x5140
xorl %ecx, %ecx
leaq 0x421e(%rip), %rdx      # 0x5590
cmpq $0x18, %rcx
je 0x1388
movq %rax, (%rcx,%rdx)
addq $0x8, %rcx
addq $0x170, %rax            # imm = 0x170
jmp 0x1372
movl %ebp, %edi
movq %r15, %rsi
callq 0x2209
leaq 0x42e7(%rip), %r13      # 0x5680
movq (%r13), %rdi
leaq 0x42ec(%rip), %rbp      # 0x5690
movq (%rbp), %rsi
movl $0x8005, %edx           # imm = 0x8005
callq 0x1160
leaq 0x8(%rsp), %r15
andq $0x0, 0x20(%r15)
andl $0x0, (%r15)
movq (%r13), %rdi
movq (%rbp), %rsi
pushq $0x31
popq %r12
movq %r12, %rdx
movq %r15, %rcx
callq 0x1150
andq $0x0, 0x20(%r15)
movq %rax, 0x41c5(%rip)      # 0x55a8
movl $0xf, (%r15)
movq (%r13), %rdi
movq (%rbp), %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1150
andq $0x0, 0x20(%r15)
movq %rax, 0x41a7(%rip)      # 0x55b0
movl $0x5, (%r15)
movq (%r13), %rdi
movq (%rbp), %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1150
andq $0x0, 0x20(%r15)
movq %rax, 0x4189(%rip)      # 0x55b8
movl $0xa, (%r15)
movq (%r13), %rdi
movq (%rbp), %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x1150
movq %rax, 0x4170(%rip)      # 0x55c0
movq %rbx, %rdi
callq 0x147b
movq %rax, 0x4169(%rip)      # 0x55c8
testq %r14, %r14
jne 0x146b
xorl %edi, %edi
callq 0x1779
movq %r14, %rdi
callq 0x16e0
movq %rax, %rdi
callq 0x1779