// [TypeInfo RVA: 0x0]
public class MonsterFlee : MonoBehaviour
{
	public float DetectionRange; // 0x20
	public float MonsterSpeedWander; // 0x24
	public float MonsterSpeedChase; // 0x28
	public UnityEngine.AI.NavMeshAgent agent; // 0x30
	public UnityEngine.Transform[] points; // 0x38
	public string tagString; // 0x40

	// RVA: 0x323EDD8 VA: 0x7818929DD8
	private void Start();
	/*
	 *   undefined *puVar1;
	 *   uint uVar2;
	 *   void *pvVar3;
	 *   long lVar4;
	 *   void *obj;
	 *   void **ppvVar5;
	 *   UnityEngine_Vector3 UVar6;
	 *   float fStack_2c;
	 *   float fStack_28;
	 *   float fStack_24;
	 *
	 *   puVar1 = PTR_DAT_070c08f8;
	 *   if ((bRam000000000754a9d5 & 1) == 0) {
	 *     func_0x031fdc8c(PTR_DAT_070c08f8);
	 *     bRam000000000754a9d5 = 1;
	 *   }
	 *   pvVar3 = (void *)func_0x0373df50(this,*(undefined8 *)puVar1);
	 *   ppvVar5 = &this.agent;
	 *   *ppvVar5 = pvVar3;
	 *   func_0x031fdc38(ppvVar5,pvVar3);
	 *   if (*ppvVar5 == null) {
	 *     IL2CPP.ThrowNullReferenceException();
	 *   }
	 *   UnityEngine.AI.NavMeshAgent.set_speed(*ppvVar5,this.MonsterSpeedWander);
	 *   if (this.points != null) {
	 *     lVar4 = *(long *)((long)this.points + 0x18);
	 *     if (lVar4 == 0) {
	 *       return;
	 *     }
	 *     uVar2 = Random.Range(0,(int)lVar4);
	 *     pvVar3 = this.points;
	 *     if (pvVar3 != null) {
	 *       if (*(uint *)((long)pvVar3 + 0x18) <= uVar2) {
	 *         IL2CPP.ThrowIndexOutOfRangeException();
	 *       }
	 *       pvVar3 = *(void **)((long)pvVar3 + (long)(int)uVar2 * 8 + 0x20);
	 *       if (pvVar3 != null) {
	 *         obj = this.agent;
	 *         UVar6 = UnityEngine.Transform.get_position(pvVar3);
	 *         fStack_24 = UVar6.z;
	 *         fStack_28 = UVar6.y;
	 *         fStack_2c = UVar6.x;
	 *         if (obj != null) {
	 *           if ((bRam000000000755cc32 & 1) == 0) {
	 *             func_0x031fdc8c(PTR_DAT_0714d7a8,0);
	 *             bRam000000000755cc32 = 1;
	 *           }
	 *           if (obj != null) {
	 *             lVar4 = *(long *)((long)obj + 0x10);
	 *             if (lVar4 == 0) {
	 *               UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException(obj);
	 *             }
	 *             if (pcRam000000000755cc58 == null) {
	 *               pcRam000000000755cc58 = (code *)func_0x031fdc50(&UNK_013514e2);
	 *             }
	 *             (*pcRam000000000755cc58)(lVar4,&fStack_2c);
	 *             return;
	 *           }
	 *           IL2CPP.ThrowNullReferenceException();
	 *         }
	 *       }
	 *     }
	 *   }
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x323EEC8 VA: 0x7818929EC8
	private void Update();
	/*
	 *   undefined *puVar1;
	 *   bool bVar2;
	 *   void *pvVar3;
	 *   void *pvVar4;
	 *   void *extraout_x1;
	 *   void *methodInfo_00;
	 *   void *pvVar5;
	 *   ulong uVar6;
	 *   void *pvVar7;
	 *   long lVar8;
	 *   float fVar9;
	 *   float fVar10;
	 *   float fVar11;
	 *   float fVar12;
	 *   UnityEngine_Vector3 UVar13;
	 *   UnityEngine_Vector3 UVar14;
	 *
	 *   puVar1 = typeinfo_ptr_PhotonUnityNetworking_PhotonNetwork_6FC08F0;
	 *   if ((bRam000000000754a9d6 & 1) == 0) {
	 *     func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8);
	 *     func_0x031fdc8c(typeinfo_ptr_PhotonUnityNetworking_PhotonNetwork_6FC08F0);
	 *     bRam000000000754a9d6 = 1;
	 *     methodInfo = extraout_x1;
	 *   }
	 *   if (*(int *)(*(long *)puVar1 + 0xe4) == 0) {
	 *     func_0x031fde08(*(long *)puVar1,methodInfo);
	 *   }
	 *   bVar2 = Photon.Pun.PhotonNetwork.get_IsMasterClient();
	 *   pvVar3 = this.agent;
	 *   if (bVar2) {
	 *     if (pvVar3 != null) {
	 *       UnityEngine.InputSystem.OnScreen.OnScreenStick.Behaviour.set_enabled(pvVar3,true);
	 *       pvVar3 = UnityEngine.GameObject.FindGameObjectsWithTag(this.tagString);
	 *       puVar1 = typeinfo_ptr_mscorlib_Math_6FC0738;
	 *       if (pvVar3 != null) {
	 *         uVar6 = *(ulong *)((long)pvVar3 + 0x18);
	 *         if (uVar6 == 0) {
	 *           pvVar7 = null;
	 *         }
	 *         else {
	 *           if ((int)uVar6 < 1) {
	 *             pvVar7 = null;
	 *           }
	 *           else {
	 *             lVar8 = 0;
	 *             fVar10 = 3.4028235e+38;
	 *             pvVar5 = null;
	 *             do {
	 *               if ((uint)uVar6 <= (uint)lVar8) {
	 *                 IL2CPP.ThrowIndexOutOfRangeException();
	 *               }
	 *               pvVar7 = *(void **)((long)pvVar3 + lVar8 * 8 + 0x20);
	 *               pvVar4 = UnityEngine.Component.get_transform(this);
	 *               if (pvVar4 == null) goto LAB_0333f208;
	 *               UVar13 = UnityEngine.Transform.get_position(pvVar4);
	 *               if ((pvVar7 == null) ||
	 *                  (pvVar4 = UnityEngine.GameObject.get_transform(pvVar7), pvVar4 == null))
	 *               goto LAB_0333f208;
	 *               UVar14 = UnityEngine.Transform.get_position(pvVar4);
	 *               if (cRam000000000754a7c9 == '\0') {
	 *                 func_0x031fdc8c(puVar1);
	 *                 cRam000000000754a7c9 = '\x01';
	 *               }
	 *               if (*(int *)(*(long *)puVar1 + 0xe4) == 0) {
	 *                 func_0x031fde08();
	 *               }
	 *               fVar9 = UVar13.y - UVar14.y;
	 *               fVar11 = UVar13.x - UVar14.x;
	 *               lVar8 = lVar8 + 1;
	 *               fVar12 = UVar13.z - UVar14.z;
	 *               fVar9 = SQRT(fVar12 * fVar12 + fVar11 * fVar11 + fVar9 * fVar9);
	 *               uVar6 = (ulong)*(uint *)((long)pvVar3 + 0x18);
	 *               if (this.DetectionRange <= fVar9 || fVar10 <= fVar9) {
	 *                 pvVar7 = pvVar5;
	 *                 fVar9 = fVar10;
	 *               }
	 *               fVar10 = fVar9;
	 *               pvVar5 = pvVar7;
	 *             } while ((int)lVar8 < (int)*(uint *)((long)pvVar3 + 0x18));
	 *           }
	 *           if (*(int *)(*(long *)typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8 + 0xe4) == 0) {
	 *             func_0x031fde08();
	 *           }
	 *           pvVar5 = null;
	 *           uVar6 = UnityEngine.Object.op_Inequality(pvVar7,null);
	 *           pvVar3 = this.agent;
	 *           if ((uVar6 & 1) == 0) {
	 *             if (pvVar3 == null) goto LAB_0333f208;
	 *             bVar2 = UnityEngine.AI.NavMeshAgent.get_pathPending(pvVar3);
	 *             if (!bVar2) {
	 *               if (this.agent == null) goto LAB_0333f208;
	 *               fVar10 = UnityEngine.AI.NavMeshAgent.get_remainingDistance(this.agent);
	 *               if (fVar10 < 0.5) {
	 *                 if (this.agent == null) goto LAB_0333f208;
	 *                 UnityEngine.AI.NavMeshAgent.set_speed(this.agent,this.MonsterSpeedWander);
	 *                 MonsterFlee.Wander(this);
	 *               }
	 *             }
	 *           }
	 *           else {
	 *             if ((pvVar3 == null) ||
	 *                (UnityEngine.AI.NavMeshAgent.set_speed(pvVar3,this.MonsterSpeedChase), pvVar7 == null))
	 *             goto LAB_0333f208;
	 *             pvVar3 = UnityEngine.GameObject.get_transform(pvVar7);
	 *             MonsterFlee.Flee(this,pvVar3);
	 *           }
	 *         }
	 *         if (*(int *)(*(long *)typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8 + 0xe4) == 0) {
	 *           func_0x031fde08();
	 *         }
	 *         pvVar3 = null;
	 *         uVar6 = UnityEngine.Object.op_Inequality(pvVar7,null);
	 *         if ((uVar6 & 1) == 0) {
	 *           return;
	 *         }
	 *         if (pvVar7 != null) {
	 *           pvVar5 = this.agent;
	 *           pvVar7 = UnityEngine.GameObject.get_transform(pvVar7);
	 *           MonsterFlee.GetFleePosition(this,pvVar7);
	 *           if (pvVar5 != null) {
	 *             if ((bRam000000000755cc32 & 1) == 0) {
	 *               func_0x031fdc8c(PTR_DAT_0714d7a8,0);
	 *               bRam000000000755cc32 = 1;
	 *             }
	 *             if (pvVar5 == null) {
	 *               IL2CPP.ThrowNullReferenceException();
	 *             }
	 *             lVar8 = *(long *)((long)pvVar5 + 0x10);
	 *             if (lVar8 == 0) {
	 *               UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException(pvVar5);
	 *             }
	 *             if (pcRam000000000755cc58 == null) {
	 *               pcRam000000000755cc58 = (code *)func_0x031fdc50(&UNK_013514e2);
	 *             }
	 *             (*pcRam000000000755cc58)(lVar8,&stack0xffffffffffffffd4);
	 *             return;
	 *           }
	 *         }
	 *       }
	 *     }
	 *   }
	 *   else if (pvVar3 != null) {
	 *     if ((bRam000000000755f745 & 1) == 0) {
	 *       func_0x031fdc8c(PTR_DAT_0714f3a0,0,0);
	 *       bRam000000000755f745 = 1;
	 *     }
	 *     if (pvVar3 == null) {
	 *       IL2CPP.ThrowNullReferenceException();
	 *     }
	 *     lVar8 = *(long *)((long)pvVar3 + 0x10);
	 *     if (lVar8 == 0) {
	 *       UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException(pvVar3);
	 *     }
	 *     if (pcRam000000000755f750 == null) {
	 *       pcRam000000000755f750 = (code *)func_0x031fdc50(&UNK_0137c3e0);
	 *     }
	 *     (*pcRam000000000755f750)(lVar8,0);
	 *     return;
	 *   }
	 * LAB_0333f208:
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x323F210 VA: 0x781892A210
	private void Flee(UnityEngine.Transform target);
	/*
	 *   void *obj;
	 *   long lVar1;
	 *   UnityEngine_Vector3 UVar2;
	 *   float fStack_2c;
	 *   float fStack_28;
	 *   float fStack_24;
	 *
	 *   obj = this.agent;
	 *   UVar2 = MonsterFlee.GetFleePosition(this,target);
	 *   fStack_24 = UVar2.z;
	 *   fStack_28 = UVar2.y;
	 *   fStack_2c = UVar2.x;
	 *   if (obj == null) {
	 *     IL2CPP.ThrowNullReferenceException();
	 *   }
	 *   if ((bRam000000000755cc32 & 1) == 0) {
	 *     func_0x031fdc8c(PTR_DAT_0714d7a8,0);
	 *     bRam000000000755cc32 = 1;
	 *   }
	 *   if (obj != null) {
	 *     lVar1 = *(long *)((long)obj + 0x10);
	 *     if (lVar1 == 0) {
	 *       UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException(obj);
	 *     }
	 *     if (pcRam000000000755cc58 == null) {
	 *       pcRam000000000755cc58 = (code *)func_0x031fdc50(&UNK_013514e2);
	 *     }
	 *     (*pcRam000000000755cc58)(lVar1,&fStack_2c);
	 *     return;
	 *   }
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x323F234 VA: 0x781892A234
	private UnityEngine.Vector3 GetFleePosition(UnityEngine.Transform target);
	/*
	 *   void *pvVar1;
	 *   ulong uVar2;
	 *   float *pfVar3;
	 *   float fVar4;
	 *   float fVar5;
	 *   float fVar6;
	 *   float fVar7;
	 *   UnityEngine_Vector3 UVar8;
	 *   UnityEngine_Vector3 UVar9;
	 *   UnityEngine_Vector3 UVar10;
	 *   undefined8 uStack_90;
	 *   undefined8 uStack_88;
	 *   undefined8 uStack_80;
	 *   undefined8 uStack_78;
	 *   undefined4 uStack_70;
	 *
	 *   uStack_70 = 0;
	 *   uStack_88 = 0;
	 *   uStack_90 = 0;
	 *   uStack_78 = 0;
	 *   uStack_80 = 0;
	 *   pvVar1 = UnityEngine.Component.get_transform(this);
	 *   if (pvVar1 != null) {
	 *     UVar8 = UnityEngine.Transform.get_position(pvVar1);
	 *     if (target != null) {
	 *       UVar9 = UnityEngine.Transform.get_position(target);
	 *       pvVar1 = UnityEngine.Component.get_transform(this);
	 *       if (pvVar1 != null) {
	 *         UVar10 = UnityEngine.Transform.get_position(pvVar1);
	 *         if (cRam000000000754a7cc == '\0') {
	 *           func_0x031fdc8c(typeinfo_ptr_mscorlib_Math_6FC0738);
	 *           cRam000000000754a7cc = '\x01';
	 *         }
	 *         fVar6 = UVar8.x - UVar9.x;
	 *         fVar7 = UVar8.y - UVar9.y;
	 *         fVar5 = UVar8.z - UVar9.z;
	 *         if (*(int *)(*(long *)typeinfo_ptr_mscorlib_Math_6FC0738 + 0xe4) == 0) {
	 *           func_0x031fde08();
	 *         }
	 *         fVar4 = SQRT(fVar5 * fVar5 + fVar6 * fVar6 + fVar7 * fVar7);
	 *         if (fVar4 <= _UNK_0134eeec) {
	 *           if (cRam000000000754a7ce == '\0') {
	 *             func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Vector3_6FC0A08);
	 *             cRam000000000754a7ce = '\x01';
	 *           }
	 *           pfVar3 = *(float **)(*(long *)typeinfo_ptr_UnityEngine_CoreModule_Vector3_6FC0A08 + 0xb8);
	 *           fVar6 = *pfVar3;
	 *           fVar7 = pfVar3[1];
	 *           fVar5 = pfVar3[2];
	 *         }
	 *         else {
	 *           fVar6 = fVar6 / fVar4;
	 *           fVar7 = fVar7 / fVar4;
	 *           fVar5 = fVar5 / fVar4;
	 *         }
	 *         fVar4 = this.DetectionRange;
	 *         fVar6 = UVar10.x + fVar6 * fVar4;
	 *         fVar7 = UVar10.y + fVar7 * fVar4;
	 *         fVar5 = UVar10.z + fVar5 * fVar4;
	 *         uVar2 = NavMesh.SamplePosition(fVar6,fVar7,fVar5,0x3f800000,&uStack_90,0xffffffff,0);
	 *         if ((uVar2 & 1) == 0) {
	 *           uStack_88._0_4_ = fVar5;
	 *           uStack_90._4_4_ = fVar7;
	 *           uStack_90._0_4_ = fVar6;
	 *         }
	 *         UVar8.y = uStack_90._4_4_;
	 *         UVar8.x = (float)uStack_90;
	 *         UVar8.z = (float)uStack_88;
	 *         return UVar8;
	 *       }
	 *     }
	 *   }
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x323EE54 VA: 0x7818929E54
	private void Wander();
	/*
	 *   uint uVar1;
	 *   long lVar2;
	 *   void *pvVar3;
	 *   void *obj;
	 *   UnityEngine_Vector3 UVar4;
	 *   float fStack_2c;
	 *   float fStack_28;
	 *   float fStack_24;
	 *
	 *   if (this.points != null) {
	 *     lVar2 = *(long *)((long)this.points + 0x18);
	 *     if (lVar2 == 0) {
	 *       return;
	 *     }
	 *     uVar1 = Random.Range(0,(int)lVar2);
	 *     pvVar3 = this.points;
	 *     if (pvVar3 != null) {
	 *       if (*(uint *)((long)pvVar3 + 0x18) <= uVar1) {
	 *         IL2CPP.ThrowIndexOutOfRangeException();
	 *       }
	 *       pvVar3 = *(void **)((long)pvVar3 + (long)(int)uVar1 * 8 + 0x20);
	 *       if (pvVar3 != null) {
	 *         obj = this.agent;
	 *         UVar4 = UnityEngine.Transform.get_position(pvVar3);
	 *         fStack_24 = UVar4.z;
	 *         fStack_28 = UVar4.y;
	 *         fStack_2c = UVar4.x;
	 *         if (obj != null) {
	 *           if ((bRam000000000755cc32 & 1) == 0) {
	 *             func_0x031fdc8c(PTR_DAT_0714d7a8,0);
	 *             bRam000000000755cc32 = 1;
	 *           }
	 *           if (obj != null) {
	 *             lVar2 = *(long *)((long)obj + 0x10);
	 *             if (lVar2 == 0) {
	 *               UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException(obj);
	 *             }
	 *             if (pcRam000000000755cc58 == null) {
	 *               pcRam000000000755cc58 = (code *)func_0x031fdc50(&UNK_013514e2);
	 *             }
	 *             (*pcRam000000000755cc58)(lVar2,&fStack_2c);
	 *             return;
	 *           }
	 *           IL2CPP.ThrowNullReferenceException();
	 *         }
	 *       }
	 *     }
	 *   }
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x323F434 VA: 0x781892A434
	private void OnDrawGizmosSelected();
	/*
	 *   void *this_00;
	 *   float fVar1;
	 *   UnityEngine_Vector3 UVar2;
	 *   UnityEngine_Color value;
	 *   float fStack_2c;
	 *   float fStack_28;
	 *   float fStack_24;
	 *
	 *   value.b = 0.0;
	 *   value.a = 1.0;
	 *   value.r = 1.0;
	 *   value.g = 0.0;
	 *   UnityEngine.Gizmos.set_color(value);
	 *   this_00 = UnityEngine.Component.get_transform(this);
	 *   if (this_00 != null) {
	 *     UVar2 = UnityEngine.Transform.get_position(this_00);
	 *     fStack_24 = UVar2.z;
	 *     fStack_28 = UVar2.y;
	 *     fStack_2c = UVar2.x;
	 *     fVar1 = this.DetectionRange;
	 *     if (pcRam000000000755e198 == null) {
	 *       pcRam000000000755e198 = (code *)func_0x031fdc50(&UNK_01388e54);
	 *     }
	 *     (*pcRam000000000755e198)(fVar1,&fStack_2c);
	 *     return;
	 *   }
	 *   IL2CPP.ThrowNullReferenceException();
	 */
	// RVA: 0x323F480 VA: 0x781892A480
	public void .ctor();
	/*
	 *   undefined *puVar1;
	 *   void *pvVar2;
	 *   undefined8 uVar3;
	 *
	 *   puVar1 = PTR_DAT_070c0a78;
	 *   if ((bRam000000000754a9d7 & 1) == 0) {
	 *     func_0x031fdc8c(PTR_DAT_070c0a78);
	 *     bRam000000000754a9d7 = 1;
	 *   }
	 *   uVar3 = NEON_fmov(0x40a00000,4);
	 *   pvVar2 = *(void **)puVar1;
	 *   this.MonsterSpeedChase = 7.5;
	 *   this.tagString = pvVar2;
	 *   this.DetectionRange = (float)(int)uVar3;
	 *   this.MonsterSpeedWander = (float)(int)((ulong)uVar3 >> 0x20);
	 *   func_0x031fdc38();
	 *   puVar1 = typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8;
	 *   if ((bRam000000000755f76f & 1) == 0) {
	 *     func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Object_6FC07E8,0);
	 *     bRam000000000755f76f = 1;
	 *   }
	 *   if (*(int *)(*(long *)puVar1 + 0xe4) == 0) {
	 *     func_0x031fde08();
	 *   }
	 *   return;
	 */
}
