// File: /workspace/github_c_makefile_star2_O3/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 0x21b8e(%rip), %xmm0    # 0x53450
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x19510
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 0x21b52(%rip), %xmm0    # 0x53454
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
callq 0x19510
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 0x36cb8(%rip), %rbp     # 0x68600
movq 0x58(%rbp), %rax
testq %rsi, %rsi
jne 0x3195c
movq 0x330(%rbx), %rcx
movq 0x30(%rcx), %rsi
movq %rbx, %rdi
callq *%rax
movl $0x1, 0x108(%rbx)
movl $0x7, 0x118(%rbx)
movq 0x36f04(%rip), %rax     # 0x68880
movq %rax, 0x220(%rbx)
movss 0x21ad1(%rip), %xmm2    # 0x5345c
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x19510
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 0x31a16
movq 0x8(%rbp), %r15
movq 0x138(%rbx), %r14
movq %r12, %rdi
callq 0x190a0
leaq 0x24699(%rip), %rdi     # 0x56097
movq %r14, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq *%r15
movq %rbx, %rdi
callq 0x19a50
jmp 0x31af5
movsd 0x2c(%rsp), %xmm0
movss 0x34(%rsp), %xmm1
movlps %xmm0, 0x4(%rbx)
movss %xmm1, 0xc(%rbx)
cmpq $0x0, 0x168(%rbx)
je 0x31a9c
andb $-0x5, 0x11d(%rbx)
movq 0x2c8(%rbx), %rax
movq 0x2d0(%rbx), %rcx
movq %rax, 0x298(%rbx)
movq $0x0, 0x2c8(%rbx)
orb $0x1, 0xc8(%rbx)
movl $0x0, 0x108(%rbx)
cmpq %rbx, %rcx
jne 0x31a9c
movq 0x37327(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
addss 0x2180a(%rip), %xmm0    # 0x53290
movss %xmm0, 0x200(%rbx)
movq 0x372bb(%rip), %rax     # 0x68d50
movq %rax, 0x210(%rbx)
movl 0x140(%rbx), %eax
testb $0x2, %al
je 0x31ac9
movl $0x2, 0x108(%rbx)
movq $0x0, 0x220(%rbx)
movabsq $-0x20000000002, %rcx   # imm = 0xFFFFFDFFFFFFFFFE
andq %rcx, 0x40(%rbx)
testb $0x1, %al
je 0x31aec
orb $0x1, 0xc8(%rbx)
movl $0x0, 0x108(%rbx)
movq 0x36ee3(%rip), %rax     # 0x689c8
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