// File: /workspace/github_c_makefile_star2_O1/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 0x19710
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 0x2423e(%rip), %xmm0    # 0x542f0
movups %xmm0, 0xcc(%rbx)
movabsq $0x4170000041700000, %rax # imm = 0x4170000041700000
movq %rax, 0xdc(%rbx)
movq 0x3952f(%rip), %r12     # 0x69600
movq 0x30(%r15), %rsi
movq %rbx, %rdi
callq *0x58(%r12)
movl $0x1, 0x108(%rbx)
movl $0x7, 0x118(%rbx)
movq 0x39490(%rip), %rax     # 0x69588
movq %rax, 0x220(%rbx)
movq %r14, 0x110(%rbx)
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x301b3
leaq 0xcc(%rbx), %rax
movq %rax, 0x10(%rsp)
leaq 0xd8(%rbx), %rax
movq %rax, 0x8(%rsp)
addq $0xebc, %rdi            # imm = 0xEBC
leaq 0x1c(%rsp), %r13
leaq 0x28(%rsp), %rbp
movq %r13, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x183a0
leaq 0x34(%rsp), %rsi
movq $0x41c00000, (%rsi)     # imm = 0x41C00000
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 0x18fa0
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 0x39465(%rip), %r12     # 0x69600
movq %r14, %r9
callq *0x60(%r12)
movq 0xc(%r13), %rax
movss 0x14(%r13), %xmm0
movq %rax, 0x4(%rbx)
jmp 0x301e4
leaq 0x10(%r14), %rdi
leaq 0x1c(%rsp), %rsi
leaq 0x28(%rsp), %rdx
xorl %ecx, %ecx
callq 0x183a0
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 0x1c(%rsp), %rdi
movss 0x26cc4(%rip), %xmm0    # 0x56ec4
callq 0x189d0
movl $0x43960000, 0x1c8(%rbx) # imm = 0x43960000
leaq 0x1b69(%rip), %rax      # 0x31d7f
movq %rax, 0x210(%rbx)
movq 0x39b7c(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
addss 0x23cf7(%rip), %xmm0    # 0x53f28
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