namespace DataStreamDemo
{

	// [TypeInfo RVA: 0x0]
	internal static class Util : Object
	{
		private static System.UInt32[] crcLookupTable; // 0x0

		// RVA: 0x3285B74 VA: 0x7818970B74
		public static uint CalculateCrc(System.Byte[] buffer, int offset, int length);
		/*
		 *   uint uVar1;
		 *   undefined *puVar2;
		 *   uint uVar3;
		 *   void *pvVar4;
		 *   void *extraout_x1;
		 *   ulong uVar5;
		 *   long lVar6;
		 *   ulong uVar7;
		 *   void *pvVar8;
		 *
		 *   puVar2 = PTR_DAT_070c5bb0;
		 *   uVar5 = (ulong)(uint)length;
		 *   pvVar8 = (void *)(ulong)(uint)offset;
		 *   pvVar4 = pvVar8;
		 *   if ((bRam000000000754acce & 1) == 0) {
		 *     func_0x031fdc8c(PTR_DAT_070c5bb0);
		 *     bRam000000000754acce = 1;
		 *     pvVar4 = extraout_x1;
		 *   }
		 *   if (**(long **)(*(long *)puVar2 + 0xb8) == 0) {
		 *     pvVar4 = Util.InitializeTable(0xedb88320);
		 *     **(undefined8 **)(*(long *)puVar2 + 0xb8) = pvVar4;
		 *     func_0x031fdc38(*(undefined8 *)(*(long *)puVar2 + 0xb8),pvVar4);
		 *   }
		 *   if (length < 1) {
		 *     uVar3 = 0xffffffff;
		 *   }
		 *   else {
		 *     if (buffer == null) {
		 * LAB_03385c74:
		 *       IL2CPP.ThrowNullReferenceException();
		 *     }
		 *     uVar3 = 0xffffffff;
		 *     uVar1 = 0;
		 *     if ((uint)offset <= *(uint *)((long)buffer + 0x18)) {
		 *       uVar1 = *(uint *)((long)buffer + 0x18) - offset;
		 *     }
		 *     uVar7 = (ulong)uVar1;
		 *     lVar6 = **(long **)(*(long *)puVar2 + 0xb8);
		 *     do {
		 *       if (uVar7 == 0) {
		 * LAB_03385c70:
		 *         IL2CPP.ThrowIndexOutOfRangeException();
		 *       }
		 *       if (lVar6 == 0) goto LAB_03385c74;
		 *       uVar1 = uVar3 & 0xff ^ (uint)*(byte *)((long)buffer + (long)(int)pvVar8 + 0x20);
		 *       if (*(uint *)(lVar6 + 0x18) <= uVar1) goto LAB_03385c70;
		 *       uVar5 = uVar5 - 1;
		 *       pvVar8 = (void *)(ulong)((int)pvVar8 + 1);
		 *       uVar7 = uVar7 - 1;
		 *       uVar3 = *(uint *)(lVar6 + (ulong)uVar1 * 4 + 0x20) ^ uVar3 >> 8;
		 *     } while (uVar5 != 0);
		 *   }
		 *   return uVar3;
		 */
		// RVA: 0x3286474 VA: 0x7818971474
		private static System.UInt32[] InitializeTable(uint polynomial);
		/*
		 *   long lVar1;
		 *   uint uVar2;
		 *   undefined *puVar3;
		 *   void *pvVar4;
		 *   ulong uVar5;
		 *   ulong uVar6;
		 *   int iVar7;
		 *
		 *   puVar3 = PTR_DAT_070c5c10;
		 *   if ((bRam000000000754accf & 1) == 0) {
		 *     func_0x031fdc8c(PTR_DAT_070c5c10);
		 *     bRam000000000754accf = 1;
		 *   }
		 *   pvVar4 = (void *)func_0x031fdd78(*(undefined8 *)puVar3,0x100);
		 *   uVar5 = 0;
		 *   do {
		 *     iVar7 = 8;
		 *     uVar6 = uVar5 & 0xffffffff;
		 *     do {
		 *       iVar7 = iVar7 + -1;
		 *       uVar2 = -((uint)uVar6 & 1) & polynomial ^ (uint)uVar6 >> 1;
		 *       uVar6 = (ulong)uVar2;
		 *     } while (iVar7 != 0);
		 *     if (pvVar4 == null) {
		 *       IL2CPP.ThrowNullReferenceException();
		 *     }
		 *     if (*(uint *)((long)pvVar4 + 0x18) <= uVar5) {
		 *       IL2CPP.ThrowIndexOutOfRangeException();
		 *     }
		 *     lVar1 = uVar5 * 4;
		 *     uVar5 = uVar5 + 1;
		 *     *(uint *)((long)pvVar4 + lVar1 + 0x20) = uVar2;
		 *   } while (uVar5 != 0x100);
		 *   return pvVar4;
		 */
	}
}
