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

; 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.ZDICT_cover_params_t = type { i32, i32, i32, i32, %struct.ZDICT_params_t }
%struct.ZDICT_params_t = type { i32, i32, i32 }
%struct.COVER_best_s = type { i32, i32, i64, ptr, i64, %struct.ZDICT_cover_params_t, i64 }
%struct.COVER_ctx_t = type { ptr, ptr, ptr, i64, ptr, i64, ptr, ptr, i32 }
%struct.COVER_tryParameters_data_s = type { ptr, ptr, i64, %struct.ZDICT_cover_params_t }

@g_displayLevel = external hidden global i32, align 4
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [31 x i8], align 1
@g_time = external hidden global i64, align 8
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [1 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @COVER_checkParameters(ptr noundef byval(%struct.ZDICT_cover_params_t) align 8, i64 noundef) #1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

declare i32 @fflush(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden void @COVER_ctx_destroy(ptr noundef) #1

declare i32 @ZSTD_isError(i64 noundef) #3

; 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
define dso_local i64 @ZDICT_optimizeTrainFromBuffer_cover(ptr noundef %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5) #1 {
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca %struct.COVER_best_s, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca %struct.COVER_ctx_t, align 8
  %30 = alloca ptr, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i64 %1, ptr %9, align 8, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i32 %4, ptr %12, align 4, !tbaa !11
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %33, i32 0, i32 3
  %35 = load i32, ptr %34, align 4, !tbaa !13
  store i32 %35, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !16
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %41

40:                                               ; preds = %6
  br label %45

41:                                               ; preds = %6
  %42 = load ptr, ptr %13, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !16
  br label %45

45:                                               ; preds = %41, %40
  %46 = phi i32 [ 6, %40 ], [ %44, %41 ]
  store i32 %46, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %47, i32 0, i32 1
  %49 = load i32, ptr %48, align 4, !tbaa !16
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %52

51:                                               ; preds = %45
  br label %56

52:                                               ; preds = %45
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %53, i32 0, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !16
  br label %56

56:                                               ; preds = %52, %51
  %57 = phi i32 [ 8, %51 ], [ %55, %52 ]
  store i32 %57, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %58 = load ptr, ptr %13, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %58, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !17
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %63

62:                                               ; preds = %56
  br label %67

63:                                               ; preds = %56
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 4, !tbaa !17
  br label %67

67:                                               ; preds = %63, %62
  %68 = phi i32 [ 50, %62 ], [ %66, %63 ]
  store i32 %68, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %69, i32 0, i32 0
  %71 = load i32, ptr %70, align 4, !tbaa !17
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %67
  br label %78

74:                                               ; preds = %67
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !17
  br label %78

78:                                               ; preds = %74, %73
  %79 = phi i32 [ 2000, %73 ], [ %77, %74 ]
  store i32 %79, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %80, i32 0, i32 2
  %82 = load i32, ptr %81, align 4, !tbaa !18
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %78
  br label %89

85:                                               ; preds = %78
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 4, !tbaa !18
  br label %89

89:                                               ; preds = %85, %84
  %90 = phi i32 [ 40, %84 ], [ %88, %85 ]
  store i32 %90, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %91 = load i32, ptr %18, align 4, !tbaa !11
  %92 = load i32, ptr %17, align 4, !tbaa !11
  %93 = sub i32 %91, %92
  %94 = load i32, ptr %19, align 4, !tbaa !11
  %95 = udiv i32 %93, %94
  %96 = icmp ugt i32 %95, 1
  br i1 %96, label %97, label %103

97:                                               ; preds = %89
  %98 = load i32, ptr %18, align 4, !tbaa !11
  %99 = load i32, ptr %17, align 4, !tbaa !11
  %100 = sub i32 %98, %99
  %101 = load i32, ptr %19, align 4, !tbaa !11
  %102 = udiv i32 %100, %101
  br label %104

103:                                              ; preds = %89
  br label %104

104:                                              ; preds = %103, %97
  %105 = phi i32 [ %102, %97 ], [ 1, %103 ]
  store i32 %105, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %106 = load i32, ptr %16, align 4, !tbaa !11
  %107 = load i32, ptr %15, align 4, !tbaa !11
  %108 = sub i32 %106, %107
  %109 = udiv i32 %108, 2
  %110 = add i32 1, %109
  %111 = load i32, ptr %18, align 4, !tbaa !11
  %112 = load i32, ptr %17, align 4, !tbaa !11
  %113 = sub i32 %111, %112
  %114 = load i32, ptr %20, align 4, !tbaa !11
  %115 = udiv i32 %113, %114
  %116 = add i32 1, %115
  %117 = mul i32 %110, %116
  store i32 %117, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %118, i32 0, i32 4
  %120 = getelementptr inbounds %struct.ZDICT_params_t, ptr %119, i32 0, i32 1
  %121 = load i32, ptr %120, align 4, !tbaa !19
  store i32 %121, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 1, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %26) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  store ptr null, ptr %27, align 8, !tbaa !5
  %122 = load i32, ptr %17, align 4, !tbaa !11
  %123 = load i32, ptr %16, align 4, !tbaa !11
  %124 = icmp ult i32 %122, %123
  br i1 %124, label %129, label %125

125:                                              ; preds = %104
  %126 = load i32, ptr %18, align 4, !tbaa !11
  %127 = load i32, ptr %17, align 4, !tbaa !11
  %128 = icmp ult i32 %126, %127
  br i1 %128, label %129, label %138

129:                                              ; preds = %125, %104
  %130 = load i32, ptr %22, align 4, !tbaa !11
  %131 = icmp sge i32 %130, 1
  br i1 %131, label %132, label %137

132:                                              ; preds = %129
  %133 = load ptr, ptr @stderr, align 8, !tbaa !5
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.6) #6
  %135 = load ptr, ptr @stderr, align 8, !tbaa !5
  %136 = call i32 @fflush(ptr noundef %135)
  br label %137

137:                                              ; preds = %132, %129
  store i64 -1, ptr %7, align 8
  store i32 1, ptr %28, align 4
  br label %371

138:                                              ; preds = %125
  %139 = load i32, ptr %12, align 4, !tbaa !11
  %140 = icmp eq i32 %139, 0
  br i1 %140, label %141, label %150

141:                                              ; preds = %138
  %142 = load i32, ptr @g_displayLevel, align 4, !tbaa !11
  %143 = icmp sge i32 %142, 1
  br i1 %143, label %144, label %149

144:                                              ; preds = %141
  %145 = load ptr, ptr @stderr, align 8, !tbaa !5
  %146 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %145, ptr noundef @.str.1) #6
  %147 = load ptr, ptr @stderr, align 8, !tbaa !5
  %148 = call i32 @fflush(ptr noundef %147)
  br label %149

149:                                              ; preds = %144, %141
  store i64 -1, ptr %7, align 8
  store i32 1, ptr %28, align 4
  br label %371

150:                                              ; preds = %138
  %151 = load i64, ptr %9, align 8, !tbaa !9
  %152 = icmp ult i64 %151, 256
  br i1 %152, label %153, label %162

153:                                              ; preds = %150
  %154 = load i32, ptr @g_displayLevel, align 4, !tbaa !11
  %155 = icmp sge i32 %154, 1
  br i1 %155, label %156, label %161

156:                                              ; preds = %153
  %157 = load ptr, ptr @stderr, align 8, !tbaa !5
  %158 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %157, ptr noundef @.str.2, i32 noundef 256) #6
  %159 = load ptr, ptr @stderr, align 8, !tbaa !5
  %160 = call i32 @fflush(ptr noundef %159)
  br label %161

161:                                              ; preds = %156, %153
  store i64 -70, ptr %7, align 8
  store i32 1, ptr %28, align 4
  br label %371

162:                                              ; preds = %150
  %163 = load i32, ptr %14, align 4, !tbaa !11
  %164 = icmp ugt i32 %163, 1
  br i1 %164, label %165, label %173

165:                                              ; preds = %162
  %166 = load i32, ptr %14, align 4, !tbaa !11
  %167 = zext i32 %166 to i64
  %168 = call ptr @POOL_create(i64 noundef %167, i64 noundef 1)
  store ptr %168, ptr %27, align 8, !tbaa !5
  %169 = load ptr, ptr %27, align 8, !tbaa !5
  %170 = icmp ne ptr %169, null
  br i1 %170, label %172, label %171

171:                                              ; preds = %165
  store i64 -64, ptr %7, align 8
  store i32 1, ptr %28, align 4
  br label %371

172:                                              ; preds = %165
  br label %173

173:                                              ; preds = %172, %162
  call void @COVER_best_init(ptr noundef %26)
  %174 = load i32, ptr %22, align 4, !tbaa !11
  %175 = icmp eq i32 %174, 0
  br i1 %175, label %176, label %177

176:                                              ; preds = %173
  br label %180

177:                                              ; preds = %173
  %178 = load i32, ptr %22, align 4, !tbaa !11
  %179 = sub nsw i32 %178, 1
  br label %180

180:                                              ; preds = %177, %176
  %181 = phi i32 [ 0, %176 ], [ %179, %177 ]
  store i32 %181, ptr @g_displayLevel, align 4, !tbaa !11
  %182 = load i32, ptr %22, align 4, !tbaa !11
  %183 = icmp sge i32 %182, 2
  br i1 %183, label %184, label %190

184:                                              ; preds = %180
  %185 = load ptr, ptr @stderr, align 8, !tbaa !5
  %186 = load i32, ptr %21, align 4, !tbaa !11
  %187 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %185, ptr noundef @.str.7, i32 noundef %186) #6
  %188 = load ptr, ptr @stderr, align 8, !tbaa !5
  %189 = call i32 @fflush(ptr noundef %188)
  br label %190

190:                                              ; preds = %184, %180
  %191 = load i32, ptr %15, align 4, !tbaa !11
  store i32 %191, ptr %24, align 4, !tbaa !11
  br label %192

192:                                              ; preds = %338, %190
  %193 = load i32, ptr %24, align 4, !tbaa !11
  %194 = load i32, ptr %16, align 4, !tbaa !11
  %195 = icmp ule i32 %193, %194
  br i1 %195, label %196, label %341

196:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 72, ptr %29) #6
  %197 = load i32, ptr %22, align 4, !tbaa !11
  %198 = icmp sge i32 %197, 3
  br i1 %198, label %199, label %205

199:                                              ; preds = %196
  %200 = load ptr, ptr @stderr, align 8, !tbaa !5
  %201 = load i32, ptr %24, align 4, !tbaa !11
  %202 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %200, ptr noundef @.str.8, i32 noundef %201) #6
  %203 = load ptr, ptr @stderr, align 8, !tbaa !5
  %204 = call i32 @fflush(ptr noundef %203)
  br label %205

205:                                              ; preds = %199, %196
  %206 = load ptr, ptr %10, align 8, !tbaa !5
  %207 = load ptr, ptr %11, align 8, !tbaa !5
  %208 = load i32, ptr %12, align 4, !tbaa !11
  %209 = load i32, ptr %24, align 4, !tbaa !11
  %210 = call i32 @COVER_ctx_init(ptr noundef %29, ptr noundef %206, ptr noundef %207, i32 noundef %208, i32 noundef %209)
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %222, label %212

212:                                              ; preds = %205
  %213 = load i32, ptr %22, align 4, !tbaa !11
  %214 = icmp sge i32 %213, 1
  br i1 %214, label %215, label %220

215:                                              ; preds = %212
  %216 = load ptr, ptr @stderr, align 8, !tbaa !5
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %216, ptr noundef @.str.9) #6
  %218 = load ptr, ptr @stderr, align 8, !tbaa !5
  %219 = call i32 @fflush(ptr noundef %218)
  br label %220

220:                                              ; preds = %215, %212
  call void @COVER_best_destroy(ptr noundef %26)
  %221 = load ptr, ptr %27, align 8, !tbaa !5
  call void @POOL_free(ptr noundef %221)
  store i64 -1, ptr %7, align 8
  store i32 1, ptr %28, align 4
  br label %335

222:                                              ; preds = %205
  %223 = load i32, ptr %17, align 4, !tbaa !11
  store i32 %223, ptr %25, align 4, !tbaa !11
  br label %224

224:                                              ; preds = %330, %222
  %225 = load i32, ptr %25, align 4, !tbaa !11
  %226 = load i32, ptr %18, align 4, !tbaa !11
  %227 = icmp ule i32 %225, %226
  br i1 %227, label %228, label %334

228:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %229 = call noalias ptr @malloc(i64 noundef 56) #7
  store ptr %229, ptr %30, align 8, !tbaa !5
  %230 = load i32, ptr %22, align 4, !tbaa !11
  %231 = icmp sge i32 %230, 3
  br i1 %231, label %232, label %238

232:                                              ; preds = %228
  %233 = load ptr, ptr @stderr, align 8, !tbaa !5
  %234 = load i32, ptr %25, align 4, !tbaa !11
  %235 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %233, ptr noundef @.str.10, i32 noundef %234) #6
  %236 = load ptr, ptr @stderr, align 8, !tbaa !5
  %237 = call i32 @fflush(ptr noundef %236)
  br label %238

238:                                              ; preds = %232, %228
  %239 = load ptr, ptr %30, align 8, !tbaa !5
  %240 = icmp ne ptr %239, null
  br i1 %240, label %251, label %241

241:                                              ; preds = %238
  %242 = load i32, ptr %22, align 4, !tbaa !11
  %243 = icmp sge i32 %242, 1
  br i1 %243, label %244, label %249

244:                                              ; preds = %241
  %245 = load ptr, ptr @stderr, align 8, !tbaa !5
  %246 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %245, ptr noundef @.str.11) #6
  %247 = load ptr, ptr @stderr, align 8, !tbaa !5
  %248 = call i32 @fflush(ptr noundef %247)
  br label %249

249:                                              ; preds = %244, %241
  call void @COVER_best_destroy(ptr noundef %26)
  call void @COVER_ctx_destroy(ptr noundef %29)
  %250 = load ptr, ptr %27, align 8, !tbaa !5
  call void @POOL_free(ptr noundef %250)
  store i64 -1, ptr %7, align 8
  store i32 1, ptr %28, align 4
  br label %327

251:                                              ; preds = %238
  %252 = load ptr, ptr %30, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.COVER_tryParameters_data_s, ptr %252, i32 0, i32 0
  store ptr %29, ptr %253, align 8, !tbaa !20
  %254 = load ptr, ptr %30, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.COVER_tryParameters_data_s, ptr %254, i32 0, i32 1
  store ptr %26, ptr %255, align 8, !tbaa !22
  %256 = load i64, ptr %9, align 8, !tbaa !9
  %257 = load ptr, ptr %30, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.COVER_tryParameters_data_s, ptr %257, i32 0, i32 2
  store i64 %256, ptr %258, align 8, !tbaa !23
  %259 = load ptr, ptr %30, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.COVER_tryParameters_data_s, ptr %259, i32 0, i32 3
  %261 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %260, ptr align 4 %261, i64 28, i1 false), !tbaa.struct !24
  %262 = load i32, ptr %25, align 4, !tbaa !11
  %263 = load ptr, ptr %30, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.COVER_tryParameters_data_s, ptr %263, i32 0, i32 3
  %265 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %264, i32 0, i32 0
  store i32 %262, ptr %265, align 8, !tbaa !25
  %266 = load i32, ptr %24, align 4, !tbaa !11
  %267 = load ptr, ptr %30, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.COVER_tryParameters_data_s, ptr %267, i32 0, i32 3
  %269 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %268, i32 0, i32 1
  store i32 %266, ptr %269, align 4, !tbaa !26
  %270 = load i32, ptr %19, align 4, !tbaa !11
  %271 = load ptr, ptr %30, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.COVER_tryParameters_data_s, ptr %271, i32 0, i32 3
  %273 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %272, i32 0, i32 2
  store i32 %270, ptr %273, align 8, !tbaa !27
  %274 = load i32, ptr @g_displayLevel, align 4, !tbaa !11
  %275 = load ptr, ptr %30, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.COVER_tryParameters_data_s, ptr %275, i32 0, i32 3
  %277 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %276, i32 0, i32 4
  %278 = getelementptr inbounds %struct.ZDICT_params_t, ptr %277, i32 0, i32 1
  store i32 %274, ptr %278, align 4, !tbaa !28
  %279 = load ptr, ptr %30, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.COVER_tryParameters_data_s, ptr %279, i32 0, i32 3
  %281 = load i64, ptr %9, align 8, !tbaa !9
  %282 = call i32 @COVER_checkParameters(ptr noundef byval(%struct.ZDICT_cover_params_t) align 8 %280, i64 noundef %281)
  %283 = icmp ne i32 %282, 0
  br i1 %283, label %294, label %284

284:                                              ; preds = %251
  %285 = load i32, ptr @g_displayLevel, align 4, !tbaa !11
  %286 = icmp sge i32 %285, 1
  br i1 %286, label %287, label %292

287:                                              ; preds = %284
  %288 = load ptr, ptr @stderr, align 8, !tbaa !5
  %289 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %288, ptr noundef @.str) #6
  %290 = load ptr, ptr @stderr, align 8, !tbaa !5
  %291 = call i32 @fflush(ptr noundef %290)
  br label %292

292:                                              ; preds = %287, %284
  %293 = load ptr, ptr %30, align 8, !tbaa !5
  call void @free(ptr noundef %293) #6
  store i32 7, ptr %28, align 4
  br label %327

294:                                              ; preds = %251
  call void @COVER_best_start(ptr noundef %26)
  %295 = load ptr, ptr %27, align 8, !tbaa !5
  %296 = icmp ne ptr %295, null
  br i1 %296, label %297, label %300

297:                                              ; preds = %294
  %298 = load ptr, ptr %27, align 8, !tbaa !5
  %299 = load ptr, ptr %30, align 8, !tbaa !5
  call void @POOL_add(ptr noundef %298, ptr noundef @COVER_tryParameters, ptr noundef %299)
  br label %302

300:                                              ; preds = %294
  %301 = load ptr, ptr %30, align 8, !tbaa !5
  call void @COVER_tryParameters(ptr noundef %301)
  br label %302

302:                                              ; preds = %300, %297
  %303 = load i32, ptr %22, align 4, !tbaa !11
  %304 = icmp sge i32 %303, 2
  br i1 %304, label %305, label %324

305:                                              ; preds = %302
  %306 = call i64 @clock() #6
  %307 = load i64, ptr @g_time, align 8, !tbaa !9
  %308 = sub nsw i64 %306, %307
  %309 = icmp sgt i64 %308, 150000
  br i1 %309, label %313, label %310

310:                                              ; preds = %305
  %311 = load i32, ptr %22, align 4, !tbaa !11
  %312 = icmp sge i32 %311, 4
  br i1 %312, label %313, label %323

313:                                              ; preds = %310, %305
  %314 = call i64 @clock() #6
  store i64 %314, ptr @g_time, align 8, !tbaa !9
  %315 = load ptr, ptr @stderr, align 8, !tbaa !5
  %316 = load i32, ptr %23, align 4, !tbaa !11
  %317 = mul i32 %316, 100
  %318 = load i32, ptr %21, align 4, !tbaa !11
  %319 = udiv i32 %317, %318
  %320 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %315, ptr noundef @.str.12, i32 noundef %319) #6
  %321 = load ptr, ptr @stderr, align 8, !tbaa !5
  %322 = call i32 @fflush(ptr noundef %321)
  br label %323

323:                                              ; preds = %313, %310
  br label %324

324:                                              ; preds = %323, %302
  %325 = load i32, ptr %23, align 4, !tbaa !11
  %326 = add i32 %325, 1
  store i32 %326, ptr %23, align 4, !tbaa !11
  store i32 0, ptr %28, align 4
  br label %327

327:                                              ; preds = %324, %292, %249
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  %328 = load i32, ptr %28, align 4
  switch i32 %328, label %335 [
    i32 0, label %329
    i32 7, label %330
  ]

329:                                              ; preds = %327
  br label %330

330:                                              ; preds = %329, %327
  %331 = load i32, ptr %20, align 4, !tbaa !11
  %332 = load i32, ptr %25, align 4, !tbaa !11
  %333 = add i32 %332, %331
  store i32 %333, ptr %25, align 4, !tbaa !11
  br label %224, !llvm.loop !29

334:                                              ; preds = %224
  call void @COVER_best_wait(ptr noundef %26)
  call void @COVER_ctx_destroy(ptr noundef %29)
  store i32 0, ptr %28, align 4
  br label %335

335:                                              ; preds = %334, %327, %220
  call void @llvm.lifetime.end.p0(i64 72, ptr %29) #6
  %336 = load i32, ptr %28, align 4
  switch i32 %336, label %371 [
    i32 0, label %337
  ]

337:                                              ; preds = %335
  br label %338

338:                                              ; preds = %337
  %339 = load i32, ptr %24, align 4, !tbaa !11
  %340 = add i32 %339, 2
  store i32 %340, ptr %24, align 4, !tbaa !11
  br label %192, !llvm.loop !31

341:                                              ; preds = %192
  %342 = load i32, ptr %22, align 4, !tbaa !11
  %343 = icmp sge i32 %342, 2
  br i1 %343, label %344, label %349

344:                                              ; preds = %341
  %345 = load ptr, ptr @stderr, align 8, !tbaa !5
  %346 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %345, ptr noundef @.str.13, ptr noundef @.str.14) #6
  %347 = load ptr, ptr @stderr, align 8, !tbaa !5
  %348 = call i32 @fflush(ptr noundef %347)
  br label %349

349:                                              ; preds = %344, %341
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %350 = getelementptr inbounds %struct.COVER_best_s, ptr %26, i32 0, i32 4
  %351 = load i64, ptr %350, align 8, !tbaa !32
  store i64 %351, ptr %31, align 8, !tbaa !9
  %352 = getelementptr inbounds %struct.COVER_best_s, ptr %26, i32 0, i32 6
  %353 = load i64, ptr %352, align 8, !tbaa !34
  %354 = call i32 @ZSTD_isError(i64 noundef %353)
  %355 = icmp ne i32 %354, 0
  br i1 %355, label %356, label %361

356:                                              ; preds = %349
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %357 = getelementptr inbounds %struct.COVER_best_s, ptr %26, i32 0, i32 6
  %358 = load i64, ptr %357, align 8, !tbaa !34
  store i64 %358, ptr %32, align 8, !tbaa !9
  call void @COVER_best_destroy(ptr noundef %26)
  %359 = load ptr, ptr %27, align 8, !tbaa !5
  call void @POOL_free(ptr noundef %359)
  %360 = load i64, ptr %32, align 8, !tbaa !9
  store i64 %360, ptr %7, align 8
  store i32 1, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  br label %370

361:                                              ; preds = %349
  %362 = load ptr, ptr %13, align 8, !tbaa !5
  %363 = getelementptr inbounds %struct.COVER_best_s, ptr %26, i32 0, i32 5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %362, ptr align 8 %363, i64 28, i1 false), !tbaa.struct !24
  %364 = load ptr, ptr %8, align 8, !tbaa !5
  %365 = getelementptr inbounds %struct.COVER_best_s, ptr %26, i32 0, i32 3
  %366 = load ptr, ptr %365, align 8, !tbaa !35
  %367 = load i64, ptr %31, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %364, ptr align 1 %366, i64 %367, i1 false)
  call void @COVER_best_destroy(ptr noundef %26)
  %368 = load ptr, ptr %27, align 8, !tbaa !5
  call void @POOL_free(ptr noundef %368)
  %369 = load i64, ptr %31, align 8, !tbaa !9
  store i64 %369, ptr %7, align 8
  store i32 1, ptr %28, align 4
  br label %370

370:                                              ; preds = %361, %356
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  br label %371

371:                                              ; preds = %370, %335, %171, %161, %149, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  %372 = load i64, ptr %7, align 8
  ret i64 %372
}

declare ptr @POOL_create(i64 noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @COVER_best_init(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @COVER_best_destroy(ptr noundef) #1

declare void @POOL_free(ptr noundef) #3

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

; 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) #5

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @COVER_best_start(ptr noundef) #1

declare void @POOL_add(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @COVER_tryParameters(ptr noundef) #1

; Function Attrs: nounwind
declare i64 @clock() #2

; Function Attrs: nounwind uwtable
declare hidden void @COVER_best_wait(ptr 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 = { nounwind "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 = { nounwind allocsize(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 nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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, !12, i64 12}
!14 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !15, i64 16}
!15 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!16 = !{!14, !12, i64 4}
!17 = !{!14, !12, i64 0}
!18 = !{!14, !12, i64 8}
!19 = !{!14, !12, i64 20}
!20 = !{!21, !6, i64 0}
!21 = !{!"COVER_tryParameters_data_s", !6, i64 0, !6, i64 8, !10, i64 16, !14, i64 24}
!22 = !{!21, !6, i64 8}
!23 = !{!21, !10, i64 16}
!24 = !{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}
!25 = !{!21, !12, i64 24}
!26 = !{!21, !12, i64 28}
!27 = !{!21, !12, i64 32}
!28 = !{!21, !12, i64 44}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = !{!33, !10, i64 24}
!33 = !{!"COVER_best_s", !12, i64 0, !12, i64 4, !10, i64 8, !6, i64 16, !10, i64 24, !14, i64 32, !10, i64 64}
!34 = !{!33, !10, i64 64}
!35 = !{!33, !6, i64 16}


; 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.ZDICT_cover_params_t = type { i32, i32, i32, i32, %struct.ZDICT_params_t }
%struct.ZDICT_params_t = type { i32, i32, i32 }
%struct.COVER_best_s = type { i32, i32, i64, ptr, i64, %struct.ZDICT_cover_params_t, i64 }
%struct.COVER_ctx_t = type { ptr, ptr, ptr, i64, ptr, i64, ptr, ptr, i32 }

@g_displayLevel = external hidden local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [31 x i8], align 1
@g_time = external hidden local_unnamed_addr global i64, align 8
@.str.12 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [1 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @COVER_checkParameters(ptr noundef byval(%struct.ZDICT_cover_params_t) align 8, i64 noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2

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

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

declare i32 @ZSTD_isError(i64 noundef) local_unnamed_addr #3

; 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
define dso_local i64 @ZDICT_optimizeTrainFromBuffer_cover(ptr nocapture noundef writeonly %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr nocapture noundef %5) local_unnamed_addr #1 {
  %7 = alloca %struct.COVER_best_s, align 8
  %8 = alloca %struct.COVER_ctx_t, align 8
  %9 = getelementptr inbounds i8, ptr %5, i64 12
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %5, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !11
  %13 = icmp eq i32 %12, 0
  %spec.select = select i1 %13, i32 6, i32 %12
  %14 = select i1 %13, i32 8, i32 %12
  %15 = load i32, ptr %5, align 4, !tbaa !12
  %16 = icmp eq i32 %15, 0
  %17 = select i1 %16, i32 50, i32 %15
  %18 = select i1 %16, i32 2000, i32 %15
  %19 = getelementptr inbounds i8, ptr %5, i64 8
  %20 = load i32, ptr %19, align 4, !tbaa !13
  %21 = icmp eq i32 %20, 0
  %22 = select i1 %21, i32 40, i32 %20
  %23 = select i1 %16, i32 1950, i32 0
  %24 = udiv i32 %23, %22
  %25 = tail call i32 @llvm.umax.i32(i32 %24, i32 1)
  %.lhs.trunc = trunc nuw nsw i32 %23 to i16
  %.rhs.trunc = trunc nuw nsw i32 %25 to i16
  %26 = udiv i16 %.lhs.trunc, %.rhs.trunc
  %narrow = add nuw nsw i16 %26, 1
  %27 = zext nneg i16 %narrow to i32
  %28 = zext i1 %13 to i32
  %29 = shl nuw nsw i32 %27, %28
  %30 = getelementptr inbounds i8, ptr %5, i64 20
  %31 = load i32, ptr %30, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %7) #9
  %32 = icmp ult i32 %17, %14
  %33 = icmp ult i32 %18, %17
  %or.cond126 = or i1 %32, %33
  br i1 %or.cond126, label %34, label %41

34:                                               ; preds = %6
  %35 = icmp sgt i32 %31, 0
  br i1 %35, label %36, label %163

36:                                               ; preds = %34
  %37 = load ptr, ptr @stderr, align 8, !tbaa !15
  %38 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.6) #10
  %39 = load ptr, ptr @stderr, align 8, !tbaa !15
  %40 = tail call i32 @fflush(ptr noundef %39)
  br label %163

41:                                               ; preds = %6
  %42 = icmp eq i32 %4, 0
  br i1 %42, label %43, label %51

43:                                               ; preds = %41
  %44 = load i32, ptr @g_displayLevel, align 4, !tbaa !17
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %46, label %163

46:                                               ; preds = %43
  %47 = load ptr, ptr @stderr, align 8, !tbaa !15
  %48 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.1) #10
  %49 = load ptr, ptr @stderr, align 8, !tbaa !15
  %50 = tail call i32 @fflush(ptr noundef %49)
  br label %163

51:                                               ; preds = %41
  %52 = icmp ult i64 %1, 256
  br i1 %52, label %53, label %61

53:                                               ; preds = %51
  %54 = load i32, ptr @g_displayLevel, align 4, !tbaa !17
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %56, label %163

56:                                               ; preds = %53
  %57 = load ptr, ptr @stderr, align 8, !tbaa !15
  %58 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef nonnull @.str.2, i32 noundef 256) #10
  %59 = load ptr, ptr @stderr, align 8, !tbaa !15
  %60 = tail call i32 @fflush(ptr noundef %59)
  br label %163

61:                                               ; preds = %51
  %62 = icmp ugt i32 %10, 1
  br i1 %62, label %63, label %66

63:                                               ; preds = %61
  %64 = zext i32 %10 to i64
  %65 = tail call ptr @POOL_create(i64 noundef %64, i64 noundef 1) #9
  %.not = icmp eq ptr %65, null
  br i1 %.not, label %163, label %66

66:                                               ; preds = %63, %61
  %.0102 = phi ptr [ %65, %63 ], [ null, %61 ]
  call void @COVER_best_init(ptr noundef nonnull %7)
  %67 = call i32 @llvm.usub.sat.i32(i32 %31, i32 1)
  store i32 %67, ptr @g_displayLevel, align 4, !tbaa !17
  %68 = icmp sgt i32 %31, 1
  br i1 %68, label %69, label %74

69:                                               ; preds = %66
  %70 = load ptr, ptr @stderr, align 8, !tbaa !15
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str.7, i32 noundef %29) #10
  %72 = load ptr, ptr @stderr, align 8, !tbaa !15
  %73 = call i32 @fflush(ptr noundef %72)
  br label %74

74:                                               ; preds = %69, %66
  %.not119139 = icmp ugt i32 %spec.select, %14
  br i1 %.not119139, label %._crit_edge144, label %.lr.ph143.split.preheader

.lr.ph143.split.preheader:                        ; preds = %74
  %75 = icmp sgt i32 %31, 2
  %.not125 = icmp eq ptr %.0102, null
  %76 = icmp ugt i32 %31, 3
  br label %.lr.ph143.split

.lr.ph143.split:                                  ; preds = %.lr.ph143.split.preheader, %._crit_edge
  %.095141 = phi i32 [ %.297.ph, %._crit_edge ], [ 1, %.lr.ph143.split.preheader ]
  %.099140 = phi i32 [ %145, %._crit_edge ], [ %spec.select, %.lr.ph143.split.preheader ]
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %8) #9
  br i1 %75, label %77, label %82

77:                                               ; preds = %.lr.ph143.split
  %78 = load ptr, ptr @stderr, align 8, !tbaa !15
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str.8, i32 noundef %.099140) #10
  %80 = load ptr, ptr @stderr, align 8, !tbaa !15
  %81 = call i32 @fflush(ptr noundef %80)
  br label %82

82:                                               ; preds = %77, %.lr.ph143.split
  %83 = call i32 @COVER_ctx_init(ptr noundef nonnull %8, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %.099140)
  %.not121 = icmp eq i32 %83, 0
  br i1 %.not121, label %.split.us, label %.preheader

.split.us:                                        ; preds = %82
  %84 = icmp sgt i32 %31, 0
  br i1 %84, label %85, label %90

85:                                               ; preds = %.split.us
  %86 = load ptr, ptr @stderr, align 8, !tbaa !15
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef nonnull @.str.9) #10
  %88 = load ptr, ptr @stderr, align 8, !tbaa !15
  %89 = call i32 @fflush(ptr noundef %88)
  br label %90

90:                                               ; preds = %85, %.split.us
  call void @COVER_best_destroy(ptr noundef nonnull %7)
  br label %.thread131

.preheader:                                       ; preds = %82, %143
  %.196138 = phi i32 [ %.297.ph, %143 ], [ %.095141, %82 ]
  %.0103137 = phi i32 [ %144, %143 ], [ %17, %82 ]
  %91 = call noalias dereferenceable_or_null(56) ptr @malloc(i64 noundef 56) #11
  br i1 %75, label %92, label %97

92:                                               ; preds = %.preheader
  %93 = load ptr, ptr @stderr, align 8, !tbaa !15
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %93, ptr noundef nonnull @.str.10, i32 noundef %.0103137) #10
  %95 = load ptr, ptr @stderr, align 8, !tbaa !15
  %96 = call i32 @fflush(ptr noundef %95)
  br label %97

97:                                               ; preds = %92, %.preheader
  %.not123 = icmp eq ptr %91, null
  br i1 %.not123, label %98, label %105

98:                                               ; preds = %97
  %99 = icmp sgt i32 %31, 0
  br i1 %99, label %100, label %142

100:                                              ; preds = %98
  %101 = load ptr, ptr @stderr, align 8, !tbaa !15
  %102 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef nonnull @.str.11) #10
  %103 = load ptr, ptr @stderr, align 8, !tbaa !15
  %104 = call i32 @fflush(ptr noundef %103)
  br label %142

105:                                              ; preds = %97
  store ptr %8, ptr %91, align 8, !tbaa !18
  %106 = getelementptr inbounds i8, ptr %91, i64 8
  store ptr %7, ptr %106, align 8, !tbaa !21
  %107 = getelementptr inbounds i8, ptr %91, i64 16
  store i64 %1, ptr %107, align 8, !tbaa !22
  %108 = getelementptr inbounds i8, ptr %91, i64 24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(28) %108, ptr noundef nonnull align 4 dereferenceable(28) %5, i64 28, i1 false), !tbaa.struct !23
  store i32 %.0103137, ptr %108, align 8, !tbaa !24
  %109 = getelementptr inbounds i8, ptr %91, i64 28
  store i32 %.099140, ptr %109, align 4, !tbaa !25
  %110 = getelementptr inbounds i8, ptr %91, i64 32
  store i32 %22, ptr %110, align 8, !tbaa !26
  %111 = load i32, ptr @g_displayLevel, align 4, !tbaa !17
  %112 = getelementptr inbounds i8, ptr %91, i64 44
  store i32 %111, ptr %112, align 4, !tbaa !27
  %113 = call i32 @COVER_checkParameters(ptr noundef nonnull byval(%struct.ZDICT_cover_params_t) align 8 %108, i64 noundef %1)
  %.not124 = icmp eq i32 %113, 0
  br i1 %.not124, label %114, label %123

114:                                              ; preds = %105
  %115 = load i32, ptr @g_displayLevel, align 4, !tbaa !17
  %116 = icmp sgt i32 %115, 0
  br i1 %116, label %117, label %122

117:                                              ; preds = %114
  %118 = load ptr, ptr @stderr, align 8, !tbaa !15
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef nonnull @.str) #10
  %120 = load ptr, ptr @stderr, align 8, !tbaa !15
  %121 = call i32 @fflush(ptr noundef %120)
  br label %122

122:                                              ; preds = %117, %114
  call void @free(ptr noundef nonnull %91) #9
  br label %143

123:                                              ; preds = %105
  call void @COVER_best_start(ptr noundef nonnull %7)
  br i1 %.not125, label %125, label %124

124:                                              ; preds = %123
  call void @POOL_add(ptr noundef nonnull %.0102, ptr noundef nonnull @COVER_tryParameters, ptr noundef nonnull %91) #9
  br label %126

125:                                              ; preds = %123
  call void @COVER_tryParameters(ptr noundef nonnull %91)
  br label %126

126:                                              ; preds = %125, %124
  br i1 %68, label %127, label %140

127:                                              ; preds = %126
  %128 = call i64 @clock() #9
  %129 = load i64, ptr @g_time, align 8, !tbaa !28
  %130 = sub nsw i64 %128, %129
  %131 = icmp sgt i64 %130, 150000
  %or.cond = select i1 %131, i1 true, i1 %76
  br i1 %or.cond, label %132, label %140

132:                                              ; preds = %127
  %133 = call i64 @clock() #9
  store i64 %133, ptr @g_time, align 8, !tbaa !28
  %134 = load ptr, ptr @stderr, align 8, !tbaa !15
  %135 = mul i32 %.196138, 100
  %136 = udiv i32 %135, %29
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef nonnull @.str.12, i32 noundef %136) #10
  %138 = load ptr, ptr @stderr, align 8, !tbaa !15
  %139 = call i32 @fflush(ptr noundef %138)
  br label %140

140:                                              ; preds = %132, %127, %126
  %141 = add i32 %.196138, 1
  br label %143

142:                                              ; preds = %98, %100
  call void @COVER_best_destroy(ptr noundef nonnull %7)
  call void @COVER_ctx_destroy(ptr noundef nonnull %8)
  br label %.thread131

143:                                              ; preds = %140, %122
  %.297.ph = phi i32 [ %.196138, %122 ], [ %141, %140 ]
  %144 = add i32 %.0103137, %25
  %.not122 = icmp ugt i32 %144, %18
  br i1 %.not122, label %._crit_edge, label %.preheader, !llvm.loop !29

.thread131:                                       ; preds = %142, %90
  call void @POOL_free(ptr noundef %.0102) #9
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #9
  br label %163

._crit_edge:                                      ; preds = %143
  call void @COVER_best_wait(ptr noundef nonnull %7)
  call void @COVER_ctx_destroy(ptr noundef nonnull %8)
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %8) #9
  %145 = add i32 %.099140, 2
  %.not119 = icmp ugt i32 %145, %14
  br i1 %.not119, label %._crit_edge144, label %.lr.ph143.split, !llvm.loop !31

._crit_edge144:                                   ; preds = %._crit_edge, %74
  br i1 %68, label %146, label %151

146:                                              ; preds = %._crit_edge144
  %147 = load ptr, ptr @stderr, align 8, !tbaa !15
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %147, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.14) #10
  %149 = load ptr, ptr @stderr, align 8, !tbaa !15
  %150 = call i32 @fflush(ptr noundef %149)
  br label %151

151:                                              ; preds = %146, %._crit_edge144
  %152 = getelementptr inbounds i8, ptr %7, i64 24
  %153 = load i64, ptr %152, align 8, !tbaa !32
  %154 = getelementptr inbounds i8, ptr %7, i64 64
  %155 = load i64, ptr %154, align 8, !tbaa !34
  %156 = call i32 @ZSTD_isError(i64 noundef %155) #9
  %.not120 = icmp eq i32 %156, 0
  br i1 %.not120, label %159, label %157

157:                                              ; preds = %151
  %158 = load i64, ptr %154, align 8, !tbaa !34
  call void @COVER_best_destroy(ptr noundef nonnull %7)
  call void @POOL_free(ptr noundef %.0102) #9
  br label %163

159:                                              ; preds = %151
  %160 = getelementptr inbounds i8, ptr %7, i64 32
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %5, ptr noundef nonnull align 8 dereferenceable(28) %160, i64 28, i1 false), !tbaa.struct !23
  %161 = getelementptr inbounds i8, ptr %7, i64 16
  %162 = load ptr, ptr %161, align 8, !tbaa !35
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %0, ptr align 1 %162, i64 %153, i1 false)
  call void @COVER_best_destroy(ptr noundef nonnull %7)
  call void @POOL_free(ptr noundef %.0102) #9
  br label %163

163:                                              ; preds = %.thread131, %157, %159, %63, %53, %56, %43, %46, %34, %36
  %.5 = phi i64 [ -1, %36 ], [ -1, %34 ], [ -1, %46 ], [ -1, %43 ], [ -70, %56 ], [ -70, %53 ], [ -64, %63 ], [ %158, %157 ], [ %153, %159 ], [ -1, %.thread131 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #9
  ret i64 %.5
}

declare ptr @POOL_create(i64 noundef, i64 noundef) local_unnamed_addr #3

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

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

declare void @POOL_free(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; 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) #5

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

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

declare void @POOL_add(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @COVER_tryParameters(ptr noundef) #1

; Function Attrs: nounwind
declare i64 @clock() local_unnamed_addr #7

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

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

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

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 = { nofree nounwind "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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { nounwind "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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { cold nounwind }
attributes #11 = { nounwind allocsize(0) }

!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 12}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16}
!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}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !7, i64 20}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !16, i64 0}
!19 = !{!"COVER_tryParameters_data_s", !16, i64 0, !16, i64 8, !20, i64 16, !6, i64 24}
!20 = !{!"long", !8, i64 0}
!21 = !{!19, !16, i64 8}
!22 = !{!19, !20, i64 16}
!23 = !{i64 0, i64 4, !17, i64 4, i64 4, !17, i64 8, i64 4, !17, i64 12, i64 4, !17, i64 16, i64 4, !17, i64 20, i64 4, !17, i64 24, i64 4, !17}
!24 = !{!19, !7, i64 24}
!25 = !{!19, !7, i64 28}
!26 = !{!19, !7, i64 32}
!27 = !{!19, !7, i64 44}
!28 = !{!20, !20, i64 0}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}
!32 = !{!33, !20, i64 24}
!33 = !{!"COVER_best_s", !7, i64 0, !7, i64 4, !20, i64 8, !16, i64 16, !20, i64 24, !6, i64 32, !20, i64 64}
!34 = !{!33, !20, i64 64}
!35 = !{!33, !16, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass