// File: /workspace/github_c_makefile_star2_O3/veltzer[P]xmeltdown/src/draw.c
// Function: DrawSkel
void DrawSkel(SkeletonPtr s, GC gc, Window where)
{
	int xhip, yhip, xneck, yneck, xshoulder, yshoulder;
	int xhead, yhead;
	int x, y;

	double rsumt, lsumt;
	XPoint mypoints[7];

	x=s->waistx;
	y=s->waisty;

	s->rthigh.anchor=&torsoup;
	s->lthigh.anchor=&torsoup;
	s->rshin.anchor=&(s->rthigh);
	s->lshin.anchor=&(s->lthigh);
	s->rfoot.anchor=&(s->rshin);
	s->lfoot.anchor=&(s->lshin);
	s->rtricep.anchor=&(s->rbicep);
	s->ltricep.anchor=&(s->lbicep);
	s->rbicep.anchor=&torsodown;
	s->lbicep.anchor=&torsodown;

/*
** Get control points along the torso
*/
	xhip=(int) (0.5*s->torso.r*cos(s->torso.t));
	yhip=(int) (0.5*s->torso.r*sin(s->torso.t));
	xneck=-xhip;
	yneck=-yhip;
	xshoulder=(int) (0.75*xneck);
	yshoulder=(int) (0.75*yneck);

	xhead=(int) -((s->headradius+(0.5*s->torso.r))*cos(s->torso.t));
	yhead=(int) -((s->headradius+(0.5*s->torso.r))*sin(s->torso.t));

	xhip+=x;
	yhip+=y;
	xneck+=x;
	yneck+=y;
	xhead+=x;
	yhead+=y;
	xshoulder+=x;
	yshoulder+=y;

	waist.x=x;
	waist.y=y;
	waist.anchor=NULL;

	s->torso.anchor=&waist;
	s->torso.x=xhip;
	s->torso.y=yhip;

/*
** A ray from the hips pointing upwards, used as the anchor for the legs.
*/
	torsoup.x=xhip;
	torsoup.y=yhip;
	torsoup.t=s->torso.t;

/*
** A ray from the shoulders pointing downwards, the anchor for the arms.
*/
	torsodown.x=xshoulder;
	torsodown.y=yshoulder;
	torsodown.t=s->torso.t;

	mypoints[0].x=xhip;
	mypoints[0].y=yhip;
	mypoints[1].x=xneck;
	mypoints[1].y=yneck;

	DrawLines(mypoints, 2, gc, where);

/*
** Draw head
*/
	XDrawArc (dpy, where, gc,
		xhead-s->headradius, yhead-s->headradius,
		2*s->headradius,
		2*s->headradius,
		0, 360*64);

/*
** Get control points for arms
*/
	rsumt=s->torso.t;
	lsumt=s->torso.t;
	EndPoint(&(s->rbicep), rsumt);
	EndPoint(&(s->lbicep), lsumt);

	rsumt+=s->rbicep.t;
	lsumt+=s->lbicep.t;
	EndPoint(&(s->rtricep), rsumt);
	EndPoint(&(s->ltricep), lsumt);

	mypoints[0].x=s->rtricep.x;
	mypoints[0].y=s->rtricep.y;
	mypoints[1].x=s->rbicep.x;
	mypoints[1].y=s->rbicep.y;
	mypoints[2].x=xshoulder;
	mypoints[2].y=yshoulder;
	mypoints[3].x=s->lbicep.x;
	mypoints[3].y=s->lbicep.y;
	mypoints[4].x=s->ltricep.x;
	mypoints[4].y=s->ltricep.y;

	DrawLines(mypoints, 5, gc, where);

/*
** Get control points for legs
*/

	rsumt=s->torso.t;
	lsumt=s->torso.t;
	EndPoint(&(s->rthigh), rsumt);
	EndPoint(&(s->lthigh), lsumt);

	rsumt+=s->rthigh.t;
	lsumt+=s->lthigh.t;
	EndPoint(&(s->rshin), rsumt);
	EndPoint(&(s->lshin), lsumt);

	rsumt+=s->rshin.t;
	lsumt+=s->lshin.t;
	EndPoint(&(s->rfoot), rsumt);
	EndPoint(&(s->lfoot), lsumt);

	mypoints[0].x=s->rfoot.x;
	mypoints[0].y=s->rfoot.y;
	mypoints[1].x=s->rshin.x;
	mypoints[1].y=s->rshin.y;
	mypoints[2].x=s->rthigh.x;
	mypoints[2].y=s->rthigh.y;
	mypoints[3].x=xhip;
	mypoints[3].y=yhip;
	mypoints[4].x=s->lthigh.x;
	mypoints[4].y=s->lthigh.y;
	mypoints[5].x=s->lshin.x;
	mypoints[5].y=s->lshin.y;
	mypoints[6].x=s->lfoot.x;
	mypoints[6].y=s->lfoot.y;

	DrawLines(mypoints, 7, gc, where);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x30(%rdi), %rax
leaq 0x366e(%rip), %rcx      # 0x5120
movq %rcx, 0x48(%rdi)
leaq 0xd0(%rdi), %rdx
movq %rcx, 0xe8(%rdi)
leaq 0x50(%rdi), %rcx
movq %rax, 0x68(%rdi)
leaq 0xf0(%rdi), %rax
movq %rdx, 0x108(%rdi)
movq %rcx, 0x88(%rdi)
movq %rax, 0x128(%rdi)
leaq 0x90(%rdi), %rax
movq %rax, 0xc8(%rdi)
leaq 0x130(%rdi), %rax
movq %rax, 0x168(%rdi)
leaq 0x3635(%rip), %rax      # 0x5140
movq %rax, 0xa8(%rdi)
movq %rax, 0x148(%rdi)
movsd 0x18(%rdi), %xmm0
movq 0x4(%rdi), %r12
movq %r12, %xmm1
movdqa %xmm1, 0x20(%rsp)
movss 0x10(%rdi), %xmm1
movaps %xmm1, 0x10(%rsp)
callq 0x10b0
movss 0x10(%r15), %xmm1
movaps 0x10(%rsp), %xmm2
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
cvtdq2pd %xmm2, %xmm1
movaps %xmm0, 0x30(%rsp)
mulpd 0x1535(%rip), %xmm1     # 0x3090
movapd %xmm1, 0x10(%rsp)
movsd 0x18(%r15), %xmm0
callq 0x11a0
movapd 0x30(%rsp), %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
mulpd 0x10(%rsp), %xmm1
cvttpd2dq %xmm1, %xmm1
movapd %xmm1, (%rsp)
xorpd %xmm0, %xmm0
psubd %xmm1, %xmm0
cvtdq2pd %xmm0, %xmm0
mulpd 0x1507(%rip), %xmm0     # 0x30a0
cvttpd2dq %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl (%r15), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x10(%r15), %xmm1
mulsd 0x1504(%rip), %xmm1     # 0x30c0
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movsd 0x18(%r15), %xmm0
callq 0x10b0
movapd 0x30(%rsp), %xmm2
xorpd 0x14d1(%rip), %xmm2     # 0x30b0
mulsd %xmm0, %xmm2
cvttsd2si %xmm2, %ebp
xorps %xmm0, %xmm0
cvtsi2sdl (%r15), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x10(%r15), %xmm1
mulsd 0x14c0(%rip), %xmm1     # 0x30c0
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movsd 0x18(%r15), %xmm0
callq 0x11a0
movapd 0x30(%rsp), %xmm1
xorpd 0x148d(%rip), %xmm1     # 0x30b0
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %eax
movdqa 0x20(%rsp), %xmm2
movdqa %xmm2, %xmm0
movdqa (%rsp), %xmm5
paddd %xmm5, %xmm0
movd %xmm0, %ecx
movl %ecx, 0x30(%rsp)
pshufd $0x55, %xmm2, %xmm1     # xmm1 = xmm2[1,1,1,1]
movdqa %xmm2, %xmm4
movd %xmm1, %r13d
addl %eax, %r13d
pshufd $0x55, %xmm0, %xmm2     # xmm2 = xmm0[1,1,1,1]
movd %xmm2, %edx
movl %edx, 0x4c(%rsp)
addl %r12d, %ebp
movdqa 0x10(%rsp), %xmm3
paddd %xmm4, %xmm3
movdqa %xmm3, 0x10(%rsp)
movl %r12d, 0x34f2(%rip)     # 0x5170
leaq 0x34db(%rip), %rax      # 0x5160
movd %xmm1, 0x34e7(%rip)     # 0x5174
movq $0x0, 0x34e0(%rip) # 0x5178
movq %rax, 0x28(%r15)
movd %xmm0, 0x20(%r15)
movd %xmm2, 0x24(%r15)
movd %xmm0, 0x3480(%rip)     # 0x5130
movd %xmm2, 0x347c(%rip)     # 0x5134
movsd 0x18(%r15), %xmm0
movsd %xmm0, 0x3462(%rip)     # 0x5128
movq %xmm3, 0x3482(%rip)     # 0x5150
movsd %xmm0, 0x3472(%rip)     # 0x5148
leaq 0x50(%rsp), %r12
movw %cx, (%r12)
movw %dx, 0x2(%r12)
psubd %xmm5, %xmm4
pshuflw $0xe8, %xmm4, %xmm0     # xmm0 = xmm4[0,2,2,3,4,5,6,7]
movd %xmm0, 0x4(%r12)
movq 0x3483(%rip), %rdi      # 0x5180
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
movl $0x2, %r8d
xorl %r9d, %r9d
callq 0x10f0
movq 0x3465(%rip), %rdi      # 0x5180
movl (%r15), %r9d
subl %r9d, %ebp
subl %r9d, %r13d
addl %r9d, %r9d
subq $0x8, %rsp
movq %r14, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
movl %r13d, %r8d
pushq $0x5a00                 # imm = 0x5A00
pushq $0x0
pushq %r9
callq 0x1160
addq $0x20, %rsp
movsd 0x18(%r15), %xmm1
movsd %xmm1, 0x20(%rsp)
movq 0xa8(%r15), %rax
movl 0x10(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x90(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x98(%r15), %xmm0
addsd %xmm1, %xmm0
callq 0x10b0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0xa0(%r15)
movq 0xa8(%r15), %rax
movl 0x14(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x90(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x98(%r15), %xmm0
addsd 0x20(%rsp), %xmm0
callq 0x11a0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0xa4(%r15)
movq 0x148(%r15), %rax
movl 0x10(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x130(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x138(%r15), %xmm0
addsd 0x20(%rsp), %xmm0
callq 0x10b0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x140(%r15)
movq 0x148(%r15), %rax
movl 0x14(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x130(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x138(%r15), %xmm0
addsd 0x20(%rsp), %xmm0
callq 0x11a0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x144(%r15)
movsd 0x98(%r15), %xmm1
movsd 0x20(%rsp), %xmm0
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
addsd 0x138(%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0xc8(%r15), %rax
movl 0x10(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0xb0(%r15), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0xb8(%r15), %xmm0
addsd %xmm1, %xmm0
callq 0x10b0
mulsd 0x40(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0xc0(%r15)
movq 0xc8(%r15), %rax
movl 0x14(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0xb0(%r15), %xmm0
movsd %xmm0, 0x40(%rsp)
movsd (%rsp), %xmm0
addsd 0xb8(%r15), %xmm0
callq 0x11a0
mulsd 0x40(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0xc4(%r15)
movq 0x168(%r15), %rax
movl 0x10(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x150(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x158(%r15), %xmm0
addsd 0x20(%rsp), %xmm0
callq 0x10b0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x160(%r15)
movq 0x168(%r15), %rax
movl 0x14(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x150(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x20(%rsp), %xmm0
addsd 0x158(%r15), %xmm0
callq 0x11a0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x164(%r15)
movq 0xc0(%r15), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, (%r12)
movq 0xa0(%r15), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0x4(%r12)
pshuflw $0xe8, 0x10(%rsp), %xmm0 # xmm0 = mem[0,2,2,3,4,5,6,7]
movd %xmm0, 0x8(%r12)
movq 0x140(%r15), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0xc(%r12)
movzwl 0x160(%r15), %ecx
movw %cx, 0x10(%r12)
movw %ax, 0x12(%r12)
movq 0x3197(%rip), %rdi      # 0x5180
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
movl $0x5, %r8d
xorl %r9d, %r9d
callq 0x10f0
movsd 0x18(%r15), %xmm1
movsd %xmm1, 0x20(%rsp)
movq 0x48(%r15), %rax
movl 0x10(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x30(%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x38(%r15), %xmm0
addsd %xmm1, %xmm0
callq 0x10b0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x40(%r15)
movq 0x48(%r15), %rax
movl 0x14(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x30(%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x38(%r15), %xmm0
addsd 0x20(%rsp), %xmm0
callq 0x11a0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x44(%r15)
movq 0xe8(%r15), %rax
movl 0x10(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0xd0(%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0xd8(%r15), %xmm0
addsd 0x20(%rsp), %xmm0
callq 0x10b0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0xe0(%r15)
movq 0xe8(%r15), %rax
movl 0x14(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0xd0(%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0xd8(%r15), %xmm0
addsd 0x20(%rsp), %xmm0
callq 0x11a0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0xe4(%r15)
movsd 0x38(%r15), %xmm1
movsd 0x20(%rsp), %xmm0
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
addsd 0xd8(%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x68(%r15), %rax
movl 0x10(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x50(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x58(%r15), %xmm0
addsd %xmm1, %xmm0
callq 0x10b0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x60(%r15)
movq 0x68(%r15), %rax
movl 0x14(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x50(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x58(%r15), %xmm0
addsd 0x10(%rsp), %xmm0
callq 0x11a0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x64(%r15)
movq 0x108(%r15), %rax
movl 0x10(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0xf0(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0xf8(%r15), %xmm0
addsd 0x20(%rsp), %xmm0
callq 0x10b0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x100(%r15)
movq 0x108(%r15), %rax
movl 0x14(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0xf0(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0xf8(%r15), %xmm0
addsd 0x20(%rsp), %xmm0
callq 0x11a0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x104(%r15)
movsd 0x10(%rsp), %xmm1
addsd 0x58(%r15), %xmm1
movsd %xmm1, 0x10(%rsp)
movsd 0x20(%rsp), %xmm0
addsd 0xf8(%r15), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x88(%r15), %rax
movl 0x10(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x70(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x78(%r15), %xmm0
addsd %xmm1, %xmm0
callq 0x10b0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x80(%r15)
movq 0x88(%r15), %rax
movl 0x14(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x70(%r15), %xmm0
movsd %xmm0, (%rsp)
movsd 0x10(%rsp), %xmm0
addsd 0x78(%r15), %xmm0
callq 0x11a0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x84(%r15)
movq 0x128(%r15), %rax
movl 0x10(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x110(%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x118(%r15), %xmm0
addsd 0x20(%rsp), %xmm0
callq 0x10b0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x120(%r15)
movq 0x128(%r15), %rax
movl 0x14(%rax), %ebp
xorps %xmm0, %xmm0
cvtsi2sdl 0x110(%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm0
addsd 0x118(%r15), %xmm0
callq 0x11a0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebp, %eax
movl %eax, 0x124(%r15)
movq 0x80(%r15), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, (%r12)
movq 0x60(%r15), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0x4(%r12)
movq 0x40(%r15), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0x8(%r12)
movl 0x30(%rsp), %ecx
movw %cx, 0xc(%r12)
movl 0x4c(%rsp), %ecx
movw %cx, 0xe(%r12)
movq 0xe0(%r15), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0x10(%r12)
movq 0x100(%r15), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0x14(%r12)
movzwl 0x120(%r15), %ecx
movw %cx, 0x18(%r12)
movw %ax, 0x1a(%r12)
movq 0x2dc1(%rip), %rdi      # 0x5180
movq %r14, %rsi
movq %rbx, %rdx
movq %r12, %rcx
movl $0x7, %r8d
xorl %r9d, %r9d
callq 0x10f0
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq