namespace TMPro.Examples
{

	// [TypeInfo RVA: 0x0]
	public class TMP_FrameRateCounter : MonoBehaviour
	{
		public float UpdateInterval; // 0x20
		private float m_LastInterval; // 0x24
		private int m_Frames; // 0x28
		public TMPro.Examples.TMP_FrameRateCounter.FpsCounterAnchorPositions AnchorPosition; // 0x2C
		private string htmlColorTag; // 0x30
		private const string fpsLabel; // 0x0
		private TMPro.TextMeshPro m_TextMeshPro; // 0x38
		private UnityEngine.Transform m_frameCounter_transform; // 0x40
		private UnityEngine.Camera m_camera; // 0x48
		private TMPro.Examples.TMP_FrameRateCounter.FpsCounterAnchorPositions last_AnchorPosition; // 0x50

		// RVA: 0x326E638 VA: 0x7818959638
		private void Awake();
		/*
		 *   undefined *puVar1;
		 *   undefined *puVar2;
		 *   undefined *puVar3;
		 *   bool bVar4;
		 *   void *pvVar5;
		 *   void *pvVar6;
		 *   undefined8 uVar7;
		 *   void **ppvVar8;
		 *   void **ppvVar9;
		 *   void *this_00;
		 *   long *plVar10;
		 *
		 *   if ((bRam000000000754abfb & 1) == 0) {
		 *     func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Application_6FC0EA8);
		 *     func_0x031fdc8c(PTR_DAT_070c1540);
		 *     func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_GameObject_6FC1548);
		 *     func_0x031fdc8c(PTR_DAT_070c50c0);
		 *     func_0x031fdc8c(PTR_DAT_070c5438);
		 *     func_0x031fdc8c(PTR_DAT_070c5448);
		 *     func_0x031fdc8c(PTR_DAT_070c5450);
		 *     func_0x031fdc8c(PTR_DAT_070c5458);
		 *     bRam000000000754abfb = 1;
		 *   }
		 *   bVar4 = UnityEngine.InputSystem.OnScreen.OnScreenStick.Behaviour.get_enabled(this);
		 *   puVar3 = PTR_DAT_070c5450;
		 *   puVar2 = typeinfo_ptr_UnityEngine_CoreModule_GameObject_6FC1548;
		 *   puVar1 = typeinfo_ptr_UnityEngine_CoreModule_Application_6FC0EA8;
		 *   if (!bVar4) {
		 *     return;
		 *   }
		 *   pvVar5 = UnityEngine.Camera.get_main();
		 *   this.m_camera = pvVar5;
		 *   func_0x031fdc38();
		 *   if (*(int *)(*(long *)puVar1 + 0xe4) == 0) {
		 *     func_0x031fde08();
		 *   }
		 *   UnityEngine.Application.set_targetFrameRate(9999);
		 *   pvVar5 = (void *)func_0x031fdf24(*(undefined8 *)puVar2);
		 *   UnityEngine.GameObject..ctor(pvVar5,*(void **)puVar3);
		 *   if (pvVar5 != null) {
		 *     pvVar6 = (void *)func_0x037f2fa8(pvVar5,*(undefined8 *)PTR_DAT_070c1540);
		 *     ppvVar8 = &this.m_TextMeshPro;
		 *     *ppvVar8 = pvVar6;
		 *     func_0x031fdc38(ppvVar8,pvVar6);
		 *     this_00 = *ppvVar8;
		 *     pvVar6 = (void *)func_0x03949758(*(undefined8 *)PTR_DAT_070c5458,*(undefined8 *)PTR_DAT_070c5438
		 *                                     );
		 *     if (this_00 != null) {
		 *       TMPro.TMP_Text.set_font(this_00,pvVar6);
		 *       plVar10 = *ppvVar8;
		 *       uVar7 = func_0x03949758(*(undefined8 *)PTR_DAT_070c5448,*(undefined8 *)PTR_DAT_070c50c0);
		 *       if (plVar10 != null) {
		 *         (**(code **)(*plVar10 + 0x578))(plVar10,uVar7,*(undefined8 *)(*plVar10 + 0x580));
		 *         pvVar5 = UnityEngine.GameObject.get_transform(pvVar5);
		 *         ppvVar9 = &this.m_frameCounter_transform;
		 *         *ppvVar9 = pvVar5;
		 *         func_0x031fdc38(ppvVar9,pvVar5);
		 *         if (this.m_camera != null) {
		 *           pvVar6 = *ppvVar9;
		 *           pvVar5 = UnityEngine.Component.get_transform(this.m_camera);
		 *           if (pvVar6 != null) {
		 *             UnityEngine.Transform.SetParent(pvVar6,pvVar5);
		 *             pvVar5 = *ppvVar9;
		 *             if (cRam000000000754a7d0 == '\0') {
		 *               func_0x031fdc8c(typeinfo_ptr_UnityEngine_CoreModule_Quaternion_6FC0EA0);
		 *               cRam000000000754a7d0 = '\x01';
		 *             }
		 *             if (pvVar5 != null) {
		 *               UnityEngine.Transform.set_localRotation(pvVar5,**(UnityEngine_Vector4 **)
		 *                                   (*(long *)typeinfo_ptr_UnityEngine_CoreModule_Quaternion_6FC0EA0 +
		 *                                   0xb8));
		 *               if (*ppvVar8 != null) {
		 *                 TMPro.TMP_Text.set_textWrappingMode(*ppvVar8,0);
		 *                 if (*ppvVar8 != null) {
		 *                   TMPro.TMP_Text.set_fontSize(*ppvVar8,24.0);
		 *                   TMP_FrameRateCounter.Set_FrameCounter_Position(this,*(undefined4 *)&this.field_0x2c);
		 *                   *(undefined4 *)&this.last_AnchorPosition = *(undefined4 *)&this.field_0x2c;
		 *                   return;
		 *                 }
		 *               }
		 *             }
		 *           }
		 *         }
		 *       }
		 *     }
		 *   }
		 *   IL2CPP.ThrowNullReferenceException();
		 */
		// RVA: 0x326EA88 VA: 0x7818959A88
		private void Start();
		/*
		 *   float fVar1;
		 *
		 *   fVar1 = UnityEngine.Time.get_realtimeSinceStartup();
		 *   this.m_Frames = 0;
		 *   this.m_LastInterval = fVar1;
		 *   return;
		 */
		// RVA: 0x326EAA8 VA: 0x7818959AA8
		private void Update();
		/*
		 *   undefined8 *puVar1;
		 *   undefined8 *puVar2;
		 *   void *this_00;
		 *   undefined *puVar3;
		 *   void *sourceText;
		 *   int iVar4;
		 *   void **ppvVar5;
		 *   float fVar6;
		 *   float arg0;
		 *
		 *   if ((bRam000000000754abfc & 1) == 0) {
		 *     func_0x031fdc8c(PTR_DAT_070c5480);
		 *     func_0x031fdc8c(PTR_DAT_070c5488);
		 *     func_0x031fdc8c(PTR_DAT_070c5490);
		 *     func_0x031fdc8c(PTR_DAT_070c5498);
		 *     bRam000000000754abfc = 1;
		 *   }
		 *   iVar4 = *(int *)&this.field_0x2c;
		 *   if (iVar4 != *(int *)&this.last_AnchorPosition) {
		 *     TMP_FrameRateCounter.Set_FrameCounter_Position(this);
		 *     iVar4 = *(int *)&this.field_0x2c;
		 *   }
		 *   *(int *)&this.last_AnchorPosition = iVar4;
		 *   this.m_Frames = this.m_Frames + 1;
		 *   fVar6 = UnityEngine.Time.get_realtimeSinceStartup();
		 *   puVar3 = PTR_DAT_070c5498;
		 *   if (this.m_LastInterval + this.UpdateInterval < fVar6) {
		 *     arg0 = (float)this.m_Frames / (fVar6 - this.m_LastInterval);
		 *     puVar1 = (undefined8 *)PTR_DAT_070c5488;
		 *     if (10.0 <= arg0) {
		 *       puVar1 = (undefined8 *)PTR_DAT_070c5480;
		 *     }
		 *     puVar2 = (undefined8 *)PTR_DAT_070c5490;
		 *     if (30.0 <= arg0) {
		 *       puVar2 = puVar1;
		 *     }
		 *     ppvVar5 = &this.htmlColorTag;
		 *     *ppvVar5 = (void *)*puVar2;
		 *     func_0x031fdc38(ppvVar5);
		 *     this_00 = this.m_TextMeshPro;
		 *     sourceText = System.String.Concat(*ppvVar5,*(void **)puVar3);
		 *     if (this_00 == null) {
		 *       IL2CPP.ThrowNullReferenceException();
		 *     }
		 *     TMPro.TMP_Text.SetText(this_00,sourceText,arg0,1000.0 / arg0);
		 *     this.m_Frames = 0;
		 *     this.m_LastInterval = fVar6;
		 *   }
		 *   return;
		 */
		// RVA: 0x326E8B0 VA: 0x78189598B0
		private void Set_FrameCounter_Position(TMPro.Examples.TMP_FrameRateCounter.FpsCounterAnchorPositions anchor_position);
		/*
		 *   long *plVar1;
		 *   void *pvVar2;
		 *   void *obj;
		 *   long lVar3;
		 *   undefined4 uVar4;
		 *   undefined4 uVar5;
		 *   UnityEngine_Vector3 UVar6;
		 *   float fStack_2c;
		 *   float fStack_28;
		 *   float fStack_24;
		 *
		 *   plVar1 = *(long **)(param_1 + 0x38);
		 *   if (plVar1 == null) goto LAB_0336ea84;
		 *   (**(code **)(*plVar1 + 0x5d8))
		 *             (0x3f800000,0x3f800000,0x3f800000,0x3f800000,plVar1,*(undefined8 *)(*plVar1 + 0x5e0));
		 *   if (param_2 < 2) {
		 *     if (param_2 == 0) {
		 *       if (*(void **)(param_1 + 0x38) == null) goto LAB_0336ea84;
		 *       TMPro.TMP_Text.set_alignment(*(void **)(param_1 + 0x38),0x101);
		 *       if ((*(void **)(param_1 + 0x38) == null) ||
		 *          (pvVar2 = TMPro.TMP_Text.get_rectTransform(*(void **)(param_1 + 0x38)), pvVar2 == null))
		 *       goto LAB_0336ea84;
		 *       UnityEngine.RectTransform.set_pivot(pvVar2,(UnityEngine_Vector2)0x3f80000000000000);
		 *       pvVar2 = *(void **)(param_1 + 0x48);
		 *       if (pvVar2 == null) goto LAB_0336ea84;
		 *       uVar4 = 0;
		 *       obj = *(void **)(param_1 + 0x40);
		 * LAB_0336ea5c:
		 *       uVar5 = 0x3f800000;
		 *     }
		 *     else {
		 *       if (param_2 != 1) {
		 *         return;
		 *       }
		 *       if (*(void **)(param_1 + 0x38) == null) goto LAB_0336ea84;
		 *       TMPro.TMP_Text.set_alignment(*(void **)(param_1 + 0x38),0x401);
		 *       if ((*(void **)(param_1 + 0x38) == null) ||
		 *          (pvVar2 = TMPro.TMP_Text.get_rectTransform(*(void **)(param_1 + 0x38)), pvVar2 == null))
		 *       goto LAB_0336ea84;
		 *       UnityEngine.RectTransform.set_pivot(pvVar2,(UnityEngine_Vector2)0x0);
		 *       pvVar2 = *(void **)(param_1 + 0x48);
		 *       if (pvVar2 == null) goto LAB_0336ea84;
		 *       obj = *(void **)(param_1 + 0x40);
		 *       uVar4 = 0;
		 *       uVar5 = 0;
		 *     }
		 *   }
		 *   else {
		 *     if (param_2 == 2) {
		 *       if (*(void **)(param_1 + 0x38) == null) goto LAB_0336ea84;
		 *       TMPro.TMP_Text.set_alignment(*(void **)(param_1 + 0x38),0x104);
		 *       if ((*(void **)(param_1 + 0x38) == null) ||
		 *          (pvVar2 = TMPro.TMP_Text.get_rectTransform(*(void **)(param_1 + 0x38)), pvVar2 == null))
		 *       goto LAB_0336ea84;
		 *       UnityEngine.RectTransform.set_pivot(pvVar2,(UnityEngine_Vector2)0x3f8000003f800000);
		 *       pvVar2 = *(void **)(param_1 + 0x48);
		 *       if (pvVar2 == null) goto LAB_0336ea84;
		 *       obj = *(void **)(param_1 + 0x40);
		 *       uVar4 = 0x3f800000;
		 *       goto LAB_0336ea5c;
		 *     }
		 *     if (param_2 != 3) {
		 *       return;
		 *     }
		 *     if (*(void **)(param_1 + 0x38) == null) goto LAB_0336ea84;
		 *     TMPro.TMP_Text.set_alignment(*(void **)(param_1 + 0x38),0x404)
		 *     ;
		 *     if ((*(void **)(param_1 + 0x38) == null) ||
		 *        (pvVar2 = TMPro.TMP_Text.get_rectTransform(*(void **)(param_1 + 0x38)), pvVar2 == null))
		 *     goto LAB_0336ea84;
		 *     UnityEngine.RectTransform.set_pivot(pvVar2,(UnityEngine_Vector2)0x3f800000);
		 *     pvVar2 = *(void **)(param_1 + 0x48);
		 *     if (pvVar2 == null) goto LAB_0336ea84;
		 *     obj = *(void **)(param_1 + 0x40);
		 *     uVar5 = 0;
		 *     uVar4 = 0x3f800000;
		 *   }
		 *   UVar6.y = (float)uVar5;
		 *   UVar6.x = (float)uVar4;
		 *   UVar6.z = 100.0;
		 *   UVar6 = UnityEngine.Camera.ViewportToWorldPoint(pvVar2,UVar6);
		 *   fStack_24 = UVar6.z;
		 *   fStack_28 = UVar6.y;
		 *   fStack_2c = UVar6.x;
		 *   if (obj != null) {
		 *     if ((bRam000000000755ff19 & 1) == 0) {
		 *       func_0x031fdc8c(PTR_DAT_0714f6d0,0);
		 *       bRam000000000755ff19 = 1;
		 *     }
		 *     if (obj == null) {
		 *       IL2CPP.ThrowNullReferenceException();
		 *     }
		 *     lVar3 = *(long *)((long)obj + 0x10);
		 *     if (lVar3 == 0) {
		 *       UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException(obj);
		 *     }
		 *     if (pcRam000000000755ff50 == null) {
		 *       pcRam000000000755ff50 = (code *)func_0x031fdc50(&UNK_01396672);
		 *     }
		 *     (*pcRam000000000755ff50)(lVar3,&fStack_2c);
		 *     return;
		 *   }
		 * LAB_0336ea84:
		 *   IL2CPP.ThrowNullReferenceException();
		 */
		// RVA: 0x326EC04 VA: 0x7818959C04
		public void .ctor();
		/*
		 *   undefined *puVar1;
		 *
		 *   this.UpdateInterval = 5.0;
		 *   *(undefined4 *)&this.field_0x2c = 2;
		 *   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;
		 */
	}
}
