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

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

%struct.FASTCOVER_accel_t = type { i32, i32 }
%struct.ZDICT_fastCover_params_t = type { i32, i32, i32, i32, i32, double, i32, i32, i32, %struct.ZDICT_params_t }
%struct.ZDICT_params_t = type { i32, i32, i32 }
%struct.ZDICT_cover_params_t = type { i32, i32, i32, i32, double, i32, i32, %struct.ZDICT_params_t }
%struct.COVER_best_s = type { %union.pthread_mutex_t, %union.pthread_cond_t, i64, ptr, i64, %struct.ZDICT_cover_params_t, i64 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%struct.FASTCOVER_ctx_t = type { ptr, ptr, ptr, i64, i64, i64, i64, ptr, i32, i32, %struct.FASTCOVER_accel_t }
%struct.FASTCOVER_tryParameters_data_s = type { ptr, ptr, i64, %struct.ZDICT_cover_params_t }

@stderr = external global ptr, align 8
@g_displayLevel = external hidden global i32, align 4
@.str.39 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [31 x i8], align 1
@g_time = external hidden global i64, align 8
@.str.49 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [45 x i8], align 1
@FASTCOVER_defaultAccelParameters = external hidden constant [11 x %struct.FASTCOVER_accel_t], align 16
@.str.54 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [13 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @POOL_free(ptr noundef) #1

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

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

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

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

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

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

declare i32 @fflush(ptr noundef) #5

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @FASTCOVER_convertToCoverParams(ptr noundef byval(%struct.ZDICT_fastCover_params_t) align 8, ptr noundef) #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @ZDICT_optimizeTrainFromBuffer_fastCover(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 %struct.ZDICT_cover_params_t, align 8
  %15 = alloca %struct.FASTCOVER_accel_t, align 4
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %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 i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca %struct.COVER_best_s, align 8
  %33 = alloca ptr, align 8
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca %struct.FASTCOVER_ctx_t, align 8
  %37 = alloca i64, align 8
  %38 = alloca ptr, align 8
  %39 = alloca i64, align 8
  %40 = 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 48, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %41 = load ptr, ptr %13, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %41, i32 0, i32 4
  %43 = load i32, ptr %42, align 8, !tbaa !13
  store i32 %43, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %44 = load ptr, ptr %13, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %44, i32 0, i32 5
  %46 = load double, ptr %45, align 8, !tbaa !17
  %47 = fcmp ole double %46, 0.000000e+00
  br i1 %47, label %48, label %49

48:                                               ; preds = %6
  br label %53

49:                                               ; preds = %6
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %50, i32 0, i32 5
  %52 = load double, ptr %51, align 8, !tbaa !17
  br label %53

53:                                               ; preds = %49, %48
  %54 = phi double [ 7.500000e-01, %48 ], [ %52, %49 ]
  store double %54, ptr %17, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %55 = load ptr, ptr %13, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !19
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %53
  br label %64

60:                                               ; preds = %53
  %61 = load ptr, ptr %13, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %61, i32 0, i32 1
  %63 = load i32, ptr %62, align 4, !tbaa !19
  br label %64

64:                                               ; preds = %60, %59
  %65 = phi i32 [ 6, %59 ], [ %63, %60 ]
  store i32 %65, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !19
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %64
  br label %75

71:                                               ; preds = %64
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %72, i32 0, i32 1
  %74 = load i32, ptr %73, align 4, !tbaa !19
  br label %75

75:                                               ; preds = %71, %70
  %76 = phi i32 [ 8, %70 ], [ %74, %71 ]
  store i32 %76, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 8, !tbaa !20
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %75
  br label %86

82:                                               ; preds = %75
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %83, i32 0, i32 0
  %85 = load i32, ptr %84, align 8, !tbaa !20
  br label %86

86:                                               ; preds = %82, %81
  %87 = phi i32 [ 50, %81 ], [ %85, %82 ]
  store i32 %87, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %89, align 8, !tbaa !20
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %93

92:                                               ; preds = %86
  br label %97

93:                                               ; preds = %86
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %94, i32 0, i32 0
  %96 = load i32, ptr %95, align 8, !tbaa !20
  br label %97

97:                                               ; preds = %93, %92
  %98 = phi i32 [ 2000, %92 ], [ %96, %93 ]
  store i32 %98, ptr %21, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %99, i32 0, i32 3
  %101 = load i32, ptr %100, align 4, !tbaa !21
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %97
  br label %108

104:                                              ; preds = %97
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %105, i32 0, i32 3
  %107 = load i32, ptr %106, align 4, !tbaa !21
  br label %108

108:                                              ; preds = %104, %103
  %109 = phi i32 [ 40, %103 ], [ %107, %104 ]
  store i32 %109, ptr %22, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  %110 = load i32, ptr %21, align 4, !tbaa !11
  %111 = load i32, ptr %20, align 4, !tbaa !11
  %112 = sub i32 %110, %111
  %113 = load i32, ptr %22, align 4, !tbaa !11
  %114 = udiv i32 %112, %113
  %115 = icmp ugt i32 %114, 1
  br i1 %115, label %116, label %122

116:                                              ; preds = %108
  %117 = load i32, ptr %21, align 4, !tbaa !11
  %118 = load i32, ptr %20, align 4, !tbaa !11
  %119 = sub i32 %117, %118
  %120 = load i32, ptr %22, align 4, !tbaa !11
  %121 = udiv i32 %119, %120
  br label %123

122:                                              ; preds = %108
  br label %123

123:                                              ; preds = %122, %116
  %124 = phi i32 [ %121, %116 ], [ 1, %122 ]
  store i32 %124, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %125 = load i32, ptr %19, align 4, !tbaa !11
  %126 = load i32, ptr %18, align 4, !tbaa !11
  %127 = sub i32 %125, %126
  %128 = udiv i32 %127, 2
  %129 = add i32 1, %128
  %130 = load i32, ptr %21, align 4, !tbaa !11
  %131 = load i32, ptr %20, align 4, !tbaa !11
  %132 = sub i32 %130, %131
  %133 = load i32, ptr %23, align 4, !tbaa !11
  %134 = udiv i32 %132, %133
  %135 = add i32 1, %134
  %136 = mul i32 %129, %135
  store i32 %136, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %137, i32 0, i32 2
  %139 = load i32, ptr %138, align 8, !tbaa !22
  %140 = icmp eq i32 %139, 0
  br i1 %140, label %141, label %142

141:                                              ; preds = %123
  br label %146

142:                                              ; preds = %123
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %143, i32 0, i32 2
  %145 = load i32, ptr %144, align 8, !tbaa !22
  br label %146

146:                                              ; preds = %142, %141
  %147 = phi i32 [ 20, %141 ], [ %145, %142 ]
  store i32 %147, ptr %25, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %148 = load ptr, ptr %13, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %148, i32 0, i32 6
  %150 = load i32, ptr %149, align 8, !tbaa !23
  %151 = icmp eq i32 %150, 0
  br i1 %151, label %152, label %153

152:                                              ; preds = %146
  br label %157

153:                                              ; preds = %146
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %154, i32 0, i32 6
  %156 = load i32, ptr %155, align 8, !tbaa !23
  br label %157

157:                                              ; preds = %153, %152
  %158 = phi i32 [ 1, %152 ], [ %156, %153 ]
  store i32 %158, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %159 = load ptr, ptr %13, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.ZDICT_fastCover_params_t, ptr %159, i32 0, i32 9
  %161 = getelementptr inbounds %struct.ZDICT_params_t, ptr %160, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !24
  store i32 %162, ptr %28, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 1, ptr %29, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.start.p0(i64 168, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  store ptr null, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  store i32 0, ptr %34, align 4, !tbaa !11
  %163 = load double, ptr %17, align 8, !tbaa !18
  %164 = fcmp ole double %163, 0.000000e+00
  br i1 %164, label %168, label %165

165:                                              ; preds = %157
  %166 = load double, ptr %17, align 8, !tbaa !18
  %167 = fcmp ogt double %166, 1.000000e+00
  br i1 %167, label %168, label %177

168:                                              ; preds = %165, %157
  %169 = load i32, ptr %28, align 4, !tbaa !11
  %170 = icmp sge i32 %169, 1
  br i1 %170, label %171, label %176

171:                                              ; preds = %168
  %172 = load ptr, ptr @stderr, align 8, !tbaa !5
  %173 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %172, ptr noundef @.str.54) #7
  %174 = load ptr, ptr @stderr, align 8, !tbaa !5
  %175 = call i32 @fflush(ptr noundef %174)
  br label %176

176:                                              ; preds = %171, %168
  store i64 -42, ptr %7, align 8
  store i32 1, ptr %35, align 4
  br label %477

177:                                              ; preds = %165
  %178 = load i32, ptr %26, align 4, !tbaa !11
  %179 = icmp eq i32 %178, 0
  br i1 %179, label %183, label %180

180:                                              ; preds = %177
  %181 = load i32, ptr %26, align 4, !tbaa !11
  %182 = icmp ugt i32 %181, 10
  br i1 %182, label %183, label %192

183:                                              ; preds = %180, %177
  %184 = load i32, ptr %28, align 4, !tbaa !11
  %185 = icmp sge i32 %184, 1
  br i1 %185, label %186, label %191

186:                                              ; preds = %183
  %187 = load ptr, ptr @stderr, align 8, !tbaa !5
  %188 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %187, ptr noundef @.str.55) #7
  %189 = load ptr, ptr @stderr, align 8, !tbaa !5
  %190 = call i32 @fflush(ptr noundef %189)
  br label %191

191:                                              ; preds = %186, %183
  store i64 -42, ptr %7, align 8
  store i32 1, ptr %35, align 4
  br label %477

192:                                              ; preds = %180
  %193 = load i32, ptr %20, align 4, !tbaa !11
  %194 = load i32, ptr %19, align 4, !tbaa !11
  %195 = icmp ult i32 %193, %194
  br i1 %195, label %200, label %196

196:                                              ; preds = %192
  %197 = load i32, ptr %21, align 4, !tbaa !11
  %198 = load i32, ptr %20, align 4, !tbaa !11
  %199 = icmp ult i32 %197, %198
  br i1 %199, label %200, label %209

200:                                              ; preds = %196, %192
  %201 = load i32, ptr %28, align 4, !tbaa !11
  %202 = icmp sge i32 %201, 1
  br i1 %202, label %203, label %208

203:                                              ; preds = %200
  %204 = load ptr, ptr @stderr, align 8, !tbaa !5
  %205 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %204, ptr noundef @.str.56) #7
  %206 = load ptr, ptr @stderr, align 8, !tbaa !5
  %207 = call i32 @fflush(ptr noundef %206)
  br label %208

208:                                              ; preds = %203, %200
  store i64 -42, ptr %7, align 8
  store i32 1, ptr %35, align 4
  br label %477

209:                                              ; preds = %196
  %210 = load i32, ptr %12, align 4, !tbaa !11
  %211 = icmp eq i32 %210, 0
  br i1 %211, label %212, label %221

212:                                              ; preds = %209
  %213 = load i32, ptr %28, 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.53) #7
  %218 = load ptr, ptr @stderr, align 8, !tbaa !5
  %219 = call i32 @fflush(ptr noundef %218)
  br label %220

220:                                              ; preds = %215, %212
  store i64 -72, ptr %7, align 8
  store i32 1, ptr %35, align 4
  br label %477

221:                                              ; preds = %209
  %222 = load i64, ptr %9, align 8, !tbaa !9
  %223 = icmp ult i64 %222, 256
  br i1 %223, label %224, label %233

224:                                              ; preds = %221
  %225 = load i32, ptr %28, align 4, !tbaa !11
  %226 = icmp sge i32 %225, 1
  br i1 %226, label %227, label %232

227:                                              ; preds = %224
  %228 = load ptr, ptr @stderr, align 8, !tbaa !5
  %229 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %228, ptr noundef @.str.39, i32 noundef 256) #7
  %230 = load ptr, ptr @stderr, align 8, !tbaa !5
  %231 = call i32 @fflush(ptr noundef %230)
  br label %232

232:                                              ; preds = %227, %224
  store i64 -70, ptr %7, align 8
  store i32 1, ptr %35, align 4
  br label %477

233:                                              ; preds = %221
  %234 = load i32, ptr %16, align 4, !tbaa !11
  %235 = icmp ugt i32 %234, 1
  br i1 %235, label %236, label %244

236:                                              ; preds = %233
  %237 = load i32, ptr %16, align 4, !tbaa !11
  %238 = zext i32 %237 to i64
  %239 = call ptr @POOL_create(i64 noundef %238, i64 noundef 1)
  store ptr %239, ptr %33, align 8, !tbaa !5
  %240 = load ptr, ptr %33, align 8, !tbaa !5
  %241 = icmp ne ptr %240, null
  br i1 %241, label %243, label %242

242:                                              ; preds = %236
  store i64 -64, ptr %7, align 8
  store i32 1, ptr %35, align 4
  br label %477

243:                                              ; preds = %236
  br label %244

244:                                              ; preds = %243, %233
  call void @COVER_best_init(ptr noundef %32)
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 48, i1 false)
  %245 = load ptr, ptr %13, align 8, !tbaa !5
  call void @FASTCOVER_convertToCoverParams(ptr noundef byval(%struct.ZDICT_fastCover_params_t) align 8 %245, ptr noundef %14)
  %246 = load i32, ptr %26, align 4, !tbaa !11
  %247 = zext i32 %246 to i64
  %248 = getelementptr inbounds [11 x %struct.FASTCOVER_accel_t], ptr @FASTCOVER_defaultAccelParameters, i64 0, i64 %247
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 8 %248, i64 8, i1 false), !tbaa.struct !25
  %249 = load i32, ptr %28, align 4, !tbaa !11
  %250 = icmp eq i32 %249, 0
  br i1 %250, label %251, label %252

251:                                              ; preds = %244
  br label %255

252:                                              ; preds = %244
  %253 = load i32, ptr %28, align 4, !tbaa !11
  %254 = sub nsw i32 %253, 1
  br label %255

255:                                              ; preds = %252, %251
  %256 = phi i32 [ 0, %251 ], [ %254, %252 ]
  store i32 %256, ptr @g_displayLevel, align 4, !tbaa !11
  %257 = load i32, ptr %28, align 4, !tbaa !11
  %258 = icmp sge i32 %257, 2
  br i1 %258, label %259, label %265

259:                                              ; preds = %255
  %260 = load ptr, ptr @stderr, align 8, !tbaa !5
  %261 = load i32, ptr %24, align 4, !tbaa !11
  %262 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %260, ptr noundef @.str.44, i32 noundef %261) #7
  %263 = load ptr, ptr @stderr, align 8, !tbaa !5
  %264 = call i32 @fflush(ptr noundef %263)
  br label %265

265:                                              ; preds = %259, %255
  %266 = load i32, ptr %18, align 4, !tbaa !11
  store i32 %266, ptr %30, align 4, !tbaa !11
  br label %267

267:                                              ; preds = %442, %265
  %268 = load i32, ptr %30, align 4, !tbaa !11
  %269 = load i32, ptr %19, align 4, !tbaa !11
  %270 = icmp ule i32 %268, %269
  br i1 %270, label %271, label %445

271:                                              ; preds = %267
  call void @llvm.lifetime.start.p0(i64 80, ptr %36) #7
  %272 = load i32, ptr %28, align 4, !tbaa !11
  %273 = icmp sge i32 %272, 3
  br i1 %273, label %274, label %280

274:                                              ; preds = %271
  %275 = load ptr, ptr @stderr, align 8, !tbaa !5
  %276 = load i32, ptr %30, align 4, !tbaa !11
  %277 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %275, ptr noundef @.str.45, i32 noundef %276) #7
  %278 = load ptr, ptr @stderr, align 8, !tbaa !5
  %279 = call i32 @fflush(ptr noundef %278)
  br label %280

280:                                              ; preds = %274, %271
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #7
  %281 = load ptr, ptr %10, align 8, !tbaa !5
  %282 = load ptr, ptr %11, align 8, !tbaa !5
  %283 = load i32, ptr %12, align 4, !tbaa !11
  %284 = load i32, ptr %30, align 4, !tbaa !11
  %285 = load double, ptr %17, align 8, !tbaa !18
  %286 = load i32, ptr %25, align 4, !tbaa !11
  %287 = load i64, ptr %15, align 4
  %288 = call i64 @FASTCOVER_ctx_init(ptr noundef %36, ptr noundef %281, ptr noundef %282, i32 noundef %283, i32 noundef %284, double noundef %285, i32 noundef %286, i64 %287)
  store i64 %288, ptr %37, align 8, !tbaa !9
  %289 = load i64, ptr %37, align 8, !tbaa !9
  %290 = call i32 @ZSTD_isError(i64 noundef %289)
  %291 = icmp ne i32 %290, 0
  br i1 %291, label %292, label %303

292:                                              ; preds = %280
  %293 = load i32, ptr %28, align 4, !tbaa !11
  %294 = icmp sge i32 %293, 1
  br i1 %294, label %295, label %300

295:                                              ; preds = %292
  %296 = load ptr, ptr @stderr, align 8, !tbaa !5
  %297 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %296, ptr noundef @.str.46) #7
  %298 = load ptr, ptr @stderr, align 8, !tbaa !5
  %299 = call i32 @fflush(ptr noundef %298)
  br label %300

300:                                              ; preds = %295, %292
  call void @COVER_best_destroy(ptr noundef %32)
  %301 = load ptr, ptr %33, align 8, !tbaa !5
  call void @POOL_free(ptr noundef %301)
  %302 = load i64, ptr %37, align 8, !tbaa !9
  store i64 %302, ptr %7, align 8
  store i32 1, ptr %35, align 4
  br label %304

303:                                              ; preds = %280
  store i32 0, ptr %35, align 4
  br label %304

304:                                              ; preds = %303, %300
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  %305 = load i32, ptr %35, align 4
  switch i32 %305, label %439 [
    i32 0, label %306
  ]

306:                                              ; preds = %304
  %307 = load i32, ptr %34, align 4, !tbaa !11
  %308 = icmp ne i32 %307, 0
  br i1 %308, label %314, label %309

309:                                              ; preds = %306
  %310 = load i64, ptr %9, align 8, !tbaa !9
  %311 = getelementptr inbounds %struct.FASTCOVER_ctx_t, ptr %36, i32 0, i32 6
  %312 = load i64, ptr %311, align 8, !tbaa !26
  %313 = load i32, ptr %28, align 4, !tbaa !11
  call void @COVER_warnOnSmallCorpus(i64 noundef %310, i64 noundef %312, i32 noundef %313)
  store i32 1, ptr %34, align 4, !tbaa !11
  br label %314

314:                                              ; preds = %309, %306
  %315 = load i32, ptr %20, align 4, !tbaa !11
  store i32 %315, ptr %31, align 4, !tbaa !11
  br label %316

316:                                              ; preds = %434, %314
  %317 = load i32, ptr %31, align 4, !tbaa !11
  %318 = load i32, ptr %21, align 4, !tbaa !11
  %319 = icmp ule i32 %317, %318
  br i1 %319, label %320, label %438

320:                                              ; preds = %316
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  %321 = call noalias ptr @malloc(i64 noundef 72) #8
  store ptr %321, ptr %38, align 8, !tbaa !5
  %322 = load i32, ptr %28, align 4, !tbaa !11
  %323 = icmp sge i32 %322, 3
  br i1 %323, label %324, label %330

324:                                              ; preds = %320
  %325 = load ptr, ptr @stderr, align 8, !tbaa !5
  %326 = load i32, ptr %31, align 4, !tbaa !11
  %327 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %325, ptr noundef @.str.47, i32 noundef %326) #7
  %328 = load ptr, ptr @stderr, align 8, !tbaa !5
  %329 = call i32 @fflush(ptr noundef %328)
  br label %330

330:                                              ; preds = %324, %320
  %331 = load ptr, ptr %38, align 8, !tbaa !5
  %332 = icmp ne ptr %331, null
  br i1 %332, label %343, label %333

333:                                              ; preds = %330
  %334 = load i32, ptr %28, align 4, !tbaa !11
  %335 = icmp sge i32 %334, 1
  br i1 %335, label %336, label %341

336:                                              ; preds = %333
  %337 = load ptr, ptr @stderr, align 8, !tbaa !5
  %338 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %337, ptr noundef @.str.48) #7
  %339 = load ptr, ptr @stderr, align 8, !tbaa !5
  %340 = call i32 @fflush(ptr noundef %339)
  br label %341

341:                                              ; preds = %336, %333
  call void @COVER_best_destroy(ptr noundef %32)
  call void @FASTCOVER_ctx_destroy(ptr noundef %36)
  %342 = load ptr, ptr %33, align 8, !tbaa !5
  call void @POOL_free(ptr noundef %342)
  store i64 -64, ptr %7, align 8
  store i32 1, ptr %35, align 4
  br label %431

343:                                              ; preds = %330
  %344 = load ptr, ptr %38, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %344, i32 0, i32 0
  store ptr %36, ptr %345, align 8, !tbaa !29
  %346 = load ptr, ptr %38, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %346, i32 0, i32 1
  store ptr %32, ptr %347, align 8, !tbaa !32
  %348 = load i64, ptr %9, align 8, !tbaa !9
  %349 = load ptr, ptr %38, align 8, !tbaa !5
  %350 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %349, i32 0, i32 2
  store i64 %348, ptr %350, align 8, !tbaa !33
  %351 = load ptr, ptr %38, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %351, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %352, ptr align 8 %14, i64 48, i1 false), !tbaa.struct !34
  %353 = load i32, ptr %31, align 4, !tbaa !11
  %354 = load ptr, ptr %38, align 8, !tbaa !5
  %355 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %354, i32 0, i32 3
  %356 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %355, i32 0, i32 0
  store i32 %353, ptr %356, align 8, !tbaa !35
  %357 = load i32, ptr %30, align 4, !tbaa !11
  %358 = load ptr, ptr %38, align 8, !tbaa !5
  %359 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %358, i32 0, i32 3
  %360 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %359, i32 0, i32 1
  store i32 %357, ptr %360, align 4, !tbaa !36
  %361 = load double, ptr %17, align 8, !tbaa !18
  %362 = load ptr, ptr %38, align 8, !tbaa !5
  %363 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %362, i32 0, i32 3
  %364 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %363, i32 0, i32 4
  store double %361, ptr %364, align 8, !tbaa !37
  %365 = load i32, ptr %22, align 4, !tbaa !11
  %366 = load ptr, ptr %38, align 8, !tbaa !5
  %367 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %366, i32 0, i32 3
  %368 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %367, i32 0, i32 2
  store i32 %365, ptr %368, align 8, !tbaa !38
  %369 = load ptr, ptr %38, align 8, !tbaa !5
  %370 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %369, i32 0, i32 3
  %371 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %370, i32 0, i32 5
  store i32 0, ptr %371, align 8, !tbaa !39
  %372 = load i32, ptr @g_displayLevel, align 4, !tbaa !11
  %373 = load ptr, ptr %38, align 8, !tbaa !5
  %374 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %373, i32 0, i32 3
  %375 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %374, i32 0, i32 7
  %376 = getelementptr inbounds %struct.ZDICT_params_t, ptr %375, i32 0, i32 1
  store i32 %372, ptr %376, align 4, !tbaa !40
  %377 = load ptr, ptr %38, align 8, !tbaa !5
  %378 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %377, i32 0, i32 3
  %379 = load i64, ptr %9, align 8, !tbaa !9
  %380 = load ptr, ptr %38, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct.FASTCOVER_tryParameters_data_s, ptr %380, i32 0, i32 0
  %382 = load ptr, ptr %381, align 8, !tbaa !29
  %383 = getelementptr inbounds %struct.FASTCOVER_ctx_t, ptr %382, i32 0, i32 9
  %384 = load i32, ptr %383, align 4, !tbaa !41
  %385 = load i32, ptr %26, align 4, !tbaa !11
  %386 = call i32 @FASTCOVER_checkParameters(ptr noundef byval(%struct.ZDICT_cover_params_t) align 8 %378, i64 noundef %379, i32 noundef %384, i32 noundef %385)
  %387 = icmp ne i32 %386, 0
  br i1 %387, label %398, label %388

388:                                              ; preds = %343
  %389 = load i32, ptr @g_displayLevel, align 4, !tbaa !11
  %390 = icmp sge i32 %389, 1
  br i1 %390, label %391, label %396

391:                                              ; preds = %388
  %392 = load ptr, ptr @stderr, align 8, !tbaa !5
  %393 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %392, ptr noundef @.str.52) #7
  %394 = load ptr, ptr @stderr, align 8, !tbaa !5
  %395 = call i32 @fflush(ptr noundef %394)
  br label %396

396:                                              ; preds = %391, %388
  %397 = load ptr, ptr %38, align 8, !tbaa !5
  call void @free(ptr noundef %397) #7
  store i32 7, ptr %35, align 4
  br label %431

398:                                              ; preds = %343
  call void @COVER_best_start(ptr noundef %32)
  %399 = load ptr, ptr %33, align 8, !tbaa !5
  %400 = icmp ne ptr %399, null
  br i1 %400, label %401, label %404

401:                                              ; preds = %398
  %402 = load ptr, ptr %33, align 8, !tbaa !5
  %403 = load ptr, ptr %38, align 8, !tbaa !5
  call void @POOL_add(ptr noundef %402, ptr noundef @FASTCOVER_tryParameters, ptr noundef %403)
  br label %406

404:                                              ; preds = %398
  %405 = load ptr, ptr %38, align 8, !tbaa !5
  call void @FASTCOVER_tryParameters(ptr noundef %405)
  br label %406

406:                                              ; preds = %404, %401
  %407 = load i32, ptr %28, align 4, !tbaa !11
  %408 = icmp sge i32 %407, 2
  br i1 %408, label %409, label %428

409:                                              ; preds = %406
  %410 = call i64 @clock() #7
  %411 = load i64, ptr @g_time, align 8, !tbaa !9
  %412 = sub nsw i64 %410, %411
  %413 = icmp sgt i64 %412, 150000
  br i1 %413, label %417, label %414

414:                                              ; preds = %409
  %415 = load i32, ptr %28, align 4, !tbaa !11
  %416 = icmp sge i32 %415, 4
  br i1 %416, label %417, label %427

417:                                              ; preds = %414, %409
  %418 = call i64 @clock() #7
  store i64 %418, ptr @g_time, align 8, !tbaa !9
  %419 = load ptr, ptr @stderr, align 8, !tbaa !5
  %420 = load i32, ptr %29, align 4, !tbaa !11
  %421 = mul i32 %420, 100
  %422 = load i32, ptr %24, align 4, !tbaa !11
  %423 = udiv i32 %421, %422
  %424 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %419, ptr noundef @.str.49, i32 noundef %423) #7
  %425 = load ptr, ptr @stderr, align 8, !tbaa !5
  %426 = call i32 @fflush(ptr noundef %425)
  br label %427

427:                                              ; preds = %417, %414
  br label %428

428:                                              ; preds = %427, %406
  %429 = load i32, ptr %29, align 4, !tbaa !11
  %430 = add i32 %429, 1
  store i32 %430, ptr %29, align 4, !tbaa !11
  store i32 0, ptr %35, align 4
  br label %431

431:                                              ; preds = %428, %396, %341
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  %432 = load i32, ptr %35, align 4
  switch i32 %432, label %439 [
    i32 0, label %433
    i32 7, label %434
  ]

433:                                              ; preds = %431
  br label %434

434:                                              ; preds = %433, %431
  %435 = load i32, ptr %23, align 4, !tbaa !11
  %436 = load i32, ptr %31, align 4, !tbaa !11
  %437 = add i32 %436, %435
  store i32 %437, ptr %31, align 4, !tbaa !11
  br label %316, !llvm.loop !42

438:                                              ; preds = %316
  call void @COVER_best_wait(ptr noundef %32)
  call void @FASTCOVER_ctx_destroy(ptr noundef %36)
  store i32 0, ptr %35, align 4
  br label %439

439:                                              ; preds = %438, %431, %304
  call void @llvm.lifetime.end.p0(i64 80, ptr %36) #7
  %440 = load i32, ptr %35, align 4
  switch i32 %440, label %477 [
    i32 0, label %441
  ]

441:                                              ; preds = %439
  br label %442

442:                                              ; preds = %441
  %443 = load i32, ptr %30, align 4, !tbaa !11
  %444 = add i32 %443, 2
  store i32 %444, ptr %30, align 4, !tbaa !11
  br label %267, !llvm.loop !44

445:                                              ; preds = %267
  %446 = load i32, ptr %28, align 4, !tbaa !11
  %447 = icmp sge i32 %446, 2
  br i1 %447, label %448, label %453

448:                                              ; preds = %445
  %449 = load ptr, ptr @stderr, align 8, !tbaa !5
  %450 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %449, ptr noundef @.str.50, ptr noundef @.str.51) #7
  %451 = load ptr, ptr @stderr, align 8, !tbaa !5
  %452 = call i32 @fflush(ptr noundef %451)
  br label %453

453:                                              ; preds = %448, %445
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #7
  %454 = getelementptr inbounds %struct.COVER_best_s, ptr %32, i32 0, i32 4
  %455 = load i64, ptr %454, align 8, !tbaa !45
  store i64 %455, ptr %39, align 8, !tbaa !9
  %456 = getelementptr inbounds %struct.COVER_best_s, ptr %32, i32 0, i32 6
  %457 = load i64, ptr %456, align 8, !tbaa !47
  %458 = call i32 @ZSTD_isError(i64 noundef %457)
  %459 = icmp ne i32 %458, 0
  br i1 %459, label %460, label %465

460:                                              ; preds = %453
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  %461 = getelementptr inbounds %struct.COVER_best_s, ptr %32, i32 0, i32 6
  %462 = load i64, ptr %461, align 8, !tbaa !47
  store i64 %462, ptr %40, align 8, !tbaa !9
  call void @COVER_best_destroy(ptr noundef %32)
  %463 = load ptr, ptr %33, align 8, !tbaa !5
  call void @POOL_free(ptr noundef %463)
  %464 = load i64, ptr %40, align 8, !tbaa !9
  store i64 %464, ptr %7, align 8
  store i32 1, ptr %35, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  br label %476

465:                                              ; preds = %453
  %466 = getelementptr inbounds %struct.COVER_best_s, ptr %32, i32 0, i32 5
  %467 = load ptr, ptr %13, align 8, !tbaa !5
  %468 = load i32, ptr %25, align 4, !tbaa !11
  %469 = load i32, ptr %26, align 4, !tbaa !11
  call void @FASTCOVER_convertToFastCoverParams(ptr noundef byval(%struct.ZDICT_cover_params_t) align 8 %466, ptr noundef %467, i32 noundef %468, i32 noundef %469)
  %470 = load ptr, ptr %8, align 8, !tbaa !5
  %471 = getelementptr inbounds %struct.COVER_best_s, ptr %32, i32 0, i32 3
  %472 = load ptr, ptr %471, align 8, !tbaa !48
  %473 = load i64, ptr %39, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %470, ptr align 1 %472, i64 %473, i1 false)
  call void @COVER_best_destroy(ptr noundef %32)
  %474 = load ptr, ptr %33, align 8, !tbaa !5
  call void @POOL_free(ptr noundef %474)
  %475 = load i64, ptr %39, align 8, !tbaa !9
  store i64 %475, ptr %7, align 8
  store i32 1, ptr %35, align 4
  br label %476

476:                                              ; preds = %465, %460
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  br label %477

477:                                              ; preds = %476, %439, %242, %232, %220, %208, %191, %176
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 168, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %14) #7
  %478 = load i64, ptr %7, align 8
  ret i64 %478
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { "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 #6 = { 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 #7 = { nounwind }
attributes #8 = { 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 16}
!14 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !15, i64 24, !12, i64 32, !12, i64 36, !12, i64 40, !16, i64 44}
!15 = !{!"double", !7, i64 0}
!16 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!17 = !{!14, !15, i64 24}
!18 = !{!15, !15, i64 0}
!19 = !{!14, !12, i64 4}
!20 = !{!14, !12, i64 0}
!21 = !{!14, !12, i64 12}
!22 = !{!14, !12, i64 8}
!23 = !{!14, !12, i64 32}
!24 = !{!14, !12, i64 48}
!25 = !{i64 0, i64 4, !11, i64 4, i64 4, !11}
!26 = !{!27, !10, i64 48}
!27 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !6, i64 56, !12, i64 64, !12, i64 68, !28, i64 72}
!28 = !{!"", !12, i64 0, !12, i64 4}
!29 = !{!30, !6, i64 0}
!30 = !{!"FASTCOVER_tryParameters_data_s", !6, i64 0, !6, i64 8, !10, i64 16, !31, i64 24}
!31 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !15, i64 16, !12, i64 24, !12, i64 28, !16, i64 32}
!32 = !{!30, !6, i64 8}
!33 = !{!30, !10, i64 16}
!34 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 4, !11, i64 12, i64 4, !11, i64 16, i64 8, !18, 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}
!35 = !{!30, !12, i64 24}
!36 = !{!30, !12, i64 28}
!37 = !{!30, !15, i64 40}
!38 = !{!30, !12, i64 32}
!39 = !{!30, !12, i64 48}
!40 = !{!30, !12, i64 60}
!41 = !{!27, !12, i64 68}
!42 = distinct !{!42, !43}
!43 = !{!"llvm.loop.mustprogress"}
!44 = distinct !{!44, !43}
!45 = !{!46, !10, i64 104}
!46 = !{!"COVER_best_s", !7, i64 0, !7, i64 40, !10, i64 88, !6, i64 96, !10, i64 104, !31, i64 112, !10, i64 160}
!47 = !{!46, !10, i64 160}
!48 = !{!46, !6, i64 96}


; 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.FASTCOVER_accel_t = type { i32, i32 }
%struct.ZDICT_fastCover_params_t = type { i32, i32, i32, i32, i32, double, i32, i32, i32, %struct.ZDICT_params_t }
%struct.ZDICT_params_t = type { i32, i32, i32 }
%struct.ZDICT_cover_params_t = type { i32, i32, i32, i32, double, i32, i32, %struct.ZDICT_params_t }
%struct.COVER_best_s = type { %union.pthread_mutex_t, %union.pthread_cond_t, i64, ptr, i64, %struct.ZDICT_cover_params_t, i64 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%struct.FASTCOVER_ctx_t = type { ptr, ptr, ptr, i64, i64, i64, i64, ptr, i32, i32, %struct.FASTCOVER_accel_t }

@stderr = external local_unnamed_addr global ptr, align 8
@g_displayLevel = external hidden local_unnamed_addr global i32, align 4
@.str.39 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [31 x i8], align 1
@g_time = external hidden local_unnamed_addr global i64, align 8
@.str.49 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [45 x i8], align 1
@FASTCOVER_defaultAccelParameters = external hidden local_unnamed_addr constant [11 x %struct.FASTCOVER_accel_t], align 16
@.str.54 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [13 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #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 dso_local void @COVER_best_init(ptr noundef) local_unnamed_addr #1

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @FASTCOVER_convertToCoverParams(ptr noundef byval(%struct.ZDICT_fastCover_params_t) align 8, ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @ZDICT_optimizeTrainFromBuffer_fastCover(ptr nocapture noundef writeonly %0, i64 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  %7 = alloca %struct.ZDICT_cover_params_t, align 8
  %8 = alloca %struct.COVER_best_s, align 8
  %9 = alloca %struct.FASTCOVER_ctx_t, align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #9
  %10 = getelementptr inbounds i8, ptr %5, i64 16
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %5, i64 24
  %13 = load double, ptr %12, align 8, !tbaa !12
  %14 = fcmp ugt double %13, 0.000000e+00
  %15 = select i1 %14, double %13, double 7.500000e-01
  %16 = getelementptr inbounds i8, ptr %5, i64 4
  %17 = load i32, ptr %16, align 4, !tbaa !13
  %18 = icmp eq i32 %17, 0
  %19 = select i1 %18, i32 6, i32 %17
  %20 = select i1 %18, i32 8, i32 %17
  %21 = load i32, ptr %5, align 8, !tbaa !14
  %22 = icmp eq i32 %21, 0
  %23 = select i1 %22, i32 50, i32 %21
  %24 = select i1 %22, i32 2000, i32 %21
  %25 = getelementptr inbounds i8, ptr %5, i64 12
  %26 = load i32, ptr %25, align 4, !tbaa !15
  %27 = icmp eq i32 %26, 0
  %28 = select i1 %27, i32 40, i32 %26
  %29 = select i1 %22, i32 1950, i32 0
  %30 = udiv i32 %29, %28
  %31 = tail call i32 @llvm.umax.i32(i32 %30, i32 1)
  %.lhs.trunc = trunc nuw nsw i32 %29 to i16
  %.rhs.trunc = trunc nuw nsw i32 %31 to i16
  %32 = udiv i16 %.lhs.trunc, %.rhs.trunc
  %narrow = add nuw nsw i16 %32, 1
  %33 = zext nneg i16 %narrow to i32
  %34 = zext i1 %18 to i32
  %35 = shl nuw nsw i32 %33, %34
  %36 = getelementptr inbounds i8, ptr %5, i64 8
  %37 = load i32, ptr %36, align 8, !tbaa !16
  %38 = icmp eq i32 %37, 0
  %39 = select i1 %38, i32 20, i32 %37
  %40 = getelementptr inbounds i8, ptr %5, i64 32
  %41 = load i32, ptr %40, align 8, !tbaa !17
  %42 = tail call i32 @llvm.umax.i32(i32 %41, i32 1)
  %43 = getelementptr inbounds i8, ptr %5, i64 48
  %44 = load i32, ptr %43, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 168, ptr nonnull %8) #9
  %45 = fcmp ogt double %15, 1.000000e+00
  br i1 %45, label %46, label %53

46:                                               ; preds = %6
  %47 = icmp sgt i32 %44, 0
  br i1 %47, label %48, label %203

48:                                               ; preds = %46
  %49 = load ptr, ptr @stderr, align 8, !tbaa !19
  %50 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.54) #10
  %51 = load ptr, ptr @stderr, align 8, !tbaa !19
  %52 = tail call i32 @fflush(ptr noundef %51)
  br label %203

53:                                               ; preds = %6
  %54 = icmp ugt i32 %41, 10
  br i1 %54, label %55, label %62

55:                                               ; preds = %53
  %56 = icmp sgt i32 %44, 0
  br i1 %56, label %57, label %203

57:                                               ; preds = %55
  %58 = load ptr, ptr @stderr, align 8, !tbaa !19
  %59 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.55) #10
  %60 = load ptr, ptr @stderr, align 8, !tbaa !19
  %61 = tail call i32 @fflush(ptr noundef %60)
  br label %203

62:                                               ; preds = %53
  %63 = icmp ult i32 %23, %20
  %64 = icmp ult i32 %24, %23
  %or.cond = or i1 %63, %64
  br i1 %or.cond, label %65, label %72

65:                                               ; preds = %62
  %66 = icmp sgt i32 %44, 0
  br i1 %66, label %67, label %203

67:                                               ; preds = %65
  %68 = load ptr, ptr @stderr, align 8, !tbaa !19
  %69 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.56) #10
  %70 = load ptr, ptr @stderr, align 8, !tbaa !19
  %71 = tail call i32 @fflush(ptr noundef %70)
  br label %203

72:                                               ; preds = %62
  %73 = icmp eq i32 %4, 0
  br i1 %73, label %74, label %81

74:                                               ; preds = %72
  %75 = icmp sgt i32 %44, 0
  br i1 %75, label %76, label %203

76:                                               ; preds = %74
  %77 = load ptr, ptr @stderr, align 8, !tbaa !19
  %78 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.53) #10
  %79 = load ptr, ptr @stderr, align 8, !tbaa !19
  %80 = tail call i32 @fflush(ptr noundef %79)
  br label %203

81:                                               ; preds = %72
  %82 = icmp ult i64 %1, 256
  br i1 %82, label %83, label %90

83:                                               ; preds = %81
  %84 = icmp sgt i32 %44, 0
  br i1 %84, label %85, label %203

85:                                               ; preds = %83
  %86 = load ptr, ptr @stderr, align 8, !tbaa !19
  %87 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef nonnull @.str.39, i32 noundef 256) #10
  %88 = load ptr, ptr @stderr, align 8, !tbaa !19
  %89 = tail call i32 @fflush(ptr noundef %88)
  br label %203

90:                                               ; preds = %81
  %91 = icmp ugt i32 %11, 1
  br i1 %91, label %92, label %95

92:                                               ; preds = %90
  %93 = zext i32 %11 to i64
  %94 = tail call ptr @POOL_create(i64 noundef %93, i64 noundef 1)
  %.not = icmp eq ptr %94, null
  br i1 %.not, label %203, label %95

95:                                               ; preds = %92, %90
  %.0142 = phi ptr [ %94, %92 ], [ null, %90 ]
  call void @COVER_best_init(ptr noundef nonnull %8)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %7, i8 0, i64 48, i1 false)
  call void @FASTCOVER_convertToCoverParams(ptr noundef nonnull byval(%struct.ZDICT_fastCover_params_t) align 8 %5, ptr noundef nonnull %7)
  %96 = zext nneg i32 %42 to i64
  %97 = getelementptr inbounds [11 x %struct.FASTCOVER_accel_t], ptr @FASTCOVER_defaultAccelParameters, i64 0, i64 %96
  %.sroa.0.0.copyload = load i64, ptr %97, align 8
  %98 = call i32 @llvm.usub.sat.i32(i32 %44, i32 1)
  store i32 %98, ptr @g_displayLevel, align 4, !tbaa !21
  %99 = icmp sgt i32 %44, 1
  br i1 %99, label %100, label %105

100:                                              ; preds = %95
  %101 = load ptr, ptr @stderr, align 8, !tbaa !19
  %102 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %101, ptr noundef nonnull @.str.44, i32 noundef %35) #10
  %103 = load ptr, ptr @stderr, align 8, !tbaa !19
  %104 = call i32 @fflush(ptr noundef %103)
  br label %105

105:                                              ; preds = %100, %95
  %.not163191 = icmp ugt i32 %19, %20
  br i1 %.not163191, label %._crit_edge197, label %.lr.ph196.split.preheader

.lr.ph196.split.preheader:                        ; preds = %105
  %106 = icmp sgt i32 %44, 2
  %107 = getelementptr inbounds i8, ptr %9, i64 48
  %108 = getelementptr inbounds i8, ptr %9, i64 68
  %.not170 = icmp eq ptr %.0142, null
  %109 = icmp ugt i32 %44, 3
  br label %.lr.ph196.split

.lr.ph196.split:                                  ; preds = %.lr.ph196.split.preheader, %._crit_edge
  %.0130194 = phi i32 [ %.2132.ph, %._crit_edge ], [ 1, %.lr.ph196.split.preheader ]
  %.0134193 = phi i32 [ %185, %._crit_edge ], [ %19, %.lr.ph196.split.preheader ]
  %.not166192 = phi i1 [ false, %._crit_edge ], [ true, %.lr.ph196.split.preheader ]
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %9) #9
  br i1 %106, label %110, label %115

110:                                              ; preds = %.lr.ph196.split
  %111 = load ptr, ptr @stderr, align 8, !tbaa !19
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef nonnull @.str.45, i32 noundef %.0134193) #10
  %113 = load ptr, ptr @stderr, align 8, !tbaa !19
  %114 = call i32 @fflush(ptr noundef %113)
  br label %115

115:                                              ; preds = %110, %.lr.ph196.split
  %116 = call i64 @FASTCOVER_ctx_init(ptr noundef nonnull %9, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %.0134193, double noundef %15, i32 noundef %39, i64 %.sroa.0.0.copyload)
  %117 = call i32 @ZSTD_isError(i64 noundef %116)
  %.not165 = icmp eq i32 %117, 0
  br i1 %.not165, label %125, label %.split.us

.split.us:                                        ; preds = %115
  %118 = icmp sgt i32 %44, 0
  br i1 %118, label %119, label %124

119:                                              ; preds = %.split.us
  %120 = load ptr, ptr @stderr, align 8, !tbaa !19
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef nonnull @.str.46) #10
  %122 = load ptr, ptr @stderr, align 8, !tbaa !19
  %123 = call i32 @fflush(ptr noundef %122)
  br label %124

124:                                              ; preds = %.split.us, %119
  call void @COVER_best_destroy(ptr noundef nonnull %8)
  br label %.thread180

125:                                              ; preds = %115
  br i1 %.not166192, label %126, label %.lr.ph.preheader

126:                                              ; preds = %125
  %127 = load i64, ptr %107, align 8, !tbaa !22
  call void @COVER_warnOnSmallCorpus(i64 noundef %1, i64 noundef %127, i32 noundef %44)
  br label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %126, %125
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %183
  %.1131190 = phi i32 [ %.2132.ph, %183 ], [ %.0130194, %.lr.ph.preheader ]
  %.0135189 = phi i32 [ %184, %183 ], [ %23, %.lr.ph.preheader ]
  %128 = call noalias dereferenceable_or_null(72) ptr @malloc(i64 noundef 72) #11
  br i1 %106, label %129, label %134

129:                                              ; preds = %.lr.ph
  %130 = load ptr, ptr @stderr, align 8, !tbaa !19
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef nonnull @.str.47, i32 noundef %.0135189) #10
  %132 = load ptr, ptr @stderr, align 8, !tbaa !19
  %133 = call i32 @fflush(ptr noundef %132)
  br label %134

134:                                              ; preds = %129, %.lr.ph
  %.not168 = icmp eq ptr %128, null
  br i1 %.not168, label %135, label %142

135:                                              ; preds = %134
  %136 = icmp sgt i32 %44, 0
  br i1 %136, label %137, label %182

137:                                              ; preds = %135
  %138 = load ptr, ptr @stderr, align 8, !tbaa !19
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef nonnull @.str.48) #10
  %140 = load ptr, ptr @stderr, align 8, !tbaa !19
  %141 = call i32 @fflush(ptr noundef %140)
  br label %182

142:                                              ; preds = %134
  store ptr %9, ptr %128, align 8, !tbaa !26
  %143 = getelementptr inbounds i8, ptr %128, i64 8
  store ptr %8, ptr %143, align 8, !tbaa !29
  %144 = getelementptr inbounds i8, ptr %128, i64 16
  store i64 %1, ptr %144, align 8, !tbaa !30
  %145 = getelementptr inbounds i8, ptr %128, i64 24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %145, ptr noundef nonnull align 8 dereferenceable(48) %7, i64 48, i1 false), !tbaa.struct !31
  store i32 %.0135189, ptr %145, align 8, !tbaa !33
  %146 = getelementptr inbounds i8, ptr %128, i64 28
  store i32 %.0134193, ptr %146, align 4, !tbaa !34
  %147 = getelementptr inbounds i8, ptr %128, i64 40
  store double %15, ptr %147, align 8, !tbaa !35
  %148 = getelementptr inbounds i8, ptr %128, i64 32
  store i32 %28, ptr %148, align 8, !tbaa !36
  %149 = getelementptr inbounds i8, ptr %128, i64 48
  store i32 0, ptr %149, align 8, !tbaa !37
  %150 = load i32, ptr @g_displayLevel, align 4, !tbaa !21
  %151 = getelementptr inbounds i8, ptr %128, i64 60
  store i32 %150, ptr %151, align 4, !tbaa !38
  %152 = load i32, ptr %108, align 4, !tbaa !39
  %153 = call i32 @FASTCOVER_checkParameters(ptr noundef nonnull byval(%struct.ZDICT_cover_params_t) align 8 %145, i64 noundef %1, i32 noundef %152, i32 noundef %42)
  %.not169 = icmp eq i32 %153, 0
  br i1 %.not169, label %154, label %163

154:                                              ; preds = %142
  %155 = load i32, ptr @g_displayLevel, align 4, !tbaa !21
  %156 = icmp sgt i32 %155, 0
  br i1 %156, label %157, label %162

157:                                              ; preds = %154
  %158 = load ptr, ptr @stderr, align 8, !tbaa !19
  %159 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef nonnull @.str.52) #10
  %160 = load ptr, ptr @stderr, align 8, !tbaa !19
  %161 = call i32 @fflush(ptr noundef %160)
  br label %162

162:                                              ; preds = %157, %154
  call void @free(ptr noundef nonnull %128) #9
  br label %183

163:                                              ; preds = %142
  call void @COVER_best_start(ptr noundef nonnull %8)
  br i1 %.not170, label %165, label %164

164:                                              ; preds = %163
  call void @POOL_add(ptr noundef nonnull %.0142, ptr noundef nonnull @FASTCOVER_tryParameters, ptr noundef nonnull %128)
  br label %166

165:                                              ; preds = %163
  call void @FASTCOVER_tryParameters(ptr noundef nonnull %128)
  br label %166

166:                                              ; preds = %165, %164
  br i1 %99, label %167, label %180

167:                                              ; preds = %166
  %168 = call i64 @clock() #9
  %169 = load i64, ptr @g_time, align 8, !tbaa !40
  %170 = sub nsw i64 %168, %169
  %171 = icmp sgt i64 %170, 150000
  %or.cond6 = select i1 %171, i1 true, i1 %109
  br i1 %or.cond6, label %172, label %180

172:                                              ; preds = %167
  %173 = call i64 @clock() #9
  store i64 %173, ptr @g_time, align 8, !tbaa !40
  %174 = load ptr, ptr @stderr, align 8, !tbaa !19
  %175 = mul i32 %.1131190, 100
  %176 = udiv i32 %175, %35
  %177 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %174, ptr noundef nonnull @.str.49, i32 noundef %176) #10
  %178 = load ptr, ptr @stderr, align 8, !tbaa !19
  %179 = call i32 @fflush(ptr noundef %178)
  br label %180

180:                                              ; preds = %172, %167, %166
  %181 = add i32 %.1131190, 1
  br label %183

182:                                              ; preds = %135, %137
  call void @COVER_best_destroy(ptr noundef nonnull %8)
  call void @FASTCOVER_ctx_destroy(ptr noundef nonnull %9)
  br label %.thread180

183:                                              ; preds = %180, %162
  %.2132.ph = phi i32 [ %.1131190, %162 ], [ %181, %180 ]
  %184 = add i32 %.0135189, %31
  %.not167 = icmp ugt i32 %184, %24
  br i1 %.not167, label %._crit_edge, label %.lr.ph, !llvm.loop !41

.thread180:                                       ; preds = %182, %124
  %.4.ph = phi i64 [ %116, %124 ], [ -64, %182 ]
  call void @POOL_free(ptr noundef %.0142)
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %9) #9
  br label %203

._crit_edge:                                      ; preds = %183
  call void @COVER_best_wait(ptr noundef nonnull %8)
  call void @FASTCOVER_ctx_destroy(ptr noundef nonnull %9)
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %9) #9
  %185 = add i32 %.0134193, 2
  %.not163 = icmp ugt i32 %185, %20
  br i1 %.not163, label %._crit_edge197, label %.lr.ph196.split, !llvm.loop !43

._crit_edge197:                                   ; preds = %._crit_edge, %105
  br i1 %99, label %186, label %191

186:                                              ; preds = %._crit_edge197
  %187 = load ptr, ptr @stderr, align 8, !tbaa !19
  %188 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %187, ptr noundef nonnull @.str.50, ptr noundef nonnull @.str.51) #10
  %189 = load ptr, ptr @stderr, align 8, !tbaa !19
  %190 = call i32 @fflush(ptr noundef %189)
  br label %191

191:                                              ; preds = %186, %._crit_edge197
  %192 = getelementptr inbounds i8, ptr %8, i64 104
  %193 = load i64, ptr %192, align 8, !tbaa !44
  %194 = getelementptr inbounds i8, ptr %8, i64 160
  %195 = load i64, ptr %194, align 8, !tbaa !46
  %196 = call i32 @ZSTD_isError(i64 noundef %195)
  %.not164 = icmp eq i32 %196, 0
  br i1 %.not164, label %199, label %197

197:                                              ; preds = %191
  %198 = load i64, ptr %194, align 8, !tbaa !46
  call void @COVER_best_destroy(ptr noundef nonnull %8)
  call void @POOL_free(ptr noundef %.0142)
  br label %203

199:                                              ; preds = %191
  %200 = getelementptr inbounds i8, ptr %8, i64 112
  call void @FASTCOVER_convertToFastCoverParams(ptr noundef nonnull byval(%struct.ZDICT_cover_params_t) align 8 %200, ptr noundef nonnull %5, i32 noundef %39, i32 noundef %42)
  %201 = getelementptr inbounds i8, ptr %8, i64 96
  %202 = load ptr, ptr %201, align 8, !tbaa !47
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %0, ptr align 1 %202, i64 %193, i1 false)
  call void @COVER_best_destroy(ptr noundef nonnull %8)
  call void @POOL_free(ptr noundef %.0142)
  br label %203

203:                                              ; preds = %.thread180, %197, %199, %92, %83, %85, %74, %76, %65, %67, %55, %57, %46, %48
  %.6 = phi i64 [ -42, %48 ], [ -42, %46 ], [ -42, %57 ], [ -42, %55 ], [ -42, %67 ], [ -42, %65 ], [ -72, %76 ], [ -72, %74 ], [ -70, %85 ], [ -70, %83 ], [ -64, %92 ], [ %198, %197 ], [ %193, %199 ], [ %.4.ph, %.thread180 ]
  call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #9
  ret i64 %.6
}

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

; Function Attrs: nounwind uwtable
declare hidden void @FASTCOVER_convertToFastCoverParams(ptr noundef byval(%struct.ZDICT_cover_params_t) align 8, ptr noundef, i32 noundef, i32 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { 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 #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 16}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24, !7, i64 32, !7, i64 36, !7, i64 40, !11, i64 44}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8}
!12 = !{!6, !10, i64 24}
!13 = !{!6, !7, i64 4}
!14 = !{!6, !7, i64 0}
!15 = !{!6, !7, i64 12}
!16 = !{!6, !7, i64 8}
!17 = !{!6, !7, i64 32}
!18 = !{!6, !7, i64 48}
!19 = !{!20, !20, i64 0}
!20 = !{!"any pointer", !8, i64 0}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !24, i64 48}
!23 = !{!"", !20, i64 0, !20, i64 8, !20, i64 16, !24, i64 24, !24, i64 32, !24, i64 40, !24, i64 48, !20, i64 56, !7, i64 64, !7, i64 68, !25, i64 72}
!24 = !{!"long", !8, i64 0}
!25 = !{!"", !7, i64 0, !7, i64 4}
!26 = !{!27, !20, i64 0}
!27 = !{!"FASTCOVER_tryParameters_data_s", !20, i64 0, !20, i64 8, !24, i64 16, !28, i64 24}
!28 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !7, i64 24, !7, i64 28, !11, i64 32}
!29 = !{!27, !20, i64 8}
!30 = !{!27, !24, i64 16}
!31 = !{i64 0, i64 4, !21, i64 4, i64 4, !21, i64 8, i64 4, !21, i64 12, i64 4, !21, i64 16, i64 8, !32, i64 24, i64 4, !21, i64 28, i64 4, !21, i64 32, i64 4, !21, i64 36, i64 4, !21, i64 40, i64 4, !21}
!32 = !{!10, !10, i64 0}
!33 = !{!27, !7, i64 24}
!34 = !{!27, !7, i64 28}
!35 = !{!27, !10, i64 40}
!36 = !{!27, !7, i64 32}
!37 = !{!27, !7, i64 48}
!38 = !{!27, !7, i64 60}
!39 = !{!23, !7, i64 68}
!40 = !{!24, !24, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = distinct !{!43, !42}
!44 = !{!45, !24, i64 104}
!45 = !{!"COVER_best_s", !8, i64 0, !8, i64 40, !24, i64 88, !20, i64 96, !24, i64 104, !28, i64 112, !24, i64 160}
!46 = !{!45, !24, i64 160}
!47 = !{!45, !20, i64 96}


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