; LLVM IR from fhanau/Efficient-Compression-Tool :: src/zopfli (deflate)

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

; 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: mustprogress uwtable
define dso_local void @ZopfliDeflate(ptr noundef %0, i32 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #1 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca %struct.ZopfliLZ77Store, align 8
  %22 = alloca i8, align 1
  %23 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !9
  store ptr %2, ptr %10, align 8, !tbaa !5
  store i64 %3, ptr %11, align 8, !tbaa !11
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  %24 = load i64, ptr %11, align 8, !tbaa !11
  %25 = icmp ne i64 %24, 0
  br i1 %25, label %46, label %26

26:                                               ; preds = %7
  %27 = load ptr, ptr %13, align 8, !tbaa !5
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = load ptr, ptr %14, align 8, !tbaa !5
  %30 = load i64, ptr %29, align 8, !tbaa !11
  %31 = add i64 %30, 10
  %32 = call ptr @realloc(ptr noundef %28, i64 noundef %31) #5
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %32, ptr %33, align 8, !tbaa !5
  %34 = load i32, ptr %9, align 4, !tbaa !9
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZL6AddBitiPhPS_Pm(i32 noundef %34, ptr noundef %35, ptr noundef %36, ptr noundef %37)
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = load ptr, ptr %13, align 8, !tbaa !5
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZL7AddBitsjjPhS_Pm(i32 noundef 1, i32 noundef 2, ptr noundef %38, ptr noundef %40, ptr noundef %41)
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = load ptr, ptr %13, align 8, !tbaa !5
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZL7AddBitsjjPhS_Pm(i32 noundef 0, i32 noundef 7, ptr noundef %42, ptr noundef %44, ptr noundef %45)
  br label %173

46:                                               ; preds = %7
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ZopfliOptions, ptr %47, i32 0, i32 10
  %49 = load i32, ptr %48, align 4, !tbaa !13
  %50 = icmp ugt i32 %49, 1
  br i1 %50, label %51, label %66

51:                                               ; preds = %46
  %52 = load i64, ptr %11, align 8, !tbaa !11
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ZopfliOptions, ptr %53, i32 0, i32 4
  %55 = load i32, ptr %54, align 4, !tbaa !15
  %56 = zext i32 %55 to i64
  %57 = icmp uge i64 %52, %56
  br i1 %57, label %58, label %66

58:                                               ; preds = %51
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = load i64, ptr %11, align 8, !tbaa !11
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = load ptr, ptr %13, align 8, !tbaa !5
  %65 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZL18ZopfliDeflateMultiPK13ZopfliOptionsiPKhmPhPS4_Pm(ptr noundef %59, i32 noundef %60, ptr noundef %61, i64 noundef %62, ptr noundef %63, ptr noundef %64, ptr noundef %65)
  br label %173

66:                                               ; preds = %51, %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 5000000, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  store i8 1, ptr %17, align 1, !tbaa !16
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.ZopfliOptions, ptr %67, i32 0, i32 11
  %69 = load i32, ptr %68, align 4, !tbaa !17
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %79, label %71

71:                                               ; preds = %66
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.ZopfliOptions, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 4, !tbaa !18
  %75 = icmp eq i32 %74, 1
  br i1 %75, label %76, label %79

76:                                               ; preds = %71
  %77 = load i64, ptr %16, align 8, !tbaa !11
  %78 = udiv i64 %77, 5
  store i64 %78, ptr %16, align 8, !tbaa !11
  br label %79

79:                                               ; preds = %76, %71, %66
  br label %80

80:                                               ; preds = %168, %79
  %81 = load i64, ptr %15, align 8, !tbaa !11
  %82 = load i64, ptr %11, align 8, !tbaa !11
  %83 = icmp ult i64 %81, %82
  br i1 %83, label %84, label %172

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %85 = load i64, ptr %15, align 8, !tbaa !11
  %86 = load i64, ptr %16, align 8, !tbaa !11
  %87 = add i64 %85, %86
  %88 = load i64, ptr %11, align 8, !tbaa !11
  %89 = icmp uge i64 %87, %88
  %90 = zext i1 %89 to i32
  store i32 %90, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %96

93:                                               ; preds = %84
  %94 = load i32, ptr %18, align 4, !tbaa !9
  %95 = icmp ne i32 %94, 0
  br label %96

96:                                               ; preds = %93, %84
  %97 = phi i1 [ false, %84 ], [ %95, %93 ]
  %98 = zext i1 %97 to i32
  store i32 %98, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %99 = load i32, ptr %18, align 4, !tbaa !9
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %105

101:                                              ; preds = %96
  %102 = load i64, ptr %11, align 8, !tbaa !11
  %103 = load i64, ptr %15, align 8, !tbaa !11
  %104 = sub i64 %102, %103
  br label %107

105:                                              ; preds = %96
  %106 = load i64, ptr %16, align 8, !tbaa !11
  br label %107

107:                                              ; preds = %105, %101
  %108 = phi i64 [ %104, %101 ], [ %106, %105 ]
  store i64 %108, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #6
  call void @ZopfliInitLZ77Store(ptr noundef %21)
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.ZopfliOptions, ptr %109, i32 0, i32 13
  %111 = load i32, ptr %110, align 4, !tbaa !19
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %124, label %113

113:                                              ; preds = %107
  %114 = load ptr, ptr %8, align 8, !tbaa !5
  %115 = load i32, ptr %19, align 4, !tbaa !9
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = load i64, ptr %15, align 8, !tbaa !11
  %118 = load i64, ptr %15, align 8, !tbaa !11
  %119 = load i64, ptr %20, align 8, !tbaa !11
  %120 = add i64 %118, %119
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZL17ZopfliDeflatePartPK13ZopfliOptionsiPKhmmPhPS4_PmS4_hP15ZopfliLZ77Store(ptr noundef %114, i32 noundef %115, ptr noundef %116, i64 noundef %117, i64 noundef %120, ptr noundef %121, ptr noundef %122, ptr noundef %123, ptr noundef %17, i8 noundef zeroext 0, ptr noundef %21)
  br label %168

124:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #6
  %125 = load i8, ptr %17, align 1, !tbaa !16
  store i8 %125, ptr %22, align 1, !tbaa !16
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  %127 = load i32, ptr %19, align 4, !tbaa !9
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = load i64, ptr %15, align 8, !tbaa !11
  %130 = load i64, ptr %15, align 8, !tbaa !11
  %131 = load i64, ptr %20, align 8, !tbaa !11
  %132 = add i64 %130, %131
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZL17ZopfliDeflatePartPK13ZopfliOptionsiPKhmmPhPS4_PmS4_hP15ZopfliLZ77Store(ptr noundef %126, i32 noundef %127, ptr noundef %128, i64 noundef %129, i64 noundef %132, ptr noundef %133, ptr noundef %134, ptr noundef %135, ptr noundef %17, i8 noundef zeroext 1, ptr noundef %21)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %164, %124
  %137 = load i32, ptr %23, align 4, !tbaa !9
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.ZopfliOptions, ptr %138, i32 0, i32 13
  %140 = load i32, ptr %139, align 4, !tbaa !19
  %141 = icmp ult i32 %137, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %167

143:                                              ; preds = %136
  %144 = load i8, ptr %22, align 1, !tbaa !16
  store i8 %144, ptr %17, align 1, !tbaa !16
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = load i32, ptr %19, align 4, !tbaa !9
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = load i64, ptr %15, align 8, !tbaa !11
  %149 = load i64, ptr %15, align 8, !tbaa !11
  %150 = load i64, ptr %20, align 8, !tbaa !11
  %151 = add i64 %149, %150
  %152 = load ptr, ptr %12, align 8, !tbaa !5
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  %154 = load ptr, ptr %14, align 8, !tbaa !5
  %155 = load i32, ptr %23, align 4, !tbaa !9
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.ZopfliOptions, ptr %156, i32 0, i32 13
  %158 = load i32, ptr %157, align 4, !tbaa !19
  %159 = sub i32 %158, 1
  %160 = icmp ne i32 %155, %159
  %161 = zext i1 %160 to i32
  %162 = add nsw i32 2, %161
  %163 = trunc i32 %162 to i8
  call void @_ZL17ZopfliDeflatePartPK13ZopfliOptionsiPKhmmPhPS4_PmS4_hP15ZopfliLZ77Store(ptr noundef %145, i32 noundef %146, ptr noundef %147, i64 noundef %148, i64 noundef %151, ptr noundef %152, ptr noundef %153, ptr noundef %154, ptr noundef %17, i8 noundef zeroext %163, ptr noundef %21)
  br label %164

164:                                              ; preds = %143
  %165 = load i32, ptr %23, align 4, !tbaa !9
  %166 = add i32 %165, 1
  store i32 %166, ptr %23, align 4, !tbaa !9
  br label %136, !llvm.loop !20

167:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #6
  br label %168

168:                                              ; preds = %167, %113
  %169 = load i64, ptr %20, align 8, !tbaa !11
  %170 = load i64, ptr %15, align 8, !tbaa !11
  %171 = add i64 %170, %169
  store i64 %171, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %80, !llvm.loop !22

172:                                              ; preds = %80
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %173

173:                                              ; preds = %172, %58, %26
  ret void
}

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL18ZopfliDeflateMultiPK13ZopfliOptionsiPKhmPhPS4_Pm(ptr noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare void @ZopfliInitLZ77Store(ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL17ZopfliDeflatePartPK13ZopfliOptionsiPKhmmPhPS4_PmS4_hP15ZopfliLZ77Store(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 #3 = { mustprogress 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 = { "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 allocsize(1) }
attributes #6 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 40}
!14 = !{!"_ZTS13ZopfliOptions", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68}
!15 = !{!14, !10, i64 16}
!16 = !{!7, !7, i64 0}
!17 = !{!14, !10, i64 44}
!18 = !{!14, !10, i64 0}
!19 = !{!14, !10, i64 52}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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

; 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 uwtable
define dso_local void @ZopfliDeflate(ptr noundef %0, i32 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #1 {
  %8 = alloca i8, align 1
  %9 = alloca %struct.ZopfliLZ77Store, align 8
  %.not = icmp eq i64 %3, 0
  br i1 %.not, label %10, label %17

10:                                               ; preds = %7
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = load i64, ptr %6, align 8, !tbaa !9
  %13 = add i64 %12, 10
  %14 = tail call ptr @realloc(ptr noundef %11, i64 noundef %13) #5
  store ptr %14, ptr %5, align 8, !tbaa !5
  tail call void @_ZL6AddBitiPhPS_Pm(i32 noundef %1, ptr noundef %4, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  tail call void @_ZL7AddBitsjjPhS_Pm(i32 noundef 1, i32 noundef 2, ptr noundef %4, ptr noundef %15, ptr noundef nonnull %6)
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  tail call void @_ZL7AddBitsjjPhS_Pm(i32 noundef 0, i32 noundef 7, ptr noundef %4, ptr noundef %16, ptr noundef nonnull %6)
  br label %57

17:                                               ; preds = %7
  %18 = getelementptr inbounds i8, ptr %0, i64 40
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = icmp ugt i32 %19, 1
  br i1 %20, label %21, label %26

21:                                               ; preds = %17
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  %23 = load i32, ptr %22, align 4, !tbaa !14
  %24 = zext i32 %23 to i64
  %.not76 = icmp ugt i64 %24, %3
  br i1 %.not76, label %26, label %25

25:                                               ; preds = %21
  tail call void @_ZL18ZopfliDeflateMultiPK13ZopfliOptionsiPKhmPhPS4_Pm(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6)
  br label %57

26:                                               ; preds = %21, %17
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #6
  store i8 1, ptr %8, align 1, !tbaa !15
  %27 = getelementptr inbounds i8, ptr %0, i64 44
  %28 = load i32, ptr %27, align 4, !tbaa !16
  %.not77 = icmp eq i32 %28, 0
  br i1 %.not77, label %29, label %32

29:                                               ; preds = %26
  %30 = load i32, ptr %0, align 4, !tbaa !17
  %31 = icmp eq i32 %30, 1
  %spec.select = select i1 %31, i64 1000000, i64 5000000
  br label %32

32:                                               ; preds = %29, %26
  %.074 = phi i64 [ 5000000, %26 ], [ %spec.select, %29 ]
  %33 = icmp ne i32 %1, 0
  %34 = getelementptr inbounds i8, ptr %0, i64 52
  br label %35

35:                                               ; preds = %32, %.loopexit
  %.07381 = phi i64 [ 0, %32 ], [ %.pre-phi, %.loopexit ]
  %36 = add i64 %.07381, %.074
  %37 = icmp uge i64 %36, %3
  %38 = and i1 %33, %37
  %39 = zext i1 %38 to i32
  %40 = sub i64 %3, %.07381
  %41 = select i1 %37, i64 %40, i64 %.074
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #6
  call void @ZopfliInitLZ77Store(ptr noundef nonnull %9)
  %42 = load i32, ptr %34, align 4, !tbaa !18
  %.not78 = icmp eq i32 %42, 0
  br i1 %.not78, label %43, label %45

43:                                               ; preds = %35
  %44 = add i64 %41, %.07381
  call void @_ZL17ZopfliDeflatePartPK13ZopfliOptionsiPKhmmPhPS4_PmS4_hP15ZopfliLZ77Store(ptr noundef nonnull %0, i32 noundef %39, ptr noundef %2, i64 noundef %.07381, i64 noundef %44, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef nonnull %8, i8 noundef zeroext 0, ptr noundef nonnull %9)
  br label %.loopexit

45:                                               ; preds = %35
  %46 = load i8, ptr %8, align 1, !tbaa !15
  %47 = add i64 %41, %.07381
  call void @_ZL17ZopfliDeflatePartPK13ZopfliOptionsiPKhmmPhPS4_PmS4_hP15ZopfliLZ77Store(ptr noundef nonnull %0, i32 noundef %39, ptr noundef %2, i64 noundef %.07381, i64 noundef %47, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef nonnull %8, i8 noundef zeroext 1, ptr noundef nonnull %9)
  %48 = load i32, ptr %34, align 4, !tbaa !18
  %.not83 = icmp eq i32 %48, 0
  br i1 %.not83, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %45, %.lr.ph
  %49 = phi i32 [ %53, %.lr.ph ], [ %48, %45 ]
  %.080 = phi i32 [ %52, %.lr.ph ], [ 0, %45 ]
  store i8 %46, ptr %8, align 1, !tbaa !15
  %50 = add i32 %49, -1
  %.not79 = icmp eq i32 %.080, %50
  %51 = select i1 %.not79, i8 2, i8 3
  call void @_ZL17ZopfliDeflatePartPK13ZopfliOptionsiPKhmmPhPS4_PmS4_hP15ZopfliLZ77Store(ptr noundef nonnull %0, i32 noundef %39, ptr noundef %2, i64 noundef %.07381, i64 noundef %47, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef nonnull %8, i8 noundef zeroext %51, ptr noundef nonnull %9)
  %52 = add nuw i32 %.080, 1
  %53 = load i32, ptr %34, align 4, !tbaa !18
  %54 = icmp ult i32 %52, %53
  br i1 %54, label %.lr.ph, label %.loopexit, !llvm.loop !19

.loopexit:                                        ; preds = %.lr.ph, %45, %43
  %.pre-phi = phi i64 [ %47, %45 ], [ %44, %43 ], [ %47, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  %55 = icmp ult i64 %.pre-phi, %3
  br i1 %55, label %35, label %56, !llvm.loop !21

56:                                               ; preds = %.loopexit
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  br label %57

57:                                               ; preds = %56, %25, %10
  ret void
}

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL18ZopfliDeflateMultiPK13ZopfliOptionsiPKhmPhPS4_Pm(ptr noundef, i32 noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @ZopfliInitLZ77Store(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL17ZopfliDeflatePartPK13ZopfliOptionsiPKhmmPhPS4_PmS4_hP15ZopfliLZ77Store(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 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 #3 = { mustprogress 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 = { "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 allocsize(1) }
attributes #6 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 40}
!12 = !{!"_ZTS13ZopfliOptions", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56, !13, i64 60, !13, i64 64, !13, i64 68}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 16}
!15 = !{!7, !7, i64 0}
!16 = !{!12, !13, i64 44}
!17 = !{!12, !13, i64 0}
!18 = !{!12, !13, i64 52}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


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