; LLVM IR from fwip/fastqz :: libzpaq.ll (ZN7libzpaq9PredictorC2ERNS_5ZPAQLE)

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

%"class.libzpaq::Predictor" = type <{ i32, i32, [256 x i32], [256 x i32], ptr, [256 x %"struct.libzpaq::Component"], [256 x i32], [1024 x i32], [4096 x i16], [32768 x i16], %"class.libzpaq::StateTable", ptr, i32, [4 x i8] }>
%"struct.libzpaq::Component" = type { i64, i64, i64, i64, i64, %"class.libzpaq::Array", %"class.libzpaq::Array.0", %"class.libzpaq::Array.2" }
%"class.libzpaq::Array" = type <{ ptr, i64, i32, [4 x i8] }>
%"class.libzpaq::Array.0" = type <{ ptr, i64, i32, [4 x i8] }>
%"class.libzpaq::Array.2" = type <{ ptr, i64, i32, [4 x i8] }>
%"class.libzpaq::StateTable" = type { [1024 x i8] }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN7libzpaq3logEd(double noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN7libzpaq3expEd(double 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7libzpaq9PredictorC2ERNS_5ZPAQLE(ptr noundef nonnull align 8 dereferenceable(110620) %0, ptr noundef nonnull align 8 dereferenceable(192) %1) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8
  %16 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 0
  store i32 1, ptr %16, align 8, !tbaa !9
  %17 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 1
  store i32 1, ptr %17, align 4, !tbaa !13
  %18 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 4
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %19, ptr %18, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 5
  %21 = getelementptr inbounds [256 x %"struct.libzpaq::Component"], ptr %20, i32 0, i32 0
  %22 = getelementptr inbounds %"struct.libzpaq::Component", ptr %21, i64 256
  br label %23

23:                                               ; preds = %25, %2
  %24 = phi ptr [ %21, %2 ], [ %26, %25 ]
  invoke void @_ZN7libzpaq9ComponentC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %24)
          to label %25 unwind label %37

25:                                               ; preds = %23
  %26 = getelementptr inbounds %"struct.libzpaq::Component", ptr %24, i64 1
  %27 = icmp eq ptr %26, %22
  br i1 %27, label %28, label %23

28:                                               ; preds = %25
  %29 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 10
  invoke void @_ZN7libzpaq10StateTableC1Ev(ptr noundef nonnull align 1 dereferenceable(1024) %29)
          to label %30 unwind label %47

30:                                               ; preds = %28
  %31 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 6
  %32 = getelementptr inbounds [256 x i32], ptr %31, i64 0, i64 0
  store i32 0, ptr %32, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !14
  br label %33

33:                                               ; preds = %58, %30
  %34 = load i32, ptr %7, align 4, !tbaa !14
  %35 = icmp slt i32 %34, 256
  br i1 %35, label %51, label %36

36:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %61

37:                                               ; preds = %23
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %5, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %6, align 4
  %41 = icmp eq ptr %21, %24
  br i1 %41, label %46, label %42

42:                                               ; preds = %42, %37
  %43 = phi ptr [ %24, %37 ], [ %44, %42 ]
  %44 = getelementptr inbounds %"struct.libzpaq::Component", ptr %43, i64 -1
  call void @_ZN7libzpaq9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %44) #5
  %45 = icmp eq ptr %44, %21
  br i1 %45, label %46, label %42

46:                                               ; preds = %42, %37
  br label %178

47:                                               ; preds = %28
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %5, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %6, align 4
  br label %170

51:                                               ; preds = %33
  %52 = load i32, ptr %7, align 4, !tbaa !14
  %53 = sdiv i32 2048, %52
  %54 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 6
  %55 = load i32, ptr %7, align 4, !tbaa !14
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [256 x i32], ptr %54, i64 0, i64 %56
  store i32 %53, ptr %57, align 4, !tbaa !14
  br label %58

