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

@repStartValue = external hidden constant [3 x i32], align 4
@stderr = external global ptr, align 8
@.str.51 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__.ZDICT_finalizeDictionary = external hidden unnamed_addr constant [130 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [65 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @MEM_writeLE32(ptr noundef, i32 noundef) #3

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare hidden i64 @XXH_INLINE_XXH64(ptr nocapture noundef, i64 noundef, i64 noundef) #4

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

declare i32 @fflush(ptr noundef) #6

; Function Attrs: nounwind uwtable
define dso_local i64 @ZDICT_finalizeDictionary(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, ptr noundef byval(%struct.ZDICT_params_t) align 8 %7) #7 {
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca [256 x i8], align 16
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca ptr, align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  store ptr %0, ptr %10, align 8, !tbaa !5
  store i64 %1, ptr %11, align 8, !tbaa !9
  store ptr %2, ptr %12, align 8, !tbaa !5
  store i64 %3, ptr %13, align 8, !tbaa !9
  store ptr %4, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store i32 %6, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.start.p0(i64 256, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #9
  %32 = getelementptr inbounds %struct.ZDICT_params_t, ptr %7, i32 0, i32 0
  %33 = load i32, ptr %32, align 8, !tbaa !13
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %8
  br label %39

36:                                               ; preds = %8
  %37 = getelementptr inbounds %struct.ZDICT_params_t, ptr %7, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !13
  br label %39

39:                                               ; preds = %36, %35
  %40 = phi i32 [ 3, %35 ], [ %38, %36 ]
  store i32 %40, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #9
  %41 = getelementptr inbounds %struct.ZDICT_params_t, ptr %7, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !15
  store i32 %42, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %43 = call i32 @ZDICT_maxRep(ptr noundef @repStartValue)
  %44 = zext i32 %43 to i64
  store i64 %44, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  br label %45

45:                                               ; preds = %39
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load i64, ptr %11, align 8, !tbaa !9
  %49 = load i64, ptr %13, align 8, !tbaa !9
  %50 = icmp ult i64 %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %47
  store i64 -70, ptr %9, align 8
  store i32 1, ptr %23, align 4
  br label %209

52:                                               ; preds = %47
  %53 = load i64, ptr %11, align 8, !tbaa !9
  %54 = icmp ult i64 %53, 256
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  store i64 -70, ptr %9, align 8
  store i32 1, ptr %23, align 4
  br label %209

56:                                               ; preds = %52
  %57 = getelementptr inbounds [256 x i8], ptr %18, i64 0, i64 0
  call void @MEM_writeLE32(ptr noundef %57, i32 noundef -332356553)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #9
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = load i64, ptr %13, align 8, !tbaa !9
  %60 = call i64 @XXH_INLINE_XXH64(ptr nocapture noundef %58, i64 noundef %59, i64 noundef 0) #10
  store i64 %60, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  %61 = load i64, ptr %24, align 8, !tbaa !9
  %62 = urem i64 %61, 2147450880
  %63 = add i64 %62, 32768
  %64 = trunc i64 %63 to i32
  store i32 %64, ptr %25, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  %65 = getelementptr inbounds %struct.ZDICT_params_t, ptr %7, i32 0, i32 2
  %66 = load i32, ptr %65, align 8, !tbaa !16
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %71

68:                                               ; preds = %56
  %69 = getelementptr inbounds %struct.ZDICT_params_t, ptr %7, i32 0, i32 2
  %70 = load i32, ptr %69, align 8, !tbaa !16
  br label %73

71:                                               ; preds = %56
  %72 = load i32, ptr %25, align 4, !tbaa !11
  br label %73

73:                                               ; preds = %71, %68
  %74 = phi i32 [ %70, %68 ], [ %72, %71 ]
  store i32 %74, ptr %26, align 4, !tbaa !11
  %75 = getelementptr inbounds [256 x i8], ptr %18, i64 0, i64 0
  %76 = getelementptr inbounds i8, ptr %75, i64 4
  %77 = load i32, ptr %26, align 4, !tbaa !11
  call void @MEM_writeLE32(ptr noundef %76, i32 noundef %77)
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  store i64 8, ptr %17, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %73
  %79 = load i32, ptr %20, align 4, !tbaa !11
  %80 = icmp uge i32 %79, 2
  br i1 %80, label %81, label %89

81:                                               ; preds = %78
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.57, ptr noundef @.str.51) #9
  %85 = load ptr, ptr @stderr, align 8, !tbaa !5
  %86 = call i32 @fflush(ptr noundef %85)
  br label %87

87:                                               ; preds = %82
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88, %78
  br label %90

90:                                               ; preds = %89
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  %93 = load i32, ptr %20, align 4, !tbaa !11
  %94 = icmp uge i32 %93, 2
  br i1 %94, label %95, label %103

95:                                               ; preds = %92
  br label %96

96:                                               ; preds = %95
  %97 = load ptr, ptr @stderr, align 8, !tbaa !5
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef @.str.58) #9
  %99 = load ptr, ptr @stderr, align 8, !tbaa !5
  %100 = call i32 @fflush(ptr noundef %99)
  br label %101

101:                                              ; preds = %96
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102, %92
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #9
  %106 = getelementptr inbounds [256 x i8], ptr %18, i64 0, i64 0
  %107 = load i64, ptr %17, align 8, !tbaa !9
  %108 = getelementptr inbounds i8, ptr %106, i64 %107
  %109 = load i64, ptr %17, align 8, !tbaa !9
  %110 = sub i64 256, %109
  %111 = load i32, ptr %19, align 4, !tbaa !11
  %112 = load ptr, ptr %14, align 8, !tbaa !5
  %113 = load ptr, ptr %15, align 8, !tbaa !5
  %114 = load i32, ptr %16, align 4, !tbaa !11
  %115 = load ptr, ptr %12, align 8, !tbaa !5
  %116 = load i64, ptr %13, align 8, !tbaa !9
  %117 = load i32, ptr %20, align 4, !tbaa !11
  %118 = call i64 @ZDICT_analyzeEntropy(ptr noundef %108, i64 noundef %110, i32 noundef %111, ptr noundef %112, ptr noundef %113, i32 noundef %114, ptr noundef %115, i64 noundef %116, i32 noundef %117)
  store i64 %118, ptr %27, align 8, !tbaa !9
  %119 = load i64, ptr %27, align 8, !tbaa !9
  %120 = call i32 @ZDICT_isError(i64 noundef %119)
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %124

122:                                              ; preds = %105
  %123 = load i64, ptr %27, align 8, !tbaa !9
  store i64 %123, ptr %9, align 8
  store i32 1, ptr %23, align 4
  br label %128

124:                                              ; preds = %105
  %125 = load i64, ptr %27, align 8, !tbaa !9
  %126 = load i64, ptr %17, align 8, !tbaa !9
  %127 = add i64 %126, %125
  store i64 %127, ptr %17, align 8, !tbaa !9
  store i32 0, ptr %23, align 4
  br label %128

128:                                              ; preds = %124, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #9
  %129 = load i32, ptr %23, align 4
  switch i32 %129, label %209 [
    i32 0, label %130
  ]

130:                                              ; preds = %128
  %131 = load i64, ptr %17, align 8, !tbaa !9
  %132 = load i64, ptr %13, align 8, !tbaa !9
  %133 = add i64 %131, %132
  %134 = load i64, ptr %11, align 8, !tbaa !9
  %135 = icmp ugt i64 %133, %134
  br i1 %135, label %136, label %140

136:                                              ; preds = %130
  %137 = load i64, ptr %11, align 8, !tbaa !9
  %138 = load i64, ptr %17, align 8, !tbaa !9
  %139 = sub i64 %137, %138
  store i64 %139, ptr %13, align 8, !tbaa !9
  br label %140

140:                                              ; preds = %136, %130
  %141 = load i64, ptr %13, align 8, !tbaa !9
  %142 = load i64, ptr %21, align 8, !tbaa !9
  %143 = icmp ult i64 %141, %142
  br i1 %143, label %144, label %170

144:                                              ; preds = %140
  br label %145

145:                                              ; preds = %144
  %146 = load i64, ptr %17, align 8, !tbaa !9
  %147 = load i64, ptr %21, align 8, !tbaa !9
  %148 = add i64 %146, %147
  %149 = load i64, ptr %11, align 8, !tbaa !9
  %150 = icmp ugt i64 %148, %149
  br i1 %150, label %151, label %164

151:                                              ; preds = %145
  br label %152

152:                                              ; preds = %151
  br label %153

153:                                              ; preds = %152
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  store i64 -70, ptr %9, align 8
  store i32 1, ptr %23, align 4
  br label %209

164:                                              ; preds = %145
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load i64, ptr %21, align 8, !tbaa !9
  %168 = load i64, ptr %13, align 8, !tbaa !9
  %169 = sub i64 %167, %168
  store i64 %169, ptr %22, align 8, !tbaa !9
  br label %171

170:                                              ; preds = %140
  store i64 0, ptr %22, align 8, !tbaa !9
  br label %171

171:                                              ; preds = %170, %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #9
  %172 = load i64, ptr %17, align 8, !tbaa !9
  %173 = load i64, ptr %22, align 8, !tbaa !9
  %174 = add i64 %172, %173
  %175 = load i64, ptr %13, align 8, !tbaa !9
  %176 = add i64 %174, %175
  store i64 %176, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #9
  %177 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %177, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #9
  %178 = load ptr, ptr %29, align 8, !tbaa !5
  %179 = load i64, ptr %17, align 8, !tbaa !9
  %180 = getelementptr inbounds i8, ptr %178, i64 %179
  store ptr %180, ptr %30, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #9
  %181 = load ptr, ptr %30, align 8, !tbaa !5
  %182 = load i64, ptr %22, align 8, !tbaa !9
  %183 = getelementptr inbounds i8, ptr %181, i64 %182
  store ptr %183, ptr %31, align 8, !tbaa !5
  %184 = load i64, ptr %28, align 8, !tbaa !9
  %185 = load i64, ptr %11, align 8, !tbaa !9
  %186 = icmp ule i64 %184, %185
  br i1 %186, label %187, label %188

187:                                              ; preds = %171
  br label %189

188:                                              ; preds = %171
  call void @__assert_fail(ptr noundef @.str.59, ptr noundef @.str.60, i32 noundef 52198, ptr noundef @__PRETTY_FUNCTION__.ZDICT_finalizeDictionary) #11
  unreachable

189:                                              ; preds = %187
  %190 = load ptr, ptr %31, align 8, !tbaa !5
  %191 = load i64, ptr %13, align 8, !tbaa !9
  %192 = getelementptr inbounds i8, ptr %190, i64 %191
  %193 = load ptr, ptr %10, align 8, !tbaa !5
  %194 = load i64, ptr %28, align 8, !tbaa !9
  %195 = getelementptr inbounds i8, ptr %193, i64 %194
  %196 = icmp eq ptr %192, %195
  br i1 %196, label %197, label %198

197:                                              ; preds = %189
  br label %199

198:                                              ; preds = %189
  call void @__assert_fail(ptr noundef @.str.61, ptr noundef @.str.60, i32 noundef 52199, ptr noundef @__PRETTY_FUNCTION__.ZDICT_finalizeDictionary) #11
  unreachable

199:                                              ; preds = %197
  %200 = load ptr, ptr %31, align 8, !tbaa !5
  %201 = load ptr, ptr %12, align 8, !tbaa !5
  %202 = load i64, ptr %13, align 8, !tbaa !9
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %200, ptr align 1 %201, i64 %202, i1 false)
  %203 = load ptr, ptr %29, align 8, !tbaa !5
  %204 = getelementptr inbounds [256 x i8], ptr %18, i64 0, i64 0
  %205 = load i64, ptr %17, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %203, ptr align 16 %204, i64 %205, i1 false)
  %206 = load ptr, ptr %30, align 8, !tbaa !5
  %207 = load i64, ptr %22, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 1 %206, i8 0, i64 %207, i1 false)
  %208 = load i64, ptr %28, align 8, !tbaa !9
  store i64 %208, ptr %9, align 8
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #9
  br label %209

209:                                              ; preds = %199, %163, %128, %55, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 256, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  %210 = load i64, ptr %9, align 8
  ret i64 %210
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @ZDICT_maxRep(ptr noundef) #7

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #8

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind "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 = { "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 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 #8 = { noreturn 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8}
!15 = !{!14, !12, i64 4}
!16 = !{!14, !12, i64 8}


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

@repStartValue = external hidden constant [3 x i32], align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.51 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__.ZDICT_finalizeDictionary = external hidden unnamed_addr constant [130 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [65 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @MEM_writeLE32(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare hidden i64 @XXH_INLINE_XXH64(ptr nocapture noundef, i64 noundef, i64 noundef) local_unnamed_addr #4

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

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

; Function Attrs: nounwind uwtable
define dso_local i64 @ZDICT_finalizeDictionary(ptr noundef writeonly %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, ptr nocapture noundef readonly byval(%struct.ZDICT_params_t) align 8 %7) local_unnamed_addr #6 {
  %9 = alloca [256 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %9) #8
  %10 = load i32, ptr %7, align 8
  %11 = icmp eq i32 %10, 0
  %12 = select i1 %11, i32 3, i32 %10
  %13 = getelementptr inbounds i8, ptr %7, i64 4
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = tail call i32 @ZDICT_maxRep(ptr noundef nonnull @repStartValue)
  %16 = zext i32 %15 to i64
  %17 = icmp ult i64 %1, %3
  %18 = icmp ult i64 %1, 256
  %or.cond = or i1 %18, %17
  br i1 %or.cond, label %64, label %19

19:                                               ; preds = %8
  call void @MEM_writeLE32(ptr noundef nonnull %9, i32 noundef -332356553)
  %20 = call i64 @XXH_INLINE_XXH64(ptr nocapture noundef %2, i64 noundef %3, i64 noundef 0) #9
  %21 = urem i64 %20, 2147450880
  %22 = trunc nuw nsw i64 %21 to i32
  %23 = add nuw nsw i32 %22, 32768
  %24 = getelementptr inbounds i8, ptr %7, i64 8
  %25 = load i32, ptr %24, align 8
  %.not = icmp eq i32 %25, 0
  %26 = select i1 %.not, i32 %23, i32 %25
  %27 = getelementptr inbounds i8, ptr %9, i64 4
  call void @MEM_writeLE32(ptr noundef nonnull %27, i32 noundef %26)
  %28 = icmp ugt i32 %14, 1
  br i1 %28, label %29, label %.critedge

29:                                               ; preds = %19
  %30 = load ptr, ptr @stderr, align 8, !tbaa !10
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.57, ptr noundef nonnull @.str.51) #10
  %32 = load ptr, ptr @stderr, align 8, !tbaa !10
  %33 = call i32 @fflush(ptr noundef %32)
  %34 = load ptr, ptr @stderr, align 8, !tbaa !10
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.58) #10
  %36 = load ptr, ptr @stderr, align 8, !tbaa !10
  %37 = call i32 @fflush(ptr noundef %36)
  br label %.critedge

.critedge:                                        ; preds = %19, %29
  %38 = getelementptr inbounds i8, ptr %9, i64 8
  %39 = call i64 @ZDICT_analyzeEntropy(ptr noundef nonnull %38, i64 noundef 248, i32 noundef %12, ptr noundef %4, ptr noundef %5, i32 noundef %6, ptr noundef %2, i64 noundef %3, i32 noundef %14)
  %40 = call i32 @ZDICT_isError(i64 noundef %39)
  %.not65 = icmp eq i32 %40, 0
  %41 = add i64 %39, 8
  br i1 %.not65, label %42, label %64

42:                                               ; preds = %.critedge
  %43 = add i64 %41, %3
  %44 = icmp ugt i64 %43, %1
  %45 = sub i64 %1, %41
  %spec.select = select i1 %44, i64 %45, i64 %3
  %46 = icmp ult i64 %spec.select, %16
  br i1 %46, label %47, label %52

47:                                               ; preds = %42
  %48 = add i64 %41, %16
  %49 = icmp ugt i64 %48, %1
  br i1 %49, label %64, label %50

50:                                               ; preds = %47
  %51 = sub nsw i64 %16, %spec.select
  br label %52

52:                                               ; preds = %42, %50
  %.060 = phi i64 [ %51, %50 ], [ 0, %42 ]
  %53 = add i64 %spec.select, %41
  %54 = add i64 %53, %.060
  %55 = getelementptr inbounds i8, ptr %0, i64 %41
  %56 = getelementptr inbounds i8, ptr %55, i64 %.060
  %.not66 = icmp ugt i64 %54, %1
  br i1 %.not66, label %57, label %58

57:                                               ; preds = %52
  call void @__assert_fail(ptr noundef nonnull @.str.59, ptr noundef nonnull @.str.60, i32 noundef 52198, ptr noundef nonnull @__PRETTY_FUNCTION__.ZDICT_finalizeDictionary) #11
  unreachable

58:                                               ; preds = %52
  %59 = getelementptr inbounds i8, ptr %56, i64 %spec.select
  %60 = getelementptr inbounds i8, ptr %0, i64 %54
  %61 = icmp eq ptr %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  call void @__assert_fail(ptr noundef nonnull @.str.61, ptr noundef nonnull @.str.60, i32 noundef 52199, ptr noundef nonnull @__PRETTY_FUNCTION__.ZDICT_finalizeDictionary) #11
  unreachable

63:                                               ; preds = %58
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %56, ptr align 1 %2, i64 %spec.select, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %0, ptr nonnull align 16 %9, i64 %41, i1 false)
  call void @llvm.memset.p0.i64(ptr align 1 %55, i8 0, i64 %.060, i1 false)
  br label %64

64:                                               ; preds = %47, %8, %.critedge, %63
  %.1 = phi i64 [ %54, %63 ], [ %39, %.critedge ], [ -70, %8 ], [ -70, %47 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %9) #8
  ret i64 %.1
}

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 #7 = { noreturn 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 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { cold nounwind }
attributes #11 = { noreturn 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 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !8, i64 0}


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