// File: /workspace/github_c_makefile_star2_O3/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 0x1cf9(%rip), %rdi      # 0x3068
xorl %eax, %eax
callq 0x1030
movl $0x1, %edi
callq 0x1090
movl %edi, %ebp
movq 0x8(%r15), %rbx
cmpl $0x2, %edi
jne 0x1397
movl $0xa, 0x3d9b(%rip)      # 0x5130
jmp 0x13b1
movq 0x10(%r15), %rdi
callq 0x1120
movl %eax, 0x3d8a(%rip)      # 0x5130
cmpl $0x4, %ebp
jne 0x13b1
movq 0x18(%r15), %r14
jmp 0x13b4
xorl %r14d, %r14d
movdqa 0x1c54(%rip), %xmm0     # 0x3010
leaq 0x3d7d(%rip), %rax      # 0x5140
xorl %ecx, %ecx
movdqa 0x1c53(%rip), %xmm1     # 0x3020
movdqa 0x1c5b(%rip), %xmm2     # 0x3030
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
leaq 0x41af(%rip), %rdx      # 0x5590
movdqa 0x1c57(%rip), %xmm4     # 0x3040
movdqa %xmm0, %xmm5
pxor %xmm1, %xmm5
movdqa %xmm2, %xmm6
pcmpgtd %xmm5, %xmm6
pshufd $0xf5, %xmm5, %xmm5     # xmm5 = xmm5[1,1,3,3]
pcmpeqd %xmm3, %xmm5
pand %xmm6, %xmm5
movd %xmm5, %esi
testb $0x1, %sil
je 0x1414
movq %rax, (%rdx,%rcx,8)
pextrw $0x4, %xmm5, %esi
testb $0x1, %sil
je 0x142b
leaq 0x170(%rax), %rsi
movq %rsi, 0x8(%rdx,%rcx,8)
addq $0x2, %rcx
paddq %xmm4, %xmm0
addq $0x2e0, %rax            # imm = 0x2E0
cmpq $0x4, %rcx
jne 0x13e9
movl %ebp, %edi
movq %r15, %rsi
callq 0x28d2
leaq 0x4230(%rip), %r13      # 0x5680
movq (%r13), %rdi
leaq 0x4235(%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, 0x410e(%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, 0x40ed(%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, 0x40cc(%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, 0x40ab(%rip)      # 0x55c0
movq %rbx, %rdi
callq 0x153c
movq %rax, 0x40a4(%rip)      # 0x55c8
testq %r14, %r14
je 0x1534
movq %r14, %rdi
callq 0x18d0
movq %rax, %r15
movq %r15, %rdi
callq 0x197c