// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: SelectRuneSpawnPoint
edict_t *SelectRuneSpawnPoint (void)
{
	edict_t	*spot = NULL;
	int		count = 0;
	int		selection;
	
	spot = NULL;
	
	while ((spot = G_Find (spot, FOFS(classname), "item_health_small")) != NULL)
	{
		count++;
	}
	
	if (count>0)
	{
		
		selection = random() * count;
		
		if (selection < 0)
			selection = 0;
		if (selection > 20) //arbitrary, lets not wait too long
			selection = 20;
		
		spot = NULL;
		do
		{
			spot = G_Find (spot, FOFS(classname), "item_health_small");
			selection--;
		} 
		while(selection > 0);
	}
	else
	{
		while ((spot = G_Find (spot, FOFS(classname), "item_health_large")) != NULL)
		{
			count++;
		}
		if (count>0)
		{
			
			selection = random() * count;
			
			if (selection < 0)
				selection = 0;
			if (selection > 20) //arbitrary, lets not wait too long
				selection = 20;
			
			spot = NULL;
			do
			{
				spot = G_Find (spot, FOFS(classname), "item_health_large");
				selection--;
			} 
			while(selection > 0);
		}
		else
		{
			while ((spot = G_Find (spot, FOFS(classname), "item_health")) != NULL)
			{
				count++;
			}
			if (count>0)
			{
				
				selection = random() * count;
				
				if (selection < 0)
					selection = 0;
				if (selection > 20) //arbitrary, lets not wait too long
					selection = 20;
				
				spot = NULL;
				do
				{
					spot = G_Find (spot, FOFS(classname), "item_health");
					selection--;
				} 
				while(selection > 0);
			}
		}
		
	}
	
	return spot;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl $0x1, %ebp
xorl %eax, %eax
leaq 0x33e99(%rip), %rbx     # 0x53193
movq %rax, %rdi
movl $0x138, %esi            # imm = 0x138
movq %rbx, %rdx
callq 0x19430
decl %ebp
testq %rax, %rax
jne 0x1f2fa
testl %ebp, %ebp
je 0x1f373
negl %ebp
callq 0x19a10
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
divss 0x33f5b(%rip), %xmm0    # 0x53288
cvtsi2ss %ebp, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
xorl %ebx, %ebx
testl %eax, %eax
cmovlel %ebx, %eax
cmpl $0x14, %eax
movl $0x14, %ebp
cmovll %eax, %ebp
incl %ebp
leaq 0x33e3f(%rip), %r14     # 0x53193
movq %rbx, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x19430
movq %rax, %rbx
decl %ebp
cmpl $0x1, %ebp
ja 0x1f354
jmp 0x1f47c
movl $0x1, %ebp
xorl %eax, %eax
leaq 0x33e24(%rip), %rbx     # 0x531a5
movq %rax, %rdi
movl $0x138, %esi            # imm = 0x138
movq %rbx, %rdx
callq 0x19430
decl %ebp
testq %rax, %rax
jne 0x1f381
testl %ebp, %ebp
je 0x1f3fa
negl %ebp
callq 0x19a10
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
divss 0x33ed4(%rip), %xmm0    # 0x53288
cvtsi2ss %ebp, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
xorl %ebx, %ebx
testl %eax, %eax
cmovlel %ebx, %eax
cmpl $0x14, %eax
movl $0x14, %ebp
cmovll %eax, %ebp
incl %ebp
leaq 0x33dca(%rip), %r14     # 0x531a5
movq %rbx, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x19430
movq %rax, %rbx
decl %ebp
cmpl $0x1, %ebp
ja 0x1f3db
jmp 0x1f47c
movl $0x1, %ebp
xorl %eax, %eax
leaq 0x33daf(%rip), %rbx     # 0x531b7
movq %rax, %rdi
movl $0x138, %esi            # imm = 0x138
movq %rbx, %rdx
callq 0x19430
decl %ebp
testq %rax, %rax
jne 0x1f408
xorl %ebx, %ebx
testl %ebp, %ebp
je 0x1f47c
negl %ebp
callq 0x19a10
andl $0x7fff, %eax           # imm = 0x7FFF
cvtsi2ss %eax, %xmm0
divss 0x33e4b(%rip), %xmm0    # 0x53288
cvtsi2ss %ebp, %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %eax
testl %eax, %eax
cmovlel %ebx, %eax
cmpl $0x14, %eax
movl $0x14, %ebp
cmovll %eax, %ebp
incl %ebp
leaq 0x33d55(%rip), %r14     # 0x531b7
movq %rbx, %rdi
movl $0x138, %esi            # imm = 0x138
movq %r14, %rdx
callq 0x19430
movq %rax, %rbx
decl %ebp
cmpl $0x1, %ebp
ja 0x1f462
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq