; 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.buffer_s = type { ptr, i64 }
%struct.range_t = type { ptr, i64 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }
%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.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.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] }

@g_nullBuffer = external hidden constant %struct.buffer_s, align 8
@kNullRange = external hidden constant %struct.range_t, align 8

; 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

; Function Attrs: nounwind uwtable
declare hidden void @ZSTDMT_releaseAllJobResources(ptr noundef) #2

declare i64 @ZSTD_freeCDict(ptr noundef) #3

declare void @ZSTD_free(ptr noundef, ptr noundef byval(%struct.ZSTD_customMem) align 8) #3

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTDMT_initCStream_internal(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %5, i64 noundef %6) #2 {
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca %struct.ZSTD_CCtx_params_s, align 8
  %16 = alloca %struct.ZSTD_compressionParameters, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i64 %2, ptr %11, align 8, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !11
  store ptr %4, ptr %13, align 8, !tbaa !5
  store i64 %6, ptr %14, align 8, !tbaa !13
  %24 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %5, i32 0, i32 7
  %25 = load i32, ptr %24, align 4, !tbaa !15
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %32

27:                                               ; preds = %7
  %28 = call i64 @ZSTDMT_computeTargetJobLog(ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %5)
  %29 = trunc i64 %28 to i32
  %30 = shl i32 1, %29
  %31 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %5, i32 0, i32 7
  store i32 %30, ptr %31, align 4, !tbaa !15
  br label %32

32:                                               ; preds = %27, %7
  %33 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %5, i32 0, i32 7
  %34 = load i32, ptr %33, align 4, !tbaa !15
  %35 = call i32 @MEM_32bits()
  %36 = icmp ne i32 %35, 0
  %37 = zext i1 %36 to i64
  %38 = select i1 %36, i32 536870912, i32 -2147483648
  %39 = icmp ugt i32 %34, %38
  br i1 %39, label %40, label %46

40:                                               ; preds = %32
  %41 = call i32 @MEM_32bits()
  %42 = icmp ne i32 %41, 0
  %43 = zext i1 %42 to i64
  %44 = select i1 %42, i32 536870912, i32 -2147483648
  %45 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %5, i32 0, i32 7
  store i32 %44, ptr %45, align 4, !tbaa !15
  br label %46

46:                                               ; preds = %40, %32
  %47 = load i64, ptr %14, align 8, !tbaa !13
  %48 = icmp ule i64 %47, 1048576
  %49 = zext i1 %48 to i32
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %50, i32 0, i32 12
  store i32 %49, ptr %51, align 8, !tbaa !21
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %52, i32 0, i32 12
  %54 = load i32, ptr %53, align 8, !tbaa !21
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %68

56:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 120, ptr %15) #5
  call void @ZSTDMT_initJobCCtxParams(ptr dead_on_unwind writable sret(%struct.ZSTD_CCtx_params_s) align 8 %15, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %5)
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %57, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !31
  %60 = getelementptr inbounds %struct.ZSTDMT_CCtxPool, ptr %59, i32 0, i32 4
  %61 = getelementptr inbounds [1 x ptr], ptr %60, i64 0, i64 0
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = load i64, ptr %11, align 8, !tbaa !9
  %65 = load ptr, ptr %13, align 8, !tbaa !5
  %66 = load i64, ptr %14, align 8, !tbaa !13
  %67 = call i64 @ZSTD_initCStream_internal(ptr noundef %62, ptr noundef %63, i64 noundef %64, ptr noundef %65, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %15, i64 noundef %66)
  store i64 %67, ptr %8, align 8
  call void @llvm.lifetime.end.p0(i64 120, ptr %15) #5
  br label %297

68:                                               ; preds = %46
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %69, i32 0, i32 17
  %71 = load i32, ptr %70, align 4, !tbaa !32
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %73, label %78

73:                                               ; preds = %68
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ZSTDMT_waitForAllJobsCompleted(ptr noundef %74)
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ZSTDMT_releaseAllJobResources(ptr noundef %75)
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %76, i32 0, i32 17
  store i32 1, ptr %77, align 4, !tbaa !32
  br label %78

78:                                               ; preds = %73, %68
  %79 = load ptr, ptr %9, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %79, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %80, ptr align 8 %5, i64 120, i1 false), !tbaa.struct !33
  %81 = load i64, ptr %14, align 8, !tbaa !13
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %82, i32 0, i32 18
  store i64 %81, ptr %83, align 8, !tbaa !34
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %111

86:                                               ; preds = %78
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %87, i32 0, i32 22
  %89 = load ptr, ptr %88, align 8, !tbaa !35
  %90 = call i64 @ZSTD_freeCDict(ptr noundef %89)
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = load i64, ptr %11, align 8, !tbaa !9
  %93 = load i32, ptr %12, align 4, !tbaa !11
  %94 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %5, i32 0, i32 1
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %95, i32 0, i32 21
  call void @llvm.lifetime.start.p0(i64 28, ptr %16) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 4 %94, i64 28, i1 false), !tbaa.struct !36
  %97 = call ptr @ZSTD_createCDict_advanced(ptr noundef %91, i64 noundef %92, i32 noundef 0, i32 noundef %93, ptr noundef byval(%struct.ZSTD_compressionParameters) align 8 %16, ptr noundef byval(%struct.ZSTD_customMem) align 8 %96)
  call void @llvm.lifetime.end.p0(i64 28, ptr %16) #5
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %98, i32 0, i32 22
  store ptr %97, ptr %99, align 8, !tbaa !35
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %100, i32 0, i32 22
  %102 = load ptr, ptr %101, align 8, !tbaa !35
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %103, i32 0, i32 23
  store ptr %102, ptr %104, align 8, !tbaa !37
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %105, i32 0, i32 22
  %107 = load ptr, ptr %106, align 8, !tbaa !35
  %108 = icmp eq ptr %107, null
  br i1 %108, label %109, label %110

109:                                              ; preds = %86
  store i64 -64, ptr %8, align 8
  br label %297

110:                                              ; preds = %86
  br label %121

111:                                              ; preds = %78
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %112, i32 0, i32 22
  %114 = load ptr, ptr %113, align 8, !tbaa !35
  %115 = call i64 @ZSTD_freeCDict(ptr noundef %114)
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %116, i32 0, i32 22
  store ptr null, ptr %117, align 8, !tbaa !35
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %119, i32 0, i32 23
  store ptr %118, ptr %120, align 8, !tbaa !37
  br label %121

121:                                              ; preds = %111, %110
  %122 = call i64 @ZSTDMT_computeOverlapLog(ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %5)
  %123 = shl i64 1, %122
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %124, i32 0, i32 7
  store i64 %123, ptr %125, align 8, !tbaa !38
  %126 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %5, i32 0, i32 7
  %127 = load i32, ptr %126, align 4, !tbaa !15
  %128 = zext i32 %127 to i64
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %129, i32 0, i32 6
  store i64 %128, ptr %130, align 8, !tbaa !39
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %131, i32 0, i32 6
  %133 = load i64, ptr %132, align 8, !tbaa !39
  %134 = icmp ult i64 %133, 1048576
  br i1 %134, label %135, label %138

135:                                              ; preds = %121
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %136, i32 0, i32 6
  store i64 1048576, ptr %137, align 8, !tbaa !39
  br label %138

138:                                              ; preds = %135, %121
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %139, i32 0, i32 6
  %141 = load i64, ptr %140, align 8, !tbaa !39
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %142, i32 0, i32 7
  %144 = load i64, ptr %143, align 8, !tbaa !38
  %145 = icmp ult i64 %141, %144
  br i1 %145, label %146, label %152

146:                                              ; preds = %138
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %147, i32 0, i32 7
  %149 = load i64, ptr %148, align 8, !tbaa !38
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %150, i32 0, i32 6
  store i64 %149, ptr %151, align 8, !tbaa !39
  br label %152

152:                                              ; preds = %146, %138
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %153, i32 0, i32 2
  %155 = load ptr, ptr %154, align 8, !tbaa !40
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %156, i32 0, i32 6
  %158 = load i64, ptr %157, align 8, !tbaa !39
  %159 = call i64 @ZSTD_compressBound(i64 noundef %158)
  call void @ZSTDMT_setBufferSize(ptr noundef %155, i64 noundef %159)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %160, i32 0, i32 5
  %162 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %161, i32 0, i32 9
  %163 = getelementptr inbounds %struct.ldmParams_t, ptr %162, i32 0, i32 0
  %164 = load i32, ptr %163, align 4, !tbaa !41
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %173

166:                                              ; preds = %152
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %167, i32 0, i32 5
  %169 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %168, i32 0, i32 1
  %170 = getelementptr inbounds %struct.ZSTD_compressionParameters, ptr %169, i32 0, i32 0
  %171 = load i32, ptr %170, align 4, !tbaa !42
  %172 = shl i32 1, %171
  br label %174

173:                                              ; preds = %152
  br label %174

174:                                              ; preds = %173, %166
  %175 = phi i32 [ %172, %166 ], [ 0, %173 ]
  %176 = zext i32 %175 to i64
  store i64 %176, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %177, i32 0, i32 7
  %179 = load i64, ptr %178, align 8, !tbaa !38
  %180 = icmp ugt i64 %179, 0
  %181 = zext i1 %180 to i32
  %182 = add nsw i32 2, %181
  %183 = sext i32 %182 to i64
  store i64 %183, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %184, i32 0, i32 6
  %186 = load i64, ptr %185, align 8, !tbaa !39
  %187 = load i64, ptr %18, align 8, !tbaa !9
  %188 = mul i64 %186, %187
  store i64 %188, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %189 = load ptr, ptr %9, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %189, i32 0, i32 5
  %191 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %190, i32 0, i32 6
  %192 = load i32, ptr %191, align 8, !tbaa !43
  %193 = icmp ugt i32 %192, 1
  br i1 %193, label %194, label %199

194:                                              ; preds = %174
  %195 = load ptr, ptr %9, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %195, i32 0, i32 5
  %197 = getelementptr inbounds %struct.ZSTD_CCtx_params_s, ptr %196, i32 0, i32 6
  %198 = load i32, ptr %197, align 8, !tbaa !43
  br label %200

199:                                              ; preds = %174
  br label %200

200:                                              ; preds = %199, %194
  %201 = phi i32 [ %198, %194 ], [ 1, %199 ]
  %202 = zext i32 %201 to i64
  store i64 %202, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %203 = load ptr, ptr %9, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %203, i32 0, i32 6
  %205 = load i64, ptr %204, align 8, !tbaa !39
  %206 = load i64, ptr %20, align 8, !tbaa !9
  %207 = mul i64 %205, %206
  store i64 %207, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %208 = load i64, ptr %17, align 8, !tbaa !9
  %209 = load i64, ptr %21, align 8, !tbaa !9
  %210 = icmp ugt i64 %208, %209
  br i1 %210, label %211, label %213

211:                                              ; preds = %200
  %212 = load i64, ptr %17, align 8, !tbaa !9
  br label %215

213:                                              ; preds = %200
  %214 = load i64, ptr %21, align 8, !tbaa !9
  br label %215

215:                                              ; preds = %213, %211
  %216 = phi i64 [ %212, %211 ], [ %214, %213 ]
  %217 = load i64, ptr %19, align 8, !tbaa !9
  %218 = add i64 %216, %217
  store i64 %218, ptr %22, align 8, !tbaa !9
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %219, i32 0, i32 8
  %221 = getelementptr inbounds %struct.roundBuff_t, ptr %220, i32 0, i32 1
  %222 = load i64, ptr %221, align 8, !tbaa !44
  %223 = load i64, ptr %22, align 8, !tbaa !9
  %224 = icmp ult i64 %222, %223
  br i1 %224, label %225, label %260

225:                                              ; preds = %215
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %226, i32 0, i32 8
  %228 = getelementptr inbounds %struct.roundBuff_t, ptr %227, i32 0, i32 0
  %229 = load ptr, ptr %228, align 8, !tbaa !45
  %230 = icmp ne ptr %229, null
  br i1 %230, label %231, label %238

231:                                              ; preds = %225
  %232 = load ptr, ptr %9, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %232, i32 0, i32 8
  %234 = getelementptr inbounds %struct.roundBuff_t, ptr %233, i32 0, i32 0
  %235 = load ptr, ptr %234, align 8, !tbaa !45
  %236 = load ptr, ptr %9, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %236, i32 0, i32 21
  call void @ZSTD_free(ptr noundef %235, ptr noundef byval(%struct.ZSTD_customMem) align 8 %237)
  br label %238

238:                                              ; preds = %231, %225
  %239 = load i64, ptr %22, align 8, !tbaa !9
  %240 = load ptr, ptr %9, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %240, i32 0, i32 21
  %242 = call ptr @ZSTD_malloc(i64 noundef %239, ptr noundef byval(%struct.ZSTD_customMem) align 8 %241)
  %243 = load ptr, ptr %9, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %243, i32 0, i32 8
  %245 = getelementptr inbounds %struct.roundBuff_t, ptr %244, i32 0, i32 0
  store ptr %242, ptr %245, align 8, !tbaa !45
  %246 = load ptr, ptr %9, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %246, i32 0, i32 8
  %248 = getelementptr inbounds %struct.roundBuff_t, ptr %247, i32 0, i32 0
  %249 = load ptr, ptr %248, align 8, !tbaa !45
  %250 = icmp eq ptr %249, null
  br i1 %250, label %251, label %255

251:                                              ; preds = %238
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %252, i32 0, i32 8
  %254 = getelementptr inbounds %struct.roundBuff_t, ptr %253, i32 0, i32 1
  store i64 0, ptr %254, align 8, !tbaa !44
  store i64 -64, ptr %8, align 8
  store i32 1, ptr %23, align 4
  br label %261

255:                                              ; preds = %238
  %256 = load i64, ptr %22, align 8, !tbaa !9
  %257 = load ptr, ptr %9, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %257, i32 0, i32 8
  %259 = getelementptr inbounds %struct.roundBuff_t, ptr %258, i32 0, i32 1
  store i64 %256, ptr %259, align 8, !tbaa !44
  br label %260

260:                                              ; preds = %255, %215
  store i32 0, ptr %23, align 4
  br label %261

261:                                              ; preds = %260, %251
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %262 = load i32, ptr %23, align 4
  switch i32 %262, label %299 [
    i32 0, label %263
    i32 1, label %297
  ]

263:                                              ; preds = %261
  %264 = load ptr, ptr %9, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %264, i32 0, i32 8
  %266 = getelementptr inbounds %struct.roundBuff_t, ptr %265, i32 0, i32 2
  store i64 0, ptr %266, align 8, !tbaa !46
  %267 = load ptr, ptr %9, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %267, i32 0, i32 9
  %269 = getelementptr inbounds %struct.inBuff_t, ptr %268, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %269, ptr align 8 @g_nullBuffer, i64 16, i1 false), !tbaa.struct !47
  %270 = load ptr, ptr %9, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %270, i32 0, i32 9
  %272 = getelementptr inbounds %struct.inBuff_t, ptr %271, i32 0, i32 2
  store i64 0, ptr %272, align 8, !tbaa !48
  %273 = load ptr, ptr %9, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %273, i32 0, i32 9
  %275 = getelementptr inbounds %struct.inBuff_t, ptr %274, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %275, ptr align 8 @kNullRange, i64 16, i1 false), !tbaa.struct !47
  %276 = load ptr, ptr %9, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %276, i32 0, i32 14
  store i32 0, ptr %277, align 8, !tbaa !49
  %278 = load ptr, ptr %9, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %278, i32 0, i32 15
  store i32 0, ptr %279, align 4, !tbaa !50
  %280 = load ptr, ptr %9, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %280, i32 0, i32 16
  store i32 0, ptr %281, align 8, !tbaa !51
  %282 = load ptr, ptr %9, align 8, !tbaa !5
  %283 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %282, i32 0, i32 17
  store i32 0, ptr %283, align 4, !tbaa !32
  %284 = load ptr, ptr %9, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %284, i32 0, i32 19
  store i64 0, ptr %285, align 8, !tbaa !52
  %286 = load ptr, ptr %9, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %286, i32 0, i32 20
  store i64 0, ptr %287, align 8, !tbaa !53
  %288 = load ptr, ptr %9, align 8, !tbaa !5
  %289 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %288, i32 0, i32 11
  %290 = load ptr, ptr %9, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct.ZSTDMT_CCtx_s, ptr %290, i32 0, i32 4
  %292 = load ptr, ptr %291, align 8, !tbaa !54
  %293 = call i32 @ZSTDMT_serialState_reset(ptr noundef %289, ptr noundef %292, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %5)
  %294 = icmp ne i32 %293, 0
  br i1 %294, label %295, label %296

295:                                              ; preds = %263
  store i64 -64, ptr %8, align 8
  br label %297

296:                                              ; preds = %263
  store i64 0, ptr %8, align 8
  br label %297

297:                                              ; preds = %296, %295, %261, %109, %56
  %298 = load i64, ptr %8, align 8
  ret i64 %298

299:                                              ; preds = %261
  unreachable
}

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

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

; Function Attrs: nounwind uwtable
declare hidden void @ZSTDMT_initJobCCtxParams(ptr dead_on_unwind noalias writable sret(%struct.ZSTD_CCtx_params_s) align 8, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8) #2

declare i64 @ZSTD_initCStream_internal(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8, i64 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @ZSTDMT_waitForAllJobsCompleted(ptr noundef) #2

declare ptr @ZSTD_createCDict_advanced(ptr noundef, i64 noundef, i32 noundef, i32 noundef, ptr noundef byval(%struct.ZSTD_compressionParameters) align 8, ptr noundef byval(%struct.ZSTD_customMem) align 8) #3

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

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

declare i64 @ZSTD_compressBound(i64 noundef) #3

declare ptr @ZSTD_malloc(i64 noundef, ptr noundef byval(%struct.ZSTD_customMem) align 8) #3

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

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


; 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.buffer_s = type { ptr, i64 }
%struct.range_t = type { ptr, i64 }
%struct.ZSTD_customMem = type { ptr, ptr, ptr }
%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 }

@g_nullBuffer = external hidden local_unnamed_addr constant %struct.buffer_s, align 8
@kNullRange = external hidden local_unnamed_addr constant %struct.range_t, align 8

; 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 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: 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 hidden void @ZSTDMT_releaseAllJobResources(ptr noundef) local_unnamed_addr #2

declare i64 @ZSTD_freeCDict(ptr noundef) local_unnamed_addr #3

declare void @ZSTD_free(ptr noundef, ptr noundef byval(%struct.ZSTD_customMem) align 8) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i64 @ZSTDMT_initCStream_internal(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8 %5, i64 noundef %6) local_unnamed_addr #2 {
  %8 = alloca %struct.ZSTD_CCtx_params_s, align 8
  %9 = alloca %struct.ZSTD_compressionParameters, align 8
  %10 = getelementptr inbounds i8, ptr %5, i64 60
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %17

13:                                               ; preds = %7
  %14 = tail call i64 @ZSTDMT_computeTargetJobLog(ptr noundef nonnull byval(%struct.ZSTD_CCtx_params_s) align 8 %5)
  %15 = trunc i64 %14 to i32
  %16 = shl nuw i32 1, %15
  store i32 %16, ptr %10, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %13, %7
  %18 = phi i32 [ %16, %13 ], [ %11, %7 ]
  %19 = tail call i32 @MEM_32bits()
  %.not = icmp eq i32 %19, 0
  %20 = select i1 %.not, i32 -2147483648, i32 536870912
  %21 = icmp ugt i32 %18, %20
  br i1 %21, label %22, label %25

22:                                               ; preds = %17
  %23 = tail call i32 @MEM_32bits()
  %.not86 = icmp eq i32 %23, 0
  %24 = select i1 %.not86, i32 -2147483648, i32 536870912
  store i32 %24, ptr %10, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %22, %17
  %26 = icmp ult i64 %6, 1048577
  %27 = zext i1 %26 to i32
  %28 = getelementptr inbounds i8, ptr %0, i64 568
  store i32 %27, ptr %28, align 8, !tbaa !15
  br i1 %26, label %29, label %35

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %8) #7
  call void @ZSTDMT_initJobCCtxParams(ptr dead_on_unwind nonnull writable sret(%struct.ZSTD_CCtx_params_s) align 8 %8, ptr noundef nonnull byval(%struct.ZSTD_CCtx_params_s) align 8 %5)
  %30 = getelementptr inbounds i8, ptr %0, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !27
  %32 = getelementptr inbounds i8, ptr %31, i64 40
  %33 = load ptr, ptr %32, align 8, !tbaa !28
  %34 = call i64 @ZSTD_initCStream_internal(ptr noundef %33, ptr noundef %1, i64 noundef %2, ptr noundef %4, ptr noundef nonnull byval(%struct.ZSTD_CCtx_params_s) align 8 %8, i64 noundef %6) #7
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %8) #7
  br label %106

35:                                               ; preds = %25
  %36 = getelementptr inbounds i8, ptr %0, i64 588
  %37 = load i32, ptr %36, align 4, !tbaa !29
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %35
  tail call void @ZSTDMT_waitForAllJobsCompleted(ptr noundef nonnull %0)
  tail call void @ZSTDMT_releaseAllJobResources(ptr noundef nonnull %0)
  store i32 1, ptr %36, align 4, !tbaa !29
  br label %40

40:                                               ; preds = %39, %35
  %41 = getelementptr inbounds i8, ptr %0, i64 40
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(120) %41, ptr noundef nonnull align 8 dereferenceable(120) %5, i64 120, i1 false), !tbaa.struct !30
  %42 = getelementptr inbounds i8, ptr %0, i64 592
  store i64 %6, ptr %42, align 8, !tbaa !32
  %.not87 = icmp eq ptr %1, null
  %43 = getelementptr inbounds i8, ptr %0, i64 640
  %44 = load ptr, ptr %43, align 8, !tbaa !33
  %45 = tail call i64 @ZSTD_freeCDict(ptr noundef %44) #7
  br i1 %.not87, label %52, label %46

46:                                               ; preds = %40
  %47 = getelementptr inbounds i8, ptr %5, i64 4
  %48 = getelementptr inbounds i8, ptr %0, i64 616
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %9) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %9, ptr noundef nonnull align 4 dereferenceable(28) %47, i64 28, i1 false), !tbaa.struct !34
  %49 = tail call ptr @ZSTD_createCDict_advanced(ptr noundef nonnull %1, i64 noundef %2, i32 noundef 0, i32 noundef %3, ptr noundef nonnull byval(%struct.ZSTD_compressionParameters) align 8 %9, ptr noundef nonnull byval(%struct.ZSTD_customMem) align 8 %48) #7
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %9) #7
  store ptr %49, ptr %43, align 8, !tbaa !33
  %50 = getelementptr inbounds i8, ptr %0, i64 648
  store ptr %49, ptr %50, align 8, !tbaa !35
  %51 = icmp eq ptr %49, null
  br i1 %51, label %106, label %54

52:                                               ; preds = %40
  store ptr null, ptr %43, align 8, !tbaa !33
  %53 = getelementptr inbounds i8, ptr %0, i64 648
  store ptr %4, ptr %53, align 8, !tbaa !35
  br label %54

54:                                               ; preds = %46, %52
  %55 = tail call i64 @ZSTDMT_computeOverlapLog(ptr noundef nonnull byval(%struct.ZSTD_CCtx_params_s) align 8 %5)
  %56 = shl nuw i64 1, %55
  %57 = getelementptr inbounds i8, ptr %0, i64 168
  store i64 %56, ptr %57, align 8, !tbaa !36
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %0, i64 160
  %narrow = tail call i32 @llvm.umax.i32(i32 %58, i32 1048576)
  %spec.select = zext i32 %narrow to i64
  %spec.store.select = tail call i64 @llvm.umax.i64(i64 %56, i64 %spec.select)
  store i64 %spec.store.select, ptr %59, align 8
  %60 = getelementptr inbounds i8, ptr %0, i64 16
  %61 = load ptr, ptr %60, align 8, !tbaa !37
  %62 = tail call i64 @ZSTD_compressBound(i64 noundef %spec.store.select) #7
  tail call void @ZSTDMT_setBufferSize(ptr noundef %61, i64 noundef %62)
  %63 = getelementptr inbounds i8, ptr %0, i64 108
  %64 = load i32, ptr %63, align 4, !tbaa !38
  %.not88 = icmp eq i32 %64, 0
  br i1 %.not88, label %70, label %65

65:                                               ; preds = %54
  %66 = getelementptr inbounds i8, ptr %0, i64 44
  %67 = load i32, ptr %66, align 4, !tbaa !39
  %68 = shl nuw i32 1, %67
  %69 = zext i32 %68 to i64
  br label %70

70:                                               ; preds = %54, %65
  %71 = phi i64 [ %69, %65 ], [ 0, %54 ]
  %72 = load i64, ptr %57, align 8, !tbaa !36
  %.not89 = icmp eq i64 %72, 0
  %73 = select i1 %.not89, i64 2, i64 3
  %74 = load i64, ptr %59, align 8, !tbaa !40
  %75 = mul i64 %73, %74
  %76 = getelementptr inbounds i8, ptr %0, i64 96
  %77 = load i32, ptr %76, align 8, !tbaa !41
  %narrow95 = tail call i32 @llvm.umax.i32(i32 %77, i32 1)
  %spec.select92 = zext i32 %narrow95 to i64
  %78 = mul i64 %74, %spec.select92
  %79 = tail call i64 @llvm.umax.i64(i64 %71, i64 %78)
  %80 = add i64 %79, %75
  %81 = getelementptr inbounds i8, ptr %0, i64 176
  %82 = getelementptr inbounds i8, ptr %0, i64 184
  %83 = load i64, ptr %82, align 8, !tbaa !42
  %84 = icmp ult i64 %83, %80
  br i1 %84, label %85, label %95

85:                                               ; preds = %70
  %86 = load ptr, ptr %81, align 8, !tbaa !43
  %.not90 = icmp eq ptr %86, null
  br i1 %.not90, label %89, label %87

87:                                               ; preds = %85
  %88 = getelementptr inbounds i8, ptr %0, i64 616
  tail call void @ZSTD_free(ptr noundef nonnull %86, ptr noundef nonnull byval(%struct.ZSTD_customMem) align 8 %88) #7
  br label %89

89:                                               ; preds = %87, %85
  %90 = getelementptr inbounds i8, ptr %0, i64 616
  %91 = tail call ptr @ZSTD_malloc(i64 noundef %80, ptr noundef nonnull byval(%struct.ZSTD_customMem) align 8 %90) #7
  store ptr %91, ptr %81, align 8, !tbaa !43
  %92 = icmp eq ptr %91, null
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i64 %80, ptr %82, align 8, !tbaa !42
  br label %95

94:                                               ; preds = %89
  store i64 0, ptr %82, align 8, !tbaa !42
  br label %106

95:                                               ; preds = %93, %70
  %96 = getelementptr inbounds i8, ptr %0, i64 192
  store i64 0, ptr %96, align 8, !tbaa !44
  %97 = getelementptr inbounds i8, ptr %0, i64 200
  %98 = getelementptr inbounds i8, ptr %0, i64 216
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %98, ptr noundef nonnull align 8 dereferenceable(16) @g_nullBuffer, i64 16, i1 false), !tbaa.struct !45
  %99 = getelementptr inbounds i8, ptr %0, i64 232
  store i64 0, ptr %99, align 8, !tbaa !47
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %97, ptr noundef nonnull align 8 dereferenceable(16) @kNullRange, i64 16, i1 false), !tbaa.struct !45
  %100 = getelementptr inbounds i8, ptr %0, i64 576
  %101 = getelementptr inbounds i8, ptr %0, i64 600
  %102 = getelementptr inbounds i8, ptr %0, i64 248
  %103 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %100, i8 0, i64 16, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %101, i8 0, i64 16, i1 false)
  %104 = load ptr, ptr %103, align 8, !tbaa !48
  %105 = tail call i32 @ZSTDMT_serialState_reset(ptr noundef nonnull %102, ptr noundef %104, ptr noundef nonnull byval(%struct.ZSTD_CCtx_params_s) align 8 %5)
  %.not91 = icmp eq i32 %105, 0
  %. = select i1 %.not91, i64 0, i64 -64
  br label %106

106:                                              ; preds = %94, %95, %46, %29
  %.1 = phi i64 [ %34, %29 ], [ -64, %94 ], [ -64, %46 ], [ %., %95 ]
  ret i64 %.1
}

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

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

; Function Attrs: nounwind uwtable
declare hidden void @ZSTDMT_initJobCCtxParams(ptr dead_on_unwind noalias writable sret(%struct.ZSTD_CCtx_params_s) align 8, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8) local_unnamed_addr #2

declare i64 @ZSTD_initCStream_internal(ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef byval(%struct.ZSTD_CCtx_params_s) align 8, i64 noundef) local_unnamed_addr #3

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

declare ptr @ZSTD_createCDict_advanced(ptr noundef, i64 noundef, i32 noundef, i32 noundef, ptr noundef byval(%struct.ZSTD_compressionParameters) align 8, ptr noundef byval(%struct.ZSTD_customMem) align 8) local_unnamed_addr #3

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

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

declare i64 @ZSTD_compressBound(i64 noundef) local_unnamed_addr #3

declare ptr @ZSTD_malloc(i64 noundef, ptr noundef byval(%struct.ZSTD_customMem) align 8) local_unnamed_addr #3

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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


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