// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rax
leaq 0x336a(%rip), %rcx      # 0x5120
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
leaq 0x335b(%rip), %rcx      # 0x5120
movq %rcx, 0xe8(%rax)
movq -0x8(%rbp), %rcx
addq $0x30, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rcx
addq $0xd0, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x108(%rax)
movq -0x8(%rbp), %rcx
addq $0x50, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x8(%rbp), %rcx
addq $0xf0, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x128(%rax)
movq -0x8(%rbp), %rcx
addq $0x90, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0xc8(%rax)
movq -0x8(%rbp), %rcx
addq $0x130, %rcx            # imm = 0x130
movq -0x8(%rbp), %rax
movq %rcx, 0x168(%rax)
movq -0x8(%rbp), %rax
leaq 0x32ee(%rip), %rcx      # 0x5140
movq %rcx, 0xa8(%rax)
movq -0x8(%rbp), %rax
leaq 0x32dc(%rip), %rcx      # 0x5140
movq %rcx, 0x148(%rax)
movq -0x8(%rbp), %rax
cvtsi2sdl 0x10(%rax), %xmm1
movsd 0x1214(%rip), %xmm0     # 0x3090
mulsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
callq 0x10a0
movaps %xmm0, %xmm1
movsd -0x90(%rbp), %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
cvtsi2sdl 0x10(%rax), %xmm1
movsd 0x11d3(%rip), %xmm0     # 0x3090
mulsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
callq 0x1190
movaps %xmm0, %xmm1
movsd -0x88(%rbp), %xmm0
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x20(%rbp)
xorl %eax, %eax
subl -0x1c(%rbp), %eax
movl %eax, -0x24(%rbp)
xorl %eax, %eax
subl -0x20(%rbp), %eax
movl %eax, -0x28(%rbp)
cvtsi2sdl -0x24(%rbp), %xmm1
movsd 0x118e(%rip), %xmm0     # 0x3098
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x2c(%rbp)
cvtsi2sdl -0x28(%rbp), %xmm1
movsd 0x1176(%rip), %xmm0     # 0x3098
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
cvtsi2sdl (%rax), %xmm1
movq -0x8(%rbp), %rax
cvtsi2sdl 0x10(%rax), %xmm0
movsd 0x114a(%rip), %xmm2     # 0x3090
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
callq 0x10a0
movaps %xmm0, %xmm1
movsd -0x80(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x34(%rbp)
movq -0x8(%rbp), %rax
cvtsi2sdl (%rax), %xmm1
movq -0x8(%rbp), %rax
cvtsi2sdl 0x10(%rax), %xmm0
movsd 0x10ec(%rip), %xmm2     # 0x3090
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
callq 0x1190
movaps %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x40(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x3c(%rbp), %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x40(%rbp), %eax
addl -0x28(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x3c(%rbp), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x40(%rbp), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x3c(%rbp), %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x40(%rbp), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, 0x3136(%rip)      # 0x5170
movl -0x40(%rbp), %eax
movl %eax, 0x3131(%rip)      # 0x5174
movq $0x0, 0x312a(%rip) # 0x5178
movq -0x8(%rbp), %rax
leaq 0x3107(%rip), %rcx      # 0x5160
movq %rcx, 0x28(%rax)
movl -0x1c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x1c(%rbp), %eax
movl %eax, 0x30b6(%rip)      # 0x5130
movl -0x20(%rbp), %eax
movl %eax, 0x30b1(%rip)      # 0x5134
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x3094(%rip)     # 0x5128
movl -0x2c(%rbp), %eax
movl %eax, 0x30b3(%rip)      # 0x5150
movl -0x30(%rbp), %eax
movl %eax, 0x30ae(%rip)      # 0x5154
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x3091(%rip)     # 0x5148
movl -0x1c(%rbp), %eax
movw %ax, -0x70(%rbp)
movl -0x20(%rbp), %eax
movw %ax, -0x6e(%rbp)
movl -0x24(%rbp), %eax
movw %ax, -0x6c(%rbp)
movl -0x28(%rbp), %eax
movw %ax, -0x6a(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x2, %esi
callq 0x2420
movq 0x3090(%rip), %rdi      # 0x5180
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x34(%rbp), %ecx
movq -0x8(%rbp), %rax
subl (%rax), %ecx
movl -0x38(%rbp), %r8d
movq -0x8(%rbp), %rax
subl (%rax), %r8d
movq -0x8(%rbp), %rax
movl (%rax), %r9d
shll %r9d
movq -0x8(%rbp), %rax
movl (%rax), %eax
shll %eax
xorl %r10d, %r10d
movl %eax, (%rsp)
movl $0x0, 0x8(%rsp)
movl $0x5a00, 0x10(%rsp)     # imm = 0x5A00
callq 0x1150
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
addq $0x90, %rdi
movsd -0x48(%rbp), %xmm0
callq 0x2460
movq -0x8(%rbp), %rdi
addq $0x130, %rdi            # imm = 0x130
movsd -0x50(%rbp), %xmm0
callq 0x2460
movq -0x8(%rbp), %rax
movsd 0x98(%rax), %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movsd 0x138(%rax), %xmm0
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
addq $0xb0, %rdi
movsd -0x48(%rbp), %xmm0
callq 0x2460
movq -0x8(%rbp), %rdi
addq $0x150, %rdi            # imm = 0x150
movsd -0x50(%rbp), %xmm0
callq 0x2460
movq -0x8(%rbp), %rax
movl 0xc0(%rax), %eax
movw %ax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movl 0xc4(%rax), %eax
movw %ax, -0x6e(%rbp)
movq -0x8(%rbp), %rax
movl 0xa0(%rax), %eax
movw %ax, -0x6c(%rbp)
movq -0x8(%rbp), %rax
movl 0xa4(%rax), %eax
movw %ax, -0x6a(%rbp)
movl -0x2c(%rbp), %eax
movw %ax, -0x68(%rbp)
movl -0x30(%rbp), %eax
movw %ax, -0x66(%rbp)
movq -0x8(%rbp), %rax
movl 0x140(%rax), %eax
movw %ax, -0x64(%rbp)
movq -0x8(%rbp), %rax
movl 0x144(%rax), %eax
movw %ax, -0x62(%rbp)
movq -0x8(%rbp), %rax
movl 0x160(%rax), %eax
movw %ax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movl 0x164(%rax), %eax
movw %ax, -0x5e(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x5, %esi
callq 0x2420
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
addq $0x30, %rdi
movsd -0x48(%rbp), %xmm0
callq 0x2460
movq -0x8(%rbp), %rdi
addq $0xd0, %rdi
movsd -0x50(%rbp), %xmm0
callq 0x2460
movq -0x8(%rbp), %rax
movsd 0x38(%rax), %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movsd 0xd8(%rax), %xmm0
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
movsd -0x48(%rbp), %xmm0
callq 0x2460
movq -0x8(%rbp), %rdi
addq $0xf0, %rdi
movsd -0x50(%rbp), %xmm0
callq 0x2460
movq -0x8(%rbp), %rax
movsd 0x58(%rax), %xmm0
addsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movsd 0xf8(%rax), %xmm0
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
addq $0x70, %rdi
movsd -0x48(%rbp), %xmm0
callq 0x2460
movq -0x8(%rbp), %rdi
addq $0x110, %rdi            # imm = 0x110
movsd -0x50(%rbp), %xmm0
callq 0x2460
movq -0x8(%rbp), %rax
movl 0x80(%rax), %eax
movw %ax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movl 0x84(%rax), %eax
movw %ax, -0x6e(%rbp)
movq -0x8(%rbp), %rax
movl 0x60(%rax), %eax
movw %ax, -0x6c(%rbp)
movq -0x8(%rbp), %rax
movl 0x64(%rax), %eax
movw %ax, -0x6a(%rbp)
movq -0x8(%rbp), %rax
movl 0x40(%rax), %eax
movw %ax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movl 0x44(%rax), %eax
movw %ax, -0x66(%rbp)
movl -0x1c(%rbp), %eax
movw %ax, -0x64(%rbp)
movl -0x20(%rbp), %eax
movw %ax, -0x62(%rbp)
movq -0x8(%rbp), %rax
movl 0xe0(%rax), %eax
movw %ax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movl 0xe4(%rax), %eax
movw %ax, -0x5e(%rbp)
movq -0x8(%rbp), %rax
movl 0x100(%rax), %eax
movw %ax, -0x5c(%rbp)
movq -0x8(%rbp), %rax
movl 0x104(%rax), %eax
movw %ax, -0x5a(%rbp)
movq -0x8(%rbp), %rax
movl 0x120(%rax), %eax
movw %ax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movl 0x124(%rax), %eax
movw %ax, -0x56(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x7, %esi
callq 0x2420
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)