// zlib.InfBlocks // zlib.InfBlocks internal int proc(ZStream z, int r) { int num = z.next_in_index; int num2 = z.avail_in; int num3 = this.bitb; int i = this.bitk; int num4 = this.write; int num5 = (num4 < this.read) ? (this.read - num4 - 1) : (this.end - num4); int num6; while (true) { switch (this.mode) { case 0: while (i < 3) { if (num2 == 0) { return(procRet(z, i, r, num, num2, num3, num4)); } r = 0; num2--; num3 |= (int)(z.next_in[num++] & 255) << i; i += 8; } num6 = (num3 & 7); this.last = (num6 & 1); switch (SupportClass.URShift(num6, 1)) { case 0: num3 = SupportClass.URShift(num3, 3); i -= 3; num6 = (i & 7); num3 = SupportClass.URShift(num3, num6); i -= num6; this.mode = 1; continue; case 1: { int[] array = new int[1]; int[] array2 = new int[1]; int[][] array3 = new int[1][]; int[][] array4 = new int[1][]; InfTree.inflate_trees_fixed(array, array2, array3, array4, z); this.codes = new InfCodes(array[0], array2[0], array3[0], array4[0], z); num3 = SupportClass.URShift(num3, 3); i -= 3; this.mode = 6; continue; } case 2: num3 = SupportClass.URShift(num3, 3); i -= 3; this.mode = 3; continue; case 3: num3 = SupportClass.URShift(num3, 3); i -= 3; this.mode = 9; z.msg = "invalid block type"; return(procRet(z, i, -3, num, num2, num3, num4)); default: continue; } break; case 1: { while (i < 32) { if (num2 == 0) { return(procRet(z, i, r, num, num2, num3, num4)); } r = 0; num2--; num3 |= (int)(z.next_in[num++] & 255) << i; i += 8; } if ((SupportClass.URShift(~num3, 16) & 65535) != (num3 & 65535)) { this.mode = 9; z.msg = "invalid stored block lengths"; return(procRet(z, i, -3, num, num2, num3, num4)); } this.left = (num3 & 65535); int arg_686_0 = 0; i = 0; num3 = arg_686_0; this.mode = ((this.left != 0) ? 2 : ((this.last != 0) ? 7 : 0)); continue; } case 2: if (num2 == 0) { return(procRet(z, i, r, num, num2, num3, num4)); } if (num5 == 0) { if (num4 == this.end && this.read != 0) { num4 = 0; num5 = ((0 < this.read) ? (this.read - num4 - 1) : (this.end - num4)); } if (num5 == 0) { this.write = num4; r = this.inflate_flush(z, r); num4 = this.write; num5 = ((num4 < this.read) ? (this.read - num4 - 1) : (this.end - num4)); if (num4 == this.end && this.read != 0) { num4 = 0; num5 = ((0 < this.read) ? (this.read - num4 - 1) : (this.end - num4)); } if (num5 == 0) { return(procRet(z, i, r, num, num2, num3, num4)); } } } r = 0; num6 = this.left; if (num6 > num2) { num6 = num2; } if (num6 > num5) { num6 = num5; } Array.Copy(z.next_in, num, this.window, num4, num6); num += num6; num2 -= num6; num4 += num6; num5 -= num6; if ((this.left -= num6) == 0) { this.mode = ((this.last != 0) ? 7 : 0); continue; } continue; case 3: while (i < 14) { if (num2 == 0) { return(procRet(z, i, r, num, num2, num3, num4)); } r = 0; num2--; num3 |= (int)(z.next_in[num++] & 255) << i; i += 8; } num6 = (this.table = (num3 & 16383)); if ((num6 & 31) <= 29 && (num6 >> 5 & 31) <= 29) { num6 = 258 + (num6 & 31) + (num6 >> 5 & 31); this.blens = new int[num6]; num3 = SupportClass.URShift(num3, 14); i -= 14; this.index = 0; this.mode = 4; goto case 4; } this.mode = 9; z.msg = "too many length or distance symbols"; return(procRet(z, i, -3, num, num2, num3, num4)); case 4: while (this.index < 4 + SupportClass.URShift(this.table, 10)) { while (i < 3) { if (num2 == 0) { return(procRet(z, i, r, num, num2, num3, num4)); } r = 0; num2--; num3 |= (int)(z.next_in[num++] & 255) << i; i += 8; } this.blens[InfBlocks.border[this.index++]] = (num3 & 7); num3 = SupportClass.URShift(num3, 3); i -= 3; } while (this.index < 19) { this.blens[InfBlocks.border[this.index++]] = 0; } this.bb[0] = 7; num6 = InfTree.inflate_trees_bits(this.blens, this.bb, this.tb, this.hufts, z); if (num6 == 0) { this.index = 0; this.mode = 5; goto case 5; } if (num6 == -3) { this.blens = null; this.mode = 9; } return(procRet(z, i, num6, num, num2, num3, num4)); case 5: while (true) { num6 = this.table; if (this.index >= 258 + (num6 & 31) + (num6 >> 5 & 31)) { break; } num6 = this.bb[0]; while (i < num6) { if (num2 == 0) { return(procRet(z, i, r, num, num2, num3, num4)); } r = 0; num2--; num3 |= (int)(z.next_in[num++] & 255) << i; i += 8; } num6 = this.hufts[(this.tb[0] + (num3 & InfBlocks.inflate_mask[num6])) * 3 + 1]; int num7 = this.hufts[(this.tb[0] + (num3 & InfBlocks.inflate_mask[num6])) * 3 + 2]; if (num7 < 16) { num3 = SupportClass.URShift(num3, num6); i -= num6; this.blens[this.index++] = num7; } else { int num8 = (num7 == 18) ? 7 : (num7 - 14); int num9 = (num7 == 18) ? 11 : 3; while (i < num6 + num8) { if (num2 == 0) { return(procRet(z, i, r, num, num2, num3, num4)); } r = 0; num2--; num3 |= (int)(z.next_in[num++] & 255) << i; i += 8; } num3 = SupportClass.URShift(num3, num6); i -= num6; num9 += (num3 & InfBlocks.inflate_mask[num8]); num3 = SupportClass.URShift(num3, num8); i -= num8; num8 = this.index; num6 = this.table; if (num8 + num9 > 258 + (num6 & 31) + (num6 >> 5 & 31) || (num7 == 16 && num8 < 1)) { this.blens = null; this.mode = 9; z.msg = "invalid bit length repeat"; return(procRet(z, i, -3, num, num2, num3, num4)); } num7 = ((num7 == 16) ? this.blens[num8 - 1] : 0); do { this.blens[num8++] = num7; } while (--num9 != 0); this.index = num8; } } this.tb[0] = -1; int[] array5 = new int[1]; int[] array6 = new int[1]; int[] array7 = new int[1]; int[] array8 = new int[1]; array5[0] = 9; array6[0] = 6; num6 = this.table; num6 = InfTree.inflate_trees_dynamic(257 + (num6 & 31), 1 + (num6 >> 5 & 31), this.blens, array5, array6, array7, array8, this.hufts, z); if (num6 == 0) { this.codes = new InfCodes(array5[0], array6[0], this.hufts, array7[0], this.hufts, array8[0], z); this.blens = null; this.mode = 6; goto case 6; } if (num6 == -3) { this.blens = null; this.mode = 9; } return(procRet(z, i, num6, num, num2, num3, num4)); case 6: this.bitb = num3; this.bitk = i; z.avail_in = num2; z.total_in += (long)(num - z.next_in_index); z.next_in_index = num; this.write = num4; if ((r = this.codes.proc(this, z, r)) != 1) { break; } r = 0; this.codes.free(z); num = z.next_in_index; num2 = z.avail_in; num3 = this.bitb; i = this.bitk; num4 = this.write; num5 = ((num4 < this.read) ? (this.read - num4 - 1) : (this.end - num4)); if (this.last != 0) { this.mode = 7; goto case 7; } this.mode = 0; continue; case 7: this.write = num4; r = this.inflate_flush(z, r); num4 = this.write; int arg_CC8_0 = (num4 < this.read) ? (this.read - num4 - 1) : (this.end - num4); if (this.read != this.write) { return(procRet(z, i, r, num, num2, num3, num4)); } this.mode = 8; goto case 8; case 8: return(procRet(z, i, 1, num, num2, num3, num4)); case 9: return(procRet(z, i, -3, num, num2, num3, num4)); } return(procRet(z, i, -2, num, num2, num3, num4)); } return(this.inflate_flush(z, r)); }
internal int proc(ZStream z, int r) { int t; // temporary storage int b; // bit buffer int k; // bits in bit buffer int p; // input data pointer int n; // bytes available there int q; // output window write pointer int m; // bytes to end of window or read pointer // copy input/output information to locals (UPDATE macro restores) { p = z.next_in_index; n = z.avail_in; b = bitb; k = bitk; } { q = write; m = (int)(q < read ? read - q - 1 : end - q); } // process input based on current state while (true) { switch (mode) { case TYPE: while (k < (3)) { if (n != 0) { r = Z_OK; } else { bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } ; n--; b |= (z.next_in[p++] & 0xff) << k; k += 8; } t = (int)(b & 7); last = t & 1; switch (SupportClass.URShift(t, 1)) { case 0: // stored { b = SupportClass.URShift(b, (3)); k -= (3); } t = k & 7; // go to byte boundary { b = SupportClass.URShift(b, (t)); k -= (t); } mode = LENS; // get length of stored block break; case 1: // fixed { int[] bl = new int[1]; int[] bd = new int[1]; int[][] tl = new int[1][]; int[][] td = new int[1][]; InfTree.inflate_trees_fixed(bl, bd, tl, td, z); codes = new InfCodes(bl[0], bd[0], tl[0], td[0], z); } { b = SupportClass.URShift(b, (3)); k -= (3); } mode = CODES; break; case 2: // dynamic { b = SupportClass.URShift(b, (3)); k -= (3); } mode = TABLE; break; case 3: // illegal { b = SupportClass.URShift(b, (3)); k -= (3); } mode = BAD; z.msg = "invalid block type"; r = Z_DATA_ERROR; bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } break; case LENS: while (k < (32)) { if (n != 0) { r = Z_OK; } else { bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } ; n--; b |= (z.next_in[p++] & 0xff) << k; k += 8; } if (((SupportClass.URShift((~b), 16)) & 0xffff) != (b & 0xffff)) { mode = BAD; z.msg = "invalid stored block lengths"; r = Z_DATA_ERROR; bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } left = (b & 0xffff); b = k = 0; // dump bits mode = left != 0 ? STORED : (last != 0 ? DRY : TYPE); break; case STORED: if (n == 0) { bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } if (m == 0) { if (q == end && read != 0) { q = 0; m = (int)(q < read ? read - q - 1 : end - q); } if (m == 0) { write = q; r = inflate_flush(z, r); q = write; m = (int)(q < read ? read - q - 1 : end - q); if (q == end && read != 0) { q = 0; m = (int)(q < read ? read - q - 1 : end - q); } if (m == 0) { bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } } } r = Z_OK; t = left; if (t > n) { t = n; } if (t > m) { t = m; } Array.Copy(z.next_in, p, window, q, t); p += t; n -= t; q += t; m -= t; if ((left -= t) != 0) { break; } mode = last != 0 ? DRY : TYPE; break; case TABLE: while (k < (14)) { if (n != 0) { r = Z_OK; } else { bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } ; n--; b |= (z.next_in[p++] & 0xff) << k; k += 8; } table = t = (b & 0x3fff); if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29) { mode = BAD; z.msg = "too many length or distance symbols"; r = Z_DATA_ERROR; bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f); blens = new int[t]; { b = SupportClass.URShift(b, (14)); k -= (14); } index = 0; mode = BTREE; goto case BTREE; case BTREE: while (index < 4 + (SupportClass.URShift(table, 10))) { while (k < (3)) { if (n != 0) { r = Z_OK; } else { bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } ; n--; b |= (z.next_in[p++] & 0xff) << k; k += 8; } blens[border[index++]] = b & 7; { b = SupportClass.URShift(b, (3)); k -= (3); } } while (index < 19) { blens[border[index++]] = 0; } bb[0] = 7; t = InfTree.inflate_trees_bits(blens, bb, tb, hufts, z); if (t != Z_OK) { r = t; if (r == Z_DATA_ERROR) { blens = null; mode = BAD; } bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } index = 0; mode = DTREE; goto case DTREE; case DTREE: while (true) { t = table; if (!(index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))) { break; } int i, j, c; t = bb[0]; while (k < (t)) { if (n != 0) { r = Z_OK; } else { bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } ; n--; b |= (z.next_in[p++] & 0xff) << k; k += 8; } if (tb[0] == -1) { //System.err.println("null..."); } t = hufts[(tb[0] + (b & inflate_mask[t])) * 3 + 1]; c = hufts[(tb[0] + (b & inflate_mask[t])) * 3 + 2]; if (c < 16) { b = SupportClass.URShift(b, (t)); k -= (t); blens[index++] = c; } else { // c == 16..18 i = c == 18 ? 7 : c - 14; j = c == 18 ? 11 : 3; while (k < (t + i)) { if (n != 0) { r = Z_OK; } else { bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } ; n--; b |= (z.next_in[p++] & 0xff) << k; k += 8; } b = SupportClass.URShift(b, (t)); k -= (t); j += (b & inflate_mask[i]); b = SupportClass.URShift(b, (i)); k -= (i); i = index; t = table; if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) || (c == 16 && i < 1)) { blens = null; mode = BAD; z.msg = "invalid bit length repeat"; r = Z_DATA_ERROR; bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } c = c == 16 ? blens[i - 1] : 0; do { blens[i++] = c; }while (--j != 0); index = i; } } tb[0] = -1; { int[] bl = new int[1]; int[] bd = new int[1]; int[] tl = new int[1]; int[] td = new int[1]; bl[0] = 9; // must be <= 9 for lookahead assumptions bd[0] = 6; // must be <= 9 for lookahead assumptions t = table; t = InfTree.inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), blens, bl, bd, tl, td, hufts, z); if (t != Z_OK) { if (t == Z_DATA_ERROR) { blens = null; mode = BAD; } r = t; bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } codes = new InfCodes(bl[0], bd[0], hufts, tl[0], hufts, td[0], z); } blens = null; mode = CODES; goto case CODES; case CODES: bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; if ((r = codes.proc(this, z, r)) != Z_STREAM_END) { return(inflate_flush(z, r)); } r = Z_OK; codes.free(z); p = z.next_in_index; n = z.avail_in; b = bitb; k = bitk; q = write; m = (int)(q < read ? read - q - 1 : end - q); if (last == 0) { mode = TYPE; break; } mode = DRY; goto case DRY; case DRY: write = q; r = inflate_flush(z, r); q = write; m = (int)(q < read ? read - q - 1 : end - q); if (read != write) { bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } mode = DONE; goto case DONE; case DONE: r = Z_STREAM_END; bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); case BAD: r = Z_DATA_ERROR; bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); default: r = Z_STREAM_ERROR; bitb = b; bitk = k; z.avail_in = n; z.total_in += p - z.next_in_index; z.next_in_index = p; write = q; return(inflate_flush(z, r)); } } }
internal int proc(ZStream z, int r) { int num1; int num4 = z.next_in_index; int num5 = z.avail_in; int num2 = this.bitb; int num3 = this.bitk; int num6 = this.write; int num7 = (num6 < this.read) ? ((this.read - num6) - 1) : (this.end - num6); Label_0047: switch (this.mode) { case 0: while (num3 < 3) { if (num5 != 0) { r = 0; } else { this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } num5--; num2 |= (z.next_in[num4++] & 0xff) << (num3 & 0x1f); num3 += 8; } num1 = num2 & 7; this.last = num1 & 1; switch (SupportClass.URShift(num1, 1)) { case 0: num2 = SupportClass.URShift(num2, 3); num3 -= 3; num1 = num3 & 7; num2 = SupportClass.URShift(num2, num1); num3 -= num1; this.mode = 1; goto Label_0047; case 1: { int[] numArray1 = new int[1]; int[] numArray2 = new int[1]; int[][] numArrayArray1 = new int[1][]; int[][] numArrayArray2 = new int[1][]; InfTree.inflate_trees_fixed(numArray1, numArray2, numArrayArray1, numArrayArray2, z); this.codes = new InfCodes(numArray1[0], numArray2[0], numArrayArray1[0], numArrayArray2[0], z); num2 = SupportClass.URShift(num2, 3); num3 -= 3; this.mode = 6; goto Label_0047; } case 2: num2 = SupportClass.URShift(num2, 3); num3 -= 3; this.mode = 3; goto Label_0047; case 3: num2 = SupportClass.URShift(num2, 3); num3 -= 3; this.mode = 9; z.msg = "invalid block type"; r = -3; this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } goto Label_0047; case 1: while (num3 < 0x20) { if (num5 != 0) { r = 0; } else { this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } num5--; num2 |= (z.next_in[num4++] & 0xff) << (num3 & 0x1f); num3 += 8; } if ((SupportClass.URShift(~num2, 0x10) & 0xffff) != (num2 & 0xffff)) { this.mode = 9; z.msg = "invalid stored block lengths"; r = -3; this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } this.left = num2 & 0xffff; num2 = num3 = 0; this.mode = (this.left != 0) ? 2 : ((this.last != 0) ? 7 : 0); goto Label_0047; case 2: if (num5 == 0) { this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } if (num7 == 0) { if ((num6 == this.end) && (this.read != 0)) { num6 = 0; num7 = (num6 < this.read) ? ((this.read - num6) - 1) : (this.end - num6); } if (num7 == 0) { this.write = num6; r = this.inflate_flush(z, r); num6 = this.write; num7 = (num6 < this.read) ? ((this.read - num6) - 1) : (this.end - num6); if ((num6 == this.end) && (this.read != 0)) { num6 = 0; num7 = (num6 < this.read) ? ((this.read - num6) - 1) : (this.end - num6); } if (num7 == 0) { this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } } } r = 0; num1 = this.left; if (num1 > num5) { num1 = num5; } if (num1 > num7) { num1 = num7; } Array.Copy(z.next_in, num4, this.window, num6, num1); num4 += num1; num5 -= num1; num6 += num1; num7 -= num1; this.left -= num1; if (this.left == 0) { this.mode = (this.last != 0) ? 7 : 0; } goto Label_0047; case 3: while (num3 < 14) { if (num5 != 0) { r = 0; } else { this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } num5--; num2 |= (z.next_in[num4++] & 0xff) << (num3 & 0x1f); num3 += 8; } this.table = num1 = num2 & 0x3fff; if (((num1 & 0x1f) > 0x1d) || (((num1 >> 5) & 0x1f) > 0x1d)) { this.mode = 9; z.msg = "too many length or distance symbols"; r = -3; this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } num1 = (0x102 + (num1 & 0x1f)) + ((num1 >> 5) & 0x1f); this.blens = new int[num1]; num2 = SupportClass.URShift(num2, 14); num3 -= 14; this.index = 0; this.mode = 4; goto Label_06E1; case 4: goto Label_06E1; case 5: goto Label_07B9; case 6: goto Label_0B63; case 7: goto Label_0C2C; case 8: goto Label_0CC1; case 9: r = -3; this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); default: r = -2; this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } Label_06E1: if (this.index < (4 + SupportClass.URShift(this.table, 10))) { while (num3 < 3) { if (num5 != 0) { r = 0; } else { this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } num5--; num2 |= (z.next_in[num4++] & 0xff) << (num3 & 0x1f); num3 += 8; } this.blens[InfBlocks.border[this.index++]] = num2 & 7; num2 = SupportClass.URShift(num2, 3); num3 -= 3; goto Label_06E1; } while (this.index < 0x13) { this.blens[InfBlocks.border[this.index++]] = 0; } this.bb[0] = 7; num1 = InfTree.inflate_trees_bits(this.blens, this.bb, this.tb, this.hufts, z); if (num1 != 0) { r = num1; if (r == -3) { this.blens = null; this.mode = 9; } this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } this.index = 0; this.mode = 5; Label_07B9: num1 = this.table; if (this.index < ((0x102 + (num1 & 0x1f)) + ((num1 >> 5) & 0x1f))) { num1 = this.bb[0]; while (num3 < num1) { if (num5 != 0) { r = 0; } else { this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } num5--; num2 |= (z.next_in[num4++] & 0xff) << (num3 & 0x1f); num3 += 8; } int num17 = this.tb[0]; num1 = this.hufts[((this.tb[0] + (num2 & InfBlocks.inflate_mask[num1])) * 3) + 1]; int num10 = this.hufts[((this.tb[0] + (num2 & InfBlocks.inflate_mask[num1])) * 3) + 2]; if (num10 < 0x10) { num2 = SupportClass.URShift(num2, num1); num3 -= num1; this.blens[this.index++] = num10; goto Label_07B9; } int num8 = (num10 == 0x12) ? 7 : (num10 - 14); int num9 = (num10 == 0x12) ? 11 : 3; while (num3 < (num1 + num8)) { if (num5 != 0) { r = 0; } else { this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } num5--; num2 |= (z.next_in[num4++] & 0xff) << (num3 & 0x1f); num3 += 8; } num2 = SupportClass.URShift(num2, num1); num3 -= num1; num9 += num2 & InfBlocks.inflate_mask[num8]; num2 = SupportClass.URShift(num2, num8); num3 -= num8; num8 = this.index; num1 = this.table; if (((num8 + num9) > ((0x102 + (num1 & 0x1f)) + ((num1 >> 5) & 0x1f))) || ((num10 == 0x10) && (num8 < 1))) { this.blens = null; this.mode = 9; z.msg = "invalid bit length repeat"; r = -3; this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } num10 = (num10 == 0x10) ? this.blens[num8 - 1] : 0; do { this.blens[num8++] = num10; }while (--num9 != 0); this.index = num8; goto Label_07B9; } this.tb[0] = -1; int[] numArray3 = new int[1]; int[] numArray4 = new int[1]; int[] numArray5 = new int[1]; int[] numArray6 = new int[1]; numArray3[0] = 9; numArray4[0] = 6; num1 = this.table; num1 = InfTree.inflate_trees_dynamic(0x101 + (num1 & 0x1f), 1 + ((num1 >> 5) & 0x1f), this.blens, numArray3, numArray4, numArray5, numArray6, this.hufts, z); switch (num1) { case 0: this.codes = new InfCodes(numArray3[0], numArray4[0], this.hufts, numArray5[0], this.hufts, numArray6[0], z); this.blens = null; this.mode = 6; goto Label_0B63; case -3: this.blens = null; this.mode = 9; break; } r = num1; this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); Label_0B63: this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; if ((r = this.codes.proc(this, z, r)) != 1) { return(this.inflate_flush(z, r)); } r = 0; this.codes.free(z); num4 = z.next_in_index; num5 = z.avail_in; num2 = this.bitb; num3 = this.bitk; num6 = this.write; num7 = (num6 < this.read) ? ((this.read - num6) - 1) : (this.end - num6); if (this.last == 0) { this.mode = 0; goto Label_0047; } this.mode = 7; Label_0C2C: this.write = num6; r = this.inflate_flush(z, r); num6 = this.write; num7 = (num6 < this.read) ? ((this.read - num6) - 1) : (this.end - num6); if (this.read != this.write) { this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); } this.mode = 8; Label_0CC1: r = 1; this.bitb = num2; this.bitk = num3; z.avail_in = num5; z.total_in += num4 - z.next_in_index; z.next_in_index = num4; this.write = num6; return(this.inflate_flush(z, r)); }