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

; 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::StateTable" = type { [1024 x i8] }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7libzpaq6memsetEPvim(ptr noundef, i32 noundef, i64 noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7libzpaq10StateTable10num_statesEii(ptr noundef nonnull align 1 dereferenceable(1024), i32 noundef, i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7libzpaq10StateTable10next_stateERiS1_i(ptr noundef nonnull align 1 dereferenceable(1024), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7libzpaq10StateTableC2Ev(ptr noundef nonnull align 1 dereferenceable(1024) %0) unnamed_addr #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca [50 x [50 x [2 x i8]]], align 16
  %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
  %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
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %17 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 50, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 5000, ptr %4) #4
  call void @llvm.memset.p0.i64(ptr align 16 %4, i8 0, i64 5000, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %67, %1
  %19 = load i32, ptr %6, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 50
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %70

22:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %63, %22
  %24 = load i32, ptr %8, align 4, !tbaa !9
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %66

28:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %29 = load i32, ptr %6, align 4, !tbaa !9
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = sub nsw i32 %29, %30
  store i32 %31, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = call noundef i32 @_ZN7libzpaq10StateTable10num_statesEii(ptr noundef nonnull align 1 dereferenceable(1024) %17, i32 noundef %32, i32 noundef %33)
  store i32 %34, ptr %10, align 4, !tbaa !9
  %35 = load i32, ptr %10, align 4, !tbaa !9
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %62

37:                                               ; preds = %28
  %38 = load i32, ptr %5, align 4, !tbaa !9
  %39 = trunc i32 %38 to i8
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [50 x [50 x [2 x i8]]], ptr %4, i64 0, i64 %41
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [50 x [2 x i8]], ptr %42, i64 0, i64 %44
  %46 = getelementptr inbounds [2 x i8], ptr %45, i64 0, i64 0
  store i8 %39, ptr %46, align 2, !tbaa !11
  %47 = load i32, ptr %5, align 4, !tbaa !9
  %48 = load i32, ptr %10, align 4, !tbaa !9
  %49 = add nsw i32 %47, %48
  %50 = sub nsw i32 %49, 1
  %51 = trunc i32 %50 to i8
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [50 x [50 x [2 x i8]]], ptr %4, i64 0, i64 %53
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [50 x [2 x i8]], ptr %54, i64 0, i64 %56
  %58 = getelementptr inbounds [2 x i8], ptr %57, i64 0, i64 1
  store i8 %51, ptr %58, align 1, !tbaa !11
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = load i32, ptr %5, align 4, !tbaa !9
  %61 = add nsw i32 %60, %59
  store i32 %61, ptr %5, align 4, !tbaa !9
  br label %62

62:                                               ; preds = %37, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %8, align 4, !tbaa !9
  br label %23, !llvm.loop !12

66:                                               ; preds = %27
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %6, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %6, align 4, !tbaa !9
  br label %18, !llvm.loop !14

70:                                               ; preds = %21
  %71 = getelementptr inbounds %"class.libzpaq::StateTable", ptr %17, i32 0, i32 0
  %72 = getelementptr inbounds [1024 x i8], ptr %71, i64 0, i64 0
  %73 = call noundef ptr @_ZN7libzpaq6memsetEPvim(ptr noundef %72, i32 noundef 0, i64 noundef 1024)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %159, %70
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = icmp slt i32 %75, 50
  br i1 %76, label %78, label %77

77:                                               ; preds = %74
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %162

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

79:                                               ; preds = %155, %78
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = icmp slt i32 %80, 50
  br i1 %81, label %83, label %82

82:                                               ; preds = %79
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %158

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

84:                                               ; preds = %151, %83
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = load i32, ptr %11, align 4, !tbaa !9
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = call noundef i32 @_ZN7libzpaq10StateTable10num_statesEii(ptr noundef nonnull align 1 dereferenceable(1024) %17, i32 noundef %86, i32 noundef %87)
  %89 = icmp slt i32 %85, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %84
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %154

91:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %92 = load i32, ptr %11, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [50 x [50 x [2 x i8]]], ptr %4, i64 0, i64 %93
  %95 = load i32, ptr %12, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [50 x [2 x i8]], ptr %94, i64 0, i64 %96
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [2 x i8], ptr %97, i64 0, i64 %99
  %101 = load i8, ptr %100, align 1, !tbaa !11
  %102 = zext i8 %101 to i32
  store i32 %102, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %103 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %103, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %104 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %104, ptr %16, align 4, !tbaa !9
  call void @_ZN7libzpaq10StateTable10next_stateERiS1_i(ptr noundef nonnull align 1 dereferenceable(1024) %17, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16, i32 noundef 0)
  %105 = load i32, ptr %15, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [50 x [50 x [2 x i8]]], ptr %4, i64 0, i64 %106
  %108 = load i32, ptr %16, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [50 x [2 x i8]], ptr %107, i64 0, i64 %109
  %111 = getelementptr inbounds [2 x i8], ptr %110, i64 0, i64 0
  %112 = load i8, ptr %111, align 2, !tbaa !11
  %113 = getelementptr inbounds %"class.libzpaq::StateTable", ptr %17, i32 0, i32 0
  %114 = load i32, ptr %14, align 4, !tbaa !9
  %115 = mul nsw i32 %114, 4
  %116 = add nsw i32 %115, 0
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [1024 x i8], ptr %113, i64 0, i64 %117
  store i8 %112, ptr %118, align 1, !tbaa !11
  %119 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %119, ptr %15, align 4, !tbaa !9
  %120 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %120, ptr %16, align 4, !tbaa !9
  call void @_ZN7libzpaq10StateTable10next_stateERiS1_i(ptr noundef nonnull align 1 dereferenceable(1024) %17, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16, i32 noundef 1)
  %121 = load i32, ptr %15, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [50 x [50 x [2 x i8]]], ptr %4, i64 0, i64 %122
  %124 = load i32, ptr %16, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [50 x [2 x i8]], ptr %123, i64 0, i64 %125
  %127 = getelementptr inbounds [2 x i8], ptr %126, i64 0, i64 1
  %128 = load i8, ptr %127, align 1, !tbaa !11
  %129 = getelementptr inbounds %"class.libzpaq::StateTable", ptr %17, i32 0, i32 0
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = mul nsw i32 %130, 4
  %132 = add nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [1024 x i8], ptr %129, i64 0, i64 %133
  store i8 %128, ptr %134, align 1, !tbaa !11
  %135 = load i32, ptr %11, align 4, !tbaa !9
  %136 = trunc i32 %135 to i8
  %137 = getelementptr inbounds %"class.libzpaq::StateTable", ptr %17, i32 0, i32 0
  %138 = load i32, ptr %14, align 4, !tbaa !9
  %139 = mul nsw i32 %138, 4
  %140 = add nsw i32 %139, 2
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1024 x i8], ptr %137, i64 0, i64 %141
  store i8 %136, ptr %142, align 1, !tbaa !11
  %143 = load i32, ptr %12, align 4, !tbaa !9
  %144 = trunc i32 %143 to i8
  %145 = getelementptr inbounds %"class.libzpaq::StateTable", ptr %17, i32 0, i32 0
  %146 = load i32, ptr %14, align 4, !tbaa !9
  %147 = mul nsw i32 %146, 4
  %148 = add nsw i32 %147, 3
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [1024 x i8], ptr %145, i64 0, i64 %149
  store i8 %144, ptr %150, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %151

151:                                              ; preds = %91
  %152 = load i32, ptr %13, align 4, !tbaa !9
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %13, align 4, !tbaa !9
  br label %84, !llvm.loop !15

154:                                              ; preds = %90
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr %12, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %12, align 4, !tbaa !9
  br label %79, !llvm.loop !16

158:                                              ; preds = %82
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %11, align 4, !tbaa !9
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %11, align 4, !tbaa !9
  br label %74, !llvm.loop !17

162:                                              ; preds = %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 5000, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

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 nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


; 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 ptr @_ZN7libzpaq6memsetEPvim(ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN7libzpaq10StateTable10num_statesEii(ptr noundef nonnull align 1 dereferenceable(1024), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7libzpaq10StateTable10next_stateERiS1_i(ptr noundef nonnull align 1 dereferenceable(1024), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7libzpaq10StateTableC2Ev(ptr noundef nonnull align 1 dereferenceable(1024) %0) unnamed_addr #3 align 2 {
  %2 = alloca [50 x [50 x [2 x i8]]], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %2) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(5000) %2, i8 0, i64 5000, i1 false)
  br label %.preheader48

.preheader48:                                     ; preds = %1, %8
  %indvars.iv61 = phi i64 [ 0, %1 ], [ %indvars.iv.next62, %8 ]
  %indvars.iv59 = phi i64 [ 1, %1 ], [ %indvars.iv.next60, %8 ]
  %.052 = phi i32 [ 0, %1 ], [ %.2, %8 ]
  %5 = trunc nuw nsw i64 %indvars.iv61 to i32
  br label %9

6:                                                ; preds = %8
  %7 = tail call noundef ptr @_ZN7libzpaq6memsetEPvim(ptr noundef nonnull %0, i32 noundef 0, i64 noundef 1024)
  br label %.preheader47

8:                                                ; preds = %20
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next62, 50
  br i1 %exitcond66.not, label %6, label %.preheader48, !llvm.loop !5

9:                                                ; preds = %.preheader48, %20
  %indvars.iv = phi i64 [ 0, %.preheader48 ], [ %indvars.iv.next, %20 ]
  %.150 = phi i32 [ %.052, %.preheader48 ], [ %.2, %20 ]
  %indvars56 = trunc i64 %indvars.iv to i32
  %10 = sub nsw i32 %5, %indvars56
  %11 = tail call noundef i32 @_ZN7libzpaq10StateTable10num_statesEii(ptr noundef nonnull align 1 dereferenceable(1024) %0, i32 noundef %10, i32 noundef %indvars56)
  %.not46 = icmp eq i32 %11, 0
  br i1 %.not46, label %20, label %12

12:                                               ; preds = %9
  %13 = sub nsw i64 %indvars.iv61, %indvars.iv
  %14 = trunc i32 %.150 to i8
  %15 = getelementptr inbounds [50 x [50 x [2 x i8]]], ptr %2, i64 0, i64 %13, i64 %indvars.iv
  store i8 %14, ptr %15, align 2, !tbaa !7
  %16 = add nsw i32 %11, %.150
  %17 = trunc i32 %16 to i8
  %18 = add i8 %17, -1
  %19 = getelementptr inbounds i8, ptr %15, i64 1
  store i8 %18, ptr %19, align 1, !tbaa !7
  br label %20

20:                                               ; preds = %12, %9
  %.2 = phi i32 [ %16, %12 ], [ %.150, %9 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv59
  br i1 %exitcond.not, label %8, label %9, !llvm.loop !10

.preheader47:                                     ; preds = %6, %28
  %indvars.iv74 = phi i64 [ 0, %6 ], [ %indvars.iv.next75, %28 ]
  %21 = trunc nuw nsw i64 %indvars.iv74 to i32
  %22 = trunc i64 %indvars.iv74 to i8
  br label %.preheader

23:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %2) #4
  ret void

.preheader:                                       ; preds = %.preheader47, %._crit_edge
  %indvars.iv70 = phi i64 [ 0, %.preheader47 ], [ %indvars.iv.next71, %._crit_edge ]
  %24 = trunc nuw nsw i64 %indvars.iv70 to i32
  %25 = call noundef i32 @_ZN7libzpaq10StateTable10num_statesEii(ptr noundef nonnull align 1 dereferenceable(1024) %0, i32 noundef %21, i32 noundef %24)
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %27 = trunc i64 %indvars.iv70 to i8
  br label %29

28:                                               ; preds = %._crit_edge
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next75, 50
  br i1 %exitcond77.not, label %23, label %.preheader47, !llvm.loop !11

._crit_edge:                                      ; preds = %29, %.preheader
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next71, 50
  br i1 %exitcond73.not, label %28, label %.preheader, !llvm.loop !12

29:                                               ; preds = %.lr.ph, %29
  %indvars.iv67 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next68, %29 ]
  %30 = getelementptr inbounds [50 x [50 x [2 x i8]]], ptr %2, i64 0, i64 %indvars.iv74, i64 %indvars.iv70, i64 %indvars.iv67
  %31 = load i8, ptr %30, align 1, !tbaa !7
  %32 = zext i8 %31 to i32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 %21, ptr %3, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store i32 %24, ptr %4, align 4, !tbaa !13
  call void @_ZN7libzpaq10StateTable10next_stateERiS1_i(ptr noundef nonnull align 1 dereferenceable(1024) %0, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef 0)
  %33 = load i32, ptr %3, align 4, !tbaa !13
  %34 = sext i32 %33 to i64
  %35 = load i32, ptr %4, align 4, !tbaa !13
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [50 x [50 x [2 x i8]]], ptr %2, i64 0, i64 %34, i64 %36
  %38 = load i8, ptr %37, align 2, !tbaa !7
  %39 = shl nuw nsw i32 %32, 2
  %40 = zext nneg i32 %39 to i64
  %41 = getelementptr inbounds [1024 x i8], ptr %0, i64 0, i64 %40
  store i8 %38, ptr %41, align 1, !tbaa !7
  store i32 %21, ptr %3, align 4, !tbaa !13
  store i32 %24, ptr %4, align 4, !tbaa !13
  call void @_ZN7libzpaq10StateTable10next_stateERiS1_i(ptr noundef nonnull align 1 dereferenceable(1024) %0, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef 1)
  %42 = load i32, ptr %3, align 4, !tbaa !13
  %43 = sext i32 %42 to i64
  %44 = load i32, ptr %4, align 4, !tbaa !13
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [50 x [50 x [2 x i8]]], ptr %2, i64 0, i64 %43, i64 %45, i64 1
  %47 = load i8, ptr %46, align 1, !tbaa !7
  %48 = or disjoint i32 %39, 1
  %49 = zext nneg i32 %48 to i64
  %50 = getelementptr inbounds [1024 x i8], ptr %0, i64 0, i64 %49
  store i8 %47, ptr %50, align 1, !tbaa !7
  %51 = or disjoint i32 %39, 2
  %52 = zext nneg i32 %51 to i64
  %53 = getelementptr inbounds [1024 x i8], ptr %0, i64 0, i64 %52
  store i8 %22, ptr %53, align 1, !tbaa !7
  %54 = or disjoint i32 %39, 3
  %55 = zext nneg i32 %54 to i64
  %56 = getelementptr inbounds [1024 x i8], ptr %0, i64 0, i64 %55
  store i8 %27, ptr %56, align 1, !tbaa !7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %57 = call noundef i32 @_ZN7libzpaq10StateTable10num_statesEii(ptr noundef nonnull align 1 dereferenceable(1024) %0, i32 noundef %21, i32 noundef %24)
  %58 = sext i32 %57 to i64
  %59 = icmp slt i64 %indvars.iv.next68, %58
  br i1 %59, label %29, label %._crit_edge, !llvm.loop !15
}

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 nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = distinct !{!10, !6}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = distinct !{!15, !6}


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