; 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.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_dictSelection = type { ptr, i64, i64 }

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @ZDICT_finalizeDictionary(ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef byval(%struct.ZDICT_params_t) align 8) #2

; Function Attrs: nounwind uwtable
declare dso_local i64 @COVER_checkTotalCompressedSize(ptr noundef byval(%struct.ZDICT_cover_params_t) align 8, ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, i64 noundef) #2

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @COVER_dictSelectionError(ptr dead_on_unwind noalias writable sret(%struct.COVER_dictSelection) align 8, i64 noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @COVER_selectDict(ptr dead_on_unwind noalias writable sret(%struct.COVER_dictSelection) align 8 %0, ptr noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, i64 noundef %7, i64 noundef %8, ptr noundef byval(%struct.ZDICT_cover_params_t) align 8 %9, ptr noundef %10, i64 noundef %11) #2 {
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca double, align 8
  %29 = alloca i32, align 4
  store ptr %1, ptr %13, align 8, !tbaa !5
  store i64 %2, ptr %14, align 8, !tbaa !9
  store i64 %3, ptr %15, align 8, !tbaa !9
  store ptr %4, ptr %16, align 8, !tbaa !5
  store ptr %5, ptr %17, align 8, !tbaa !5
  store i32 %6, ptr %18, align 4, !tbaa !11
  store i64 %7, ptr %19, align 8, !tbaa !9
  store i64 %8, ptr %20, align 8, !tbaa !9
  store ptr %10, ptr %21, align 8, !tbaa !5
  store i64 %11, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  store i64 0, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store i64 0, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %30 = load ptr, ptr %13, align 8, !tbaa !5
  %31 = load i64, ptr %15, align 8, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %30, i64 %31
  store ptr %32, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %33 = load i64, ptr %14, align 8, !tbaa !9
  %34 = call noalias ptr @malloc(i64 noundef %33) #6
  store ptr %34, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %35 = load i64, ptr %14, align 8, !tbaa !9
  %36 = call noalias ptr @malloc(i64 noundef %35) #6
  store ptr %36, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %37 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %9, i32 0, i32 6
  %38 = load i32, ptr %37, align 4, !tbaa !13
  %39 = uitofp i32 %38 to double
  %40 = fdiv double %39, 1.000000e+02
  %41 = fadd double %40, 1.000000e+00
  store double %41, ptr %28, align 8, !tbaa !17
  %42 = load ptr, ptr %26, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %44, label %47

44:                                               ; preds = %12
  %45 = load ptr, ptr %27, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  br i1 %46, label %51, label %47

47:                                               ; preds = %44, %12
  %48 = load ptr, ptr %26, align 8, !tbaa !5
  call void @free(ptr noundef %48) #5
  %49 = load ptr, ptr %27, align 8, !tbaa !5
  call void @free(ptr noundef %49) #5
  %50 = load i64, ptr %15, align 8, !tbaa !9
  call void @COVER_dictSelectionError(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, i64 noundef %50)
  store i32 1, ptr %29, align 4
  br label %165

51:                                               ; preds = %44
  %52 = load ptr, ptr %26, align 8, !tbaa !5
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  %54 = load i64, ptr %15, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %52, ptr align 1 %53, i64 %54, i1 false)
  %55 = load ptr, ptr %26, align 8, !tbaa !5
  %56 = load i64, ptr %14, align 8, !tbaa !9
  %57 = load ptr, ptr %13, align 8, !tbaa !5
  %58 = load i64, ptr %15, align 8, !tbaa !9
  %59 = load ptr, ptr %16, align 8, !tbaa !5
  %60 = load ptr, ptr %17, align 8, !tbaa !5
  %61 = load i32, ptr %18, align 4, !tbaa !11
  %62 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %9, i32 0, i32 7
  %63 = call i64 @ZDICT_finalizeDictionary(ptr noundef %55, i64 noundef %56, ptr noundef %57, i64 noundef %58, ptr noundef %59, ptr noundef %60, i32 noundef %61, ptr noundef byval(%struct.ZDICT_params_t) align 8 %62)
  store i64 %63, ptr %15, align 8, !tbaa !9
  %64 = load i64, ptr %15, align 8, !tbaa !9
  %65 = call i32 @ZDICT_isError(i64 noundef %64)
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %71

67:                                               ; preds = %51
  %68 = load ptr, ptr %26, align 8, !tbaa !5
  call void @free(ptr noundef %68) #5
  %69 = load ptr, ptr %27, align 8, !tbaa !5
  call void @free(ptr noundef %69) #5
  %70 = load i64, ptr %15, align 8, !tbaa !9
  call void @COVER_dictSelectionError(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, i64 noundef %70)
  store i32 1, ptr %29, align 4
  br label %165

71:                                               ; preds = %51
  %72 = load ptr, ptr %17, align 8, !tbaa !5
  %73 = load ptr, ptr %16, align 8, !tbaa !5
  %74 = load ptr, ptr %21, align 8, !tbaa !5
  %75 = load i64, ptr %19, align 8, !tbaa !9
  %76 = load i64, ptr %20, align 8, !tbaa !9
  %77 = load ptr, ptr %26, align 8, !tbaa !5
  %78 = load i64, ptr %15, align 8, !tbaa !9
  %79 = call i64 @COVER_checkTotalCompressedSize(ptr noundef byval(%struct.ZDICT_cover_params_t) align 8 %9, ptr noundef %72, ptr noundef %73, ptr noundef %74, i64 noundef %75, i64 noundef %76, ptr noundef %77, i64 noundef %78)
  store i64 %79, ptr %22, align 8, !tbaa !9
  %80 = load i64, ptr %22, align 8, !tbaa !9
  %81 = call i32 @ZSTD_isError(i64 noundef %80)
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %87

83:                                               ; preds = %71
  %84 = load ptr, ptr %26, align 8, !tbaa !5
  call void @free(ptr noundef %84) #5
  %85 = load ptr, ptr %27, align 8, !tbaa !5
  call void @free(ptr noundef %85) #5
  %86 = load i64, ptr %22, align 8, !tbaa !9
  call void @COVER_dictSelectionError(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, i64 noundef %86)
  store i32 1, ptr %29, align 4
  br label %165

87:                                               ; preds = %71
  %88 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %9, i32 0, i32 5
  %89 = load i32, ptr %88, align 8, !tbaa !18
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %91, label %96

91:                                               ; preds = %87
  %92 = load ptr, ptr %27, align 8, !tbaa !5
  call void @free(ptr noundef %92) #5
  %93 = load ptr, ptr %26, align 8, !tbaa !5
  %94 = load i64, ptr %15, align 8, !tbaa !9
  %95 = load i64, ptr %22, align 8, !tbaa !9
  call void @setDictSelection(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, ptr noundef %93, i64 noundef %94, i64 noundef %95)
  store i32 1, ptr %29, align 4
  br label %165

96:                                               ; preds = %87
  %97 = load i64, ptr %15, align 8, !tbaa !9
  store i64 %97, ptr %23, align 8, !tbaa !9
  %98 = load i64, ptr %22, align 8, !tbaa !9
  store i64 %98, ptr %24, align 8, !tbaa !9
  store i64 256, ptr %15, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %155, %96
  %100 = load i64, ptr %15, align 8, !tbaa !9
  %101 = load i64, ptr %23, align 8, !tbaa !9
  %102 = icmp ult i64 %100, %101
  br i1 %102, label %103, label %158

103:                                              ; preds = %99
  %104 = load ptr, ptr %27, align 8, !tbaa !5
  %105 = load ptr, ptr %26, align 8, !tbaa !5
  %106 = load i64, ptr %23, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %104, ptr align 1 %105, i64 %106, i1 false)
  %107 = load ptr, ptr %27, align 8, !tbaa !5
  %108 = load i64, ptr %14, align 8, !tbaa !9
  %109 = load ptr, ptr %25, align 8, !tbaa !5
  %110 = load i64, ptr %15, align 8, !tbaa !9
  %111 = sub i64 0, %110
  %112 = getelementptr inbounds i8, ptr %109, i64 %111
  %113 = load i64, ptr %15, align 8, !tbaa !9
  %114 = load ptr, ptr %16, align 8, !tbaa !5
  %115 = load ptr, ptr %17, align 8, !tbaa !5
  %116 = load i32, ptr %18, align 4, !tbaa !11
  %117 = getelementptr inbounds %struct.ZDICT_cover_params_t, ptr %9, i32 0, i32 7
  %118 = call i64 @ZDICT_finalizeDictionary(ptr noundef %107, i64 noundef %108, ptr noundef %112, i64 noundef %113, ptr noundef %114, ptr noundef %115, i32 noundef %116, ptr noundef byval(%struct.ZDICT_params_t) align 8 %117)
  store i64 %118, ptr %15, align 8, !tbaa !9
  %119 = load i64, ptr %15, align 8, !tbaa !9
  %120 = call i32 @ZDICT_isError(i64 noundef %119)
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %126

122:                                              ; preds = %103
  %123 = load ptr, ptr %26, align 8, !tbaa !5
  call void @free(ptr noundef %123) #5
  %124 = load ptr, ptr %27, align 8, !tbaa !5
  call void @free(ptr noundef %124) #5
  %125 = load i64, ptr %15, align 8, !tbaa !9
  call void @COVER_dictSelectionError(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, i64 noundef %125)
  store i32 1, ptr %29, align 4
  br label %165

126:                                              ; preds = %103
  %127 = load ptr, ptr %17, align 8, !tbaa !5
  %128 = load ptr, ptr %16, align 8, !tbaa !5
  %129 = load ptr, ptr %21, align 8, !tbaa !5
  %130 = load i64, ptr %19, align 8, !tbaa !9
  %131 = load i64, ptr %20, align 8, !tbaa !9
  %132 = load ptr, ptr %27, align 8, !tbaa !5
  %133 = load i64, ptr %15, align 8, !tbaa !9
  %134 = call i64 @COVER_checkTotalCompressedSize(ptr noundef byval(%struct.ZDICT_cover_params_t) align 8 %9, ptr noundef %127, ptr noundef %128, ptr noundef %129, i64 noundef %130, i64 noundef %131, ptr noundef %132, i64 noundef %133)
  store i64 %134, ptr %22, align 8, !tbaa !9
  %135 = load i64, ptr %22, align 8, !tbaa !9
  %136 = call i32 @ZSTD_isError(i64 noundef %135)
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %142

138:                                              ; preds = %126
  %139 = load ptr, ptr %26, align 8, !tbaa !5
  call void @free(ptr noundef %139) #5
  %140 = load ptr, ptr %27, align 8, !tbaa !5
  call void @free(ptr noundef %140) #5
  %141 = load i64, ptr %22, align 8, !tbaa !9
  call void @COVER_dictSelectionError(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, i64 noundef %141)
  store i32 1, ptr %29, align 4
  br label %165

142:                                              ; preds = %126
  %143 = load i64, ptr %22, align 8, !tbaa !9
  %144 = uitofp i64 %143 to double
  %145 = load i64, ptr %24, align 8, !tbaa !9
  %146 = uitofp i64 %145 to double
  %147 = load double, ptr %28, align 8, !tbaa !17
  %148 = fmul double %146, %147
  %149 = fcmp ole double %144, %148
  br i1 %149, label %150, label %155

150:                                              ; preds = %142
  %151 = load ptr, ptr %26, align 8, !tbaa !5
  call void @free(ptr noundef %151) #5
  %152 = load ptr, ptr %27, align 8, !tbaa !5
  %153 = load i64, ptr %15, align 8, !tbaa !9
  %154 = load i64, ptr %22, align 8, !tbaa !9
  call void @setDictSelection(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, ptr noundef %152, i64 noundef %153, i64 noundef %154)
  store i32 1, ptr %29, align 4
  br label %165

155:                                              ; preds = %142
  %156 = load i64, ptr %15, align 8, !tbaa !9
  %157 = mul i64 %156, 2
  store i64 %157, ptr %15, align 8, !tbaa !9
  br label %99, !llvm.loop !19

158:                                              ; preds = %99
  %159 = load i64, ptr %23, align 8, !tbaa !9
  store i64 %159, ptr %15, align 8, !tbaa !9
  %160 = load i64, ptr %24, align 8, !tbaa !9
  store i64 %160, ptr %22, align 8, !tbaa !9
  %161 = load ptr, ptr %27, align 8, !tbaa !5
  call void @free(ptr noundef %161) #5
  %162 = load ptr, ptr %26, align 8, !tbaa !5
  %163 = load i64, ptr %15, align 8, !tbaa !9
  %164 = load i64, ptr %22, align 8, !tbaa !9
  call void @setDictSelection(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, ptr noundef %162, i64 noundef %163, i64 noundef %164)
  store i32 1, ptr %29, align 4
  br label %165

165:                                              ; preds = %158, %150, %138, %122, %91, %83, %67, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @ZDICT_isError(i64 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = { nounwind }
attributes #6 = { 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 28}
!14 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !15, i64 16, !12, i64 24, !12, i64 28, !16, i64 32}
!15 = !{!"double", !7, i64 0}
!16 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!17 = !{!15, !15, i64 0}
!18 = !{!14, !12, i64 24}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; 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_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_dictSelection = type { ptr, i64, i64 }

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @COVER_dictSelectionError(ptr dead_on_unwind noalias writable sret(%struct.COVER_dictSelection) align 8, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @setDictSelection(ptr dead_on_unwind noalias writable sret(%struct.COVER_dictSelection) align 8, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @COVER_selectDict(ptr dead_on_unwind noalias writable sret(%struct.COVER_dictSelection) align 8 %0, ptr noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, i64 noundef %7, i64 noundef %8, ptr noundef byval(%struct.ZDICT_cover_params_t) align 8 %9, ptr noundef %10, i64 noundef %11) local_unnamed_addr #1 {
  %13 = getelementptr inbounds i8, ptr %1, i64 %3
  %14 = tail call noalias ptr @malloc(i64 noundef %2) #4
  %15 = tail call noalias ptr @malloc(i64 noundef %2) #4
  %16 = getelementptr inbounds i8, ptr %9, i64 28
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = uitofp i32 %17 to double
  %19 = fdiv double %18, 1.000000e+02
  %20 = fadd double %19, 1.000000e+00
  %21 = icmp ne ptr %14, null
  %22 = icmp ne ptr %15, null
  %or.cond = and i1 %21, %22
  br i1 %or.cond, label %24, label %23

23:                                               ; preds = %12
  tail call void @free(ptr noundef %14) #5
  tail call void @free(ptr noundef %15) #5
  tail call void @COVER_dictSelectionError(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, i64 noundef %3)
  br label %58

24:                                               ; preds = %12
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %14, ptr align 1 %1, i64 %3, i1 false)
  %25 = getelementptr inbounds i8, ptr %9, i64 32
  %26 = tail call i64 @ZDICT_finalizeDictionary(ptr noundef nonnull %14, i64 noundef %2, ptr noundef %1, i64 noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, ptr noundef nonnull byval(%struct.ZDICT_params_t) align 8 %25)
  %27 = tail call i32 @ZDICT_isError(i64 noundef %26)
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %29, label %28

28:                                               ; preds = %24
  tail call void @free(ptr noundef nonnull %14) #5
  tail call void @free(ptr noundef nonnull %15) #5
  tail call void @COVER_dictSelectionError(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, i64 noundef %26)
  br label %58

29:                                               ; preds = %24
  %30 = tail call i64 @COVER_checkTotalCompressedSize(ptr noundef nonnull byval(%struct.ZDICT_cover_params_t) align 8 %9, ptr noundef %5, ptr noundef %4, ptr noundef %10, i64 noundef %7, i64 noundef %8, ptr noundef nonnull %14, i64 noundef %26)
  %31 = tail call i32 @ZSTD_isError(i64 noundef %30)
  %.not85 = icmp eq i32 %31, 0
  br i1 %.not85, label %33, label %32

32:                                               ; preds = %29
  tail call void @free(ptr noundef nonnull %14) #5
  tail call void @free(ptr noundef nonnull %15) #5
  tail call void @COVER_dictSelectionError(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, i64 noundef %30)
  br label %58

33:                                               ; preds = %29
  %34 = getelementptr inbounds i8, ptr %9, i64 24
  %35 = load i32, ptr %34, align 8, !tbaa !12
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %40, label %.preheader

.preheader:                                       ; preds = %33
  %37 = icmp ugt i64 %26, 256
  br i1 %37, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %38 = uitofp i64 %30 to double
  %39 = fmul double %20, %38
  br label %41

40:                                               ; preds = %33
  tail call void @free(ptr noundef nonnull %15) #5
  tail call void @setDictSelection(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, ptr noundef nonnull %14, i64 noundef %26, i64 noundef %30)
  br label %58

41:                                               ; preds = %.lr.ph, %55
  %.092 = phi i64 [ 256, %.lr.ph ], [ %56, %55 ]
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %15, ptr nonnull align 1 %14, i64 %26, i1 false)
  %42 = sub i64 0, %.092
  %43 = getelementptr inbounds i8, ptr %13, i64 %42
  %44 = tail call i64 @ZDICT_finalizeDictionary(ptr noundef nonnull %15, i64 noundef %2, ptr noundef %43, i64 noundef %.092, ptr noundef %4, ptr noundef %5, i32 noundef %6, ptr noundef nonnull byval(%struct.ZDICT_params_t) align 8 %25)
  %45 = tail call i32 @ZDICT_isError(i64 noundef %44)
  %.not86 = icmp eq i32 %45, 0
  br i1 %.not86, label %47, label %46

46:                                               ; preds = %41
  tail call void @free(ptr noundef %14) #5
  tail call void @free(ptr noundef %15) #5
  tail call void @COVER_dictSelectionError(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, i64 noundef %44)
  br label %58

47:                                               ; preds = %41
  %48 = tail call i64 @COVER_checkTotalCompressedSize(ptr noundef nonnull byval(%struct.ZDICT_cover_params_t) align 8 %9, ptr noundef %5, ptr noundef %4, ptr noundef %10, i64 noundef %7, i64 noundef %8, ptr noundef nonnull %15, i64 noundef %44)
  %49 = tail call i32 @ZSTD_isError(i64 noundef %48)
  %.not87 = icmp eq i32 %49, 0
  br i1 %.not87, label %51, label %50

50:                                               ; preds = %47
  tail call void @free(ptr noundef %14) #5
  tail call void @free(ptr noundef %15) #5
  tail call void @COVER_dictSelectionError(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, i64 noundef %48)
  br label %58

51:                                               ; preds = %47
  %52 = uitofp i64 %48 to double
  %53 = fcmp ult double %39, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %51
  tail call void @free(ptr noundef %14) #5
  tail call void @setDictSelection(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, ptr noundef nonnull %15, i64 noundef %44, i64 noundef %48)
  br label %58

55:                                               ; preds = %51
  %56 = shl i64 %44, 1
  %57 = icmp ult i64 %56, %26
  br i1 %57, label %41, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %55, %.preheader
  tail call void @free(ptr noundef %15) #5
  tail call void @setDictSelection(ptr dead_on_unwind writable sret(%struct.COVER_dictSelection) align 8 %0, ptr noundef nonnull %14, i64 noundef %26, i64 noundef %30)
  br label %58

58:                                               ; preds = %._crit_edge, %54, %50, %46, %40, %32, %28, %23
  ret void
}

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

attributes #0 = { mustprogress nocallback nofree 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 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 #3 = { 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 #4 = { nounwind allocsize(0) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 28}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !7, i64 24, !7, i64 28, !11, i64 32}
!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, !7, i64 24}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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