// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: tossrune
static void tossrune (edict_t *ent, vec3_t dir)
{	
	float		*v;
	vec3_t		temp;
	edict_t     *owner;
	trace_t	tr;
	
	VectorSet(ent->mins, -15,-15,-15);
	VectorSet(ent->maxs, 15, 15, 15);
	tossruneset(ent);
	ent->touch = Touch_Item;
	owner = ent->owner;
	ent->owner = NULL;
	ent->groundentity = NULL;
	
	VectorCopy(ent->s.origin, temp);
	
	if (!dir || !dir[0] ) // Random toss
	{
		
		v = tv(0, 0, 48);
		VectorAdd (ent->s.origin, v, ent->s.origin);
		ent->velocity[0] = -2000 + (random() * 4000);
		ent->velocity[1] = -2000 + (random() * 4000);
		ent->velocity[2] = 800 + (random() * 200);
		
	}
	else
	{
		VectorScale(dir, 64, dir);
		VectorAdd (ent->s.origin, dir, ent->s.origin);
		VectorScale(dir, 4, dir);
		VectorCopy(dir, ent->velocity);
	}
	
	tr = gi.trace (temp, ent->mins, ent->maxs, ent->s.origin, owner, MASK_SOLID);
	if (tr.fraction < 1.0 || tr.allsolid)
	{
		VectorCopy(temp, ent->s.origin);
	}
	
	ent->think = Rune_Think;
	ent->nextthink = level.time + FRAMETIME;//RUNETHINKTIME;

	// We just moved.  Remember this time
	ent->last_move_time = level.time;

	//ent->solid = SOLID_BBOX;
	ent->solid = SOLID_TRIGGER;
	gi.linkentity (ent); //always pair with changes to solid
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
leaq 0xcc(%rdi), %rax
movq %rax, 0x18(%rsp)
leaq 0xd8(%rdi), %rax
movq %rax, 0x10(%rsp)
movaps 0x3123a(%rip), %xmm0    # 0x4f2f0
movups %xmm0, 0xcc(%rdi)
movsd 0x3123b(%rip), %xmm0    # 0x4f300
movsd %xmm0, 0xdc(%rdi)
callq 0x1e75f
movq 0x487a7(%rip), %rax     # 0x66880
movq %rax, 0x220(%rbx)
movq 0x110(%rbx), %r12
andq $0x0, 0x110(%rbx)
andq $0x0, 0x2b8(%rbx)
leaq 0x4(%rbx), %r13
movsd 0x4(%rbx), %xmm0
leaq 0x20(%rsp), %rbp
movsd %xmm0, (%rbp)
movss 0xc(%rbx), %xmm0
movss %xmm0, 0x8(%rbp)
movss 0x3117c(%rip), %xmm2    # 0x4f298
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x196c0
movss 0x4(%rbx), %xmm0
movss 0x8(%rbx), %xmm1
addss (%rax), %xmm0
movss %xmm0, 0x4(%rbx)
addss 0x4(%rax), %xmm1
movss %xmm1, 0x8(%rbx)
movss 0xc(%rbx), %xmm0
addss 0x8(%rax), %xmm0
movss %xmm0, 0xc(%rbx)
callq 0x19bf0
movl $0x7fff, %r14d          # imm = 0x7FFF
andl %r14d, %eax
cvtsi2ss %eax, %xmm0
divss 0x3111b(%rip), %xmm0    # 0x4f288
mulss 0x31127(%rip), %xmm0    # 0x4f29c
addss 0x31123(%rip), %xmm0    # 0x4f2a0
movss %xmm0, 0x1c0(%rbx)
callq 0x19bf0
andl %r14d, %eax
cvtsi2ss %eax, %xmm0
divss 0x310ef(%rip), %xmm0    # 0x4f288
mulss 0x310fb(%rip), %xmm0    # 0x4f29c
addss 0x310f7(%rip), %xmm0    # 0x4f2a0
movss %xmm0, 0x1c4(%rbx)
callq 0x19bf0
andl %r14d, %eax
cvtsi2ss %eax, %xmm0
divss 0x310c3(%rip), %xmm0    # 0x4f288
mulss 0x310d7(%rip), %xmm0    # 0x4f2a4
addss 0x310d3(%rip), %xmm0    # 0x4f2a8
movss %xmm0, 0x1c8(%rbx)
movq 0x4841c(%rip), %r15     # 0x66600
movl $0x3, (%rsp)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
movq 0x18(%rsp), %rdx
movq 0x10(%rsp), %rcx
movq %r13, %r8
movq %r12, %r9
callq *0x60(%r15)
movss 0x30d16(%rip), %xmm0    # 0x4ef28
ucomiss 0x8(%r14), %xmm0
ja 0x1e220
cmpl $0x0, 0x30(%rsp)
je 0x1e236
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x4(%rbx)
movss 0x28(%rsp), %xmm0
movss %xmm0, 0xc(%rbx)
movq 0x489e3(%rip), %rax     # 0x66c20
movq %rax, 0x210(%rbx)
movq 0x48b55(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movss 0x31038(%rip), %xmm1    # 0x4f290
addss %xmm0, %xmm1
movss %xmm1, 0x200(%rbx)
movss %xmm0, 0x250(%rbx)
movl $0x1, 0x108(%rbx)
movq %rbx, %rdi
callq *0x90(%r15)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq