; LLVM IR from catid/Zpng :: zstd (zstdmt_compress)

; 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_CCtx_params_s = type { i32, %struct.ZSTD_compressionParameters, %struct.ZSTD_frameParameters, i32, i32, i32, i32, i32, i32, %struct.ldmParams_t, %struct.ZSTD_customMem }
%struct.ZSTD_compressionParameters = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_frameParameters = type { i32, i32, i32 }
%struct.ldmParams_t = type { i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }
%struct.ZSTDMT_CCtx_s = type { ptr, ptr, ptr, ptr, ptr, %struct.ZSTD_CCtx_params_s, i64, i64, %struct.roundBuff_t, %struct.inBuff_t, i32, %struct.serialState_t, i32, i32, i32, i32, i32, i32, i64, i64, i64, %struct.ZSTD_customMem, ptr, ptr }
%struct.roundBuff_t = type { ptr, i64, i64 }
%struct.inBuff_t = type { %struct.range_t, %struct.buffer_s, i64 }
%struct.range_t = type { ptr, i64 }
%struct.buffer_s = type { ptr, i64 }
%struct.serialState_t = type { i32, i32, %struct.ZSTD_CCtx_params_s, %struct.ldmState_t, %struct.XXH64_state_s, i32, i32, i32, %struct.ZSTD_window_t }
%struct.ldmState_t = type { %struct.ZSTD_window_t, ptr, ptr, i64 }
%struct.XXH64_state_s = type { i64, i64, i64, i64, i64, [4 x i64], i32, [2 x i32] }
%struct.ZSTD_window_t = type { ptr, ptr, ptr, i32, i32 }
%struct.ZSTDMT_CCtxPool = type { i32, i32, i32, %struct.ZSTD_customMem, [1 x ptr] }
%struct.ZSTD_outBuffer_s = type { ptr, i64, i64 }
%struct.ZSTD_inBuffer_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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

declare i32 @ZSTD_isError(i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTDMT_compress_advanced_internal(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8) #3

declare i64 @ZSTD_compressBound(i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTDMT_compressStream_generic(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #3 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %17, i32 0, i32 12
  %19 = load i32, ptr %18, align 8, !tbaa !11
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %32

21:                                               ; preds = %4
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %22, i32 0, i32 3
  %24 = load ptr, ptr %23, align 8, !tbaa !28
  %25 = getelementptr inbounds %struct.ZSTDMT_CCtxPool, ptr %24, i32 0, i32 4
  %26 = getelementptr inbounds [1 x ptr], ptr %25, i64 0, i64 0
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = call i64 @ZSTD_compressStream_generic(ptr noundef %27, ptr noundef %28, ptr noundef %29, i32 noundef %30)
  store i64 %31, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %327

32:                                               ; preds = %4
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %33, i32 0, i32 16
  %35 = load i32, ptr %34, align 8, !tbaa !29
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %41

37:                                               ; preds = %32
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %37
  store i64 -60, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %327

41:                                               ; preds = %37, %32
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %42, i32 0, i32 15
  %44 = load i32, ptr %43, align 4, !tbaa !30
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %134

46:                                               ; preds = %41
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %47, i32 0, i32 9
  %49 = getelementptr inbounds %struct.inBuff_t, ptr %48, i32 0, i32 2
  %50 = load i64, ptr %49, align 8, !tbaa !31
  %51 = icmp eq i64 %50, 0
  br i1 %51, label %52, label %134

52:                                               ; preds = %46
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %53, i32 0, i32 10
  %55 = load i32, ptr %54, align 8, !tbaa !32
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %134, label %57

57:                                               ; preds = %52
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = icmp eq i32 %58, 2
  br i1 %59, label %60, label %134

60:                                               ; preds = %57
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ZSTD_outBuffer_s, ptr %61, i32 0, i32 1
  %63 = load i64, ptr %62, align 8, !tbaa !33
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ZSTD_outBuffer_s, ptr %64, i32 0, i32 2
  %66 = load i64, ptr %65, align 8, !tbaa !35
  %67 = sub i64 %63, %66
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %68, i32 0, i32 1
  %70 = load i64, ptr %69, align 8, !tbaa !36
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %71, i32 0, i32 2
  %73 = load i64, ptr %72, align 8, !tbaa !38
  %74 = sub i64 %70, %73
  %75 = call i64 @ZSTD_compressBound(i64 noundef %74)
  %76 = icmp uge i64 %67, %75
  br i1 %76, label %77, label %134

77:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ZSTD_outBuffer_s, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !39
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ZSTD_outBuffer_s, ptr %82, i32 0, i32 2
  %84 = load i64, ptr %83, align 8, !tbaa !35
  %85 = getelementptr inbounds i8, ptr %81, i64 %84
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.ZSTD_outBuffer_s, ptr %86, i32 0, i32 1
  %88 = load i64, ptr %87, align 8, !tbaa !33
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.ZSTD_outBuffer_s, ptr %89, i32 0, i32 2
  %91 = load i64, ptr %90, align 8, !tbaa !35
  %92 = sub i64 %88, %91
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !40
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %96, i32 0, i32 2
  %98 = load i64, ptr %97, align 8, !tbaa !38
  %99 = getelementptr inbounds i8, ptr %95, i64 %98
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %100, i32 0, i32 1
  %102 = load i64, ptr %101, align 8, !tbaa !36
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %103, i32 0, i32 2
  %105 = load i64, ptr %104, align 8, !tbaa !38
  %106 = sub i64 %102, %105
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %107, i32 0, i32 23
  %109 = load ptr, ptr %108, align 8, !tbaa !41
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %110, i32 0, i32 5
  %112 = call i64 @ZSTDMT_compress_advanced_internal(ptr noundef %78, ptr noundef %85, i64 noundef %92, ptr noundef %99, i64 noundef %106, ptr noundef %109, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %111)
  store i64 %112, ptr %12, align 8, !tbaa !42
  %113 = load i64, ptr %12, align 8, !tbaa !42
  %114 = call i32 @ZSTD_isError(i64 noundef %113)
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %118

116:                                              ; preds = %77
  %117 = load i64, ptr %12, align 8, !tbaa !42
  store i64 %117, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %133

118:                                              ; preds = %77
  %119 = load ptr, ptr %8, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %119, i32 0, i32 1
  %121 = load i64, ptr %120, align 8, !tbaa !36
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %122, i32 0, i32 2
  store i64 %121, ptr %123, align 8, !tbaa !38
  %124 = load i64, ptr %12, align 8, !tbaa !42
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.ZSTD_outBuffer_s, ptr %125, i32 0, i32 2
  %127 = load i64, ptr %126, align 8, !tbaa !35
  %128 = add i64 %127, %124
  store i64 %128, ptr %126, align 8, !tbaa !35
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %129, i32 0, i32 17
  store i32 1, ptr %130, align 4, !tbaa !43
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %131, i32 0, i32 16
  store i32 1, ptr %132, align 8, !tbaa !29
  store i64 0, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %133

133:                                              ; preds = %118, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %327

134:                                              ; preds = %60, %57, %52, %46, %41
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %135, i32 0, i32 10
  %137 = load i32, ptr %136, align 8, !tbaa !32
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %248, label %139

139:                                              ; preds = %134
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %140, i32 0, i32 1
  %142 = load i64, ptr %141, align 8, !tbaa !36
  %143 = load ptr, ptr %8, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %143, i32 0, i32 2
  %145 = load i64, ptr %144, align 8, !tbaa !38
  %146 = icmp ugt i64 %142, %145
  br i1 %146, label %147, label %248

147:                                              ; preds = %139
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %148, i32 0, i32 9
  %150 = getelementptr inbounds %struct.inBuff_t, ptr %149, i32 0, i32 1
  %151 = getelementptr inbounds %struct.buffer_s, ptr %150, i32 0, i32 0
  %152 = load ptr, ptr %151, align 8, !tbaa !44
  %153 = icmp eq ptr %152, null
  br i1 %153, label %154, label %160

154:                                              ; preds = %147
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = call i32 @ZSTDMT_tryGetInputRange(ptr noundef %155)
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  br label %159

159:                                              ; preds = %158, %154
  br label %160

160:                                              ; preds = %159, %147
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %161, i32 0, i32 9
  %163 = getelementptr inbounds %struct.inBuff_t, ptr %162, i32 0, i32 1
  %164 = getelementptr inbounds %struct.buffer_s, ptr %163, i32 0, i32 0
  %165 = load ptr, ptr %164, align 8, !tbaa !44
  %166 = icmp ne ptr %165, null
  br i1 %166, label %167, label %235

167:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %168 = load ptr, ptr %8, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %168, i32 0, i32 1
  %170 = load i64, ptr %169, align 8, !tbaa !36
  %171 = load ptr, ptr %8, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %171, i32 0, i32 2
  %173 = load i64, ptr %172, align 8, !tbaa !38
  %174 = sub i64 %170, %173
  %175 = load ptr, ptr %6, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %175, i32 0, i32 6
  %177 = load i64, ptr %176, align 8, !tbaa !45
  %178 = load ptr, ptr %6, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %178, i32 0, i32 9
  %180 = getelementptr inbounds %struct.inBuff_t, ptr %179, i32 0, i32 2
  %181 = load i64, ptr %180, align 8, !tbaa !31
  %182 = sub i64 %177, %181
  %183 = icmp ult i64 %174, %182
  br i1 %183, label %184, label %192

184:                                              ; preds = %167
  %185 = load ptr, ptr %8, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %185, i32 0, i32 1
  %187 = load i64, ptr %186, align 8, !tbaa !36
  %188 = load ptr, ptr %8, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %188, i32 0, i32 2
  %190 = load i64, ptr %189, align 8, !tbaa !38
  %191 = sub i64 %187, %190
  br label %201

192:                                              ; preds = %167
  %193 = load ptr, ptr %6, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %193, i32 0, i32 6
  %195 = load i64, ptr %194, align 8, !tbaa !45
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %196, i32 0, i32 9
  %198 = getelementptr inbounds %struct.inBuff_t, ptr %197, i32 0, i32 2
  %199 = load i64, ptr %198, align 8, !tbaa !31
  %200 = sub i64 %195, %199
  br label %201

201:                                              ; preds = %192, %184
  %202 = phi i64 [ %191, %184 ], [ %200, %192 ]
  store i64 %202, ptr %13, align 8, !tbaa !42
  %203 = load ptr, ptr %6, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %203, i32 0, i32 9
  %205 = getelementptr inbounds %struct.inBuff_t, ptr %204, i32 0, i32 1
  %206 = getelementptr inbounds %struct.buffer_s, ptr %205, i32 0, i32 0
  %207 = load ptr, ptr %206, align 8, !tbaa !44
  %208 = load ptr, ptr %6, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %208, i32 0, i32 9
  %210 = getelementptr inbounds %struct.inBuff_t, ptr %209, i32 0, i32 2
  %211 = load i64, ptr %210, align 8, !tbaa !31
  %212 = getelementptr inbounds i8, ptr %207, i64 %211
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %213, i32 0, i32 0
  %215 = load ptr, ptr %214, align 8, !tbaa !40
  %216 = load ptr, ptr %8, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %216, i32 0, i32 2
  %218 = load i64, ptr %217, align 8, !tbaa !38
  %219 = getelementptr inbounds i8, ptr %215, i64 %218
  %220 = load i64, ptr %13, align 8, !tbaa !42
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %212, ptr align 1 %219, i64 %220, i1 false)
  %221 = load i64, ptr %13, align 8, !tbaa !42
  %222 = load ptr, ptr %8, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %222, i32 0, i32 2
  %224 = load i64, ptr %223, align 8, !tbaa !38
  %225 = add i64 %224, %221
  store i64 %225, ptr %223, align 8, !tbaa !38
  %226 = load i64, ptr %13, align 8, !tbaa !42
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %227, i32 0, i32 9
  %229 = getelementptr inbounds %struct.inBuff_t, ptr %228, i32 0, i32 2
  %230 = load i64, ptr %229, align 8, !tbaa !31
  %231 = add i64 %230, %226
  store i64 %231, ptr %229, align 8, !tbaa !31
  %232 = load i64, ptr %13, align 8, !tbaa !42
  %233 = icmp ugt i64 %232, 0
  %234 = zext i1 %233 to i32
  store i32 %234, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %235

235:                                              ; preds = %201, %160
  %236 = load ptr, ptr %8, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %236, i32 0, i32 2
  %238 = load i64, ptr %237, align 8, !tbaa !38
  %239 = load ptr, ptr %8, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %239, i32 0, i32 1
  %241 = load i64, ptr %240, align 8, !tbaa !36
  %242 = icmp ult i64 %238, %241
  br i1 %242, label %243, label %247

243:                                              ; preds = %235
  %244 = load i32, ptr %9, align 4, !tbaa !9
  %245 = icmp eq i32 %244, 2
  br i1 %245, label %246, label %247

246:                                              ; preds = %243
  store i32 1, ptr %9, align 4, !tbaa !9
  br label %247

247:                                              ; preds = %246, %243, %235
  br label %248

248:                                              ; preds = %247, %139, %134
  %249 = load ptr, ptr %6, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %249, i32 0, i32 10
  %251 = load i32, ptr %250, align 8, !tbaa !32
  %252 = icmp ne i32 %251, 0
  br i1 %252, label %279, label %253

253:                                              ; preds = %248
  %254 = load ptr, ptr %6, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %254, i32 0, i32 9
  %256 = getelementptr inbounds %struct.inBuff_t, ptr %255, i32 0, i32 2
  %257 = load i64, ptr %256, align 8, !tbaa !31
  %258 = load ptr, ptr %6, align 8, !tbaa !5
  %259 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %258, i32 0, i32 6
  %260 = load i64, ptr %259, align 8, !tbaa !45
  %261 = icmp uge i64 %257, %260
  br i1 %261, label %279, label %262

262:                                              ; preds = %253
  %263 = load i32, ptr %9, align 4, !tbaa !9
  %264 = icmp ne i32 %263, 0
  br i1 %264, label %265, label %271

265:                                              ; preds = %262
  %266 = load ptr, ptr %6, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %266, i32 0, i32 9
  %268 = getelementptr inbounds %struct.inBuff_t, ptr %267, i32 0, i32 2
  %269 = load i64, ptr %268, align 8, !tbaa !31
  %270 = icmp ugt i64 %269, 0
  br i1 %270, label %279, label %271

271:                                              ; preds = %265, %262
  %272 = load i32, ptr %9, align 4, !tbaa !9
  %273 = icmp eq i32 %272, 2
  br i1 %273, label %274, label %300

274:                                              ; preds = %271
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %275, i32 0, i32 16
  %277 = load i32, ptr %276, align 8, !tbaa !29
  %278 = icmp ne i32 %277, 0
  br i1 %278, label %300, label %279

279:                                              ; preds = %274, %265, %253, %248
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %280 = load ptr, ptr %6, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %280, i32 0, i32 9
  %282 = getelementptr inbounds %struct.inBuff_t, ptr %281, i32 0, i32 2
  %283 = load i64, ptr %282, align 8, !tbaa !31
  store i64 %283, ptr %14, align 8, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %284 = load ptr, ptr %6, align 8, !tbaa !5
  %285 = load i64, ptr %14, align 8, !tbaa !42
  %286 = load i32, ptr %9, align 4, !tbaa !9
  %287 = call i64 @ZSTDMT_createCompressionJob(ptr noundef %284, i64 noundef %285, i32 noundef %286)
  store i64 %287, ptr %15, align 8, !tbaa !42
  %288 = load i64, ptr %15, align 8, !tbaa !42
  %289 = call i32 @ERR_isError(i64 noundef %288)
  %290 = icmp ne i32 %289, 0
  br i1 %290, label %291, label %293

291:                                              ; preds = %279
  %292 = load i64, ptr %15, align 8, !tbaa !42
  store i64 %292, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %294

293:                                              ; preds = %279
  store i32 0, ptr %11, align 4
  br label %294

294:                                              ; preds = %293, %291
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  %295 = load i32, ptr %11, align 4
  switch i32 %295, label %297 [
    i32 0, label %296
  ]

296:                                              ; preds = %294
  store i32 0, ptr %11, align 4
  br label %297

297:                                              ; preds = %296, %294
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %298 = load i32, ptr %11, align 4
  switch i32 %298, label %327 [
    i32 0, label %299
  ]

299:                                              ; preds = %297
  br label %300

300:                                              ; preds = %299, %274, %271
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %301 = load ptr, ptr %6, align 8, !tbaa !5
  %302 = load ptr, ptr %7, align 8, !tbaa !5
  %303 = load i32, ptr %10, align 4, !tbaa !9
  %304 = icmp ne i32 %303, 0
  %305 = xor i1 %304, true
  %306 = zext i1 %305 to i32
  %307 = load i32, ptr %9, align 4, !tbaa !9
  %308 = call i64 @ZSTDMT_flushProduced(ptr noundef %301, ptr noundef %302, i32 noundef %306, i32 noundef %307)
  store i64 %308, ptr %16, align 8, !tbaa !42
  %309 = load ptr, ptr %8, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %309, i32 0, i32 2
  %311 = load i64, ptr %310, align 8, !tbaa !38
  %312 = load ptr, ptr %8, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct.ZSTD_inBuffer_s, ptr %312, i32 0, i32 1
  %314 = load i64, ptr %313, align 8, !tbaa !36
  %315 = icmp ult i64 %311, %314
  br i1 %315, label %316, label %324

316:                                              ; preds = %300
  %317 = load i64, ptr %16, align 8, !tbaa !42
  %318 = icmp ugt i64 %317, 1
  br i1 %318, label %319, label %321

319:                                              ; preds = %316
  %320 = load i64, ptr %16, align 8, !tbaa !42
  br label %322

321:                                              ; preds = %316
  br label %322

322:                                              ; preds = %321, %319
  %323 = phi i64 [ %320, %319 ], [ 1, %321 ]
  store i64 %323, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %326

324:                                              ; preds = %300
  %325 = load i64, ptr %16, align 8, !tbaa !42
  store i64 %325, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %326

326:                                              ; preds = %324, %322
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %327

327:                                              ; preds = %326, %297, %133, %40, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  %328 = load i64, ptr %5, align 8
  ret i64 %328
}

declare i64 @ZSTD_compressStream_generic(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @ZSTDMT_tryGetInputRange(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden i32 @ERR_isError(i64 noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 #4 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 568}
!12 = !{!"ZSTDMT_CCtx_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !18, i64 160, !18, i64 168, !19, i64 176, !20, i64 200, !10, i64 240, !23, i64 248, !10, i64 568, !10, i64 572, !10, i64 576, !10, i64 580, !10, i64 584, !10, i64 588, !27, i64 592, !27, i64 600, !27, i64 608, !17, i64 616, !6, i64 640, !6, i64 648}
!13 = !{!"ZSTD_CCtx_params_s", !10, i64 0, !14, i64 4, !15, i64 32, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !16, i64 68, !17, i64 96}
!14 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!15 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8}
!16 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!17 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"long", !7, i64 0}
!19 = !{!"", !6, i64 0, !18, i64 8, !18, i64 16}
!20 = !{!"", !21, i64 0, !22, i64 16, !18, i64 32}
!21 = !{!"", !6, i64 0, !18, i64 8}
!22 = !{!"buffer_s", !6, i64 0, !18, i64 8}
!23 = !{!"", !10, i64 0, !10, i64 4, !13, i64 8, !24, i64 128, !26, i64 184, !10, i64 272, !10, i64 276, !10, i64 280, !25, i64 288}
!24 = !{!"", !25, i64 0, !6, i64 32, !6, i64 40, !18, i64 48}
!25 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28}
!26 = !{!"XXH64_state_s", !27, i64 0, !27, i64 8, !27, i64 16, !27, i64 24, !27, i64 32, !7, i64 40, !10, i64 72, !7, i64 76}
!27 = !{!"long long", !7, i64 0}
!28 = !{!12, !6, i64 24}
!29 = !{!12, !10, i64 584}
!30 = !{!12, !10, i64 580}
!31 = !{!12, !18, i64 232}
!32 = !{!12, !10, i64 240}
!33 = !{!34, !18, i64 8}
!34 = !{!"ZSTD_outBuffer_s", !6, i64 0, !18, i64 8, !18, i64 16}
!35 = !{!34, !18, i64 16}
!36 = !{!37, !18, i64 8}
!37 = !{!"ZSTD_inBuffer_s", !6, i64 0, !18, i64 8, !18, i64 16}
!38 = !{!37, !18, i64 16}
!39 = !{!34, !6, i64 0}
!40 = !{!37, !6, i64 0}
!41 = !{!12, !6, i64 648}
!42 = !{!18, !18, i64 0}
!43 = !{!12, !10, i64 588}
!44 = !{!12, !6, i64 216}
!45 = !{!12, !18, i64 160}


; 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"

%struct.ZSTD_CCtx_params_s = type { i32, %struct.ZSTD_compressionParameters, %struct.ZSTD_frameParameters, i32, i32, i32, i32, i32, i32, %struct.ldmParams_t, %struct.ZSTD_customMem }
%struct.ZSTD_compressionParameters = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_frameParameters = type { i32, i32, i32 }
%struct.ldmParams_t = type { i32, i32, i32, i32, i32, i32 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

declare i32 @ZSTD_isError(i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i64 @ZSTDMT_compress_advanced_internal(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8) local_unnamed_addr #2

declare i64 @ZSTD_compressBound(i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTDMT_compressStream_generic(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 568
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %13, label %7

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = load ptr, ptr %8, align 8, !tbaa !26
  %10 = getelementptr inbounds i8, ptr %9, i64 40
  %11 = load ptr, ptr %10, align 8, !tbaa !27
  %12 = tail call i64 @ZSTD_compressStream_generic(ptr noundef %11, ptr noundef %1, ptr noundef %2, i32 noundef %3) #4
  br label %123

13:                                               ; preds = %4
  %14 = getelementptr inbounds i8, ptr %0, i64 584
  %15 = load i32, ptr %14, align 8, !tbaa !28
  %16 = icmp ne i32 %15, 0
  %17 = icmp eq i32 %3, 0
  %or.cond = and i1 %17, %16
  br i1 %or.cond, label %123, label %18

18:                                               ; preds = %13
  %19 = getelementptr inbounds i8, ptr %0, i64 580
  %20 = load i32, ptr %19, align 4, !tbaa !29
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %64

22:                                               ; preds = %18
  %23 = getelementptr inbounds i8, ptr %0, i64 232
  %24 = load i64, ptr %23, align 8, !tbaa !30
  %25 = icmp eq i64 %24, 0
  br i1 %25, label %26, label %64

26:                                               ; preds = %22
  %27 = getelementptr inbounds i8, ptr %0, i64 240
  %28 = load i32, ptr %27, align 8, !tbaa !31
  %29 = icmp eq i32 %28, 0
  %30 = icmp eq i32 %3, 2
  %or.cond4 = and i1 %30, %29
  br i1 %or.cond4, label %31, label %64

31:                                               ; preds = %26
  %32 = getelementptr inbounds i8, ptr %1, i64 8
  %33 = load i64, ptr %32, align 8, !tbaa !32
  %34 = getelementptr inbounds i8, ptr %1, i64 16
  %35 = load i64, ptr %34, align 8, !tbaa !34
  %36 = sub i64 %33, %35
  %37 = getelementptr inbounds i8, ptr %2, i64 8
  %38 = load i64, ptr %37, align 8, !tbaa !35
  %39 = getelementptr inbounds i8, ptr %2, i64 16
  %40 = load i64, ptr %39, align 8, !tbaa !37
  %41 = sub i64 %38, %40
  %42 = tail call i64 @ZSTD_compressBound(i64 noundef %41) #4
  %.not99 = icmp ult i64 %36, %42
  br i1 %.not99, label %64, label %43

43:                                               ; preds = %31
  %44 = load ptr, ptr %1, align 8, !tbaa !38
  %45 = load i64, ptr %34, align 8, !tbaa !34
  %46 = getelementptr inbounds i8, ptr %44, i64 %45
  %47 = load i64, ptr %32, align 8, !tbaa !32
  %48 = sub i64 %47, %45
  %49 = load ptr, ptr %2, align 8, !tbaa !39
  %50 = load i64, ptr %39, align 8, !tbaa !37
  %51 = getelementptr inbounds i8, ptr %49, i64 %50
  %52 = load i64, ptr %37, align 8, !tbaa !35
  %53 = sub i64 %52, %50
  %54 = getelementptr inbounds i8, ptr %0, i64 648
  %55 = load ptr, ptr %54, align 8, !tbaa !40
  %56 = getelementptr inbounds i8, ptr %0, i64 40
  %57 = tail call i64 @ZSTDMT_compress_advanced_internal(ptr noundef nonnull %0, ptr noundef %46, i64 noundef %48, ptr noundef %51, i64 noundef %53, ptr noundef %55, ptr noundef nonnull byval(%struct.ZSTD_CCtx_params_s) align 8 %56)
  %58 = tail call i32 @ZSTD_isError(i64 noundef %57) #4
  %.not110 = icmp eq i32 %58, 0
  br i1 %.not110, label %59, label %123

59:                                               ; preds = %43
  %60 = load i64, ptr %37, align 8, !tbaa !35
  store i64 %60, ptr %39, align 8, !tbaa !37
  %61 = load i64, ptr %34, align 8, !tbaa !34
  %62 = add i64 %61, %57
  store i64 %62, ptr %34, align 8, !tbaa !34
  %63 = getelementptr inbounds i8, ptr %0, i64 588
  store i32 1, ptr %63, align 4, !tbaa !41
  store i32 1, ptr %14, align 8, !tbaa !28
  br label %123

64:                                               ; preds = %31, %26, %22, %18
  %65 = getelementptr inbounds i8, ptr %0, i64 240
  %66 = load i32, ptr %65, align 8, !tbaa !31
  %.not100 = icmp eq i32 %66, 0
  br i1 %.not100, label %67, label %.thread114

67:                                               ; preds = %64
  %68 = getelementptr inbounds i8, ptr %2, i64 8
  %69 = load i64, ptr %68, align 8, !tbaa !35
  %70 = getelementptr inbounds i8, ptr %2, i64 16
  %71 = load i64, ptr %70, align 8, !tbaa !37
  %72 = icmp ugt i64 %69, %71
  br i1 %72, label %73, label %.thread125

73:                                               ; preds = %67
  %74 = getelementptr inbounds i8, ptr %0, i64 216
  %75 = load ptr, ptr %74, align 8, !tbaa !42
  %76 = icmp eq ptr %75, null
  br i1 %76, label %77, label %.thread

77:                                               ; preds = %73
  %78 = tail call i32 @ZSTDMT_tryGetInputRange(ptr noundef nonnull %0)
  %.pr = load ptr, ptr %74, align 8, !tbaa !42
  %.not101 = icmp eq ptr %.pr, null
  %.pre123 = load i64, ptr %70, align 8, !tbaa !37
  br i1 %.not101, label %96, label %..thread_crit_edge

..thread_crit_edge:                               ; preds = %77
  %.pre = load i64, ptr %68, align 8, !tbaa !35
  br label %.thread

.thread:                                          ; preds = %..thread_crit_edge, %73
  %79 = phi i64 [ %.pre123, %..thread_crit_edge ], [ %71, %73 ]
  %80 = phi i64 [ %.pre, %..thread_crit_edge ], [ %69, %73 ]
  %81 = phi ptr [ %.pr, %..thread_crit_edge ], [ %75, %73 ]
  %82 = sub i64 %80, %79
  %83 = getelementptr inbounds i8, ptr %0, i64 160
  %84 = load i64, ptr %83, align 8, !tbaa !43
  %85 = getelementptr inbounds i8, ptr %0, i64 232
  %86 = load i64, ptr %85, align 8, !tbaa !30
  %87 = sub i64 %84, %86
  %. = tail call i64 @llvm.umin.i64(i64 %82, i64 %87)
  %88 = getelementptr inbounds i8, ptr %81, i64 %86
  %89 = load ptr, ptr %2, align 8, !tbaa !39
  %90 = getelementptr inbounds i8, ptr %89, i64 %79
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %88, ptr align 1 %90, i64 %., i1 false)
  %91 = load i64, ptr %70, align 8, !tbaa !37
  %92 = add i64 %91, %.
  store i64 %92, ptr %70, align 8, !tbaa !37
  %93 = load i64, ptr %85, align 8, !tbaa !30
  %94 = add i64 %93, %.
  store i64 %94, ptr %85, align 8, !tbaa !30
  %.not109 = icmp eq i64 %., 0
  %95 = zext i1 %.not109 to i32
  br label %96

96:                                               ; preds = %77, %.thread
  %97 = phi i64 [ %92, %.thread ], [ %.pre123, %77 ]
  %.093 = phi i32 [ %95, %.thread ], [ 1, %77 ]
  %98 = load i64, ptr %68, align 8, !tbaa !35
  %99 = icmp ult i64 %97, %98
  %100 = icmp eq i32 %3, 2
  %or.cond6 = and i1 %100, %99
  %spec.store.select7 = select i1 %or.cond6, i32 1, i32 %3
  %.pr113.pre = load i32, ptr %65, align 8, !tbaa !31
  %101 = icmp eq i32 %.pr113.pre, 0
  br i1 %101, label %.thread125, label %.thread114

.thread125:                                       ; preds = %67, %96
  %.092.ph130 = phi i32 [ %spec.store.select7, %96 ], [ %3, %67 ]
  %.194.ph129 = phi i32 [ %.093, %96 ], [ 1, %67 ]
  %102 = getelementptr inbounds i8, ptr %0, i64 232
  %103 = load i64, ptr %102, align 8, !tbaa !30
  %104 = getelementptr inbounds i8, ptr %0, i64 160
  %105 = load i64, ptr %104, align 8, !tbaa !43
  %.not103 = icmp ult i64 %103, %105
  br i1 %.not103, label %106, label %.thread114

106:                                              ; preds = %.thread125
  %.not104 = icmp eq i32 %.092.ph130, 0
  %.not105 = icmp eq i64 %103, 0
  %or.cond111 = or i1 %.not104, %.not105
  br i1 %or.cond111, label %107, label %.thread114

107:                                              ; preds = %106
  %108 = icmp eq i32 %.092.ph130, 2
  br i1 %108, label %109, label %115

109:                                              ; preds = %107
  %110 = load i32, ptr %14, align 8, !tbaa !28
  %.not106 = icmp eq i32 %110, 0
  br i1 %.not106, label %.thread114, label %115

.thread114:                                       ; preds = %64, %106, %109, %.thread125, %96
  %.092120 = phi i32 [ %.092.ph130, %106 ], [ 2, %109 ], [ %.092.ph130, %.thread125 ], [ %spec.store.select7, %96 ], [ %3, %64 ]
  %.194119 = phi i32 [ %.194.ph129, %106 ], [ %.194.ph129, %109 ], [ %.194.ph129, %.thread125 ], [ %.093, %96 ], [ 1, %64 ]
  %111 = getelementptr inbounds i8, ptr %0, i64 232
  %112 = load i64, ptr %111, align 8, !tbaa !30
  %113 = tail call i64 @ZSTDMT_createCompressionJob(ptr noundef nonnull %0, i64 noundef %112, i32 noundef %.092120)
  %114 = tail call i32 @ERR_isError(i64 noundef %113)
  %.not107 = icmp eq i32 %114, 0
  br i1 %.not107, label %115, label %123

115:                                              ; preds = %.thread114, %109, %107
  %.092121 = phi i32 [ %.092120, %.thread114 ], [ 2, %109 ], [ %.092.ph130, %107 ]
  %.194118 = phi i32 [ %.194119, %.thread114 ], [ %.194.ph129, %109 ], [ %.194.ph129, %107 ]
  %116 = tail call i64 @ZSTDMT_flushProduced(ptr noundef nonnull %0, ptr noundef %1, i32 noundef %.194118, i32 noundef %.092121)
  %117 = getelementptr inbounds i8, ptr %2, i64 16
  %118 = load i64, ptr %117, align 8, !tbaa !37
  %119 = getelementptr inbounds i8, ptr %2, i64 8
  %120 = load i64, ptr %119, align 8, !tbaa !35
  %121 = icmp ult i64 %118, %120
  %122 = tail call i64 @llvm.umax.i64(i64 %116, i64 1)
  %.2 = select i1 %121, i64 %122, i64 %116
  br label %123

123:                                              ; preds = %59, %43, %13, %.thread114, %115, %7
  %.3 = phi i64 [ %12, %7 ], [ %.2, %115 ], [ %113, %.thread114 ], [ -60, %13 ], [ 0, %59 ], [ %57, %43 ]
  ret i64 %.3
}

declare i64 @ZSTD_compressStream_generic(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @ZSTDMT_tryGetInputRange(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @ERR_isError(i64 noundef) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #3

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !11, i64 568}
!6 = !{!"ZSTDMT_CCtx_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !16, i64 160, !16, i64 168, !17, i64 176, !18, i64 200, !11, i64 240, !21, i64 248, !11, i64 568, !11, i64 572, !11, i64 576, !11, i64 580, !11, i64 584, !11, i64 588, !25, i64 592, !25, i64 600, !25, i64 608, !15, i64 616, !7, i64 640, !7, i64 648}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"ZSTD_CCtx_params_s", !11, i64 0, !12, i64 4, !13, i64 32, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !14, i64 68, !15, i64 96}
!11 = !{!"int", !8, i64 0}
!12 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24}
!13 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8}
!14 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!15 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16}
!16 = !{!"long", !8, i64 0}
!17 = !{!"", !7, i64 0, !16, i64 8, !16, i64 16}
!18 = !{!"", !19, i64 0, !20, i64 16, !16, i64 32}
!19 = !{!"", !7, i64 0, !16, i64 8}
!20 = !{!"buffer_s", !7, i64 0, !16, i64 8}
!21 = !{!"", !11, i64 0, !11, i64 4, !10, i64 8, !22, i64 128, !24, i64 184, !11, i64 272, !11, i64 276, !11, i64 280, !23, i64 288}
!22 = !{!"", !23, i64 0, !7, i64 32, !7, i64 40, !16, i64 48}
!23 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !11, i64 28}
!24 = !{!"XXH64_state_s", !25, i64 0, !25, i64 8, !25, i64 16, !25, i64 24, !25, i64 32, !8, i64 40, !11, i64 72, !8, i64 76}
!25 = !{!"long long", !8, i64 0}
!26 = !{!6, !7, i64 24}
!27 = !{!7, !7, i64 0}
!28 = !{!6, !11, i64 584}
!29 = !{!6, !11, i64 580}
!30 = !{!6, !16, i64 232}
!31 = !{!6, !11, i64 240}
!32 = !{!33, !16, i64 8}
!33 = !{!"ZSTD_outBuffer_s", !7, i64 0, !16, i64 8, !16, i64 16}
!34 = !{!33, !16, i64 16}
!35 = !{!36, !16, i64 8}
!36 = !{!"ZSTD_inBuffer_s", !7, i64 0, !16, i64 8, !16, i64 16}
!37 = !{!36, !16, i64 16}
!38 = !{!33, !7, i64 0}
!39 = !{!36, !7, i64 0}
!40 = !{!6, !7, i64 648}
!41 = !{!6, !11, i64 588}
!42 = !{!6, !7, i64 216}
!43 = !{!6, !16, i64 160}


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