// File: /workspace/github_c_makefile_star2_O1/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: Drop_Rune
void Drop_Rune (edict_t *ent, gitem_t *item)
{
	edict_t	*dropped;
	float *v;
	
	if (!item)
		return;
	
	ent->client->pers.inventory[ITEM_INDEX(item)]--;

	dropped = ent->client->rune;
	if (!dropped)
		return;
	ent->client->rune = 0;
	
	tossruneset(dropped);

	VectorCopy(ent->s.origin, dropped->s.origin);
	tossruneset(dropped);
	dropped->touch = drop_temp_touch;
	dropped->owner = ent;

	v = tv(0, 0, 48);
	VectorAdd (dropped->s.origin, v, dropped->s.origin);
	dropped->velocity[0] = -2000 + (random() * 4000);
	dropped->velocity[1] = -2000 + (random() * 4000);
	dropped->velocity[2] = 800 + (random() * 200);

	ctf_TossEnt(ent, dropped);
	
	dropped->think = Drop_Rune_Think;
	dropped->nextthink = level.time + 1;

	// We just moved.  Remember this time
	dropped->last_move_time = level.time;

	//ent->solid = SOLID_BBOX;
	dropped->solid = SOLID_TRIGGER;
	gi.linkentity (dropped); //always pair with changes to solid

	gi.sound(ent, CHAN_ITEM, gi.soundindex("misc/power2.wav"), 1, ATTN_NORM, 0);
	ValidateSelectedItem (ent);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x20044
movq %rdi, %rbx
movq 0x58(%rdi), %rax
subq 0x49fe7(%rip), %rsi     # 0x69e40
sarq $0x3, %rsi
movabsq $-0x3c3c3c3c3c3c3c3c, %rcx # imm = 0xC3C3C3C3C3C3C3C4
imulq %rsi, %rcx
decl 0x318(%rax,%rcx)
movq 0xf68(%rax), %r14
testq %r14, %r14
je 0x20044
movq $0x0, 0xf68(%rax)
movq %r14, %rdi
callq 0x2004f
movss 0x4(%rbx), %xmm0
movss %xmm0, 0x4(%r14)
movss 0x8(%rbx), %xmm0
movss %xmm0, 0x8(%r14)
movss 0xc(%rbx), %xmm0
movss %xmm0, 0xc(%r14)
movq %r14, %rdi
callq 0x2004f
movq 0x496c3(%rip), %rax     # 0x69588
movq %rax, 0x220(%r14)
movq %rbx, 0x110(%r14)
movss 0x343bd(%rip), %xmm2    # 0x54298
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
callq 0x19510
movss 0x4(%r14), %xmm0
movss 0x8(%r14), %xmm1
addss (%rax), %xmm0
movss %xmm0, 0x4(%r14)
addss 0x4(%rax), %xmm1
movss %xmm1, 0x8(%r14)
movss 0xc(%r14), %xmm0
addss 0x8(%rax), %xmm0
movss %xmm0, 0xc(%r14)
callq 0x19a20
movl $0x7fff, %ebp           # imm = 0x7FFF
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x34355(%rip), %xmm0    # 0x54288
mulss 0x34361(%rip), %xmm0    # 0x5429c
addss 0x3435d(%rip), %xmm0    # 0x542a0
movss %xmm0, 0x1c0(%r14)
callq 0x19a20
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x34326(%rip), %xmm0    # 0x54288
mulss 0x34332(%rip), %xmm0    # 0x5429c
addss 0x3432e(%rip), %xmm0    # 0x542a0
movss %xmm0, 0x1c4(%r14)
callq 0x19a20
andl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss 0x342f7(%rip), %xmm0    # 0x54288
mulss 0x3430b(%rip), %xmm0    # 0x542a4
addss 0x34307(%rip), %xmm0    # 0x542a8
movss %xmm0, 0x1c8(%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x188a0
movq 0x49534(%rip), %rax     # 0x694f0
movq %rax, 0x210(%r14)
movq 0x49dd6(%rip), %rax     # 0x69da0
movss 0x4(%rax), %xmm0
movaps %xmm0, %xmm1
addss 0x33f4e(%rip), %xmm1    # 0x53f28
movss %xmm1, 0x200(%r14)
movss %xmm0, 0x250(%r14)
movl $0x1, 0x108(%r14)
movq 0x49602(%rip), %r15     # 0x69600
movq %r14, %rdi
callq *0x90(%r15)
movq 0x20(%r15), %r14
leaq 0x343cb(%rip), %rdi     # 0x543de
callq *0x48(%r15)
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x3, %esi
movl %eax, %edx
movss 0x33efc(%rip), %xmm0    # 0x53f28
movaps %xmm0, %xmm1
callq *%r14
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x18280
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq