                 } else {
                     state -= 6
                 }
-                uncompressedSize -= 1
+
                 continue
             }
 

        var dictionarySize = pointerData.intFromAlingedBytes(count: 4)
        dictionarySize = dictionarySize < (1 << 12) ? 1 << 12 : dictionarySize

        print("lc: \(lc), lp: \(lp), pb: \(pb), dictionarySize: \(dictionarySize)")

        /// Size of uncompressed data. -1 means it is unknown.
        var uncompressedSize = pointerData.intFromAlingedBytes(count: 8)

                rep1 = rep0
                len = lenDecoder.decode(with: &rangeDecoder, posState: posState, pointerData: &pointerData)
                state = state < 7 ? 7 : 10

                // DECODE DISTANCE:
                var lenState = len
                if lenState > Constants.numLenToPosStates - 1 {
                    lenState = Constants.numLenToPosStates - 1
                }

                let posSlot = posSlotDecoder[lenState].decode(with: &rangeDecoder, pointerData: &pointerData)
                if posSlot < 4 {
                    rep0 = posSlot
                } else {
                    let numDirectBits = (posSlot >> 1) - 1
                    var dist = ((2 | (posSlot & 1)) << numDirectBits)
                    if posSlot < Constants.endPosModelIndex {
                        // TODO: Probably incorrect first argument.
                        dist += bitTreeReverseDecode(probs: &posDecoders, bits: numDirectBits, rangeDecoder: &rangeDecoder, pointerData: &pointerData)
                    } else {
                        dist += rangeDecoder.decode(directBits: (numDirectBits - Constants.numAlignBits) << Constants.numAlignBits,
                                                    pointerData: &pointerData)
                        dist += alignDecoder.reverseDecode(with: &rangeDecoder, pointerData: &pointerData)
                    }
                    rep0 = dist
                }
                // END.

                // Check if finished marker is encoutered.
                if rep0 == 0xFFFFFFFF {
                    if rangeDecoder.isFinishedOK {
