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

@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__.ZopfliBlockSplit = external hidden unnamed_addr constant [113 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @ZopfliBlockSplitLZ77(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.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 @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

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

; Function Attrs: nounwind uwtable
define dso_local void @ZopfliBlockSplit(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, ptr noundef %5, ptr noundef %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %struct.ZopfliBlockState, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca %struct.ZopfliLZ77Store, align 8
  %21 = alloca %struct.ZopfliHash, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i64 %2, ptr %10, align 8, !tbaa !9
  store i64 %3, ptr %11, align 8, !tbaa !9
  store i64 %4, ptr %12, align 8, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 0, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store i64 0, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store ptr %21, ptr %22, align 8, !tbaa !5
  %25 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ZopfliInitLZ77Store(ptr noundef %25, ptr noundef %20)
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = load i64, ptr %10, align 8, !tbaa !9
  %28 = load i64, ptr %11, align 8, !tbaa !9
  call void @ZopfliInitBlockState(ptr noundef %26, i64 noundef %27, i64 noundef %28, i32 noundef 0, ptr noundef %17)
  %29 = load ptr, ptr %22, align 8, !tbaa !5
  call void @ZopfliAllocHash(i64 noundef 32768, ptr noundef %29)
  %30 = load ptr, ptr %14, align 8, !tbaa !5
  store i64 0, ptr %30, align 8, !tbaa !9
  %31 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr null, ptr %31, align 8, !tbaa !5
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = load i64, ptr %10, align 8, !tbaa !9
  %34 = load i64, ptr %11, align 8, !tbaa !9
  %35 = load ptr, ptr %22, align 8, !tbaa !5
  call void @ZopfliLZ77Greedy(ptr noundef %17, ptr noundef %32, i64 noundef %33, i64 noundef %34, ptr noundef %20, ptr noundef %35)
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = load i64, ptr %12, align 8, !tbaa !9
  call void @ZopfliBlockSplitLZ77(ptr noundef %36, ptr noundef %20, i64 noundef %37, ptr noundef %18, ptr noundef %19)
  %38 = load i64, ptr %10, align 8, !tbaa !9
  store i64 %38, ptr %15, align 8, !tbaa !9
  %39 = load i64, ptr %19, align 8, !tbaa !9
  %40 = icmp ugt i64 %39, 0
  br i1 %40, label %41, label %125

41:                                               ; preds = %7
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %121, %41
  %43 = load i64, ptr %16, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.ZopfliLZ77Store, ptr %20, i32 0, i32 2
  %45 = load i64, ptr %44, align 8, !tbaa !11
  %46 = icmp ult i64 %43, %45
  br i1 %46, label %47, label %124

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %48 = getelementptr inbounds %struct.ZopfliLZ77Store, ptr %20, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !13
  %50 = load i64, ptr %16, align 8, !tbaa !9
  %51 = getelementptr inbounds i16, ptr %49, i64 %50
  %52 = load i16, ptr %51, align 2, !tbaa !14
  %53 = zext i16 %52 to i32
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %47
  br label %63

56:                                               ; preds = %47
  %57 = getelementptr inbounds %struct.ZopfliLZ77Store, ptr %20, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !16
  %59 = load i64, ptr %16, align 8, !tbaa !9
  %60 = getelementptr inbounds i16, ptr %58, i64 %59
  %61 = load i16, ptr %60, align 2, !tbaa !14
  %62 = zext i16 %61 to i32
  br label %63

63:                                               ; preds = %56, %55
  %64 = phi i32 [ 1, %55 ], [ %62, %56 ]
  %65 = sext i32 %64 to i64
  store i64 %65, ptr %23, align 8, !tbaa !9
  %66 = load ptr, ptr %18, align 8, !tbaa !5
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = getelementptr inbounds i64, ptr %66, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !9
  %71 = load i64, ptr %16, align 8, !tbaa !9
  %72 = icmp eq i64 %70, %71
  br i1 %72, label %73, label %114

73:                                               ; preds = %63
  %74 = load ptr, ptr %14, align 8, !tbaa !5
  %75 = load i64, ptr %74, align 8, !tbaa !9
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = sub i64 %77, 1
  %79 = and i64 %75, %78
  %80 = icmp ne i64 %79, 0
  br i1 %80, label %98, label %81

81:                                               ; preds = %73
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = load i64, ptr %82, align 8, !tbaa !9
  %84 = icmp eq i64 %83, 0
  br i1 %84, label %85, label %87

85:                                               ; preds = %81
  %86 = call noalias ptr @malloc(i64 noundef 8) #8
  br label %95

87:                                               ; preds = %81
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  %90 = load ptr, ptr %14, align 8, !tbaa !5
  %91 = load i64, ptr %90, align 8, !tbaa !9
  %92 = mul i64 %91, 2
  %93 = mul i64 %92, 8
  %94 = call ptr @realloc(ptr noundef %89, i64 noundef %93) #9
  br label %95

95:                                               ; preds = %87, %85
  %96 = phi ptr [ %86, %85 ], [ %94, %87 ]
  %97 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %96, ptr %97, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %95, %73
  %99 = load i64, ptr %15, align 8, !tbaa !9
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = load ptr, ptr %100, align 8, !tbaa !5
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  %103 = load i64, ptr %102, align 8, !tbaa !9
  %104 = getelementptr inbounds i64, ptr %101, i64 %103
  store i64 %99, ptr %104, align 8, !tbaa !9
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  %106 = load i64, ptr %105, align 8, !tbaa !9
  %107 = add i64 %106, 1
  store i64 %107, ptr %105, align 8, !tbaa !9
  %108 = load ptr, ptr %14, align 8, !tbaa !5
  %109 = load i64, ptr %108, align 8, !tbaa !9
  %110 = load i64, ptr %19, align 8, !tbaa !9
  %111 = icmp eq i64 %109, %110
  br i1 %111, label %112, label %113

112:                                              ; preds = %98
  store i32 2, ptr %24, align 4
  br label %118

113:                                              ; preds = %98
  br label %114

114:                                              ; preds = %113, %63
  %115 = load i64, ptr %23, align 8, !tbaa !9
  %116 = load i64, ptr %15, align 8, !tbaa !9
  %117 = add i64 %116, %115
  store i64 %117, ptr %15, align 8, !tbaa !9
  store i32 0, ptr %24, align 4
  br label %118

118:                                              ; preds = %114, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  %119 = load i32, ptr %24, align 4
  switch i32 %119, label %135 [
    i32 0, label %120
    i32 2, label %124
  ]

120:                                              ; preds = %118
  br label %121

121:                                              ; preds = %120
  %122 = load i64, ptr %16, align 8, !tbaa !9
  %123 = add i64 %122, 1
  store i64 %123, ptr %16, align 8, !tbaa !9
  br label %42, !llvm.loop !17

124:                                              ; preds = %118, %42
  br label %125

125:                                              ; preds = %124, %7
  %126 = load ptr, ptr %14, align 8, !tbaa !5
  %127 = load i64, ptr %126, align 8, !tbaa !9
  %128 = load i64, ptr %19, align 8, !tbaa !9
  %129 = icmp eq i64 %127, %128
  br i1 %129, label %130, label %131

130:                                              ; preds = %125
  br label %132

131:                                              ; preds = %125
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 314, ptr noundef @__PRETTY_FUNCTION__.ZopfliBlockSplit) #10
  unreachable

132:                                              ; preds = %130
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  call void @free(ptr noundef %133) #7
  call void @ZopfliCleanBlockState(ptr noundef %17)
  call void @ZopfliCleanLZ77Store(ptr noundef %20)
  %134 = load ptr, ptr %22, align 8, !tbaa !5
  call void @ZopfliCleanHash(ptr noundef %134)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  ret void

135:                                              ; preds = %118
  unreachable
}

declare void @ZopfliInitLZ77Store(ptr noundef, ptr noundef) #5

declare void @ZopfliInitBlockState(ptr noundef, i64 noundef, i64 noundef, i32 noundef, ptr noundef) #5

declare void @ZopfliAllocHash(i64 noundef, ptr noundef) #5

declare void @ZopfliLZ77Greedy(ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) #5

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #6

declare void @ZopfliCleanBlockState(ptr noundef) #5

declare void @ZopfliCleanLZ77Store(ptr noundef) #5

declare void @ZopfliCleanHash(ptr noundef) #5

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 = { "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(1) "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) }
attributes #9 = { nounwind allocsize(1) }
attributes #10 = { 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 = !{!12, !6, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!12, !6, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"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.ZopfliBlockState = type { ptr, ptr, i64, i64 }
%struct.ZopfliLZ77Store = type { ptr, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.ZopfliHash = type { ptr, ptr, ptr, i32, ptr, ptr, ptr, i32, ptr }

@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 x i8], align 1
@__PRETTY_FUNCTION__.ZopfliBlockSplit = external hidden unnamed_addr constant [113 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @ZopfliBlockSplitLZ77(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.start.p0(i64 immarg, ptr nocapture) #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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
define dso_local void @ZopfliBlockSplit(ptr noundef %0, ptr noundef %1, i64 noundef %2, i64 noundef %3, i64 noundef %4, ptr nocapture noundef %5, ptr nocapture noundef %6) local_unnamed_addr #0 {
  %8 = alloca %struct.ZopfliBlockState, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca %struct.ZopfliLZ77Store, align 8
  %12 = alloca %struct.ZopfliHash, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #8
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  store i64 0, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %12) #8
  call void @ZopfliInitLZ77Store(ptr noundef %1, ptr noundef nonnull %11) #8
  call void @ZopfliInitBlockState(ptr noundef %0, i64 noundef %2, i64 noundef %3, i32 noundef 0, ptr noundef nonnull %8) #8
  call void @ZopfliAllocHash(i64 noundef 32768, ptr noundef nonnull %12) #8
  store i64 0, ptr %6, align 8, !tbaa !9
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @ZopfliLZ77Greedy(ptr noundef nonnull %8, ptr noundef %1, i64 noundef %2, i64 noundef %3, ptr noundef nonnull %11, ptr noundef nonnull %12) #8
  call void @ZopfliBlockSplitLZ77(ptr noundef %0, ptr noundef nonnull %11, i64 noundef %4, ptr noundef nonnull %9, ptr noundef nonnull %10)
  %13 = load i64, ptr %10, align 8, !tbaa !9
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %7
  %14 = getelementptr inbounds i8, ptr %11, i64 16
  %15 = load i64, ptr %14, align 8, !tbaa !11
  %.not46 = icmp eq i64 %15, 0
  br i1 %.not46, label %.loopexit, label %.lr.ph

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

17:                                               ; preds = %.lr.ph, %56
  %18 = phi i64 [ %13, %.lr.ph ], [ %57, %56 ]
  %19 = phi i64 [ %15, %.lr.ph ], [ %58, %56 ]
  %.03544 = phi i64 [ %2, %.lr.ph ], [ %59, %56 ]
  %.03643 = phi i64 [ 0, %.lr.ph ], [ %60, %56 ]
  %20 = load ptr, ptr %16, align 8, !tbaa !13
  %21 = getelementptr inbounds i16, ptr %20, i64 %.03643
  %22 = load i16, ptr %21, align 2, !tbaa !14
  %23 = icmp eq i16 %22, 0
  br i1 %23, label %29, label %24

24:                                               ; preds = %17
  %25 = load ptr, ptr %11, align 8, !tbaa !16
  %26 = getelementptr inbounds i16, ptr %25, i64 %.03643
  %27 = load i16, ptr %26, align 2, !tbaa !14
  %28 = zext i16 %27 to i64
  br label %29

29:                                               ; preds = %17, %24
  %30 = phi i64 [ %28, %24 ], [ 1, %17 ]
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = load i64, ptr %6, align 8, !tbaa !9
  %33 = getelementptr inbounds i64, ptr %31, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = icmp eq i64 %34, %.03643
  br i1 %35, label %36, label %56

36:                                               ; preds = %29
  %37 = call range(i64 0, 65) i64 @llvm.ctpop.i64(i64 %32)
  %.not38 = icmp ult i64 %37, 2
  br i1 %.not38, label %38, label %._crit_edge

._crit_edge:                                      ; preds = %36
  %.pre = load ptr, ptr %5, align 8, !tbaa !5
  br label %48

38:                                               ; preds = %36
  %39 = icmp eq i64 %32, 0
  br i1 %39, label %40, label %42

40:                                               ; preds = %38
  %41 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #9
  br label %46

42:                                               ; preds = %38
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = shl i64 %32, 4
  %45 = call ptr @realloc(ptr noundef %43, i64 noundef %44) #10
  %.pre47.pre = load i64, ptr %6, align 8, !tbaa !9
  br label %46

46:                                               ; preds = %42, %40
  %.pre47 = phi i64 [ 0, %40 ], [ %.pre47.pre, %42 ]
  %47 = phi ptr [ %41, %40 ], [ %45, %42 ]
  store ptr %47, ptr %5, align 8, !tbaa !5
  br label %48

48:                                               ; preds = %._crit_edge, %46
  %49 = phi i64 [ %32, %._crit_edge ], [ %.pre47, %46 ]
  %50 = phi ptr [ %.pre, %._crit_edge ], [ %47, %46 ]
  %51 = getelementptr inbounds i64, ptr %50, i64 %49
  store i64 %.03544, ptr %51, align 8, !tbaa !9
  %52 = load i64, ptr %6, align 8, !tbaa !9
  %53 = add i64 %52, 1
  store i64 %53, ptr %6, align 8, !tbaa !9
  %54 = load i64, ptr %10, align 8, !tbaa !9
  %55 = icmp eq i64 %53, %54
  br i1 %55, label %.loopexit, label %._crit_edge48

._crit_edge48:                                    ; preds = %48
  %.pre49 = load i64, ptr %14, align 8, !tbaa !11
  br label %56

56:                                               ; preds = %._crit_edge48, %29
  %57 = phi i64 [ %54, %._crit_edge48 ], [ %18, %29 ]
  %58 = phi i64 [ %.pre49, %._crit_edge48 ], [ %19, %29 ]
  %59 = add i64 %30, %.03544
  %60 = add nuw i64 %.03643, 1
  %61 = icmp ult i64 %60, %58
  br i1 %61, label %17, label %.loopexit, !llvm.loop !17

.loopexit:                                        ; preds = %56, %48, %.preheader, %7
  %62 = phi i64 [ %13, %.preheader ], [ 0, %7 ], [ %57, %56 ], [ %53, %48 ]
  %63 = load i64, ptr %6, align 8, !tbaa !9
  %64 = icmp eq i64 %63, %62
  br i1 %64, label %66, label %65

65:                                               ; preds = %.loopexit
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 314, ptr noundef nonnull @__PRETTY_FUNCTION__.ZopfliBlockSplit) #11
  unreachable

66:                                               ; preds = %.loopexit
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %67) #8
  call void @ZopfliCleanBlockState(ptr noundef nonnull %8) #8
  call void @ZopfliCleanLZ77Store(ptr noundef nonnull %11) #8
  call void @ZopfliCleanHash(ptr noundef nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  ret void
}

declare void @ZopfliInitLZ77Store(ptr noundef, ptr noundef) local_unnamed_addr #5

declare void @ZopfliInitBlockState(ptr noundef, i64 noundef, i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

declare void @ZopfliAllocHash(i64 noundef, ptr noundef) local_unnamed_addr #5

declare void @ZopfliLZ77Greedy(ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #6

declare void @ZopfliCleanBlockState(ptr noundef) local_unnamed_addr #5

declare void @ZopfliCleanLZ77Store(ptr noundef) local_unnamed_addr #5

declare void @ZopfliCleanHash(ptr noundef) local_unnamed_addr #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.ctpop.i64(i64) #7

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 = { 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 = { 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 = { 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 #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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind allocsize(1) }
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, !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 = !{!12, !6, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"short", !7, i64 0}
!16 = !{!12, !6, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass