// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_items.c
// Function: Drop_Item
edict_t *Drop_Item (edict_t *ent, gitem_t *item)
{
	edict_t	*dropped;
	vec3_t	forward, right;
	vec3_t	offset;

	dropped = G_Spawn();

	dropped->classname = item->classname;
	dropped->item = item;
	dropped->spawnflags = DROPPED_ITEM;
	dropped->s.effects = item->world_model_flags;
	dropped->s.renderfx = RF_GLOW;
	VectorSet (dropped->mins, -15, -15, -15);
	VectorSet (dropped->maxs, 15, 15, 15);
	gi.setmodel (dropped, dropped->item->world_model);
	dropped->solid = SOLID_TRIGGER;
	dropped->movetype = MOVETYPE_TOSS;  
	dropped->touch = drop_temp_touch;
	dropped->owner = ent;

	if (ent->client)
	{
		trace_t	trace;

		AngleVectors (ent->client->v_angle, forward, right, NULL);
		VectorSet(offset, 24, 0, -16);
		G_ProjectSource (ent->s.origin, offset, forward, right, dropped->s.origin);
		trace = gi.trace (ent->s.origin, dropped->mins, dropped->maxs,
			dropped->s.origin, ent, CONTENTS_SOLID);
		VectorCopy (trace.endpos, dropped->s.origin);
	}
	else
	{
		AngleVectors (ent->s.angles, forward, right, NULL);
		VectorCopy (ent->s.origin, dropped->s.origin);
	}

	VectorScale (forward, 100, dropped->velocity);
	dropped->velocity[2] = 300;

	dropped->think = drop_make_touchable;
	dropped->nextthink = level.time + 1;

	gi.linkentity (dropped);

	return dropped;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r15
movq %rdi, %r14
callq 0x198d0
movq %rax, %rbx
movq (%r15), %rax
movq %rax, 0x138(%rbx)
movq %r15, 0x330(%rbx)
movl $0x10000, 0x140(%rbx)   # imm = 0x10000
movl 0x38(%r15), %eax
movl %eax, 0x40(%rbx)
movl $0x200, 0x44(%rbx)      # imm = 0x200
movaps 0x21e94(%rip), %xmm0    # 0x4f2f0
movups %xmm0, 0xcc(%rbx)
movsd 0x21e95(%rip), %xmm0    # 0x4f300
movsd %xmm0, 0xdc(%rbx)
movq 0x39186(%rip), %r12     # 0x66600
movq 0x30(%r15), %rsi
movq %rbx, %rdi
callq *0x58(%r12)
movl $0x1, 0x108(%rbx)
movl $0x7, 0x118(%rbx)
movq 0x390e7(%rip), %rax     # 0x66588
movq %rax, 0x220(%rbx)
movq %r14, 0x110(%rbx)
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x2d563
leaq 0xcc(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0xd8(%rbx), %rax
movq %rax, 0x8(%rsp)
addq $0xebc, %rdi            # imm = 0xEBC
leaq 0x18(%rsp), %r13
leaq 0x24(%rsp), %rbp
movq %r13, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x183d0
movss 0x21f6a(%rip), %xmm0    # 0x4f464
leaq 0x30(%rsp), %rsi
movlps %xmm0, (%rsi)
movl $0xc1800000, 0x8(%rsi)  # imm = 0xC1800000
leaq 0x4(%r14), %r15
leaq 0x4(%rbx), %r12
movq %r15, %rdi
movq %r13, %rdx
movq %rbp, %rcx
movq %r12, %r8
callq 0x190d0
movl $0x1, (%rsp)
leaq 0x40(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq 0x10(%rsp), %rdx
movq 0x8(%rsp), %rcx
movq %r12, %r8
movq 0x390b8(%rip), %r12     # 0x66600
movq %r14, %r9
callq *0x60(%r12)
movss 0x14(%r13), %xmm0
movsd 0xc(%r13), %xmm1
movsd %xmm1, 0x4(%rbx)
jmp 0x2d594
leaq 0x10(%r14), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x24(%rsp), %rdx
xorl %ecx, %ecx
callq 0x183d0
movss 0x4(%r14), %xmm0
movss %xmm0, 0x4(%rbx)
movss 0x8(%r14), %xmm0
movss %xmm0, 0x8(%rbx)
movss 0xc(%r14), %xmm0
movss %xmm0, 0xc(%rbx)
movq %rbx, %rsi
addq $0x1c0, %rsi            # imm = 0x1C0
leaq 0x18(%rsp), %rdi
movss 0x2467c(%rip), %xmm0    # 0x51c2c
callq 0x18a70
movl $0x43960000, 0x1c8(%rbx) # imm = 0x43960000
leaq 0x17cd(%rip), %rax      # 0x2ed93
movq %rax, 0x210(%rbx)
movq 0x397cc(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
addss 0x21947(%rip), %xmm0    # 0x4ef28
movss %xmm0, 0x200(%rbx)
movq %rbx, %rdi
callq *0x90(%r12)
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq