using System; using System.Runtime.CompilerServices; using Cpp2IlInjected; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Utilities.Zlib { // Token: 0x02001937 RID: 6455 [Token(Token = "0x2001937")] internal sealed class ZTree { // Token: 0x0600992C RID: 39212 RVA: 0x001FC5D4 File Offset: 0x001FA7D4 [Token(Token = "0x600992C")] [Address(RVA = "0x163A470", Offset = "0x1639270", VA = "0x18163A470")] internal static int d_code(int dist) { if (dist < 256) { byte[] dist_code = ZTree._dist_code; } byte[] dist_code2 = ZTree._dist_code; throw new NullReferenceException(); } // Token: 0x0600992D RID: 39213 RVA: 0x001FC5FC File Offset: 0x001FA7FC [Token(Token = "0x600992D")] [Address(RVA = "0x163A560", Offset = "0x1639360", VA = "0x18163A560")] internal void gen_bitlen(Deflate s) { StaticTree staticTree = this.stat_desc; short[] array = this.dyn_tree; short[] static_tree = staticTree.static_tree; int i = 0; int[] extra_bits = staticTree.extra_bits; int extra_base = staticTree.extra_base; int num = staticTree.max_length; short[] bl_count = s.bl_count; i++; bl_count[0] = (short)i; while (i <= 15) { } int[] heap = s.heap; int num2 = s.heap_max; num2++; array[0] = (short)i; int num3 = s.heap_max; num3++; if (num3 < 573) { int[] heap2 = s.heap; int num4 = array.Length; num2 = num3; int num5 = heap2[num2]; num2 += num2; num2++; num2++; num4 = num; if (num2 <= num) { num4 = num2; } array[0] = (short)num4; short[] bl_count2 = s.bl_count; num5 -= extra_base; int num6 = extra_bits[num5]; int num7 = num5 * num5; if (static_tree != 0) { num7 += num6; } num3++; if (i != 0) { short[] bl_count3 = s.bl_count; int num8 = num - 1; short num9 = bl_count3[num8]; bl_count3[0] = num9; short[] bl_count4 = s.bl_count; num8++; short[] bl_count5 = s.bl_count; if (num != 0) { short[] bl_count6 = s.bl_count; if (num8 != 0) { int[] heap3 = s.heap; num = num3; int num10 = heap3[num]; int num11 = array.Length; num10 += num10; int num12 = num10 + 1; if (num4 != num) { num11 = num; num11 -= num4; array[0] = (short)num; } while (num8 != 0) { } } while (num8 != 0) { } } } } } // Token: 0x0600992E RID: 39214 RVA: 0x001FC7B4 File Offset: 0x001FA9B4 [Token(Token = "0x600992E")] [Address(RVA = "0x1639DB0", Offset = "0x1638BB0", VA = "0x181639DB0")] internal void build_tree(Deflate s) { StaticTree staticTree = this.stat_desc; short[] array = this.dyn_tree; short[] static_tree = staticTree.static_tree; int num = staticTree.elems; int num2 = 0; s.heap_max = (int)((ulong)573L); s.heap_len = num2; if (num > 0) { int length = array.Length; if ("{il2cpp array field local3->}" == num2) { num2++; array[0] = (short)num2; } int heap_len = s.heap_len; int[] heap = s.heap; int num3 = heap_len + 1; s.heap_len = num3; int num4 = heap_len + 1; heap[0] = num2; byte[] depth = s.depth; num2++; num2 += 2; } int num5 = s.heap_len; if (num5 < 2) { int[] heap2 = s.heap; int num6 = num5 + 1; s.heap_len = num6; if (num2 < 2) { } num5++; heap2[0] = num2; uint num7; array[0] = (short)num7; byte[] depth2 = s.depth; while (static_tree == 0) { } } this.max_code = 1; int i = s.heap_len; i -= 0; s.pqdownheap(array, i); while (i >= 1) { } int[] heap3 = s.heap; int heap_len2 = s.heap_len; int num8 = heap3[0]; int num9 = heap_len2 - 1; s.heap_len = num9; int length2 = heap3.Length; int num10 = heap3[heap_len2]; heap3[0] = num10; uint num11; s.pqdownheap(array, (int)num11); int[] heap4 = s.heap; int heap_max = s.heap_max; int num12 = heap4[0]; int num13 = heap_max - 1; s.heap_max = num13; int num14 = heap_max - 1; heap4[0] = num8; int heap_max2 = s.heap_max; int[] heap5 = s.heap; int num15 = heap_max2 - 1; s.heap_max = num15; int num16 = heap_max2 - 1; heap5[0] = num12; int length3 = array.Length; short num17 = array[heap5]; array[0] = num17; int length4 = s.depth.Length; byte b2; byte b3; byte b = Math.Max(b2, b3); array[0] = (short)num; int num18 = heap_max2 + 1; array[0] = (short)num; i += 2; int[] heap6 = s.heap; num++; heap6[0] = num; s.pqdownheap(array, 1); while (s.heap_len >= 2) { } int heap_max3 = s.heap_max; int[] heap7 = s.heap; int num19 = heap_max3 - 1; s.heap_max = num19; int num20 = s.heap[0]; int num21 = heap_max3 - 1; heap7[0] = num20; short[] bl_count = s.bl_count; int num22; ZTree.gen_codes(array, num22, bl_count); } // Token: 0x0600992F RID: 39215 RVA: 0x001FCA54 File Offset: 0x001FAC54 [Token(Token = "0x600992F")] [Address(RVA = "0x163AA10", Offset = "0x1639810", VA = "0x18163AA10")] internal static void gen_codes(short[] tree, int max_code, short[] bl_count) { short[] array = new short[16]; int i = 0; i += i; array[0] = (short)i; while (1UL <= (ulong)15L) { } if (bl_count != 0) { short num = array[bl_count] + 1; array[0] = num; int num2 = 0; num2 += num2; tree[0] = (short)num2; } i++; i += 2; while (i <= max_code) { } } // Token: 0x06009930 RID: 39216 RVA: 0x001FCABC File Offset: 0x001FACBC [Token(Token = "0x6009930")] [Address(RVA = "0x1639D80", Offset = "0x1638B80", VA = "0x181639D80")] internal static int bi_reverse(int code, int len) { int num = 0; int num2 = len - 1; return num + num; } // Token: 0x06009931 RID: 39217 RVA: 0x001FCAD4 File Offset: 0x001FACD4 [Token(Token = "0x6009931")] [Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")] public ZTree() { } // Token: 0x06009932 RID: 39218 RVA: 0x001FCAE8 File Offset: 0x001FACE8 // Note: this type is marked as 'beforefieldinit'. [Token(Token = "0x6009932")] [Address(RVA = "0x1639B90", Offset = "0x1638990", VA = "0x181639B90")] static ZTree() { int[] array = new int[29]; RuntimeHelpers.InitializeArray(array, fieldof(.67C0E784F3654B008A81E2988588CF4956CCF3DA).FieldHandle); ZTree.extra_lbits = array; int[] array2 = new int[30]; RuntimeHelpers.InitializeArray(array2, fieldof(.79D521E6E3E55103005E9CC3FA43B3174FAF090F).FieldHandle); ZTree.extra_dbits = array2; int[] array3 = new int[19]; RuntimeHelpers.InitializeArray(array3, fieldof(.8457F44B035C9073EE2D1F132D0A8AF5631DCDC8).FieldHandle); ZTree.extra_blbits = array3; byte[] array4 = new byte[19]; RuntimeHelpers.InitializeArray(array4, fieldof(.9F8365E9D6C62D3B47026EC465B05A7B5526B5CD).FieldHandle); ZTree.bl_order = array4; byte[] array5 = new byte[512]; RuntimeHelpers.InitializeArray(array5, fieldof(.3544182260B8A15D332367E48C7530FC0E901FD3).FieldHandle); ZTree._dist_code = array5; byte[] array6 = new byte[256]; RuntimeHelpers.InitializeArray(array6, fieldof(.6A316789EED01119DE92841832701A40AB0CABD6).FieldHandle); ZTree._length_code = array6; int[] array7 = new int[29]; RuntimeHelpers.InitializeArray(array7, fieldof(.2E868D9F2085DF93F11F58DE61C05E0D8A8F4A71).FieldHandle); ZTree.base_length = array7; int[] array8 = new int[30]; RuntimeHelpers.InitializeArray(array8, fieldof(.5581A70566F03554D8048EDBFC6E6B399AF9BCB1).FieldHandle); ZTree.base_dist = array8; } // Token: 0x04006852 RID: 26706 [Token(Token = "0x4006852")] private const int MAX_BITS = 15; // Token: 0x04006853 RID: 26707 [Token(Token = "0x4006853")] private const int BL_CODES = 19; // Token: 0x04006854 RID: 26708 [Token(Token = "0x4006854")] private const int D_CODES = 30; // Token: 0x04006855 RID: 26709 [Token(Token = "0x4006855")] private const int LITERALS = 256; // Token: 0x04006856 RID: 26710 [Token(Token = "0x4006856")] private const int LENGTH_CODES = 29; // Token: 0x04006857 RID: 26711 [Token(Token = "0x4006857")] private const int L_CODES = 286; // Token: 0x04006858 RID: 26712 [Token(Token = "0x4006858")] private const int HEAP_SIZE = 573; // Token: 0x04006859 RID: 26713 [Token(Token = "0x4006859")] internal const int MAX_BL_BITS = 7; // Token: 0x0400685A RID: 26714 [Token(Token = "0x400685A")] internal const int END_BLOCK = 256; // Token: 0x0400685B RID: 26715 [Token(Token = "0x400685B")] internal const int REP_3_6 = 16; // Token: 0x0400685C RID: 26716 [Token(Token = "0x400685C")] internal const int REPZ_3_10 = 17; // Token: 0x0400685D RID: 26717 [Token(Token = "0x400685D")] internal const int REPZ_11_138 = 18; // Token: 0x0400685E RID: 26718 [Token(Token = "0x400685E")] internal static readonly int[] extra_lbits; // Token: 0x0400685F RID: 26719 [Token(Token = "0x400685F")] internal static readonly int[] extra_dbits; // Token: 0x04006860 RID: 26720 [Token(Token = "0x4006860")] internal static readonly int[] extra_blbits; // Token: 0x04006861 RID: 26721 [Token(Token = "0x4006861")] internal static readonly byte[] bl_order; // Token: 0x04006862 RID: 26722 [Token(Token = "0x4006862")] internal const int Buf_size = 16; // Token: 0x04006863 RID: 26723 [Token(Token = "0x4006863")] internal const int DIST_CODE_LEN = 512; // Token: 0x04006864 RID: 26724 [Token(Token = "0x4006864")] internal static readonly byte[] _dist_code; // Token: 0x04006865 RID: 26725 [Token(Token = "0x4006865")] internal static readonly byte[] _length_code; // Token: 0x04006866 RID: 26726 [Token(Token = "0x4006866")] internal static readonly int[] base_length; // Token: 0x04006867 RID: 26727 [Token(Token = "0x4006867")] internal static readonly int[] base_dist; // Token: 0x04006868 RID: 26728 [FieldOffset(Offset = "0x10")] [Token(Token = "0x4006868")] internal short[] dyn_tree; // Token: 0x04006869 RID: 26729 [FieldOffset(Offset = "0x18")] [Token(Token = "0x4006869")] internal int max_code; // Token: 0x0400686A RID: 26730 [FieldOffset(Offset = "0x20")] [Token(Token = "0x400686A")] internal StaticTree stat_desc; } }