// File: /workspace/github_c_makefile_star2_O2/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 0x198d0
movq %rax, %rbx
leaq 0xfc(%r14), %rdi
movss 0x1fc20(%rip), %xmm0    # 0x50400
leaq 0x30(%rsp), %r13
movss %xmm0, 0xc(%rsp)
movq %r13, %rsi
callq 0x18a70
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 0x19bf0
movl $0x7fff, %ebp           # imm = 0x7FFF
andl %ebp, %eax
cvtsi2ss %eax, %xmm0
divss 0x1ea3a(%rip), %xmm0    # 0x4f288
cvtss2sd %xmm0, %xmm0
addsd 0x2139e(%rip), %xmm0    # 0x51bf8
addsd %xmm0, %xmm0
cvtss2sd (%r13), %xmm1
mulsd %xmm0, %xmm1
addsd 0x28(%rsp), %xmm1
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x4(%rbx)
cvtss2sd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x19bf0
andl %ebp, %eax
cvtsi2ss %eax, %xmm0
divss 0x1e9f2(%rip), %xmm0    # 0x4f288
cvtss2sd %xmm0, %xmm0
addsd 0x21356(%rip), %xmm0    # 0x51bf8
addsd %xmm0, %xmm0
cvtss2sd 0x4(%r13), %xmm1
mulsd %xmm0, %xmm1
addsd 0x10(%rsp), %xmm1
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0x8(%rbx)
cvtss2sd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
callq 0x19bf0
andl %ebp, %eax
cvtsi2ss %eax, %xmm0
divss 0x1e9aa(%rip), %xmm0    # 0x4f288
cvtss2sd %xmm0, %xmm0
addsd 0x2130e(%rip), %xmm0    # 0x51bf8
addsd %xmm0, %xmm0
cvtss2sd 0x8(%r13), %xmm1
mulsd %xmm0, %xmm1
addsd 0x18(%rsp), %xmm1
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0xc(%rbx)
movq 0x35cf2(%rip), %r13     # 0x66600
movq %rbx, %rdi
movq %r12, %rsi
callq *0x58(%r13)
andl $0x0, 0x108(%rbx)
orb $0x2, 0x40(%rbx)
orb $0x8, 0x11d(%rbx)
movl $0x1, 0x27c(%rbx)
movq 0x362fd(%rip), %rax     # 0x66c38
movq %rax, 0x238(%rbx)
testl %r15d, %r15d
je 0x30959
movss 0x1e5d9(%rip), %xmm0    # 0x4ef28
movss %xmm0, 0xc(%rsp)
pushq $0x9
jmp 0x30969
movq 0x35cc8(%rip), %rax     # 0x66628
movq %rax, 0x220(%rbx)
pushq $0x7
popq %rax
movl %eax, 0x118(%rbx)
leaq 0x3c(%rsp), %r15
movl 0x24(%rsp), %edi
movq %r15, %rsi
callq 0x197c0
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 0x19940
movq %rbx, %rdi
callq 0x19170
callq 0x19bf0
andl %ebp, %eax
cvtsi2ss %eax, %xmm0
movss 0x1e8cd(%rip), %xmm1    # 0x4f288
divss %xmm1, %xmm0
mulss 0x2294d(%rip), %xmm0    # 0x53314
movss %xmm0, 0x1cc(%rbx)
callq 0x19bf0
andl %ebp, %eax
cvtsi2ss %eax, %xmm0
divss 0x1e8a6(%rip), %xmm0    # 0x4f288
mulss 0x2292a(%rip), %xmm0    # 0x53314
movss %xmm0, 0x1d0(%rbx)
callq 0x19bf0
andl %ebp, %eax
cvtsi2ss %eax, %xmm0
divss 0x1e883(%rip), %xmm0    # 0x4f288
mulss 0x22907(%rip), %xmm0    # 0x53314
movss %xmm0, 0x1d4(%rbx)
movq 0x35a14(%rip), %rax     # 0x66430
movq %rax, 0x210(%rbx)
movq 0x36376(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
addss 0x1e4dd(%rip), %xmm0    # 0x4ef14
movss %xmm0, 0xc(%rsp)
callq 0x19bf0
andl %ebp, %eax
cvtsi2ss %eax, %xmm0
divss 0x1e838(%rip), %xmm0    # 0x4f288
mulss 0x1e4bc(%rip), %xmm0    # 0x4ef14
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