// File: /workspace/github_c_makefile_star2_O1/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, 0x40(%rsp)
movq %rdi, %r14
movl 0x4(%rdi), %ebx
movl 0x8(%rdi), %r12d
leaq 0x30(%rdi), %rax
leaq 0x362c(%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 0x35f3(%rip), %rax      # 0x5140
movq %rax, 0xa8(%rdi)
movq %rax, 0x148(%rdi)
cvtsi2sdl 0x10(%rdi), %xmm0
movq %rsi, 0x48(%rsp)
mulsd 0x1523(%rip), %xmm0     # 0x3090
movsd %xmm0, (%rsp)
movsd 0x18(%rdi), %xmm0
callq 0x10b0
mulsd (%rsp), %xmm0
cvttsd2si %xmm0, %r13d
movq %r13, (%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x10(%r14), %xmm0
mulsd 0x14f5(%rip), %xmm0     # 0x3090
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%r14), %xmm0
callq 0x11a0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %r15d
movl %r13d, %eax
negl %eax
movl %r15d, %ecx
negl %ecx
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x14c8(%rip), %xmm1     # 0x3098
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x10(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl (%r14), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x10(%r14), %xmm1
mulsd 0x1488(%rip), %xmm1     # 0x3090
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movsd 0x18(%r14), %xmm0
callq 0x10b0
movapd 0x30(%rsp), %xmm1
xorpd 0x1475(%rip), %xmm1     # 0x30a0
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %ebp
xorps %xmm0, %xmm0
cvtsi2sdl (%r14), %xmm0
xorps %xmm1, %xmm1
cvtsi2sdl 0x10(%r14), %xmm1
mulsd 0x1444(%rip), %xmm1     # 0x3090
addsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movsd 0x18(%r14), %xmm0
callq 0x11a0
movapd 0x30(%rsp), %xmm1
xorpd 0x1431(%rip), %xmm1     # 0x30a0
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %r13d
movq (%rsp), %rcx
leal (%rbx,%rcx), %esi
movl %esi, 0x30(%rsp)
leal (%r12,%r15), %edi
movl %edi, 0x2c(%rsp)
movl %ebx, %eax
subl %ecx, %eax
movl %r12d, %ecx
subl %r15d, %ecx
addl %ebx, %ebp
addl %r12d, %r13d
movl 0x10(%rsp), %r8d
addl %ebx, %r8d
movl %r8d, 0x10(%rsp)
movl 0x8(%rsp), %r9d
addl %r12d, %r9d
movl %r9d, 0x8(%rsp)
movl %ebx, 0x34b6(%rip)      # 0x5170
leaq 0x349f(%rip), %rdx      # 0x5160
movl %r12d, 0x34ac(%rip)     # 0x5174
movq $0x0, 0x34a5(%rip) # 0x5178
movq %rdx, 0x28(%r14)
movl %esi, 0x20(%r14)
movl %edi, 0x24(%r14)
movl %esi, 0x344b(%rip)      # 0x5130
movl %edi, 0x3449(%rip)      # 0x5134
movsd 0x18(%r14), %xmm0
movsd %xmm0, 0x342f(%rip)     # 0x5128
movl %r8d, 0x3450(%rip)      # 0x5150
movl %r9d, 0x344d(%rip)      # 0x5154
movsd %xmm0, 0x3439(%rip)     # 0x5148
leaq 0x50(%rsp), %r12
movw %si, (%r12)
movw %di, 0x2(%r12)
movw %ax, 0x4(%r12)
movw %cx, 0x6(%r12)
movq 0x344e(%rip), %rdi      # 0x5180
movq 0x40(%rsp), %r15
movq %r15, %rsi
movq 0x48(%rsp), %rbx
movq %rbx, %rdx
movq %r12, %rcx
movl $0x2, %r8d
xorl %r9d, %r9d
callq 0x10f0
movq 0x3426(%rip), %rdi      # 0x5180
movl (%r14), %r9d
subl %r9d, %ebp
subl %r9d, %r13d
addl %r9d, %r9d
subq $0x8, %rsp
movq %r15, %rsi
movq %rbx, %rdx
movq %rbx, %r15
movl %ebp, %ecx
movl %r13d, %r8d
pushq $0x5a00                 # imm = 0x5A00
pushq $0x0
pushq %r9
callq 0x1160
addq $0x20, %rsp
movsd 0x18(%r14), %xmm1
movsd %xmm1, (%rsp)
movq 0xa8(%r14), %rax
movl 0x10(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x90(%r14), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x98(%r14), %xmm0
addsd %xmm1, %xmm0
callq 0x10b0
mulsd 0x18(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0xa0(%r14)
movq 0xa8(%r14), %rax
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x90(%r14), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x98(%r14), %xmm0
addsd (%rsp), %xmm0
callq 0x11a0
mulsd 0x18(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0xa4(%r14)
movq 0x148(%r14), %rax
movl 0x10(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x130(%r14), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x138(%r14), %xmm0
addsd (%rsp), %xmm0
callq 0x10b0
mulsd 0x18(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x140(%r14)
movq 0x148(%r14), %rax
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x130(%r14), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x138(%r14), %xmm0
addsd (%rsp), %xmm0
callq 0x11a0
mulsd 0x18(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x144(%r14)
movsd 0x98(%r14), %xmm1
movsd (%rsp), %xmm0
addsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
addsd 0x138(%r14), %xmm0
movsd %xmm0, (%rsp)
movq 0xc8(%r14), %rax
movl 0x10(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0xb0(%r14), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0xb8(%r14), %xmm0
addsd %xmm1, %xmm0
callq 0x10b0
mulsd 0x20(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0xc0(%r14)
movq 0xc8(%r14), %rax
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0xb0(%r14), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x18(%rsp), %xmm0
addsd 0xb8(%r14), %xmm0
callq 0x11a0
mulsd 0x20(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0xc4(%r14)
movq 0x168(%r14), %rax
movl 0x10(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x150(%r14), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x158(%r14), %xmm0
addsd (%rsp), %xmm0
callq 0x10b0
mulsd 0x18(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x160(%r14)
movq 0x168(%r14), %rax
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x150(%r14), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd (%rsp), %xmm0
addsd 0x158(%r14), %xmm0
callq 0x11a0
mulsd 0x18(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x164(%r14)
movzwl 0xc0(%r14), %eax
movw %ax, (%r12)
movzwl 0xc4(%r14), %eax
movw %ax, 0x2(%r12)
movzwl 0xa0(%r14), %eax
movw %ax, 0x4(%r12)
movzwl 0xa4(%r14), %eax
movw %ax, 0x6(%r12)
movl 0x10(%rsp), %eax
movw %ax, 0x8(%r12)
movl 0x8(%rsp), %eax
movw %ax, 0xa(%r12)
movzwl 0x140(%r14), %eax
movw %ax, 0xc(%r12)
movzwl 0x144(%r14), %eax
movw %ax, 0xe(%r12)
movzwl 0x160(%r14), %eax
movw %ax, 0x10(%r12)
movzwl 0x164(%r14), %eax
movw %ax, 0x12(%r12)
movq 0x312c(%rip), %rdi      # 0x5180
movq 0x40(%rsp), %rbp
movq %rbp, %rsi
movq %r15, %rdx
movq %r12, %rcx
movl $0x5, %r8d
xorl %r9d, %r9d
callq 0x10f0
movsd 0x18(%r14), %xmm1
movsd %xmm1, (%rsp)
movq 0x48(%r14), %rax
movl 0x10(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x30(%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x38(%r14), %xmm0
addsd %xmm1, %xmm0
callq 0x10b0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x40(%r14)
movq 0x48(%r14), %rax
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x30(%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x38(%r14), %xmm0
addsd (%rsp), %xmm0
callq 0x11a0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x44(%r14)
movq 0xe8(%r14), %rax
movl 0x10(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0xd0(%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xd8(%r14), %xmm0
addsd (%rsp), %xmm0
callq 0x10b0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0xe0(%r14)
movq 0xe8(%r14), %rax
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0xd0(%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0xd8(%r14), %xmm0
addsd (%rsp), %xmm0
callq 0x11a0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0xe4(%r14)
movsd 0x38(%r14), %xmm1
movsd (%rsp), %xmm0
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
addsd 0xd8(%r14), %xmm0
movsd %xmm0, (%rsp)
movq 0x68(%r14), %rax
movl 0x10(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x50(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x58(%r14), %xmm0
addsd %xmm1, %xmm0
callq 0x10b0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x60(%r14)
movq 0x68(%r14), %rax
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x50(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x58(%r14), %xmm0
addsd 0x8(%rsp), %xmm0
callq 0x11a0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x64(%r14)
movq 0x108(%r14), %rax
movl 0x10(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0xf0(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0xf8(%r14), %xmm0
addsd (%rsp), %xmm0
callq 0x10b0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x100(%r14)
movq 0x108(%r14), %rax
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0xf0(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0xf8(%r14), %xmm0
addsd (%rsp), %xmm0
callq 0x11a0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x104(%r14)
movsd 0x8(%rsp), %xmm1
addsd 0x58(%r14), %xmm1
movsd %xmm1, 0x8(%rsp)
movsd (%rsp), %xmm0
addsd 0xf8(%r14), %xmm0
movsd %xmm0, (%rsp)
movq 0x88(%r14), %rax
movl 0x10(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x70(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x78(%r14), %xmm0
addsd %xmm1, %xmm0
callq 0x10b0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x80(%r14)
movq 0x88(%r14), %rax
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x70(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
addsd 0x78(%r14), %xmm0
callq 0x11a0
mulsd 0x10(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x84(%r14)
movq 0x128(%r14), %rax
movl 0x10(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x110(%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x118(%r14), %xmm0
addsd (%rsp), %xmm0
callq 0x10b0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x120(%r14)
movq 0x128(%r14), %rax
movl 0x14(%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2sdl 0x110(%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd (%rsp), %xmm0
addsd 0x118(%r14), %xmm0
callq 0x11a0
mulsd 0x8(%rsp), %xmm0
cvttsd2si %xmm0, %eax
addl %ebx, %eax
movl %eax, 0x124(%r14)
movzwl 0x80(%r14), %eax
movw %ax, (%r12)
movzwl 0x84(%r14), %eax
movw %ax, 0x2(%r12)
movzwl 0x60(%r14), %eax
movw %ax, 0x4(%r12)
movzwl 0x64(%r14), %eax
movw %ax, 0x6(%r12)
movzwl 0x40(%r14), %eax
movw %ax, 0x8(%r12)
movzwl 0x44(%r14), %eax
movw %ax, 0xa(%r12)
movl 0x30(%rsp), %eax
movw %ax, 0xc(%r12)
movl 0x2c(%rsp), %eax
movw %ax, 0xe(%r12)
movzwl 0xe0(%r14), %eax
movw %ax, 0x10(%r12)
movzwl 0xe4(%r14), %eax
movw %ax, 0x12(%r12)
movzwl 0x100(%r14), %eax
movw %ax, 0x14(%r12)
movzwl 0x104(%r14), %eax
movw %ax, 0x16(%r12)
movzwl 0x120(%r14), %eax
movw %ax, 0x18(%r12)
movzwl 0x124(%r14), %eax
movw %ax, 0x1a(%r12)
movq 0x2d2c(%rip), %rdi      # 0x5180
movq %rbp, %rsi
movq %r15, %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