58:                                               ; preds = %51
  %59 = load i32, ptr %7, align 4, !tbaa !14
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %7, align 4, !tbaa !14
  br label %33, !llvm.loop !15

61:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !14
  br label %62

62:                                               ; preds = %76, %61
  %63 = load i32, ptr %8, align 4, !tbaa !14
  %64 = icmp slt i32 %63, 1024
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %79

66:                                               ; preds = %62
  %67 = load i32, ptr %8, align 4, !tbaa !14
  %68 = mul nsw i32 %67, 2
  %69 = add nsw i32 %68, 3
  %70 = sdiv i32 131072, %69
  %71 = mul nsw i32 %70, 2
  %72 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 7
  %73 = load i32, ptr %8, align 4, !tbaa !14
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [1024 x i32], ptr %72, i64 0, i64 %74
  store i32 %71, ptr %75, align 4, !tbaa !14
  br label %76

76:                                               ; preds = %66
  %77 = load i32, ptr %8, align 4, !tbaa !14
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %8, align 4, !tbaa !14
  br label %62, !llvm.loop !17

79:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !14
  br label %80

80:                                               ; preds = %102, %79
  %81 = load i32, ptr %9, align 4, !tbaa !14
  %82 = icmp slt i32 %81, 32768
  br i1 %82, label %84, label %83

83:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %105

84:                                               ; preds = %80
  %85 = load i32, ptr %9, align 4, !tbaa !14
  %86 = sitofp i32 %85 to double
  %87 = fadd double %86, 5.000000e-01
  %88 = load i32, ptr %9, align 4, !tbaa !14
  %89 = sitofp i32 %88 to double
  %90 = fsub double 3.276750e+04, %89
  %91 = fdiv double %87, %90
  %92 = call noundef double @_ZN7libzpaq3logEd(double noundef %91)
  %93 = call double @llvm.fmuladd.f64(double %92, double 6.400000e+01, double 5.000000e-01)
  %94 = fadd double %93, 1.000000e+05
  %95 = fptosi double %94 to i32
  %96 = sub nsw i32 %95, 100000
  %97 = trunc i32 %96 to i16
  %98 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 9
  %99 = load i32, ptr %9, align 4, !tbaa !14
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [32768 x i16], ptr %98, i64 0, i64 %100
  store i16 %97, ptr %101, align 2, !tbaa !18
  br label %102

102:                                              ; preds = %84
  %103 = load i32, ptr %9, align 4, !tbaa !14
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %9, align 4, !tbaa !14
  br label %80, !llvm.loop !20

105:                                              ; preds = %83
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !14
  br label %106

106:                                              ; preds = %124, %105
  %107 = load i32, ptr %10, align 4, !tbaa !14
  %108 = icmp slt i32 %107, 4096
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %127

110:                                              ; preds = %106
  %111 = load i32, ptr %10, align 4, !tbaa !14
  %112 = sub nsw i32 %111, 2048
  %113 = sitofp i32 %112 to double
  %114 = fmul double %113, -1.562500e-02
  %115 = call noundef double @_ZN7libzpaq3expEd(double noundef %114)
  %116 = fadd double 1.000000e+00, %115
  %117 = fdiv double 3.276800e+04, %116
  %118 = fptosi double %117 to i32
  %119 = trunc i32 %118 to i16
  %120 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 8
  %121 = load i32, ptr %10, align 4, !tbaa !14
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [4096 x i16], ptr %120, i64 0, i64 %122
  store i16 %119, ptr %123, align 2, !tbaa !18
  br label %124

124:                                              ; preds = %110
  %125 = load i32, ptr %10, align 4, !tbaa !14
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %10, align 4, !tbaa !14
  br label %106, !llvm.loop !21

127:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 32767, ptr %13, align 4, !tbaa !14
  br label %128

128:                                              ; preds = %139, %127
  %129 = load i32, ptr %13, align 4, !tbaa !14
  %130 = icmp sge i32 %129, 0
  br i1 %130, label %132, label %131

131:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %146

132:                                              ; preds = %128
  %133 = load i32, ptr %12, align 4, !tbaa !14
  %134 = mul i32 %133, 3
  %135 = load i32, ptr %13, align 4, !tbaa !14
  %136 = invoke noundef i32 @_ZN7libzpaq9Predictor7stretchEi(ptr noundef nonnull align 8 dereferenceable(110620) %15, i32 noundef %135)
          to label %137 unwind label %142

137:                                              ; preds = %132
  %138 = add i32 %134, %136
  store i32 %138, ptr %12, align 4, !tbaa !14
  br label %139

139:                                              ; preds = %137
  %140 = load i32, ptr %13, align 4, !tbaa !14
  %141 = add nsw i32 %140, -1
  store i32 %141, ptr %13, align 4, !tbaa !14
  br label %128, !llvm.loop !22

142:                                              ; preds = %132
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %5, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %169

146:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 4095, ptr %14, align 4, !tbaa !14
  br label %147

147:                                              ; preds = %159, %146
  %148 = load i32, ptr %14, align 4, !tbaa !14
  %149 = icmp sge i32 %148, 0
  br i1 %149, label %151, label %150

150:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %166

151:                                              ; preds = %147
  %152 = load i32, ptr %11, align 4, !tbaa !14
  %153 = mul i32 %152, 3
  %154 = load i32, ptr %14, align 4, !tbaa !14
  %155 = sub nsw i32 %154, 2048
  %156 = invoke noundef i32 @_ZN7libzpaq9Predictor6squashEi(ptr noundef nonnull align 8 dereferenceable(110620) %15, i32 noundef %155)
          to label %157 unwind label %162

157:                                              ; preds = %151
  %158 = add i32 %153, %156
  store i32 %158, ptr %11, align 4, !tbaa !14
  br label %159

159:                                              ; preds = %157
  %160 = load i32, ptr %14, align 4, !tbaa !14
  %161 = add nsw i32 %160, -1
  store i32 %161, ptr %14, align 4, !tbaa !14
  br label %147, !llvm.loop !23

162:                                              ; preds = %151
  %163 = landingpad { ptr, i32 }
          cleanup
  %164 = extractvalue { ptr, i32 } %163, 0
  store ptr %164, ptr %5, align 8
  %165 = extractvalue { ptr, i32 } %163, 1
  store i32 %165, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %169

166:                                              ; preds = %150
  %167 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 11
  store ptr null, ptr %167, align 8, !tbaa !24
  %168 = getelementptr inbounds %"class.libzpaq::Predictor", ptr %15, i32 0, i32 12
  store i32 0, ptr %168, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret void

169:                                              ; preds = %162, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %170

170:                                              ; preds = %169, %47
  %171 = getelementptr inbounds [256 x %"struct.libzpaq::Component"], ptr %20, i32 0, i32 0
  %172 = getelementptr inbounds %"struct.libzpaq::Component", ptr %171, i64 256
  br label %173

173:                                              ; preds = %173, %170
  %174 = phi ptr [ %172, %170 ], [ %175, %173 ]
  %175 = getelementptr inbounds %"struct.libzpaq::Component", ptr %174, i64 -1
  call void @_ZN7libzpaq9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %175) #5
  %176 = icmp eq ptr %175, %171
  br i1 %176, label %177, label %173

177:                                              ; preds = %173
  br label %178

