// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_runes.c
// Function: RunesRangeFromSpot
float RunesRangeFromSpot (edict_t *spot)
{
  edict_t *rune;
  float	bestrunedistance;
  vec3_t v;
  float	runedistance;
  
  
  bestrunedistance = 9999999;
  

  //-bat - This should use a function!

  rune = G_Find (spot, FOFS(classname), "damage_rune");
  if (rune)
  {
	  VectorSubtract (spot->s.origin, rune->s.origin, v);
	  runedistance = VectorLength (v);
	  
	  if (runedistance < bestrunedistance)
		  bestrunedistance = runedistance;
  }

  rune = G_Find (spot, FOFS(classname), "haste_rune");
  if (rune)
  {
	  VectorSubtract (spot->s.origin, rune->s.origin, v);
	  runedistance = VectorLength (v);
	  
	  if (runedistance < bestrunedistance)
		  bestrunedistance = runedistance;
  }

  rune = G_Find (spot, FOFS(classname), "resist_rune");
  if (rune)
  {
	  VectorSubtract (spot->s.origin, rune->s.origin, v);
	  runedistance = VectorLength (v);
	  
	  if (runedistance < bestrunedistance)
		  bestrunedistance = runedistance;
  }

  rune = G_Find (spot, FOFS(classname), "regen_rune");
  if (rune)
  {
	  VectorSubtract (spot->s.origin, rune->s.origin, v);
	  runedistance = VectorLength (v);
	  
	  if (runedistance < bestrunedistance)
		  bestrunedistance = runedistance;
  }

  
  rune = G_Find (spot, FOFS(classname), "vampire_rune");   //added by Vampire
  if (rune)                                                  
  {
	  VectorSubtract (spot->s.origin, rune->s.origin, v);
	  runedistance = VectorLength (v);
	  
	  if (runedistance < bestrunedistance)
		  bestrunedistance = runedistance;
  }



  return bestrunedistance;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movss 0x50138(%rip), %xmm0    # 0x7028c
movss %xmm0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x501ca(%rip), %rdx     # 0x70338
callq 0x19660
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x201ec
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm1
movss -0x14(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x201ea
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
jmp 0x201ec
movq -0x8(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x50143(%rip), %rdx     # 0x70344
callq 0x19660
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2027f
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm1
movss -0x14(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x2027d
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
jmp 0x2027f
movq -0x8(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x500bb(%rip), %rdx     # 0x7034f
callq 0x19660
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x20312
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm1
movss -0x14(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x20310
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
jmp 0x20312
movq -0x8(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x50034(%rip), %rdx     # 0x7035b
callq 0x19660
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x203a5
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm1
movss -0x14(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x203a3
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
jmp 0x203a5
movq -0x8(%rbp), %rdi
xorl %eax, %eax
addq $0x138, %rax            # imm = 0x138
movl %eax, %esi
leaq 0x4ffac(%rip), %rdx     # 0x70366
callq 0x19660
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x20438
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm1
movss -0x14(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x20436
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
jmp 0x20438
movss -0x14(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)