// File: /workspace/github_c_makefile_star2_O1/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, 0x28(%rsp)
movaps 0x34992(%rip), %xmm0    # 0x542f0
movups %xmm0, 0xcc(%rdi)
leaq 0xd8(%rdi), %rax
movq %rax, 0x20(%rsp)
movabsq $0x4170000041700000, %rax # imm = 0x4170000041700000
movq %rax, 0xdc(%rdi)
callq 0x2004f
movq 0x49ef2(%rip), %rax     # 0x69880
movq %rax, 0x220(%rbx)
movq 0x110(%rbx), %r12
xorl %eax, %eax
movq %rax, 0x110(%rbx)
movq %rax, 0x2b8(%rbx)
leaq 0x4(%rbx), %r13
movss 0x4(%rbx), %xmm0
leaq 0x14(%rsp), %rbp
movss %xmm0, (%rbp)
movss 0x8(%rbx), %xmm0
movss %xmm0, 0x4(%rbp)
movss 0xc(%rbx), %xmm0
movss %xmm0, 0x8(%rbp)
movss 0x348bd(%rip), %xmm2    # 0x54298
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x19510
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 0x19a20
movl $0x7fff, %r14d          # imm = 0x7FFF
andl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x34859(%rip), %xmm0    # 0x54288
mulss 0x34865(%rip), %xmm0    # 0x5429c
addss 0x34861(%rip), %xmm0    # 0x542a0
movss %xmm0, 0x1c0(%rbx)
callq 0x19a20
andl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x3482a(%rip), %xmm0    # 0x54288
mulss 0x34836(%rip), %xmm0    # 0x5429c
addss 0x34832(%rip), %xmm0    # 0x542a0
movss %xmm0, 0x1c4(%rbx)
callq 0x19a20
andl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x347fb(%rip), %xmm0    # 0x54288
mulss 0x3480f(%rip), %xmm0    # 0x542a4
addss 0x3480b(%rip), %xmm0    # 0x542a8
movss %xmm0, 0x1c8(%rbx)
movq 0x49b54(%rip), %r15     # 0x69600
movl $0x3, (%rsp)
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbp, %rsi
movq 0x28(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq %r13, %r8
movq %r12, %r9
callq *0x60(%r15)
movss 0x3444e(%rip), %xmm0    # 0x53f28
ucomiss 0x8(%r14), %xmm0
ja 0x1fae8
cmpl $0x0, 0x30(%rsp)
je 0x1fb09
movss 0x14(%rsp), %xmm0
movss %xmm0, 0x4(%rbx)
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x8(%rbx)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0xc(%rbx)
movq 0x4a110(%rip), %rax     # 0x69c20
movq %rax, 0x210(%rbx)
movq 0x4a282(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
movss 0x34765(%rip), %xmm1    # 0x54290
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