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

	gib = G_Spawn();

	VectorScale (self->size, 0.5, size);
	VectorAdd (self->absmin, size, origin);
	gib->s.origin[0] = origin[0] + crandom() * size[0];
	gib->s.origin[1] = origin[1] + crandom() * size[1];
	gib->s.origin[2] = origin[2] + crandom() * size[2];

	gi.setmodel (gib, gibname);
	gib->solid = SOLID_NOT;
	gib->s.effects |= EF_GIB;
	gib->flags |= FL_NO_KNOCKBACK;
	gib->takedamage = DAMAGE_YES;
	gib->die = gib_die;

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

	VelocityForDamage (damage, vd);
	VectorMA (self->velocity, vscale, vd, gib->velocity);
	ClipGibVelocity (gib);
	gib->avelocity[0] = random()*600;
	gib->avelocity[1] = random()*600;
	gib->avelocity[2] = random()*600;

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

	gi.linkentity (gib);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %r15d
movl %edx, 0x24(%rsp)
movq %rsi, %r12
movq %rdi, %r14
callq 0x19700
movq %rax, %rbx
leaq 0xfc(%r14), %rdi
movss 0x21087(%rip), %xmm0    # 0x54400
leaq 0x30(%rsp), %r13
movss %xmm0, 0xc(%rsp)
movq %r13, %rsi
callq 0x189d0
movss 0xe4(%r14), %xmm0
movss 0xe8(%r14), %xmm1
addss (%r13), %xmm0
addss 0x4(%r13), %xmm1
movss %xmm1, 0x10(%rsp)
movss 0xec(%r14), %xmm1
addss 0x8(%r13), %xmm1
movss %xmm1, 0x18(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
callq 0x19a10
movl $0x7fff, %ebp           # imm = 0x7FFF
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x1fe9e(%rip), %xmm0    # 0x53288
cvtss2sd %xmm0, %xmm0
addsd 0x22822(%rip), %xmm0    # 0x55c18
addsd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd (%r13), %xmm1
mulsd %xmm0, %xmm1
addsd 0x28(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x4(%rbx)
xorps %xmm0, %xmm0
cvtss2sd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x19a10
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x1fe4a(%rip), %xmm0    # 0x53288
cvtss2sd %xmm0, %xmm0
addsd 0x227ce(%rip), %xmm0    # 0x55c18
addsd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%r13), %xmm1
mulsd %xmm0, %xmm1
addsd 0x10(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x8(%rbx)
xorps %xmm0, %xmm0
cvtss2sd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
callq 0x19a10
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x1fdf6(%rip), %xmm0    # 0x53288
cvtss2sd %xmm0, %xmm0
addsd 0x2277a(%rip), %xmm0    # 0x55c18
addsd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x8(%r13), %xmm1
mulsd %xmm0, %xmm1
addsd 0x18(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0xc(%rbx)
movq 0x35138(%rip), %r13     # 0x68600
movq %rbx, %rdi
movq %r12, %rsi
callq *0x58(%r13)
movl $0x0, 0x108(%rbx)
orb $0x2, 0x40(%rbx)
orb $0x8, 0x11d(%rbx)
movl $0x1, 0x27c(%rbx)
movq 0x35740(%rip), %rax     # 0x68c38
movq %rax, 0x238(%rbx)
testl %r15d, %r15d
je 0x33519
movss 0x1fa1c(%rip), %xmm0    # 0x52f28
movss %xmm0, 0xc(%rsp)
movl $0x9, %eax
jmp 0x3352c
movq 0x35108(%rip), %rax     # 0x68628
movq %rax, 0x220(%rbx)
movl $0x7, %eax
movl %eax, 0x118(%rbx)
leaq 0x3c(%rsp), %r15
movl 0x24(%rsp), %edi
movq %r15, %rsi
callq 0x19600
movl $0x1c0, %eax            # imm = 0x1C0
addq %rax, %r14
movq %rbx, %rdx
addq %rax, %rdx
movq %r14, %rdi
movss 0xc(%rsp), %xmm0
movq %r15, %rsi
callq 0x19760
movq %rbx, %rdi
callq 0x19030
callq 0x19a10
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss 0x1fd08(%rip), %xmm1    # 0x53288
divss %xmm1, %xmm0
mulss 0x23da8(%rip), %xmm0    # 0x57334
movss %xmm0, 0x1cc(%rbx)
callq 0x19a10
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x1fcde(%rip), %xmm0    # 0x53288
mulss 0x23d82(%rip), %xmm0    # 0x57334
movss %xmm0, 0x1d0(%rbx)
callq 0x19a10
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x1fcb8(%rip), %xmm0    # 0x53288
mulss 0x23d5c(%rip), %xmm0    # 0x57334
movss %xmm0, 0x1d4(%rbx)
movq 0x34e49(%rip), %rax     # 0x68430
movq %rax, 0x210(%rbx)
movq 0x357ab(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
addss 0x1f912(%rip), %xmm0    # 0x52f14
movss %xmm0, 0xc(%rsp)
callq 0x19a10
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x1fc6a(%rip), %xmm0    # 0x53288
mulss 0x1f8ee(%rip), %xmm0    # 0x52f14
addss 0xc(%rsp), %xmm0
movss %xmm0, 0x200(%rbx)
movq %rbx, %rdi
callq *0x90(%r13)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq