; LLVM IR from indygreg/python-zstandard :: zstd (zstd)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ZSTD_OffsetInfo = type { i32, i32 }
%struct.ZSTD_DCtx_s = type { ptr, ptr, ptr, ptr, %struct.ZSTD_entropyDTables_t, [640 x i32], ptr, ptr, ptr, ptr, i64, %struct.ZSTD_frameHeader, i64, i64, i32, i32, i32, i32, %struct.XXH_NAMESPACEXXH64_state_s, i64, i32, i32, i32, ptr, %struct.ZSTD_customMem, i64, i64, i64, i32, i32, ptr, ptr, i32, i32, i32, ptr, i32, i32, i32, i32, ptr, i64, i64, i64, ptr, i64, i64, i64, i64, i32, i32, i32, %struct.ZSTD_outBuffer_s, ptr, ptr, i32, [65568 x i8], [18 x i8], i64 }
%struct.ZSTD_entropyDTables_t = type { [513 x %struct.ZSTD_seqSymbol], [257 x %struct.ZSTD_seqSymbol], [513 x %struct.ZSTD_seqSymbol], [4097 x i32], [3 x i32], [157 x i32] }
%struct.ZSTD_seqSymbol = type { i16, i8, i8, i32 }
%struct.ZSTD_frameHeader = type { i64, i64, i32, i32, i32, i32, i32, i32, i32 }
%struct.XXH_NAMESPACEXXH64_state_s = type { i64, [4 x i64], [4 x i64], i32, i32, i64 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }
%struct.ZSTD_outBuffer_s = type { ptr, i64, i64 }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ZSTD_isError(i64 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @MEM_32bits() #2

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTD_decompressBlock_internal(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, i32 noundef %5) #1 {
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca %struct.ZSTD_OffsetInfo, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i64 %2, ptr %10, align 8, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i64 %4, ptr %12, align 8, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %25 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %25, ptr %14, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %6
  br label %27

27:                                               ; preds = %26
  br label %28

28:                                               ; preds = %27
  br label %29

29:                                               ; preds = %28
  %30 = load i64, ptr %12, align 8, !tbaa !9
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = call i64 @ZSTD_blockSizeMax(ptr noundef %31)
  %33 = icmp ugt i64 %30, %32
  br i1 %33, label %34, label %47

34:                                               ; preds = %29
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45
  store i64 -72, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %250

47:                                               ; preds = %29
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = load i64, ptr %12, align 8, !tbaa !9
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load i64, ptr %10, align 8, !tbaa !9
  %55 = load i32, ptr %13, align 4, !tbaa !11
  %56 = call i64 @ZSTD_decodeLiteralsBlock(ptr noundef %50, ptr noundef %51, i64 noundef %52, ptr noundef %53, i64 noundef %54, i32 noundef %55)
  store i64 %56, ptr %16, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %49
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  %60 = load i64, ptr %16, align 8, !tbaa !9
  %61 = call i32 @ZSTD_isError(i64 noundef %60)
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %65

63:                                               ; preds = %59
  %64 = load i64, ptr %16, align 8, !tbaa !9
  store i64 %64, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %72

65:                                               ; preds = %59
  %66 = load i64, ptr %16, align 8, !tbaa !9
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 %66
  store ptr %68, ptr %14, align 8, !tbaa !5
  %69 = load i64, ptr %16, align 8, !tbaa !9
  %70 = load i64, ptr %12, align 8, !tbaa !9
  %71 = sub i64 %70, %69
  store i64 %71, ptr %12, align 8, !tbaa !9
  store i32 0, ptr %15, align 4
  br label %72

72:                                               ; preds = %65, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  %73 = load i32, ptr %15, align 4
  switch i32 %73, label %250 [
    i32 0, label %74
  ]

74:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %75 = load i64, ptr %10, align 8, !tbaa !9
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = call i64 @ZSTD_blockSizeMax(ptr noundef %76)
  %78 = icmp ult i64 %75, %77
  br i1 %78, label %79, label %81

79:                                               ; preds = %74
  %80 = load i64, ptr %10, align 8, !tbaa !9
  br label %84

81:                                               ; preds = %74
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = call i64 @ZSTD_blockSizeMax(ptr noundef %82)
  br label %84

84:                                               ; preds = %81, %79
  %85 = phi i64 [ %80, %79 ], [ %83, %81 ]
  store i64 %85, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = load i64, ptr %17, align 8, !tbaa !9
  %88 = call ptr @ZSTD_maybeNullPtrAdd(ptr noundef %86, i64 noundef %87)
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.ZSTD_DCtx_s, ptr %89, i32 0, i32 8
  %91 = load ptr, ptr %90, align 8, !tbaa !13
  %92 = call i64 @ZSTD_totalHistorySize(ptr noundef %88, ptr noundef %91)
  store i64 %92, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  %93 = call i32 @MEM_32bits()
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %99

95:                                               ; preds = %84
  %96 = load i64, ptr %18, align 8, !tbaa !9
  %97 = call i64 @ZSTD_maxShortOffset()
  %98 = icmp ugt i64 %96, %97
  br label %99

99:                                               ; preds = %95, %84
  %100 = phi i1 [ false, %84 ], [ %98, %95 ]
  %101 = zext i1 %100 to i32
  store i32 %101, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.ZSTD_DCtx_s, ptr %102, i32 0, i32 33
  %104 = load i32, ptr %103, align 4, !tbaa !21
  store i32 %104, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = load ptr, ptr %14, align 8, !tbaa !5
  %107 = load i64, ptr %12, align 8, !tbaa !9
  %108 = call i64 @ZSTD_decodeSeqHeaders(ptr noundef %105, ptr noundef %21, ptr noundef %106, i64 noundef %107)
  store i64 %108, ptr %22, align 8, !tbaa !9
  %109 = load i64, ptr %22, align 8, !tbaa !9
  %110 = call i32 @ZSTD_isError(i64 noundef %109)
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %114

112:                                              ; preds = %99
  %113 = load i64, ptr %22, align 8, !tbaa !9
  store i64 %113, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %249

114:                                              ; preds = %99
  %115 = load i64, ptr %22, align 8, !tbaa !9
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = getelementptr inbounds i8, ptr %116, i64 %115
  store ptr %117, ptr %14, align 8, !tbaa !5
  %118 = load i64, ptr %22, align 8, !tbaa !9
  %119 = load i64, ptr %12, align 8, !tbaa !9
  %120 = sub i64 %119, %118
  store i64 %120, ptr %12, align 8, !tbaa !9
  br label %121

121:                                              ; preds = %114
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = icmp eq ptr %122, null
  br i1 %123, label %127, label %124

124:                                              ; preds = %121
  %125 = load i64, ptr %10, align 8, !tbaa !9
  %126 = icmp eq i64 %125, 0
  br i1 %126, label %127, label %143

127:                                              ; preds = %124, %121
  %128 = load i32, ptr %21, align 4, !tbaa !11
  %129 = icmp sgt i32 %128, 0
  br i1 %129, label %130, label %143

130:                                              ; preds = %127
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138
  br label %140

140:                                              ; preds = %139
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  store i64 -70, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %249

143:                                              ; preds = %127, %124
  br label %144

144:                                              ; preds = %143
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  %147 = call i32 @MEM_64bits()
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %167

149:                                              ; preds = %146
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = ptrtoint ptr %150 to i64
  %152 = sub i64 -1, %151
  %153 = icmp ult i64 %152, 1048576
  br i1 %153, label %154, label %167

154:                                              ; preds = %149
  br label %155

155:                                              ; preds = %154
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  store i64 -70, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %249

167:                                              ; preds = %149, %146
  br label %168

168:                                              ; preds = %167
  br label %169

169:                                              ; preds = %168
  %170 = load i32, ptr %19, align 4, !tbaa !11
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %181, label %172

172:                                              ; preds = %169
  %173 = load i32, ptr %20, align 4, !tbaa !11
  %174 = icmp ne i32 %173, 0
  br i1 %174, label %212, label %175

175:                                              ; preds = %172
  %176 = load i64, ptr %18, align 8, !tbaa !9
  %177 = icmp ugt i64 %176, 16777216
  br i1 %177, label %178, label %212

178:                                              ; preds = %175
  %179 = load i32, ptr %21, align 4, !tbaa !11
  %180 = icmp sgt i32 %179, 8
  br i1 %180, label %181, label %212

181:                                              ; preds = %178, %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %182 = load ptr, ptr %8, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.ZSTD_DCtx_s, ptr %182, i32 0, i32 2
  %184 = load ptr, ptr %183, align 8, !tbaa !22
  %185 = load i32, ptr %21, align 4, !tbaa !11
  %186 = call i64 @ZSTD_getOffsetInfo(ptr noundef %184, i32 noundef %185)
  store i64 %186, ptr %23, align 4
  %187 = load i32, ptr %19, align 4, !tbaa !11
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %198

189:                                              ; preds = %181
  %190 = getelementptr inbounds %struct.ZSTD_OffsetInfo, ptr %23, i32 0, i32 1
  %191 = load i32, ptr %190, align 4, !tbaa !23
  %192 = call i32 @MEM_32bits()
  %193 = icmp ne i32 %192, 0
  %194 = zext i1 %193 to i64
  %195 = select i1 %193, i32 25, i32 57
  %196 = icmp ule i32 %191, %195
  br i1 %196, label %197, label %198

197:                                              ; preds = %189
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %198

198:                                              ; preds = %197, %189, %181
  %199 = load i32, ptr %20, align 4, !tbaa !11
  %200 = icmp ne i32 %199, 0
  br i1 %200, label %211, label %201

201:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %202 = call i32 @MEM_64bits()
  %203 = icmp ne i32 %202, 0
  %204 = zext i1 %203 to i64
  %205 = select i1 %203, i32 7, i32 20
  store i32 %205, ptr %24, align 4, !tbaa !11
  %206 = getelementptr inbounds %struct.ZSTD_OffsetInfo, ptr %23, i32 0, i32 0
  %207 = load i32, ptr %206, align 4, !tbaa !25
  %208 = load i32, ptr %24, align 4, !tbaa !11
  %209 = icmp uge i32 %207, %208
  %210 = zext i1 %209 to i32
  store i32 %210, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  br label %211

211:                                              ; preds = %201, %198
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  br label %212

212:                                              ; preds = %211, %178, %175, %172
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.ZSTD_DCtx_s, ptr %213, i32 0, i32 33
  store i32 0, ptr %214, align 4, !tbaa !21
  %215 = load i32, ptr %20, align 4, !tbaa !11
  %216 = icmp ne i32 %215, 0
  br i1 %216, label %217, label %226

217:                                              ; preds = %212
  %218 = load ptr, ptr %8, align 8, !tbaa !5
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = load i64, ptr %10, align 8, !tbaa !9
  %221 = load ptr, ptr %14, align 8, !tbaa !5
  %222 = load i64, ptr %12, align 8, !tbaa !9
  %223 = load i32, ptr %21, align 4, !tbaa !11
  %224 = load i32, ptr %19, align 4, !tbaa !11
  %225 = call i64 @ZSTD_decompressSequencesLong(ptr noundef %218, ptr noundef %219, i64 noundef %220, ptr noundef %221, i64 noundef %222, i32 noundef %223, i32 noundef %224)
  store i64 %225, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %249

226:                                              ; preds = %212
  %227 = load ptr, ptr %8, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.ZSTD_DCtx_s, ptr %227, i32 0, i32 55
  %229 = load i32, ptr %228, align 8, !tbaa !26
  %230 = icmp eq i32 %229, 2
  br i1 %230, label %231, label %240

231:                                              ; preds = %226
  %232 = load ptr, ptr %8, align 8, !tbaa !5
  %233 = load ptr, ptr %9, align 8, !tbaa !5
  %234 = load i64, ptr %10, align 8, !tbaa !9
  %235 = load ptr, ptr %14, align 8, !tbaa !5
  %236 = load i64, ptr %12, align 8, !tbaa !9
  %237 = load i32, ptr %21, align 4, !tbaa !11
  %238 = load i32, ptr %19, align 4, !tbaa !11
  %239 = call i64 @ZSTD_decompressSequencesSplitLitBuffer(ptr noundef %232, ptr noundef %233, i64 noundef %234, ptr noundef %235, i64 noundef %236, i32 noundef %237, i32 noundef %238)
  store i64 %239, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %249

240:                                              ; preds = %226
  %241 = load ptr, ptr %8, align 8, !tbaa !5
  %242 = load ptr, ptr %9, align 8, !tbaa !5
  %243 = load i64, ptr %10, align 8, !tbaa !9
  %244 = load ptr, ptr %14, align 8, !tbaa !5
  %245 = load i64, ptr %12, align 8, !tbaa !9
  %246 = load i32, ptr %21, align 4, !tbaa !11
  %247 = load i32, ptr %19, align 4, !tbaa !11
  %248 = call i64 @ZSTD_decompressSequences(ptr noundef %241, ptr noundef %242, i64 noundef %243, ptr noundef %244, i64 noundef %245, i32 noundef %246, i32 noundef %247)
  store i64 %248, ptr %7, align 8
  store i32 1, ptr %15, align 4
  br label %249

249:                                              ; preds = %240, %231, %217, %166, %142, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  br label %250

250:                                              ; preds = %249, %72, %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %251 = load i64, ptr %7, align 8
  ret i64 %251
}

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_decodeLiteralsBlock(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @ZSTD_decodeSeqHeaders(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_blockSizeMax(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_totalHistorySize(ptr noundef, ptr noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ZSTD_maybeNullPtrAdd(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_maxShortOffset() #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @MEM_64bits() #2

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_getOffsetInfo(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_decompressSequencesLong(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_decompressSequencesSplitLitBuffer(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_decompressSequences(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 29904}
!14 = !{!"ZSTD_DCtx_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !15, i64 32, !7, i64 27324, !6, i64 29888, !6, i64 29896, !6, i64 29904, !6, i64 29912, !10, i64 29920, !16, i64 29928, !10, i64 29976, !10, i64 29984, !12, i64 29992, !12, i64 29996, !12, i64 30000, !12, i64 30004, !18, i64 30008, !10, i64 30096, !12, i64 30104, !12, i64 30108, !12, i64 30112, !6, i64 30120, !19, i64 30128, !10, i64 30152, !10, i64 30160, !10, i64 30168, !12, i64 30176, !12, i64 30180, !6, i64 30184, !6, i64 30192, !12, i64 30200, !12, i64 30204, !12, i64 30208, !6, i64 30216, !12, i64 30224, !12, i64 30228, !12, i64 30232, !12, i64 30236, !6, i64 30240, !10, i64 30248, !10, i64 30256, !10, i64 30264, !6, i64 30272, !10, i64 30280, !10, i64 30288, !10, i64 30296, !10, i64 30304, !12, i64 30312, !12, i64 30316, !12, i64 30320, !20, i64 30328, !6, i64 30352, !6, i64 30360, !12, i64 30368, !7, i64 30372, !7, i64 95940, !10, i64 95960}
!15 = !{!"", !7, i64 0, !7, i64 4104, !7, i64 6160, !7, i64 10264, !7, i64 26652, !7, i64 26664}
!16 = !{!"", !17, i64 0, !17, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40}
!17 = !{!"long long", !7, i64 0}
!18 = !{!"XXH_NAMESPACEXXH64_state_s", !10, i64 0, !7, i64 8, !7, i64 40, !12, i64 72, !12, i64 76, !10, i64 80}
!19 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"ZSTD_outBuffer_s", !6, i64 0, !10, i64 8, !10, i64 16}
!21 = !{!14, !12, i64 30204}
!22 = !{!14, !6, i64 16}
!23 = !{!24, !12, i64 4}
!24 = !{!"", !12, i64 0, !12, i64 4}
!25 = !{!24, !12, i64 0}
!26 = !{!14, !12, i64 30368}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @ZSTD_isError(i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @MEM_32bits() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTD_decompressBlock_internal(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4, i32 noundef %5) local_unnamed_addr #1 {
  %7 = alloca i32, align 4
  %8 = tail call i64 @ZSTD_blockSizeMax(ptr noundef %0)
  %9 = icmp ult i64 %8, %4
  br i1 %9, label %81, label %10

10:                                               ; preds = %6
  %11 = tail call i64 @ZSTD_decodeLiteralsBlock(ptr noundef %0, ptr noundef %3, i64 noundef %4, ptr noundef %1, i64 noundef %2, i32 noundef %5)
  %12 = tail call i32 @ZSTD_isError(i64 noundef %11)
  %.not = icmp eq i32 %12, 0
  %13 = getelementptr inbounds i8, ptr %3, i64 %11
  %14 = sub i64 %4, %11
  br i1 %.not, label %15, label %81

15:                                               ; preds = %10
  %16 = tail call i64 @ZSTD_blockSizeMax(ptr noundef %0)
  %17 = icmp ugt i64 %16, %2
  br i1 %17, label %20, label %18

18:                                               ; preds = %15
  %19 = tail call i64 @ZSTD_blockSizeMax(ptr noundef %0)
  br label %20

20:                                               ; preds = %15, %18
  %21 = phi i64 [ %19, %18 ], [ %2, %15 ]
  %22 = tail call ptr @ZSTD_maybeNullPtrAdd(ptr noundef %1, i64 noundef %21)
  %23 = getelementptr inbounds i8, ptr %0, i64 29904
  %24 = load ptr, ptr %23, align 8, !tbaa !5
  %25 = tail call i64 @ZSTD_totalHistorySize(ptr noundef %22, ptr noundef %24)
  %26 = tail call i32 @MEM_32bits()
  %.not81 = icmp eq i32 %26, 0
  br i1 %.not81, label %30, label %27

27:                                               ; preds = %20
  %28 = tail call i64 @ZSTD_maxShortOffset()
  %29 = icmp ugt i64 %25, %28
  br label %30

30:                                               ; preds = %27, %20
  %31 = phi i1 [ false, %20 ], [ %29, %27 ]
  %32 = getelementptr inbounds i8, ptr %0, i64 30204
  %33 = load i32, ptr %32, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %34 = call i64 @ZSTD_decodeSeqHeaders(ptr noundef nonnull %0, ptr noundef nonnull %7, ptr noundef %13, i64 noundef %14)
  %35 = call i32 @ZSTD_isError(i64 noundef %34)
  %.not82 = icmp eq i32 %35, 0
  br i1 %.not82, label %36, label %80

36:                                               ; preds = %30
  %37 = getelementptr inbounds i8, ptr %13, i64 %34
  %38 = sub i64 %14, %34
  %39 = icmp eq ptr %1, null
  %40 = icmp eq i64 %2, 0
  %or.cond = or i1 %39, %40
  %41 = load i32, ptr %7, align 4
  %42 = icmp sgt i32 %41, 0
  %or.cond3 = select i1 %or.cond, i1 %42, i1 false
  br i1 %or.cond3, label %80, label %43

43:                                               ; preds = %36
  %44 = call i32 @MEM_64bits()
  %.not83 = icmp ne i32 %44, 0
  %45 = icmp ugt ptr %1, inttoptr (i64 -1048577 to ptr)
  %or.cond89 = and i1 %45, %.not83
  br i1 %or.cond89, label %80, label %46

46:                                               ; preds = %43
  br i1 %31, label %55, label %47

47:                                               ; preds = %46
  %48 = icmp eq i32 %33, 0
  %49 = icmp ugt i64 %25, 16777216
  %or.cond5 = select i1 %48, i1 %49, i1 false
  %50 = load i32, ptr %7, align 4
  %51 = icmp sgt i32 %50, 8
  %or.cond7 = select i1 %or.cond5, i1 %51, i1 false
  br i1 %or.cond7, label %.thread93, label %67

.thread93:                                        ; preds = %47
  %52 = getelementptr inbounds i8, ptr %0, i64 16
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = call i64 @ZSTD_getOffsetInfo(ptr noundef %53, i32 noundef %50)
  br label %62

55:                                               ; preds = %46
  %56 = getelementptr inbounds i8, ptr %0, i64 16
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = load i32, ptr %7, align 4, !tbaa !20
  %59 = call i64 @ZSTD_getOffsetInfo(ptr noundef %57, i32 noundef %58)
  %.sroa.4.0.extract.shift = lshr i64 %59, 32
  %.sroa.4.0.extract.trunc = trunc nuw i64 %.sroa.4.0.extract.shift to i32
  %60 = call i32 @MEM_32bits()
  %.not84 = icmp eq i32 %60, 0
  %61 = select i1 %.not84, i32 57, i32 25
  %.not85 = icmp ult i32 %61, %.sroa.4.0.extract.trunc
  %spec.select = zext i1 %.not85 to i32
  %.not86 = icmp eq i32 %33, 0
  br i1 %.not86, label %62, label %.thread99

.thread99:                                        ; preds = %55
  store i32 0, ptr %32, align 4, !tbaa !18
  br label %68

62:                                               ; preds = %.thread93, %55
  %.07798 = phi i32 [ 0, %.thread93 ], [ %spec.select, %55 ]
  %.sroa.0.0.extract.trunc9197.in = phi i64 [ %54, %.thread93 ], [ %59, %55 ]
  %.sroa.0.0.extract.trunc9197 = trunc i64 %.sroa.0.0.extract.trunc9197.in to i32
  %63 = call i32 @MEM_64bits()
  %.not87 = icmp eq i32 %63, 0
  %64 = select i1 %.not87, i32 20, i32 7
  %65 = icmp ule i32 %64, %.sroa.0.0.extract.trunc9197
  %66 = zext i1 %65 to i32
  br label %67

67:                                               ; preds = %62, %47
  %.178 = phi i32 [ 0, %47 ], [ %.07798, %62 ]
  %.176 = phi i32 [ %33, %47 ], [ %66, %62 ]
  store i32 0, ptr %32, align 4, !tbaa !18
  %.not88 = icmp eq i32 %.176, 0
  br i1 %.not88, label %71, label %68

68:                                               ; preds = %.thread99, %67
  %.178103 = phi i32 [ %spec.select, %.thread99 ], [ %.178, %67 ]
  %69 = load i32, ptr %7, align 4, !tbaa !20
  %70 = call i64 @ZSTD_decompressSequencesLong(ptr noundef nonnull %0, ptr noundef %1, i64 noundef %2, ptr noundef %37, i64 noundef %38, i32 noundef %69, i32 noundef %.178103)
  br label %80

71:                                               ; preds = %67
  %72 = getelementptr inbounds i8, ptr %0, i64 30368
  %73 = load i32, ptr %72, align 8, !tbaa !21
  %74 = icmp eq i32 %73, 2
  %75 = load i32, ptr %7, align 4, !tbaa !20
  br i1 %74, label %76, label %78

76:                                               ; preds = %71
  %77 = call i64 @ZSTD_decompressSequencesSplitLitBuffer(ptr noundef nonnull %0, ptr noundef %1, i64 noundef %2, ptr noundef %37, i64 noundef %38, i32 noundef %75, i32 noundef %.178)
  br label %80

78:                                               ; preds = %71
  %79 = call i64 @ZSTD_decompressSequences(ptr noundef nonnull %0, ptr noundef %1, i64 noundef %2, ptr noundef %37, i64 noundef %38, i32 noundef %75, i32 noundef %.178)
  br label %80

80:                                               ; preds = %43, %36, %30, %78, %76, %68
  %.1 = phi i64 [ %70, %68 ], [ %77, %76 ], [ %79, %78 ], [ %34, %30 ], [ -70, %36 ], [ -70, %43 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  br label %81

81:                                               ; preds = %6, %10, %80
  %.2 = phi i64 [ %.1, %80 ], [ %11, %10 ], [ -72, %6 ]
  ret i64 %.2
}

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_decodeLiteralsBlock(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @ZSTD_decodeSeqHeaders(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_blockSizeMax(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_totalHistorySize(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ZSTD_maybeNullPtrAdd(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_maxShortOffset() local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @MEM_64bits() local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_getOffsetInfo(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_decompressSequencesLong(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_decompressSequencesSplitLitBuffer(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTD_decompressSequences(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 29904}
!6 = !{!"ZSTD_DCtx_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !8, i64 27324, !7, i64 29888, !7, i64 29896, !7, i64 29904, !7, i64 29912, !11, i64 29920, !12, i64 29928, !11, i64 29976, !11, i64 29984, !14, i64 29992, !14, i64 29996, !14, i64 30000, !14, i64 30004, !15, i64 30008, !11, i64 30096, !14, i64 30104, !14, i64 30108, !14, i64 30112, !7, i64 30120, !16, i64 30128, !11, i64 30152, !11, i64 30160, !11, i64 30168, !14, i64 30176, !14, i64 30180, !7, i64 30184, !7, i64 30192, !14, i64 30200, !14, i64 30204, !14, i64 30208, !7, i64 30216, !14, i64 30224, !14, i64 30228, !14, i64 30232, !14, i64 30236, !7, i64 30240, !11, i64 30248, !11, i64 30256, !11, i64 30264, !7, i64 30272, !11, i64 30280, !11, i64 30288, !11, i64 30296, !11, i64 30304, !14, i64 30312, !14, i64 30316, !14, i64 30320, !17, i64 30328, !7, i64 30352, !7, i64 30360, !14, i64 30368, !8, i64 30372, !8, i64 95940, !11, i64 95960}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !8, i64 0, !8, i64 4104, !8, i64 6160, !8, i64 10264, !8, i64 26652, !8, i64 26664}
!11 = !{!"long", !8, i64 0}
!12 = !{!"", !13, i64 0, !13, i64 8, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40}
!13 = !{!"long long", !8, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!"XXH_NAMESPACEXXH64_state_s", !11, i64 0, !8, i64 8, !8, i64 40, !14, i64 72, !14, i64 76, !11, i64 80}
!16 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16}
!17 = !{!"ZSTD_outBuffer_s", !7, i64 0, !11, i64 8, !11, i64 16}
!18 = !{!6, !14, i64 30204}
!19 = !{!6, !7, i64 16}
!20 = !{!14, !14, i64 0}
!21 = !{!6, !14, i64 30368}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass