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

; 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::Decoder" = type { ptr, i32, i32, i32, [4 x i8], %"class.libzpaq::Predictor", %"class.libzpaq::Array.4" }
%"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] }
%"class.libzpaq::Array.4" = type <{ ptr, i64, i32, [4 x i8] }>

; 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 nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIcEixEm(ptr noundef nonnull align 8 dereferenceable(20), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7libzpaq9Predictor9isModeledEv(ptr noundef nonnull align 8 dereferenceable(110620)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7libzpaq7Decoder4skipEv(ptr noundef nonnull align 8 dereferenceable(110672) %0) #2 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 -1, ptr %4, align 4, !tbaa !9
  %11 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 5
  %12 = call noundef zeroext i1 @_ZN7libzpaq9Predictor9isModeledEv(ptr noundef nonnull align 8 dereferenceable(110620) %11)
  br i1 %12, label %13, label %60

13:                                               ; preds = %1
  br label %14

14:                                               ; preds = %18, %13
  %15 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %16 = load i32, ptr %15, align 8, !tbaa !11
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %26

18:                                               ; preds = %14
  %19 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !17
  %21 = load ptr, ptr %20, align 8, !tbaa !18
  %22 = getelementptr inbounds ptr, ptr %21, i64 0
  %23 = load ptr, ptr %22, align 8
  %24 = call noundef i32 %23(ptr noundef nonnull align 8 dereferenceable(8) %20)
  %25 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  store i32 %24, ptr %25, align 8, !tbaa !11
  br label %14, !llvm.loop !20

26:                                               ; preds = %14
  br label %27

27:                                               ; preds = %41, %26
  %28 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %29 = load i32, ptr %28, align 8, !tbaa !11
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %39

31:                                               ; preds = %27
  %32 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !17
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %35 = getelementptr inbounds ptr, ptr %34, i64 0
  %36 = load ptr, ptr %35, align 8
  %37 = call noundef i32 %36(ptr noundef nonnull align 8 dereferenceable(8) %33)
  store i32 %37, ptr %4, align 4, !tbaa !9
  %38 = icmp sge i32 %37, 0
  br label %39

39:                                               ; preds = %31, %27
  %40 = phi i1 [ false, %27 ], [ %38, %31 ]
  br i1 %40, label %41, label %48

41:                                               ; preds = %39
  %42 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %43 = load i32, ptr %42, align 8, !tbaa !11
  %44 = shl i32 %43, 8
  %45 = load i32, ptr %4, align 4, !tbaa !9
  %46 = or i32 %44, %45
  %47 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  store i32 %46, ptr %47, align 8, !tbaa !11
  br label %27, !llvm.loop !22

48:                                               ; preds = %39
  br label %49

49:                                               ; preds = %57, %48
  %50 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !17
  %52 = load ptr, ptr %51, align 8, !tbaa !18
  %53 = getelementptr inbounds ptr, ptr %52, i64 0
  %54 = load ptr, ptr %53, align 8
  %55 = call noundef i32 %54(ptr noundef nonnull align 8 dereferenceable(8) %51)
  store i32 %55, ptr %4, align 4, !tbaa !9
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %58

57:                                               ; preds = %49
  br label %49, !llvm.loop !23

58:                                               ; preds = %49
  %59 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %59, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %167

60:                                               ; preds = %1
  %61 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %62 = load i32, ptr %61, align 8, !tbaa !11
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %90

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %86, %64
  %66 = load i32, ptr %6, align 4, !tbaa !9
  %67 = icmp slt i32 %66, 4
  br i1 %67, label %68, label %76

68:                                               ; preds = %65
  %69 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !17
  %71 = load ptr, ptr %70, align 8, !tbaa !18
  %72 = getelementptr inbounds ptr, ptr %71, i64 0
  %73 = load ptr, ptr %72, align 8
  %74 = call noundef i32 %73(ptr noundef nonnull align 8 dereferenceable(8) %70)
  store i32 %74, ptr %4, align 4, !tbaa !9
  %75 = icmp sge i32 %74, 0
  br label %76

76:                                               ; preds = %68, %65
  %77 = phi i1 [ false, %65 ], [ %75, %68 ]
  br i1 %77, label %79, label %78

78:                                               ; preds = %76
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %89

79:                                               ; preds = %76
  %80 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %81 = load i32, ptr %80, align 8, !tbaa !11
  %82 = shl i32 %81, 8
  %83 = load i32, ptr %4, align 4, !tbaa !9
  %84 = or i32 %82, %83
  %85 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  store i32 %84, ptr %85, align 8, !tbaa !11
  br label %86

86:                                               ; preds = %79
  %87 = load i32, ptr %6, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %6, align 4, !tbaa !9
  br label %65, !llvm.loop !24

89:                                               ; preds = %78
  br label %90

90:                                               ; preds = %89, %60
  br label %91

91:                                               ; preds = %154, %90
  %92 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %93 = load i32, ptr %92, align 8, !tbaa !11
  %94 = icmp ugt i32 %93, 0
  br i1 %94, label %95, label %155

95:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 65536, ptr %7, align 4, !tbaa !9
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %98 = load i32, ptr %97, align 8, !tbaa !11
  %99 = icmp ugt i32 %96, %98
  br i1 %99, label %100, label %103

100:                                              ; preds = %95
  %101 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %102 = load i32, ptr %101, align 8, !tbaa !11
  store i32 %102, ptr %7, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %100, %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %104 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !17
  %106 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 6
  %107 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIcEixEm(ptr noundef nonnull align 8 dereferenceable(20) %106, i64 noundef 0)
  %108 = load i32, ptr %7, align 4, !tbaa !9
  %109 = load ptr, ptr %105, align 8, !tbaa !18
  %110 = getelementptr inbounds ptr, ptr %109, i64 1
  %111 = load ptr, ptr %110, align 8
  %112 = call noundef i32 %111(ptr noundef nonnull align 8 dereferenceable(8) %105, ptr noundef %107, i32 noundef %108)
  store i32 %112, ptr %8, align 4, !tbaa !9
  %113 = load i32, ptr %8, align 4, !tbaa !9
  %114 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %115 = load i32, ptr %114, align 8, !tbaa !11
  %116 = sub i32 %115, %113
  store i32 %116, ptr %114, align 8, !tbaa !11
  %117 = load i32, ptr %8, align 4, !tbaa !9
  %118 = load i32, ptr %7, align 4, !tbaa !9
  %119 = icmp ne i32 %117, %118
  br i1 %119, label %120, label %121

120:                                              ; preds = %103
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %152

121:                                              ; preds = %103
  %122 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %123 = load i32, ptr %122, align 8, !tbaa !11
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %151

125:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %126

126:                                              ; preds = %147, %125
  %127 = load i32, ptr %9, align 4, !tbaa !9
  %128 = icmp slt i32 %127, 4
  br i1 %128, label %129, label %137

129:                                              ; preds = %126
  %130 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !17
  %132 = load ptr, ptr %131, align 8, !tbaa !18
  %133 = getelementptr inbounds ptr, ptr %132, i64 0
  %134 = load ptr, ptr %133, align 8
  %135 = call noundef i32 %134(ptr noundef nonnull align 8 dereferenceable(8) %131)
  store i32 %135, ptr %4, align 4, !tbaa !9
  %136 = icmp sge i32 %135, 0
  br label %137

137:                                              ; preds = %129, %126
  %138 = phi i1 [ false, %126 ], [ %136, %129 ]
  br i1 %138, label %140, label %139

139:                                              ; preds = %137
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %150

140:                                              ; preds = %137
  %141 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  %142 = load i32, ptr %141, align 8, !tbaa !11
  %143 = shl i32 %142, 8
  %144 = load i32, ptr %4, align 4, !tbaa !9
  %145 = or i32 %143, %144
  %146 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 3
  store i32 %145, ptr %146, align 8, !tbaa !11
  br label %147

147:                                              ; preds = %140
  %148 = load i32, ptr %9, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %9, align 4, !tbaa !9
  br label %126, !llvm.loop !25

150:                                              ; preds = %139
  br label %151

151:                                              ; preds = %150, %121
  store i32 0, ptr %5, align 4
  br label %152

152:                                              ; preds = %151, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %153 = load i32, ptr %5, align 4
  switch i32 %153, label %167 [
    i32 0, label %154
  ]

154:                                              ; preds = %152
  br label %91, !llvm.loop !26

155:                                              ; preds = %91
  %156 = load i32, ptr %4, align 4, !tbaa !9
  %157 = icmp sge i32 %156, 0
  br i1 %157, label %158, label %165

158:                                              ; preds = %155
  %159 = getelementptr inbounds %"class.libzpaq::Decoder", ptr %10, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !17
  %161 = load ptr, ptr %160, align 8, !tbaa !18
  %162 = getelementptr inbounds ptr, ptr %161, i64 0
  %163 = load ptr, ptr %162, align 8
  %164 = call noundef i32 %163(ptr noundef nonnull align 8 dereferenceable(8) %160)
  store i32 %164, ptr %4, align 4, !tbaa !9
  br label %165

165:                                              ; preds = %158, %155
  %166 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %166, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %167

167:                                              ; preds = %165, %152, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %168 = load i32, ptr %2, align 4
  ret i32 %168
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !10, i64 16}
!12 = !{!"_ZTSN7libzpaq7DecoderE", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 24, !15, i64 110648}
!13 = !{!"_ZTSN7libzpaq9PredictorE", !10, i64 0, !10, 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, !14, i64 109584, !6, i64 110608, !10, i64 110616}
!14 = !{!"_ZTSN7libzpaq10StateTableE", !7, i64 0}
!15 = !{!"_ZTSN7libzpaq5ArrayIcEE", !6, i64 0, !16, i64 8, !10, i64 16}
!16 = !{!"long", !7, i64 0}
!17 = !{!12, !6, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"vtable pointer", !8, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !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"

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIcEixEm(ptr noundef nonnull align 8 dereferenceable(20), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7libzpaq9Predictor9isModeledEv(ptr noundef nonnull align 8 dereferenceable(110620)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7libzpaq7Decoder4skipEv(ptr noundef nonnull align 8 dereferenceable(110672) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = tail call noundef zeroext i1 @_ZN7libzpaq9Predictor9isModeledEv(ptr noundef nonnull align 8 dereferenceable(110620) %2)
  %4 = getelementptr inbounds i8, ptr %0, i64 16
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp eq i32 %5, 0
  br i1 %3, label %.preheader37, label %26

.preheader37:                                     ; preds = %1
  br i1 %6, label %.lr.ph, label %.preheader.preheader

.lr.ph:                                           ; preds = %.preheader37, %.lr.ph
  %7 = load ptr, ptr %0, align 8, !tbaa !15
  %8 = load ptr, ptr %7, align 8, !tbaa !16
  %9 = load ptr, ptr %8, align 8
  %10 = tail call noundef i32 %9(ptr noundef nonnull align 8 dereferenceable(8) %7)
  store i32 %10, ptr %4, align 8, !tbaa !5
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %.lr.ph, label %.preheader.preheader, !llvm.loop !18

.preheader.preheader:                             ; preds = %.lr.ph, %.preheader37
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %17
  %12 = load ptr, ptr %0, align 8, !tbaa !15
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = load ptr, ptr %13, align 8
  %15 = tail call noundef i32 %14(ptr noundef nonnull align 8 dereferenceable(8) %12)
  %16 = icmp sgt i32 %15, -1
  br i1 %16, label %17, label %.critedge.preheader

17:                                               ; preds = %.preheader
  %18 = load i32, ptr %4, align 8, !tbaa !5
  %19 = shl i32 %18, 8
  %20 = or i32 %19, %15
  store i32 %20, ptr %4, align 8, !tbaa !5
  %.not36 = icmp eq i32 %20, 0
  br i1 %.not36, label %.critedge.preheader, label %.preheader, !llvm.loop !20

.critedge.preheader:                              ; preds = %17, %.preheader
  br label %.critedge

.critedge:                                        ; preds = %.critedge.preheader, %.critedge
  %21 = load ptr, ptr %0, align 8, !tbaa !15
  %22 = load ptr, ptr %21, align 8, !tbaa !16
  %23 = load ptr, ptr %22, align 8
  %24 = tail call noundef i32 %23(ptr noundef nonnull align 8 dereferenceable(8) %21)
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %.critedge, label %.loopexit, !llvm.loop !21

26:                                               ; preds = %1
  br i1 %6, label %.preheader40.preheader, label %.critedge2

.preheader40.preheader:                           ; preds = %26
  %27 = load ptr, ptr %0, align 8, !tbaa !15
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %29 = load ptr, ptr %28, align 8
  %30 = tail call noundef i32 %29(ptr noundef nonnull align 8 dereferenceable(8) %27)
  %31 = icmp sgt i32 %30, -1
  br i1 %31, label %.preheader40.1, label %.critedge2

.preheader40.1:                                   ; preds = %.preheader40.preheader
  %32 = load i32, ptr %4, align 8, !tbaa !5
  %33 = shl i32 %32, 8
  %34 = or i32 %33, %30
  store i32 %34, ptr %4, align 8, !tbaa !5
  %35 = load ptr, ptr %0, align 8, !tbaa !15
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  %37 = load ptr, ptr %36, align 8
  %38 = tail call noundef i32 %37(ptr noundef nonnull align 8 dereferenceable(8) %35)
  %39 = icmp sgt i32 %38, -1
  br i1 %39, label %.preheader40.2, label %.critedge2

.preheader40.2:                                   ; preds = %.preheader40.1
  %40 = load i32, ptr %4, align 8, !tbaa !5
  %41 = shl i32 %40, 8
  %42 = or i32 %41, %38
  store i32 %42, ptr %4, align 8, !tbaa !5
  %43 = load ptr, ptr %0, align 8, !tbaa !15
  %44 = load ptr, ptr %43, align 8, !tbaa !16
  %45 = load ptr, ptr %44, align 8
  %46 = tail call noundef i32 %45(ptr noundef nonnull align 8 dereferenceable(8) %43)
  %47 = icmp sgt i32 %46, -1
  br i1 %47, label %.preheader40.3, label %.critedge2

.preheader40.3:                                   ; preds = %.preheader40.2
  %48 = load i32, ptr %4, align 8, !tbaa !5
  %49 = shl i32 %48, 8
  %50 = or i32 %49, %46
  store i32 %50, ptr %4, align 8, !tbaa !5
  %51 = load ptr, ptr %0, align 8, !tbaa !15
  %52 = load ptr, ptr %51, align 8, !tbaa !16
  %53 = load ptr, ptr %52, align 8
  %54 = tail call noundef i32 %53(ptr noundef nonnull align 8 dereferenceable(8) %51)
  %55 = icmp sgt i32 %54, -1
  br i1 %55, label %56, label %.critedge2

56:                                               ; preds = %.preheader40.3
  %57 = load i32, ptr %4, align 8, !tbaa !5
  %58 = shl i32 %57, 8
  %59 = or i32 %58, %54
  store i32 %59, ptr %4, align 8, !tbaa !5
  br label %.critedge2

.critedge2:                                       ; preds = %.preheader40.preheader, %.preheader40.1, %.preheader40.2, %.preheader40.3, %56, %26
  %.227 = phi i32 [ -1, %26 ], [ %30, %.preheader40.preheader ], [ %38, %.preheader40.1 ], [ %46, %.preheader40.2 ], [ %54, %.preheader40.3 ], [ %54, %56 ]
  %60 = getelementptr inbounds i8, ptr %0, i64 110648
  br label %61

61:                                               ; preds = %.critedge4, %.critedge2
  %.3 = phi i32 [ %.227, %.critedge2 ], [ %.7, %.critedge4 ]
  %62 = load i32, ptr %4, align 8, !tbaa !5
  %.not = icmp eq i32 %62, 0
  br i1 %.not, label %106, label %63

63:                                               ; preds = %61
  %spec.select = tail call i32 @llvm.umin.i32(i32 %62, i32 65536)
  %64 = load ptr, ptr %0, align 8, !tbaa !15
  %65 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZN7libzpaq5ArrayIcEixEm(ptr noundef nonnull align 8 dereferenceable(20) %60, i64 noundef 0)
  %66 = load ptr, ptr %64, align 8, !tbaa !16
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  %68 = load ptr, ptr %67, align 8
  %69 = tail call noundef i32 %68(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull %65, i32 noundef %spec.select)
  %70 = load i32, ptr %4, align 8, !tbaa !5
  %71 = sub i32 %70, %69
  store i32 %71, ptr %4, align 8, !tbaa !5
  %.not35 = icmp eq i32 %69, %spec.select
  %72 = icmp eq i32 %70, %69
  %or.cond = select i1 %.not35, i1 %72, i1 false
  br i1 %or.cond, label %.preheader38.preheader, label %.critedge4

.preheader38.preheader:                           ; preds = %63
  %73 = load ptr, ptr %0, align 8, !tbaa !15
  %74 = load ptr, ptr %73, align 8, !tbaa !16
  %75 = load ptr, ptr %74, align 8
  %76 = tail call noundef i32 %75(ptr noundef nonnull align 8 dereferenceable(8) %73)
  %77 = icmp sgt i32 %76, -1
  br i1 %77, label %.preheader38.1, label %.critedge4

.preheader38.1:                                   ; preds = %.preheader38.preheader
  %78 = load i32, ptr %4, align 8, !tbaa !5
  %79 = shl i32 %78, 8
  %80 = or i32 %79, %76
  store i32 %80, ptr %4, align 8, !tbaa !5
  %81 = load ptr, ptr %0, align 8, !tbaa !15
  %82 = load ptr, ptr %81, align 8, !tbaa !16
  %83 = load ptr, ptr %82, align 8
  %84 = tail call noundef i32 %83(ptr noundef nonnull align 8 dereferenceable(8) %81)
  %85 = icmp sgt i32 %84, -1
  br i1 %85, label %.preheader38.2, label %.critedge4

.preheader38.2:                                   ; preds = %.preheader38.1
  %86 = load i32, ptr %4, align 8, !tbaa !5
  %87 = shl i32 %86, 8
  %88 = or i32 %87, %84
  store i32 %88, ptr %4, align 8, !tbaa !5
  %89 = load ptr, ptr %0, align 8, !tbaa !15
  %90 = load ptr, ptr %89, align 8, !tbaa !16
  %91 = load ptr, ptr %90, align 8
  %92 = tail call noundef i32 %91(ptr noundef nonnull align 8 dereferenceable(8) %89)
  %93 = icmp sgt i32 %92, -1
  br i1 %93, label %.preheader38.3, label %.critedge4

.preheader38.3:                                   ; preds = %.preheader38.2
  %94 = load i32, ptr %4, align 8, !tbaa !5
  %95 = shl i32 %94, 8
  %96 = or i32 %95, %92
  store i32 %96, ptr %4, align 8, !tbaa !5
  %97 = load ptr, ptr %0, align 8, !tbaa !15
  %98 = load ptr, ptr %97, align 8, !tbaa !16
  %99 = load ptr, ptr %98, align 8
  %100 = tail call noundef i32 %99(ptr noundef nonnull align 8 dereferenceable(8) %97)
  %101 = icmp sgt i32 %100, -1
  br i1 %101, label %102, label %.critedge4

102:                                              ; preds = %.preheader38.3
  %103 = load i32, ptr %4, align 8, !tbaa !5
  %104 = shl i32 %103, 8
  %105 = or i32 %104, %100
  store i32 %105, ptr %4, align 8, !tbaa !5
  br label %.critedge4

.critedge4:                                       ; preds = %.preheader38.preheader, %.preheader38.1, %.preheader38.2, %.preheader38.3, %102, %63
  %.7 = phi i32 [ %.3, %63 ], [ %76, %.preheader38.preheader ], [ %84, %.preheader38.1 ], [ %92, %.preheader38.2 ], [ %100, %.preheader38.3 ], [ %100, %102 ]
  br i1 %.not35, label %61, label %.loopexit, !llvm.loop !22

106:                                              ; preds = %61
  %107 = icmp sgt i32 %.3, -1
  br i1 %107, label %108, label %.loopexit

108:                                              ; preds = %106
  %109 = load ptr, ptr %0, align 8, !tbaa !15
  %110 = load ptr, ptr %109, align 8, !tbaa !16
  %111 = load ptr, ptr %110, align 8
  %112 = tail call noundef i32 %111(ptr noundef nonnull align 8 dereferenceable(8) %109)
  br label %.loopexit

.loopexit:                                        ; preds = %.critedge4, %.critedge, %106, %108
  %.2 = phi i32 [ %112, %108 ], [ %.3, %106 ], [ %24, %.critedge ], [ -1, %.critedge4 ]
  ret i32 %.2
}

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

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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"_ZTSN7libzpaq7DecoderE", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !11, i64 24, !13, i64 110648}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN7libzpaq9PredictorE", !10, i64 0, !10, i64 4, !8, i64 8, !8, i64 1032, !7, i64 2056, !8, i64 2064, !8, i64 30736, !8, i64 31760, !8, i64 35856, !8, i64 44048, !12, i64 109584, !7, i64 110608, !10, i64 110616}
!12 = !{!"_ZTSN7libzpaq10StateTableE", !8, i64 0}
!13 = !{!"_ZTSN7libzpaq5ArrayIcEE", !7, i64 0, !14, i64 8, !10, i64 16}
!14 = !{!"long", !8, i64 0}
!15 = !{!6, !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"vtable pointer", !9, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}


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