// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_misc.c
// Function: ThrowHead
void ThrowHead (edict_t *self, char *gibname, int damage, int type)
{
	vec3_t	vd;
	float	vscale;

	self->s.skinnum = 0;
	self->s.frame = 0;
	VectorClear (self->mins);
	VectorClear (self->maxs);

	self->s.modelindex2 = 0;
	gi.setmodel (self, gibname);
	self->solid = SOLID_NOT;
	self->s.effects |= EF_GIB;
	self->s.effects &= ~EF_FLIES;
	self->s.sound = 0;
	self->flags |= FL_NO_KNOCKBACK;
	self->svflags &= ~SVF_MONSTER;
	self->takedamage = DAMAGE_YES;
	self->die = gib_die;

	if (type == GIB_ORGANIC)
	{
		self->movetype = MOVETYPE_TOSS;
		self->touch = gib_touch;
		vscale = 0.5;
	}
	else
	{
		self->movetype = MOVETYPE_BOUNCE;
		vscale = 1.0;
	}

	VelocityForDamage (damage, vd);
	VectorMA (self->velocity, vscale, vd, self->velocity);
	ClipGibVelocity (self);

	self->avelocity[YAW] = crandom()*600;

	self->think = G_FreeEdict;
	self->nextthink = level.time + 10 + random()*10;

	gi.linkentity (self);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x3c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x38(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xd4(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xd0(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xcc(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xe0(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xdc(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xd8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x2c(%rax)
movq 0x42d38(%rip), %rax     # 0x82600
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq *%rax
movq -0x8(%rbp), %rax
movl $0x0, 0x108(%rax)
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rax
movl 0x40(%rax), %ecx
andl $0xffffbfff, %ecx       # imm = 0xFFFFBFFF
movl %ecx, 0x40(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4c(%rax)
movq -0x8(%rbp), %rax
movl 0x11c(%rax), %ecx
orl $0x800, %ecx            # imm = 0x800
movl %ecx, 0x11c(%rax)
movq -0x8(%rbp), %rax
movl 0xc8(%rax), %ecx
andl $-0x5, %ecx
movl %ecx, 0xc8(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x27c(%rax)
movq -0x8(%rbp), %rax
movq 0x432ea(%rip), %rcx     # 0x82c38
movq %rcx, 0x238(%rax)
cmpl $0x0, -0x18(%rbp)
jne 0x3f98a
movq -0x8(%rbp), %rax
movl $0x7, 0x118(%rax)
movq -0x8(%rbp), %rax
movq 0x42cb4(%rip), %rcx     # 0x82628
movq %rcx, 0x220(%rax)
movss 0x331cd(%rip), %xmm0    # 0x72b50
movss %xmm0, -0x28(%rbp)
jmp 0x3f9a5
movq -0x8(%rbp), %rax
movl $0x9, 0x118(%rax)
movss 0x3054c(%rip), %xmm0    # 0x6feec
movss %xmm0, -0x28(%rbp)
movl -0x14(%rbp), %edi
leaq -0x24(%rbp), %rsi
callq 0x19840
movq -0x8(%rbp), %rdi
addq $0x1c0, %rdi            # imm = 0x1C0
movss -0x28(%rbp), %xmm0
leaq -0x24(%rbp), %rsi
movq -0x8(%rbp), %rdx
addq $0x1c0, %rdx            # imm = 0x1C0
callq 0x199c0
movq -0x8(%rbp), %rdi
callq 0x191e0
callq 0x19c80
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x30894(%rip), %xmm1    # 0x70288
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x31a24(%rip), %xmm0    # 0x71428
subsd %xmm0, %xmm1
movsd 0x33188(%rip), %xmm0    # 0x72b98
mulsd %xmm1, %xmm0
movsd 0x347b4(%rip), %xmm1    # 0x741d0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x1d0(%rax)
movq -0x8(%rbp), %rax
movq 0x429f5(%rip), %rcx     # 0x82430
movq %rcx, 0x210(%rax)
movss 0x304a6(%rip), %xmm0    # 0x6fef0
movq 0x4334f(%rip), %rax     # 0x82da0
addss 0x4(%rax), %xmm0
movss %xmm0, -0x2c(%rbp)
callq 0x19c80
movss -0x2c(%rbp), %xmm1
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x30812(%rip), %xmm2    # 0x70288
divss %xmm2, %xmm0
movss 0x3046e(%rip), %xmm2    # 0x6fef0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x200(%rax)
movq 0x42b63(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
addq $0x30, %rsp
popq %rbp
retq