// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x20fcc
jmp 0x2128d
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x61e5d(%rip), %rcx     # 0x82e40
subq %rcx, %rax
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x28(%rbp), %rax
movl 0x318(%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, 0x318(%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0xf68(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x21027
jmp 0x2128d
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq $0x0, 0xf68(%rax)
movq -0x18(%rbp), %rdi
callq 0x212a0
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x8(%rax)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0xc(%rax)
movq -0x18(%rbp), %rdi
callq 0x212a0
movq -0x18(%rbp), %rax
movq 0x614fb(%rip), %rcx     # 0x82588
movq %rcx, 0x220(%rax)
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x110(%rax)
xorps %xmm1, %xmm1
movss 0x4f202(%rip), %xmm2    # 0x702b0
movaps %xmm1, %xmm0
callq 0x19740
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x20(%rbp), %rax
addss (%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x18(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x20(%rbp), %rax
addss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x8(%rax)
movq -0x18(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x20(%rbp), %rax
addss 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0xc(%rax)
callq 0x19c80
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x4f168(%rip), %xmm1    # 0x70288
divss %xmm1, %xmm0
movss 0x4f17c(%rip), %xmm1    # 0x702a8
mulss %xmm1, %xmm0
movss 0x4f174(%rip), %xmm1    # 0x702ac
addss %xmm1, %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x1c0(%rax)
callq 0x19c80
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x4f12a(%rip), %xmm1    # 0x70288
divss %xmm1, %xmm0
movss 0x4f13e(%rip), %xmm1    # 0x702a8
mulss %xmm1, %xmm0
movss 0x4f136(%rip), %xmm1    # 0x702ac
addss %xmm1, %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x1c4(%rax)
callq 0x19c80
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
movss 0x4f0ec(%rip), %xmm1    # 0x70288
divss %xmm1, %xmm0
movss 0x4f0f8(%rip), %xmm1    # 0x702a0
mulss %xmm1, %xmm0
movss 0x4f0f0(%rip), %xmm1    # 0x702a4
addss %xmm1, %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x1c8(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x18910
movq -0x18(%rbp), %rax
movq 0x61314(%rip), %rcx     # 0x824f0
movq %rcx, 0x210(%rax)
movss 0x4ed01(%rip), %xmm0    # 0x6feec
movq 0x61bae(%rip), %rax     # 0x82da0
addss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x200(%rax)
movq 0x61b96(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
movss %xmm0, 0x250(%rax)
movq -0x18(%rbp), %rax
movl $0x1, 0x108(%rax)
movq 0x613d0(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x18(%rbp), %rdi
callq *%rax
movq 0x613bc(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x4f1bb(%rip), %rdi     # 0x70416
movq 0x6139e(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x38(%rbp), %rdi
movl %eax, %edx
movq -0x30(%rbp), %rax
movl $0x3, %esi
movss 0x4ec70(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
movq -0x8(%rbp), %rdi
callq 0x182a0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)