// File: /workspace/github_c_makefile_star2_O1/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 0x19710
movq %rax, %rbx
leaq 0xfc(%r14), %rdi
movss 0x21b1b(%rip), %xmm0    # 0x55404
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 0x19a20
movl $0x7fff, %ebp           # imm = 0x7FFF
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x2092e(%rip), %xmm0    # 0x54288
cvtss2sd %xmm0, %xmm0
addsd 0x2324a(%rip), %xmm0    # 0x56bb0
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 0x19a20
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x208da(%rip), %xmm0    # 0x54288
cvtss2sd %xmm0, %xmm0
addsd 0x231f6(%rip), %xmm0    # 0x56bb0
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 0x19a20
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x20886(%rip), %xmm0    # 0x54288
cvtss2sd %xmm0, %xmm0
addsd 0x231a2(%rip), %xmm0    # 0x56bb0
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 0x35bc8(%rip), %r13     # 0x69600
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 0x361d0(%rip), %rax     # 0x69c38
movq %rax, 0x238(%rbx)
testl %r15d, %r15d
je 0x33a8e
movl $0x9, 0x118(%rbx)
movss 0x204a2(%rip), %xmm0    # 0x53f28
movss %xmm0, 0xc(%rsp)
jmp 0x33aa6
movl $0x7, 0x118(%rbx)
movq 0x35b89(%rip), %rax     # 0x69628
movq %rax, 0x220(%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 0x19770
movq %rbx, %rdi
callq 0x19030
callq 0x19a20
movl $0x7fff, %ebp           # imm = 0x7FFF
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss 0x2078f(%rip), %xmm1    # 0x54288
divss %xmm1, %xmm0
mulss 0x24737(%rip), %xmm0    # 0x5823c
movss %xmm0, 0x1cc(%rbx)
callq 0x19a20
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x20765(%rip), %xmm0    # 0x54288
mulss 0x24711(%rip), %xmm0    # 0x5823c
movss %xmm0, 0x1d0(%rbx)
callq 0x19a20
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x2073f(%rip), %xmm0    # 0x54288
mulss 0x246eb(%rip), %xmm0    # 0x5823c
movss %xmm0, 0x1d4(%rbx)
movq 0x358d0(%rip), %rax     # 0x69430
movq %rax, 0x210(%rbx)
movq 0x36232(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x20399(%rip), %xmm0    # 0x53f14
movss %xmm0, 0xc(%rsp)
callq 0x19a20
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x206f1(%rip), %xmm0    # 0x54288
mulss 0x20375(%rip), %xmm0    # 0x53f14
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