// File: /workspace/github_c_makefile_star2_O0/veltzer[P]xmeltdown/src/dance.c
// Function: DrawTween
void DrawTween(double factor, int which, int curbuf)
/* what fraction the movement is completed
 * which player
 * which buffer not to draw into */
{
	RayPtr toray, fromray, tweenray;
	int bonesize=sizeof(Ray);
	int bone;
/*	int		stepctr, skelctr; */
	/* static int	lastbuf = 0; */
/*	int		flag1 = 1;
 * int		flag2 = 1;
 * int		flag3 = 1;
 * int		flag4 = 0; */
	for (bone=0; bone < 11; bone++) {
		fromray=(RayPtr) ((long) &(fromskel[which]->torso)+(long) (bone*bonesize));
		toray=(RayPtr) ((long) &(toskel[which]->torso)+(long) (bone*bonesize));
		tweenray=(RayPtr) ((long) &(tweenskel[which]->torso)+(long) (bone*bonesize));
/*
** Never rotate through an angle > PI. I.e., take the shortest path.
*/
		if ((fromray->t-toray->t) > M_PI)
			toray->t+=2*M_PI;
		else if ((toray->t-fromray->t) > M_PI)
			fromray->t+=2*M_PI;
		tweenray->t=(fromray->t*factor+toray->t*(1.0-factor));
		tweenray->r=(fromray->r*factor+toray->r*(1.0-factor));
	}
	tweenskel[which]->headradius=fromskel[which]->headradius*factor+toskel[which]->headradius*(1.0-factor);
	tweenskel[which]->waistx=fromskel[which]->waistx*factor+toskel[which]->waistx*(1.0-factor);
	tweenskel[which]->waisty=fromskel[which]->waisty*factor+toskel[which]->waisty*(1.0-factor);

	tweenskel[which]->waistx=OFFSET+(which*OFFSET);

	DrawSkel(tweenskel[which], unset_gc, buffer[!curbuf]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movsd %xmm0, -0x8(%rbp)
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl $0x20, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
cmpl $0xb, -0x30(%rbp)
jge 0x1d56
movslq -0xc(%rbp), %rcx
leaq 0x39ba(%rip), %rax      # 0x55c0
movq (%rax,%rcx,8), %rax
addq $0x10, %rax
movl -0x30(%rbp), %ecx
imull -0x2c(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x39b6(%rip), %rax      # 0x55e0
movq (%rax,%rcx,8), %rax
addq $0x10, %rax
movl -0x30(%rbp), %ecx
imull -0x2c(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x3932(%rip), %rax      # 0x5580
movq (%rax,%rcx,8), %rax
addq $0x10, %rax
movl -0x30(%rbp), %ecx
imull -0x2c(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
subsd 0x8(%rax), %xmm0
movsd 0x138f(%rip), %xmm1     # 0x3010
ucomisd %xmm1, %xmm0
jbe 0x1c9f
movq -0x18(%rbp), %rax
movsd 0x1385(%rip), %xmm0     # 0x3018
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
jmp 0x1cd7
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm0
movq -0x20(%rbp), %rax
subsd 0x8(%rax), %xmm0
movsd 0x1357(%rip), %xmm1     # 0x3010
ucomisd %xmm1, %xmm0
jbe 0x1cd5
movq -0x20(%rbp), %rax
movsd 0x134d(%rip), %xmm0     # 0x3018
addsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rax)
jmp 0x1cd7
movq -0x20(%rbp), %rax
movsd 0x8(%rax), %xmm0
movsd -0x8(%rbp), %xmm2
movq -0x18(%rbp), %rax
movsd 0x8(%rax), %xmm1
movsd 0x1312(%rip), %xmm3     # 0x3008
subsd -0x8(%rbp), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x28(%rbp), %rax
movsd %xmm0, 0x8(%rax)
movq -0x20(%rbp), %rax
cvtsi2sdl (%rax), %xmm0
movsd -0x8(%rbp), %xmm2
movq -0x18(%rbp), %rax
cvtsi2sdl (%rax), %xmm1
movsd 0x12db(%rip), %xmm3     # 0x3008
subsd -0x8(%rbp), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x1bf1
movslq -0xc(%rbp), %rcx
leaq 0x385f(%rip), %rax      # 0x55c0
movq (%rax,%rcx,8), %rax
cvtsi2sdl (%rax), %xmm0
movsd -0x8(%rbp), %xmm2
movslq -0xc(%rbp), %rcx
leaq 0x3867(%rip), %rax      # 0x55e0
movq (%rax,%rcx,8), %rax
cvtsi2sdl (%rax), %xmm1
movsd 0x127f(%rip), %xmm3     # 0x3008
subsd -0x8(%rbp), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movslq -0xc(%rbp), %rdx
leaq 0x37d7(%rip), %rax      # 0x5580
movq (%rax,%rdx,8), %rax
movl %ecx, (%rax)
movslq -0xc(%rbp), %rcx
leaq 0x3806(%rip), %rax      # 0x55c0
movq (%rax,%rcx,8), %rax
cvtsi2sdl 0x4(%rax), %xmm0
movsd -0x8(%rbp), %xmm2
movslq -0xc(%rbp), %rcx
leaq 0x380d(%rip), %rax      # 0x55e0
movq (%rax,%rcx,8), %rax
cvtsi2sdl 0x4(%rax), %xmm1
movsd 0x1224(%rip), %xmm3     # 0x3008
subsd -0x8(%rbp), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movslq -0xc(%rbp), %rdx
leaq 0x377c(%rip), %rax      # 0x5580
movq (%rax,%rdx,8), %rax
movl %ecx, 0x4(%rax)
movslq -0xc(%rbp), %rcx
leaq 0x37aa(%rip), %rax      # 0x55c0
movq (%rax,%rcx,8), %rax
cvtsi2sdl 0x8(%rax), %xmm0
movsd -0x8(%rbp), %xmm2
movslq -0xc(%rbp), %rcx
leaq 0x37b1(%rip), %rax      # 0x55e0
movq (%rax,%rcx,8), %rax
cvtsi2sdl 0x8(%rax), %xmm1
movsd 0x11c8(%rip), %xmm3     # 0x3008
subsd -0x8(%rbp), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movslq -0xc(%rbp), %rdx
leaq 0x3720(%rip), %rax      # 0x5580
movq (%rax,%rdx,8), %rax
movl %ecx, 0x8(%rax)
imull $0x64, -0xc(%rbp), %ecx
addl $0x64, %ecx
movslq -0xc(%rbp), %rdx
leaq 0x3707(%rip), %rax      # 0x5580
movq (%rax,%rdx,8), %rax
movl %ecx, 0x4(%rax)
movslq -0xc(%rbp), %rcx
leaq 0x36f5(%rip), %rax      # 0x5580
movq (%rax,%rcx,8), %rdi
movq 0x370a(%rip), %rsi      # 0x55a0
cmpl $0x0, -0x10(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movslq %eax, %rcx
leaq 0x37e2(%rip), %rax      # 0x5690
movq (%rax,%rcx,8), %rdx
callq 0x2200
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)