178:                                              ; preds = %177, %46
  %179 = load ptr, ptr %5, align 8
  %180 = load i32, ptr %6, align 4
  %181 = insertvalue { ptr, i32 } poison, ptr %179, 0
  %182 = insertvalue { ptr, i32 } %181, i32 %180, 1
  resume { ptr, i32 } %182
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7libzpaq9ComponentC2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7libzpaq9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7libzpaq9Predictor7stretchEi(ptr noundef nonnull align 8 dereferenceable(110620), i32 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7libzpaq9Predictor6squashEi(ptr noundef nonnull align 8 dereferenceable(110620), i32 noundef) #0 align 2

declare void @_ZN7libzpaq10StateTableC1Ev(ptr)

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { inlinehint 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN7libzpaq9PredictorE", !11, i64 0, !11, i64 4, !7, i64 8, !7, i64 1032, !6, i64 2056, !7, i64 2064, !7, i64 30736, !7, i64 31760, !7, i64 35856, !7, i64 44048, !12, i64 109584, !6, i64 110608, !11, i64 110616}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN7libzpaq10StateTableE", !7, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!11, !11, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!19, !19, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !16}
!24 = !{!10, !6, i64 110608}
!25 = !{!10, !11, i64 110616}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN7libzpaq3logEd(double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN7libzpaq3expEd(double noundef) local_unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7libzpaq9PredictorC2ERNS_5ZPAQLE(ptr noundef nonnull align 8 dereferenceable(110620) %0, ptr noundef nonnull align 8 dereferenceable(192) %1) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  store i32 1, ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 1, ptr %3, align 4, !tbaa !12
  %4 = getelementptr inbounds i8, ptr %0, i64 2056
  store ptr %1, ptr %4, align 8, !tbaa !13
  br label %5

5:                                                ; preds = %6, %2
  %.idx = phi i64 [ 2064, %2 ], [ %.add, %6 ]
  %.ptr.ptr = getelementptr inbounds i8, ptr %0, i64 %.idx
  invoke void @_ZN7libzpaq9ComponentC2Ev(ptr noundef nonnull align 8 dereferenceable(112) %.ptr.ptr)
          to label %6 unwind label %13

6:                                                ; preds = %5
  %.add = add nuw nsw i64 %.idx, 112
  %7 = icmp eq i64 %.add, 30736
  br i1 %7, label %8, label %5

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 109584
  invoke void @_ZN7libzpaq10StateTableC1Ev(ptr noundef nonnull align 1 dereferenceable(1024) %9)
          to label %10 unwind label %17

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %0, i64 30736
  store i32 0, ptr %11, align 8, !tbaa !14
  br label %19

.preheader54:                                     ; preds = %19
  %12 = getelementptr inbounds i8, ptr %0, i64 31760
  br label %27

13:                                               ; preds = %5
  %14 = landingpad { ptr, i32 }
          cleanup
  %15 = icmp eq i64 %.idx, 2064
  br i1 %15, label %.loopexit, label %.preheader55

.preheader55:                                     ; preds = %13, %.preheader55
  %.idx42 = phi i64 [ %.add43, %.preheader55 ], [ %.idx, %13 ]
  %.add43 = add nsw i64 %.idx42, -112
  %.ptr45 = getelementptr inbounds i8, ptr %0, i64 %.add43
  tail call void @_ZN7libzpaq9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %.ptr45) #4
  %16 = icmp eq i64 %.add43, 2064
  br i1 %16, label %.loopexit, label %.preheader55

17:                                               ; preds = %8
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %71

19:                                               ; preds = %19, %10
  %indvars.iv = phi i64 [ 1, %10 ], [ %indvars.iv.next.2, %19 ]
  %.rhs.trunc = trunc i64 %indvars.iv to i16
  %20 = udiv i16 2048, %.rhs.trunc
  %.zext = zext nneg i16 %20 to i32
  %21 = getelementptr inbounds [256 x i32], ptr %11, i64 0, i64 %indvars.iv
  store i32 %.zext, ptr %21, align 4, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.rhs.trunc.1 = trunc i64 %indvars.iv.next to i16
  %22 = udiv i16 2048, %.rhs.trunc.1
  %.zext.1 = zext nneg i16 %22 to i32
  %23 = getelementptr inbounds [256 x i32], ptr %11, i64 0, i64 %indvars.iv.next
  store i32 %.zext.1, ptr %23, align 4, !tbaa !14
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %.rhs.trunc.2 = trunc i64 %indvars.iv.next.1 to i16
  %24 = udiv i16 2048, %.rhs.trunc.2
  %.zext.2 = zext nneg i16 %24 to i32
  %25 = getelementptr inbounds [256 x i32], ptr %11, i64 0, i64 %indvars.iv.next.1
  store i32 %.zext.2, ptr %25, align 4, !tbaa !14
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 256
  br i1 %exitcond.not.2, label %.preheader54, label %19, !llvm.loop !15

.preheader53:                                     ; preds = %27
  %26 = getelementptr inbounds i8, ptr %0, i64 44048
  br label %39

27:                                               ; preds = %27, %.preheader54
  %indvars.iv69 = phi i64 [ 0, %.preheader54 ], [ %indvars.iv.next70.1, %27 ]
  %indvars.iv69.tr = trunc i64 %indvars.iv69 to i32
  %28 = shl i32 %indvars.iv69.tr, 1
  %29 = or disjoint i32 %28, 3
  %30 = udiv i32 131072, %29
  %31 = shl nuw nsw i32 %30, 1
  %32 = getelementptr inbounds [1024 x i32], ptr %12, i64 0, i64 %indvars.iv69
  store i32 %31, ptr %32, align 8, !tbaa !14
  %indvars.iv.next70 = or disjoint i64 %indvars.iv69, 1
  %indvars.iv69.tr.1 = trunc i64 %indvars.iv.next70 to i32
  %33 = shl i32 %indvars.iv69.tr.1, 1
  %34 = add nuw nsw i32 %33, 3
  %35 = udiv i32 131072, %34
  %36 = shl nuw nsw i32 %35, 1
  %37 = getelementptr inbounds [1024 x i32], ptr %12, i64 0, i64 %indvars.iv.next70
  store i32 %36, ptr %37, align 4, !tbaa !14
  %indvars.iv.next70.1 = add nuw nsw i64 %indvars.iv69, 2
  %exitcond72.not.1 = icmp eq i64 %indvars.iv.next70.1, 1024
  br i1 %exitcond72.not.1, label %.preheader53, label %27, !llvm.loop !17

.preheader52:                                     ; preds = %39
  %38 = getelementptr inbounds i8, ptr %0, i64 35856
  br label %52

39:                                               ; preds = %.preheader53, %39
  %indvars.iv73 = phi i64 [ 0, %.preheader53 ], [ %indvars.iv.next74, %39 ]
  %40 = trunc nuw nsw i64 %indvars.iv73 to i32
  %41 = uitofp nneg i32 %40 to double
  %42 = fadd double %41, 5.000000e-01
  %43 = fsub double 3.276750e+04, %41
  %44 = fdiv double %42, %43
  %45 = tail call noundef double @_ZN7libzpaq3logEd(double noundef %44)
  %46 = tail call double @llvm.fmuladd.f64(double %45, double 6.400000e+01, double 5.000000e-01)
  %47 = fadd double %46, 1.000000e+05
  %48 = fptosi double %47 to i32
  %49 = trunc i32 %48 to i16
  %50 = add i16 %49, 31072
  %51 = getelementptr inbounds [32768 x i16], ptr %26, i64 0, i64 %indvars.iv73
  store i16 %50, ptr %51, align 2, !tbaa !18
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next74, 32768
  br i1 %exitcond76.not, label %.preheader52, label %39, !llvm.loop !20

52:                                               ; preds = %.preheader52, %52
  %indvars.iv77 = phi i64 [ 0, %.preheader52 ], [ %indvars.iv.next78, %52 ]
  %53 = trunc i64 %indvars.iv77 to i32
  %54 = add i32 %53, -2048
  %55 = sitofp i32 %54 to double
  %56 = fmul double %55, -1.562500e-02
  %57 = tail call noundef double @_ZN7libzpaq3expEd(double noundef %56)
  %58 = fadd double %57, 1.000000e+00
  %59 = fdiv double 3.276800e+04, %58
  %60 = fptosi double %59 to i32
  %61 = trunc i32 %60 to i16
  %62 = getelementptr inbounds [4096 x i16], ptr %38, i64 0, i64 %indvars.iv77
  store i16 %61, ptr %62, align 2, !tbaa !18
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond80.not = icmp eq i64 %indvars.iv.next78, 4096
  br i1 %exitcond80.not, label %.preheader51, label %52, !llvm.loop !21

.preheader51:                                     ; preds = %52, %.preheader51
  %.02863 = phi i32 [ %64, %.preheader51 ], [ 32767, %52 ]
  %63 = tail call noundef i32 @_ZN7libzpaq9Predictor7stretchEi(ptr noundef nonnull align 8 dereferenceable(110620) %0, i32 noundef %.02863)
  %64 = add nsw i32 %.02863, -1
  %.not = icmp eq i32 %.02863, 0
  br i1 %.not, label %.preheader, label %.preheader51, !llvm.loop !22

65:                                               ; preds = %.preheader
  %66 = getelementptr inbounds i8, ptr %0, i64 110608
  store ptr null, ptr %66, align 8, !tbaa !23
  %67 = getelementptr inbounds i8, ptr %0, i64 110616
  store i32 0, ptr %67, align 8, !tbaa !24
  ret void

.preheader:                                       ; preds = %.preheader51, %.preheader
  %.065 = phi i32 [ %70, %.preheader ], [ 4095, %.preheader51 ]
  %68 = add nsw i32 %.065, -2048
  %69 = tail call noundef i32 @_ZN7libzpaq9Predictor6squashEi(ptr noundef nonnull align 8 dereferenceable(110620) %0, i32 noundef %68)
  %70 = add nsw i32 %.065, -1
  %.not81 = icmp eq i32 %.065, 0
  br i1 %.not81, label %65, label %.preheader, !llvm.loop !25

71:                                               ; preds = %71, %17
  %.idx46 = phi i64 [ 30736, %17 ], [ %.add47, %71 ]
  %.add47 = add nsw i64 %.idx46, -112
  %.ptr48 = getelementptr inbounds i8, ptr %0, i64 %.add47
  tail call void @_ZN7libzpaq9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(112) %.ptr48) #4
  %72 = icmp eq i64 %.add47, 2064
  br i1 %72, label %.loopexit, label %71

.loopexit:                                        ; preds = %.preheader55, %71, %13
  %.pn = phi { ptr, i32 } [ %14, %13 ], [ %18, %71 ], [ %14, %.preheader55 ]
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7libzpaq9ComponentC2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN7libzpaq9ComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(112)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7libzpaq9Predictor7stretchEi(ptr noundef nonnull align 8 dereferenceable(110620), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7libzpaq9Predictor6squashEi(ptr noundef nonnull align 8 dereferenceable(110620), i32 noundef) local_unnamed_addr #0 align 2

declare void @_ZN7libzpaq10StateTableC1Ev(ptr) local_unnamed_addr

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { inlinehint 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 = { 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 0}
!6 = !{!"_ZTSN7libzpaq9PredictorE", !7, i64 0, !7, i64 4, !8, i64 8, !8, i64 1032, !10, i64 2056, !8, i64 2064, !8, i64 30736, !8, i64 31760, !8, i64 35856, !8, i64 44048, !11, i64 109584, !10, i64 110608, !7, i64 110616}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSN7libzpaq10StateTableE", !8, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!10, !10, i64 0}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!19, !19, i64 0}
!19 = !{!"short", !8, i64 0}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16}
!23 = !{!6, !10, i64 110608}
!24 = !{!6, !7, i64 110616}
!25 = distinct !{!25, !16}


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