// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: droptofloor
void droptofloor (edict_t *ent)
{
	trace_t		tr;
	vec3_t		dest;
	float		*v;

	v = tv(-15,-15,-15);
	VectorCopy (v, ent->mins);
	v = tv(15,15,15);
	VectorCopy (v, ent->maxs);

	if (ent->model)
		gi.setmodel (ent, ent->model);
	else
		gi.setmodel (ent, ent->item->world_model);
	ent->solid = SOLID_TRIGGER;
	
	ent->movetype = MOVETYPE_TOSS;  

	ent->touch = Touch_Item;

	v = tv(0,0,-128);
	VectorAdd (ent->s.origin, v, dest);

	tr = gi.trace (ent->s.origin, ent->mins, ent->maxs, dest, ent, MASK_SOLID);
	if (tr.startsolid)
	{
		gi.dprintf ("droptofloor: %s startsolid at %s\n", ent->classname, vtos(ent->s.origin));
		G_FreeEdict (ent);
		return;
	}

	VectorCopy (tr.endpos, ent->s.origin);

	if (ent->team)
	{
		ent->flags &= ~FL_TEAMSLAVE;
		ent->chain = ent->teamchain;
		ent->teamchain = NULL;

		ent->svflags |= SVF_NOCLIENT;
		ent->solid = SOLID_NOT;
		if (ent == ent->teammaster)
		{
			ent->nextthink = level.time + FRAMETIME;
			ent->think = DoRespawn;
		}
	}

	if (ent->spawnflags & ITEM_NO_TOUCH)
	{
		ent->solid = SOLID_BBOX;
		ent->touch = NULL;
		ent->s.effects &= ~EF_ROTATE;
		ent->s.renderfx &= ~RF_GLOW;
	}

	if (ent->spawnflags & ITEM_TRIGGER_SPAWN)
	{
		ent->svflags |= SVF_NOCLIENT;
		ent->solid = SOLID_NOT;
		ent->use = Use_Item;
	}

	gi.linkentity (ent);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
movss 0x2060e(%rip), %xmm0    # 0x4f450
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x196c0
movss (%rax), %xmm0
leaq 0xcc(%rbx), %r14
movss %xmm0, 0xcc(%rbx)
movss 0x4(%rax), %xmm0
movss %xmm0, 0xd0(%rbx)
movss 0x8(%rax), %xmm0
movss %xmm0, 0xd4(%rbx)
movss 0x205d2(%rip), %xmm0    # 0x4f454
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x196c0
movss (%rax), %xmm0
leaq 0xd8(%rbx), %r15
movss %xmm0, 0xd8(%rbx)
movss 0x4(%rax), %xmm0
movss %xmm0, 0xdc(%rbx)
movss 0x8(%rax), %xmm0
movss %xmm0, 0xe0(%rbx)
movq 0x120(%rbx), %rsi
movq 0x37738(%rip), %rbp     # 0x66600
movq 0x58(%rbp), %rax
testq %rsi, %rsi
jne 0x2eedc
movq 0x330(%rbx), %rcx
movq 0x30(%rcx), %rsi
movq %rbx, %rdi
callq *%rax
movl $0x1, 0x108(%rbx)
movl $0x7, 0x118(%rbx)
movq 0x37984(%rip), %rax     # 0x66880
movq %rax, 0x220(%rbx)
movss 0x20551(%rip), %xmm2    # 0x4f45c
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x196c0
leaq 0x4(%rbx), %r12
movsd 0x4(%rbx), %xmm0
movsd (%rax), %xmm1
addps %xmm0, %xmm1
leaq 0x10(%rsp), %r8
movlps %xmm1, (%r8)
movss 0xc(%rbx), %xmm0
addss 0x8(%rax), %xmm0
movss %xmm0, 0x8(%r8)
movl $0x3, (%rsp)
leaq 0x20(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq %r15, %rcx
movq %rbx, %r9
callq *0x60(%rbp)
cmpl $0x0, 0x4(%r13)
je 0x2ef96
movq 0x8(%rbp), %r15
movq 0x138(%rbx), %r14
movq %r12, %rdi
callq 0x19200
leaq 0x230f9(%rip), %rdi     # 0x52077
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq *%r15
movq %rbx, %rdi
callq 0x19c50
jmp 0x2f069
movsd 0x2c(%rsp), %xmm0
movss 0x34(%rsp), %xmm1
movlps %xmm0, 0x4(%rbx)
movss %xmm1, 0xc(%rbx)
cmpq $0x0, 0x168(%rbx)
je 0x2f016
andb $-0x5, 0x11d(%rbx)
movq 0x2c8(%rbx), %rax
movq 0x2d0(%rbx), %rcx
movq %rax, 0x298(%rbx)
andq $0x0, 0x2c8(%rbx)
orb $0x1, 0xc8(%rbx)
andl $0x0, 0x108(%rbx)
cmpq %rbx, %rcx
jne 0x2f016
movq 0x37dad(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
addss 0x20290(%rip), %xmm0    # 0x4f290
movss %xmm0, 0x200(%rbx)
movq 0x37d41(%rip), %rax     # 0x66d50
movq %rax, 0x210(%rbx)
movl 0x140(%rbx), %eax
testb $0x2, %al
je 0x2f040
movl $0x2, 0x108(%rbx)
andq $0x0, 0x220(%rbx)
movabsq $-0x20000000002, %rcx   # imm = 0xFFFFFDFFFFFFFFFE
andq %rcx, 0x40(%rbx)
testb $0x1, %al
je 0x2f060
orb $0x1, 0xc8(%rbx)
andl $0x0, 0x108(%rbx)
movq 0x3796f(%rip), %rax     # 0x669c8
movq %rax, 0x228(%rbx)
movq %rbx, %rdi
callq *0x90(%rbp)
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq