// File: /workspace/github_c_makefile_star2_O3/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 0x33a53(%rip), %xmm0    # 0x532f0
movups %xmm0, 0xcc(%rdi)
movsd 0x33a54(%rip), %xmm0    # 0x53300
movsd %xmm0, 0xdc(%rdi)
callq 0x1ff7d
movq 0x48fc0(%rip), %rax     # 0x68880
movq %rax, 0x220(%rbx)
movq 0x110(%rbx), %r12
xorl %eax, %eax
movq %rax, 0x110(%rbx)
movq %rax, 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 0x33995(%rip), %xmm2    # 0x53298
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 0x19a10
movl $0x7fff, %r14d          # imm = 0x7FFF
andl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x33931(%rip), %xmm0    # 0x53288
mulss 0x3393d(%rip), %xmm0    # 0x5329c
addss 0x33939(%rip), %xmm0    # 0x532a0
movss %xmm0, 0x1c0(%rbx)
callq 0x19a10
andl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x33902(%rip), %xmm0    # 0x53288
mulss 0x3390e(%rip), %xmm0    # 0x5329c
addss 0x3390a(%rip), %xmm0    # 0x532a0
movss %xmm0, 0x1c4(%rbx)
callq 0x19a10
andl %r14d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x338d3(%rip), %xmm0    # 0x53288
mulss 0x338e7(%rip), %xmm0    # 0x532a4
addss 0x338e3(%rip), %xmm0    # 0x532a8
movss %xmm0, 0x1c8(%rbx)
movq 0x48c2c(%rip), %r15     # 0x68600
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 0x33526(%rip), %xmm0    # 0x52f28
ucomiss 0x8(%r14), %xmm0
ja 0x1fa10
cmpl $0x0, 0x30(%rsp)
je 0x1fa26
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x4(%rbx)
movss 0x28(%rsp), %xmm0
movss %xmm0, 0xc(%rbx)
movq 0x491f3(%rip), %rax     # 0x68c20
movq %rax, 0x210(%rbx)
movq 0x49365(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
movss 0x33848(%rip), %xmm1    # 0x53290
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