// File: /workspace/github_c_makefile_star2_O3/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 0x19700
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 0x23797(%rip), %xmm0    # 0x532f0
movups %xmm0, 0xcc(%rbx)
movsd 0x23798(%rip), %xmm0    # 0x53300
movsd %xmm0, 0xdc(%rbx)
movq 0x38a89(%rip), %r12     # 0x68600
movq 0x30(%r15), %rsi
movq %rbx, %rdi
callq *0x58(%r12)
movl $0x1, 0x108(%rbx)
movl $0x7, 0x118(%rbx)
movq 0x389ea(%rip), %rax     # 0x68588
movq %rax, 0x220(%rbx)
movq %r14, 0x110(%rbx)
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x2fc60
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 0x183a0
movss 0x2386d(%rip), %xmm0    # 0x53464
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 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 0x389bb(%rip), %r12     # 0x68600
movq %r14, %r9
callq *0x60(%r12)
movss 0x14(%r13), %xmm0
movsd 0xc(%r13), %xmm1
movsd %xmm1, 0x4(%rbx)
jmp 0x2fc91
leaq 0x10(%r14), %rdi
leaq 0x18(%rsp), %rsi
leaq 0x24(%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 0x18(%rsp), %rdi
movss 0x25f9f(%rip), %xmm0    # 0x55c4c
callq 0x189d0
movl $0x43960000, 0x1c8(%rbx) # imm = 0x43960000
leaq 0x1b53(%rip), %rax      # 0x31816
movq %rax, 0x210(%rbx)
movq 0x390cf(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
addss 0x2324a(%rip), %xmm0    # 0x52f28
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