; LLVM IR from JayXon/Leanify :: lib/zopfli (blocksplitter)

; 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.SplitCostContext = type { ptr, i64, i64 }
%struct.ZopfliLZ77Store = type { ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.ZopfliOptions = type { i32, i32, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@__PRETTY_FUNCTION__.ZopfliBlockSplitLZ77 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @ZopfliBlockSplitLZ77(ptr noundef %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  %20 = alloca %struct.SplitCostContext, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 1, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %21 = load ptr, ptr %7, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.ZopfliLZ77Store, ptr %21, i32 0, i32 2
  %23 = load i64, ptr %22, align 8, !tbaa !11
  %24 = icmp ult i64 %23, 10
  br i1 %24, label %25, label %26

25:                                               ; preds = %5
  store i32 1, ptr %19, align 4
  br label %150

26:                                               ; preds = %5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.ZopfliLZ77Store, ptr %27, i32 0, i32 2
  %29 = load i64, ptr %28, align 8, !tbaa !11
  %30 = call noalias ptr @malloc(i64 noundef %29) #6
  store ptr %30, ptr %16, align 8, !tbaa !5
  %31 = load ptr, ptr %16, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %34, label %33

33:                                               ; preds = %26
  call void @exit(i32 noundef -1) #7
  unreachable

34:                                               ; preds = %26
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %35

35:                                               ; preds = %45, %34
  %36 = load i64, ptr %13, align 8, !tbaa !9
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.ZopfliLZ77Store, ptr %37, i32 0, i32 2
  %39 = load i64, ptr %38, align 8, !tbaa !11
  %40 = icmp ult i64 %36, %39
  br i1 %40, label %41, label %48

41:                                               ; preds = %35
  %42 = load ptr, ptr %16, align 8, !tbaa !5
  %43 = load i64, ptr %13, align 8, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %42, i64 %43
  store i8 0, ptr %44, align 1, !tbaa !13
  br label %45

45:                                               ; preds = %41
  %46 = load i64, ptr %13, align 8, !tbaa !9
  %47 = add i64 %46, 1
  store i64 %47, ptr %13, align 8, !tbaa !9
  br label %35, !llvm.loop !14

48:                                               ; preds = %35
  store i64 0, ptr %11, align 8, !tbaa !9
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ZopfliLZ77Store, ptr %49, i32 0, i32 2
  %51 = load i64, ptr %50, align 8, !tbaa !11
  store i64 %51, ptr %12, align 8, !tbaa !9
  br label %52

52:                                               ; preds = %136, %48
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #5
  %53 = load i64, ptr %8, align 8, !tbaa !9
  %54 = icmp ugt i64 %53, 0
  br i1 %54, label %55, label %60

55:                                               ; preds = %52
  %56 = load i64, ptr %15, align 8, !tbaa !9
  %57 = load i64, ptr %8, align 8, !tbaa !9
  %58 = icmp uge i64 %56, %57
  br i1 %58, label %59, label %60

59:                                               ; preds = %55
  store i32 5, ptr %19, align 4
  br label %134

60:                                               ; preds = %55, %52
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.SplitCostContext, ptr %20, i32 0, i32 0
  store ptr %61, ptr %62, align 8, !tbaa !16
  %63 = load i64, ptr %11, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.SplitCostContext, ptr %20, i32 0, i32 1
  store i64 %63, ptr %64, align 8, !tbaa !18
  %65 = load i64, ptr %12, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.SplitCostContext, ptr %20, i32 0, i32 2
  store i64 %65, ptr %66, align 8, !tbaa !19
  %67 = load i64, ptr %11, align 8, !tbaa !9
  %68 = load i64, ptr %12, align 8, !tbaa !9
  %69 = icmp ult i64 %67, %68
  br i1 %69, label %70, label %71

70:                                               ; preds = %60
  br label %72

71:                                               ; preds = %60
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 243, ptr noundef @__PRETTY_FUNCTION__.ZopfliBlockSplitLZ77) #7
  unreachable

72:                                               ; preds = %70
  %73 = load i64, ptr %11, align 8, !tbaa !9
  %74 = add i64 %73, 1
  %75 = load i64, ptr %12, align 8, !tbaa !9
  %76 = call i64 @FindMinimum(ptr noundef @SplitCost, ptr noundef %20, i64 noundef %74, i64 noundef %75, ptr noundef %17)
  store i64 %76, ptr %14, align 8, !tbaa !9
  %77 = load i64, ptr %14, align 8, !tbaa !9
  %78 = load i64, ptr %11, align 8, !tbaa !9
  %79 = icmp ugt i64 %77, %78
  br i1 %79, label %80, label %81

80:                                               ; preds = %72
  br label %82

81:                                               ; preds = %72
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 246, ptr noundef @__PRETTY_FUNCTION__.ZopfliBlockSplitLZ77) #7
  unreachable

82:                                               ; preds = %80
  %83 = load i64, ptr %14, align 8, !tbaa !9
  %84 = load i64, ptr %12, align 8, !tbaa !9
  %85 = icmp ult i64 %83, %84
  br i1 %85, label %86, label %87

86:                                               ; preds = %82
  br label %88

87:                                               ; preds = %82
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 247, ptr noundef @__PRETTY_FUNCTION__.ZopfliBlockSplitLZ77) #7
  unreachable

88:                                               ; preds = %86
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = load i64, ptr %11, align 8, !tbaa !9
  %91 = load i64, ptr %12, align 8, !tbaa !9
  %92 = call double @EstimateCost(ptr noundef %89, i64 noundef %90, i64 noundef %91)
  store double %92, ptr %18, align 8, !tbaa !20
  %93 = load double, ptr %17, align 8, !tbaa !20
  %94 = load double, ptr %18, align 8, !tbaa !20
  %95 = fcmp ogt double %93, %94
  br i1 %95, label %105, label %96

96:                                               ; preds = %88
  %97 = load i64, ptr %14, align 8, !tbaa !9
  %98 = load i64, ptr %11, align 8, !tbaa !9
  %99 = add i64 %98, 1
  %100 = icmp eq i64 %97, %99
  br i1 %100, label %105, label %101

101:                                              ; preds = %96
  %102 = load i64, ptr %14, align 8, !tbaa !9
  %103 = load i64, ptr %12, align 8, !tbaa !9
  %104 = icmp eq i64 %102, %103
  br i1 %104, label %105, label %109

105:                                              ; preds = %101, %96, %88
  %106 = load ptr, ptr %16, align 8, !tbaa !5
  %107 = load i64, ptr %11, align 8, !tbaa !9
  %108 = getelementptr inbounds i8, ptr %106, i64 %107
  store i8 1, ptr %108, align 1, !tbaa !13
  br label %115

109:                                              ; preds = %101
  %110 = load i64, ptr %14, align 8, !tbaa !9
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  call void @AddSorted(i64 noundef %110, ptr noundef %111, ptr noundef %112)
  %113 = load i64, ptr %15, align 8, !tbaa !9
  %114 = add i64 %113, 1
  store i64 %114, ptr %15, align 8, !tbaa !9
  br label %115

115:                                              ; preds = %109, %105
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ZopfliLZ77Store, ptr %116, i32 0, i32 2
  %118 = load i64, ptr %117, align 8, !tbaa !11
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = load ptr, ptr %120, align 8, !tbaa !5
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = load i64, ptr %122, align 8, !tbaa !9
  %124 = call i32 @FindLargestSplittableBlock(i64 noundef %118, ptr noundef %119, ptr noundef %121, i64 noundef %123, ptr noundef %11, ptr noundef %12)
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %127, label %126

126:                                              ; preds = %115
  store i32 5, ptr %19, align 4
  br label %134

127:                                              ; preds = %115
  %128 = load i64, ptr %12, align 8, !tbaa !9
  %129 = load i64, ptr %11, align 8, !tbaa !9
  %130 = sub i64 %128, %129
  %131 = icmp ult i64 %130, 10
  br i1 %131, label %132, label %133

132:                                              ; preds = %127
  store i32 5, ptr %19, align 4
  br label %134

133:                                              ; preds = %127
  store i32 0, ptr %19, align 4
  br label %134

134:                                              ; preds = %133, %132, %126, %59
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  %135 = load i32, ptr %19, align 4
  switch i32 %135, label %153 [
    i32 0, label %136
    i32 5, label %137
  ]

136:                                              ; preds = %134
  br label %52

137:                                              ; preds = %134
  %138 = load ptr, ptr %6, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.ZopfliOptions, ptr %138, i32 0, i32 0
  %140 = load i32, ptr %139, align 4, !tbaa !22
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %148

142:                                              ; preds = %137
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = load ptr, ptr %144, align 8, !tbaa !5
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  %147 = load i64, ptr %146, align 8, !tbaa !9
  call void @PrintBlockSplitPoints(ptr noundef %143, ptr noundef %145, i64 noundef %147)
  br label %148

148:                                              ; preds = %142, %137
  %149 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %149) #5
  store i32 0, ptr %19, align 4
  br label %150

150:                                              ; preds = %148, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %151 = load i32, ptr %19, align 4
  switch i32 %151, label %153 [
    i32 0, label %152
    i32 1, label %152
  ]

152:                                              ; preds = %150, %150
  ret void

153:                                              ; preds = %150, %134
  unreachable
}

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

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

; Function Attrs: nounwind uwtable
declare hidden i64 @FindMinimum(ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden double @SplitCost(i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden double @EstimateCost(ptr noundef, i64 noundef, i64 noundef) #0

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

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #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) }
attributes #7 = { 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, !10, i64 16}
!12 = !{!"ZopfliLZ77Store", !6, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !6, i64 0}
!17 = !{!"SplitCostContext", !6, i64 0, !10, i64 8, !10, i64 16}
!18 = !{!17, !10, i64 8}
!19 = !{!17, !10, i64 16}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = !{!23, !24, i64 0}
!23 = !{!"ZopfliOptions", !24, i64 0, !24, i64 4, !24, i64 8, !24, i64 12, !24, i64 16, !24, i64 20}
!24 = !{!"int", !7, i64 0}


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

@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@__PRETTY_FUNCTION__.ZopfliBlockSplitLZ77 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @ZopfliBlockSplitLZ77(ptr nocapture noundef readonly %0, ptr noundef %1, i64 noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca double, align 8
  %9 = alloca %struct.SplitCostContext, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %10 = getelementptr inbounds i8, ptr %1, i64 16
  %11 = load i64, ptr %10, align 8, !tbaa !5
  %12 = icmp ult i64 %11, 10
  br i1 %12, label %62, label %13

13:                                               ; preds = %5
  %calloc = tail call ptr @calloc(i64 1, i64 %11)
  %.not = icmp eq ptr %calloc, null
  br i1 %.not, label %15, label %.preheader.preheader

.preheader.preheader:                             ; preds = %13
  store i64 0, ptr %6, align 8, !tbaa !11
  store i64 %11, ptr %7, align 8, !tbaa !11
  %14 = add i64 %2, -1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %or.cond.not53 = icmp eq i64 %14, 0
  br i1 %or.cond.not53, label %select.unfold, label %.lr.ph

15:                                               ; preds = %13
  tail call void @exit(i32 noundef -1) #6
  unreachable

.lr.ph:                                           ; preds = %.preheader.preheader
  %16 = getelementptr inbounds i8, ptr %9, i64 8
  %17 = getelementptr inbounds i8, ptr %9, i64 16
  br label %18

18:                                               ; preds = %.lr.ph, %56
  %19 = phi i64 [ %11, %.lr.ph ], [ %52, %56 ]
  %20 = phi i64 [ 0, %.lr.ph ], [ %53, %56 ]
  %.03454 = phi i64 [ 1, %.lr.ph ], [ %.1, %56 ]
  store ptr %1, ptr %9, align 8, !tbaa !12
  store i64 %20, ptr %16, align 8, !tbaa !14
  store i64 %19, ptr %17, align 8, !tbaa !15
  %21 = icmp ult i64 %20, %19
  br i1 %21, label %23, label %22

22:                                               ; preds = %18
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 243, ptr noundef nonnull @__PRETTY_FUNCTION__.ZopfliBlockSplitLZ77) #6
  unreachable

23:                                               ; preds = %18
  %24 = add nuw i64 %20, 1
  %25 = call i64 @FindMinimum(ptr noundef nonnull @SplitCost, ptr noundef nonnull %9, i64 noundef %24, i64 noundef %19, ptr noundef nonnull %8)
  %26 = load i64, ptr %6, align 8, !tbaa !11
  %27 = icmp ugt i64 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 246, ptr noundef nonnull @__PRETTY_FUNCTION__.ZopfliBlockSplitLZ77) #6
  unreachable

29:                                               ; preds = %23
  %30 = load i64, ptr %7, align 8, !tbaa !11
  %31 = icmp ult i64 %25, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 247, ptr noundef nonnull @__PRETTY_FUNCTION__.ZopfliBlockSplitLZ77) #6
  unreachable

33:                                               ; preds = %29
  %34 = call double @EstimateCost(ptr noundef %1, i64 noundef %26, i64 noundef %30)
  %35 = load double, ptr %8, align 8, !tbaa !16
  %36 = fcmp ogt double %35, %34
  %.pre = load i64, ptr %6, align 8, !tbaa !11
  br i1 %36, label %42, label %37

37:                                               ; preds = %33
  %38 = add i64 %.pre, 1
  %39 = icmp eq i64 %25, %38
  %40 = load i64, ptr %7, align 8
  %41 = icmp eq i64 %25, %40
  %or.cond48 = select i1 %39, i1 true, i1 %41
  br i1 %or.cond48, label %42, label %44

42:                                               ; preds = %37, %33
  %43 = getelementptr inbounds i8, ptr %calloc, i64 %.pre
  store i8 1, ptr %43, align 1, !tbaa !18
  br label %46

44:                                               ; preds = %37
  call void @AddSorted(i64 noundef %25, ptr noundef %3, ptr noundef %4)
  %45 = add i64 %.03454, 1
  br label %46

46:                                               ; preds = %44, %42
  %.1 = phi i64 [ %.03454, %42 ], [ %45, %44 ]
  %47 = load i64, ptr %10, align 8, !tbaa !5
  %48 = load ptr, ptr %3, align 8, !tbaa !19
  %49 = load i64, ptr %4, align 8, !tbaa !11
  %50 = call i32 @FindLargestSplittableBlock(i64 noundef %47, ptr noundef nonnull %calloc, ptr noundef %48, i64 noundef %49, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %.not45 = icmp eq i32 %50, 0
  br i1 %.not45, label %select.unfold, label %51

51:                                               ; preds = %46
  %52 = load i64, ptr %7, align 8, !tbaa !11
  %53 = load i64, ptr %6, align 8, !tbaa !11
  %54 = sub i64 %52, %53
  %55 = icmp ult i64 %54, 10
  br i1 %55, label %select.unfold, label %56

56:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #5
  %or.cond.not = icmp ult i64 %14, %.1
  br i1 %or.cond.not, label %select.unfold, label %18

select.unfold:                                    ; preds = %46, %56, %51, %.preheader.preheader
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #5
  %57 = load i32, ptr %0, align 4, !tbaa !20
  %.not46 = icmp eq i32 %57, 0
  br i1 %.not46, label %61, label %58

58:                                               ; preds = %select.unfold
  %59 = load ptr, ptr %3, align 8, !tbaa !19
  %60 = load i64, ptr %4, align 8, !tbaa !11
  call void @PrintBlockSplitPoints(ptr noundef %1, ptr noundef %59, i64 noundef %60)
  br label %61

61:                                               ; preds = %58, %select.unfold
  call void @free(ptr noundef %calloc) #5
  br label %62

62:                                               ; preds = %5, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  ret void
}

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden i64 @FindMinimum(ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden double @SplitCost(i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden double @EstimateCost(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

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

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

; 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: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #5 = { nounwind }
attributes #6 = { 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, !10, i64 16}
!6 = !{!"ZopfliLZ77Store", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !7, i64 0}
!13 = !{!"SplitCostContext", !7, i64 0, !10, i64 8, !10, i64 16}
!14 = !{!13, !10, i64 8}
!15 = !{!13, !10, i64 16}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !8, i64 0}
!18 = !{!8, !8, i64 0}
!19 = !{!7, !7, i64 0}
!20 = !{!21, !22, i64 0}
!21 = !{!"ZopfliOptions", !22, i64 0, !22, i64 4, !22, i64 8, !22, i64 12, !22, i64 16, !22, i64 20}
!22 = !{!"int", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass