; LLVM IR from amritansh22/Data-Structures-and-Algorithms-in-cpp :: bankers_algorithm_safe_state.ll (Z6isSafePiS_PA3_iS1_)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z13calculateNeedPA3_iS0_S0_(ptr noundef, ptr noundef, ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z6isSafePiS_PA3_iS1_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca i1, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca [5 x [3 x i32]], align 16
  %11 = alloca [5 x i8], align 1
  %12 = alloca [5 x i32], align 16
  %13 = alloca [3 x i32], align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 60, ptr %10) #6
  %22 = getelementptr inbounds [5 x [3 x i32]], ptr %10, i64 0, i64 0
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_Z13calculateNeedPA3_iS0_S0_(ptr noundef %22, ptr noundef %23, ptr noundef %24)
  call void @llvm.lifetime.start.p0(i64 5, ptr %11) #6
  call void @llvm.memset.p0.i64(ptr align 1 %11, i8 0, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %38, %4
  %26 = load i32, ptr %14, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 3
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %41

29:                                               ; preds = %25
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = load i32, ptr %14, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr %30, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = load i32, ptr %14, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [3 x i32], ptr %13, i64 0, i64 %36
  store i32 %34, ptr %37, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %29
  %39 = load i32, ptr %14, align 4, !tbaa !9
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %14, align 4, !tbaa !9
  br label %25, !llvm.loop !11

41:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %129, %41
  %43 = load i32, ptr %15, align 4, !tbaa !9
  %44 = icmp slt i32 %43, 5
  br i1 %44, label %45, label %130

45:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  store i8 0, ptr %16, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %116, %45
  %47 = load i32, ptr %17, align 4, !tbaa !9
  %48 = icmp slt i32 %47, 5
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %46
  %51 = load i32, ptr %17, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [5 x i8], ptr %11, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !13, !range !15, !noundef !16
  %55 = trunc i8 %54 to i1
  %56 = zext i1 %55 to i32
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %115

58:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %59

59:                                               ; preds = %77, %58
  %60 = load i32, ptr %19, align 4, !tbaa !9
  %61 = icmp slt i32 %60, 3
  br i1 %61, label %62, label %80

62:                                               ; preds = %59
  %63 = load i32, ptr %17, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [5 x [3 x i32]], ptr %10, i64 0, i64 %64
  %66 = load i32, ptr %19, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [3 x i32], ptr %65, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = load i32, ptr %19, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [3 x i32], ptr %13, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %74 = icmp sgt i32 %69, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %62
  br label %80

76:                                               ; preds = %62
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %19, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %19, align 4, !tbaa !9
  br label %59, !llvm.loop !17

80:                                               ; preds = %75, %59
  %81 = load i32, ptr %19, align 4, !tbaa !9
  %82 = icmp eq i32 %81, 3
  br i1 %82, label %83, label %114

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

84:                                               ; preds = %102, %83
  %85 = load i32, ptr %20, align 4, !tbaa !9
  %86 = icmp slt i32 %85, 3
  br i1 %86, label %88, label %87

87:                                               ; preds = %84
  store i32 13, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %105

88:                                               ; preds = %84
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = load i32, ptr %17, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [3 x i32], ptr %89, i64 %91
  %93 = load i32, ptr %20, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [3 x i32], ptr %92, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !9
  %97 = load i32, ptr %20, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [3 x i32], ptr %13, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !9
  %101 = add nsw i32 %100, %96
  store i32 %101, ptr %99, align 4, !tbaa !9
  br label %102

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

105:                                              ; preds = %87
  %106 = load i32, ptr %17, align 4, !tbaa !9
  %107 = load i32, ptr %15, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %15, align 4, !tbaa !9
  %109 = sext i32 %107 to i64
  %110 = getelementptr inbounds [5 x i32], ptr %12, i64 0, i64 %109
  store i32 %106, ptr %110, align 4, !tbaa !9
  %111 = load i32, ptr %17, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [5 x i8], ptr %11, i64 0, i64 %112
  store i8 1, ptr %113, align 1, !tbaa !13
  store i8 1, ptr %16, align 1, !tbaa !13
  br label %114

114:                                              ; preds = %105, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %115

115:                                              ; preds = %114, %50
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %17, align 4, !tbaa !9
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %17, align 4, !tbaa !9
  br label %46, !llvm.loop !19

119:                                              ; preds = %49
  %120 = load i8, ptr %16, align 1, !tbaa !13, !range !15, !noundef !16
  %121 = trunc i8 %120 to i1
  %122 = zext i1 %121 to i32
  %123 = icmp eq i32 %122, 0
  br i1 %123, label %124, label %126

124:                                              ; preds = %119
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  store i1 false, ptr %5, align 1
  store i32 1, ptr %18, align 4
  br label %127

126:                                              ; preds = %119
  store i32 0, ptr %18, align 4
  br label %127

127:                                              ; preds = %126, %124
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  %128 = load i32, ptr %18, align 4
  switch i32 %128, label %147 [
    i32 0, label %129
  ]

129:                                              ; preds = %127
  br label %42, !llvm.loop !20

130:                                              ; preds = %42
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %132

132:                                              ; preds = %143, %130
  %133 = load i32, ptr %21, align 4, !tbaa !9
  %134 = icmp slt i32 %133, 5
  br i1 %134, label %136, label %135

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

136:                                              ; preds = %132
  %137 = load i32, ptr %21, align 4, !tbaa !9
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [5 x i32], ptr %12, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !9
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %140)
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %141, ptr noundef @.str.2)
  br label %143

143:                                              ; preds = %136
  %144 = load i32, ptr %21, align 4, !tbaa !9
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %21, align 4, !tbaa !9
  br label %132, !llvm.loop !21

146:                                              ; preds = %135
  store i1 true, ptr %5, align 1
  store i32 1, ptr %18, align 4
  br label %147

147:                                              ; preds = %146, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 20, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 5, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 60, ptr %10) #6
  %148 = load i1, ptr %5, align 1
  ret i1 %148
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { inlinehint 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 #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z13calculateNeedPA3_iS0_S0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z6isSafePiS_PA3_iS1_(ptr nocapture noundef readnone %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 {
.critedge.preheader:
  %4 = alloca [5 x [3 x i32]], align 16
  %5 = alloca [5 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %4) #5
  call void @_Z13calculateNeedPA3_iS0_S0_(ptr noundef nonnull %4, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %5) #5
  %.sroa.0.0.copyload = load i32, ptr %1, align 4, !tbaa !5
  %.sroa.18.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 4
  %.sroa.18.0.copyload = load i32, ptr %.sroa.18.0..sroa_idx, align 4, !tbaa !5
  %.sroa.33.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.33.0.copyload = load i32, ptr %.sroa.33.0..sroa_idx, align 4, !tbaa !5
  %6 = load i32, ptr %4, align 16
  %7 = getelementptr inbounds i8, ptr %4, i64 4
  %8 = load i32, ptr %7, align 4
  %9 = getelementptr inbounds i8, ptr %4, i64 8
  %10 = load i32, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr %3, i64 4
  %12 = getelementptr inbounds i8, ptr %3, i64 8
  %13 = getelementptr inbounds i8, ptr %4, i64 12
  %14 = load i32, ptr %13, align 4
  %15 = getelementptr inbounds i8, ptr %4, i64 16
  %16 = load i32, ptr %15, align 16
  %17 = getelementptr inbounds i8, ptr %4, i64 20
  %18 = load i32, ptr %17, align 4
  %19 = getelementptr inbounds i8, ptr %3, i64 12
  %20 = getelementptr inbounds i8, ptr %3, i64 16
  %21 = getelementptr inbounds i8, ptr %3, i64 20
  %22 = getelementptr inbounds i8, ptr %4, i64 24
  %23 = load i32, ptr %22, align 8
  %24 = getelementptr inbounds i8, ptr %4, i64 28
  %25 = load i32, ptr %24, align 4
  %26 = getelementptr inbounds i8, ptr %4, i64 32
  %27 = load i32, ptr %26, align 16
  %28 = getelementptr inbounds i8, ptr %3, i64 24
  %29 = getelementptr inbounds i8, ptr %3, i64 28
  %30 = getelementptr inbounds i8, ptr %3, i64 32
  %31 = getelementptr inbounds i8, ptr %4, i64 36
  %32 = load i32, ptr %31, align 4
  %33 = getelementptr inbounds i8, ptr %4, i64 40
  %34 = load i32, ptr %33, align 8
  %35 = getelementptr inbounds i8, ptr %4, i64 44
  %36 = load i32, ptr %35, align 4
  %37 = getelementptr inbounds i8, ptr %3, i64 36
  %38 = getelementptr inbounds i8, ptr %3, i64 40
  %39 = getelementptr inbounds i8, ptr %3, i64 44
  %40 = getelementptr inbounds i8, ptr %4, i64 48
  %41 = load i32, ptr %40, align 16
  %42 = getelementptr inbounds i8, ptr %4, i64 52
  %43 = load i32, ptr %42, align 4
  %44 = getelementptr inbounds i8, ptr %4, i64 56
  %45 = load i32, ptr %44, align 8
  %46 = getelementptr inbounds i8, ptr %3, i64 48
  %47 = getelementptr inbounds i8, ptr %3, i64 52
  %48 = getelementptr inbounds i8, ptr %3, i64 56
  br label %.critedge

.critedge:                                        ; preds = %.critedge.preheader, %.thread.4
  %.sroa.089.0 = phi i8 [ 0, %.critedge.preheader ], [ %.sroa.089.1, %.thread.4 ]
  %.sroa.5.0 = phi i8 [ 0, %.critedge.preheader ], [ %.sroa.5.1, %.thread.4 ]
  %.sroa.7.0 = phi i8 [ 0, %.critedge.preheader ], [ %.sroa.7.1, %.thread.4 ]
  %.sroa.9.0 = phi i8 [ 0, %.critedge.preheader ], [ %.sroa.9.1, %.thread.4 ]
  %.sroa.11.0 = phi i8 [ 0, %.critedge.preheader ], [ %.sroa.11.1, %.thread.4 ]
  %.sroa.33.0 = phi i32 [ %.sroa.33.0.copyload, %.critedge.preheader ], [ %.sroa.33.5, %.thread.4 ]
  %.sroa.18.0 = phi i32 [ %.sroa.18.0.copyload, %.critedge.preheader ], [ %.sroa.18.5, %.thread.4 ]
  %.sroa.0.0 = phi i32 [ %.sroa.0.0.copyload, %.critedge.preheader ], [ %.sroa.0.5, %.thread.4 ]
  %.036 = phi i32 [ 0, %.critedge.preheader ], [ %.3.4, %.thread.4 ]
  %49 = icmp sgt i32 %.036, 4
  br i1 %49, label %.loopexit.loopexit, label %.preheader44.preheader

.preheader44.preheader:                           ; preds = %.critedge
  %50 = icmp eq i8 %.sroa.089.0, 0
  br i1 %50, label %.preheader43.preheader, label %.thread

.preheader43.preheader:                           ; preds = %.preheader44.preheader
  %51 = icmp sgt i32 %6, %.sroa.0.0
  %52 = icmp sgt i32 %8, %.sroa.18.0
  %or.cond = select i1 %51, i1 true, i1 %52
  %53 = icmp sgt i32 %10, %.sroa.33.0
  %or.cond91 = select i1 %or.cond, i1 true, i1 %53
  br i1 %or.cond91, label %.thread, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader43.preheader
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = add nsw i32 %.sroa.0.0, %54
  %56 = load i32, ptr %11, align 4, !tbaa !5
  %57 = add nsw i32 %.sroa.18.0, %56
  %58 = load i32, ptr %12, align 4, !tbaa !5
  %59 = add nsw i32 %.sroa.33.0, %58
  %60 = add nsw i32 %.036, 1
  %61 = sext i32 %.036 to i64
  %62 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %61
  store i32 0, ptr %62, align 4, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %.preheader43.preheader, %.preheader.preheader, %.preheader44.preheader
  %.sroa.089.1 = phi i8 [ 1, %.preheader.preheader ], [ %.sroa.089.0, %.preheader44.preheader ], [ 0, %.preheader43.preheader ]
  %.sroa.33.1 = phi i32 [ %59, %.preheader.preheader ], [ %.sroa.33.0, %.preheader44.preheader ], [ %.sroa.33.0, %.preheader43.preheader ]
  %.sroa.18.1 = phi i32 [ %57, %.preheader.preheader ], [ %.sroa.18.0, %.preheader44.preheader ], [ %.sroa.18.0, %.preheader43.preheader ]
  %.sroa.0.1 = phi i32 [ %55, %.preheader.preheader ], [ %.sroa.0.0, %.preheader44.preheader ], [ %.sroa.0.0, %.preheader43.preheader ]
  %.3 = phi i32 [ %60, %.preheader.preheader ], [ %.036, %.preheader44.preheader ], [ %.036, %.preheader43.preheader ]
  %.2 = phi i8 [ 1, %.preheader.preheader ], [ 0, %.preheader44.preheader ], [ 0, %.preheader43.preheader ]
  %63 = icmp eq i8 %.sroa.5.0, 0
  br i1 %63, label %.preheader43.preheader.1, label %.thread.1

.preheader43.preheader.1:                         ; preds = %.thread
  %64 = icmp sgt i32 %14, %.sroa.0.1
  %65 = icmp sgt i32 %16, %.sroa.18.1
  %or.cond92 = select i1 %64, i1 true, i1 %65
  %66 = icmp sgt i32 %18, %.sroa.33.1
  %or.cond93 = select i1 %or.cond92, i1 true, i1 %66
  br i1 %or.cond93, label %.thread.1, label %.preheader.preheader.1

.preheader.preheader.1:                           ; preds = %.preheader43.preheader.1
  %67 = load i32, ptr %19, align 4, !tbaa !5
  %68 = add nsw i32 %.sroa.0.1, %67
  %69 = load i32, ptr %20, align 4, !tbaa !5
  %70 = add nsw i32 %.sroa.18.1, %69
  %71 = load i32, ptr %21, align 4, !tbaa !5
  %72 = add nsw i32 %.sroa.33.1, %71
  %73 = add nsw i32 %.3, 1
  %74 = sext i32 %.3 to i64
  %75 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %74
  store i32 1, ptr %75, align 4, !tbaa !5
  br label %.thread.1

.thread.1:                                        ; preds = %.preheader43.preheader.1, %.preheader.preheader.1, %.thread
  %.sroa.5.1 = phi i8 [ 1, %.preheader.preheader.1 ], [ %.sroa.5.0, %.thread ], [ 0, %.preheader43.preheader.1 ]
  %.sroa.33.2 = phi i32 [ %72, %.preheader.preheader.1 ], [ %.sroa.33.1, %.thread ], [ %.sroa.33.1, %.preheader43.preheader.1 ]
  %.sroa.18.2 = phi i32 [ %70, %.preheader.preheader.1 ], [ %.sroa.18.1, %.thread ], [ %.sroa.18.1, %.preheader43.preheader.1 ]
  %.sroa.0.2 = phi i32 [ %68, %.preheader.preheader.1 ], [ %.sroa.0.1, %.thread ], [ %.sroa.0.1, %.preheader43.preheader.1 ]
  %.3.1 = phi i32 [ %73, %.preheader.preheader.1 ], [ %.3, %.thread ], [ %.3, %.preheader43.preheader.1 ]
  %.2.1 = phi i8 [ 1, %.preheader.preheader.1 ], [ %.2, %.thread ], [ %.2, %.preheader43.preheader.1 ]
  %76 = icmp eq i8 %.sroa.7.0, 0
  br i1 %76, label %.preheader43.preheader.2, label %.thread.2

.preheader43.preheader.2:                         ; preds = %.thread.1
  %77 = icmp sgt i32 %23, %.sroa.0.2
  %78 = icmp sgt i32 %25, %.sroa.18.2
  %or.cond94 = select i1 %77, i1 true, i1 %78
  %79 = icmp sgt i32 %27, %.sroa.33.2
  %or.cond95 = select i1 %or.cond94, i1 true, i1 %79
  br i1 %or.cond95, label %.thread.2, label %.preheader.preheader.2

.preheader.preheader.2:                           ; preds = %.preheader43.preheader.2
  %80 = load i32, ptr %28, align 4, !tbaa !5
  %81 = add nsw i32 %.sroa.0.2, %80
  %82 = load i32, ptr %29, align 4, !tbaa !5
  %83 = add nsw i32 %.sroa.18.2, %82
  %84 = load i32, ptr %30, align 4, !tbaa !5
  %85 = add nsw i32 %.sroa.33.2, %84
  %86 = add nsw i32 %.3.1, 1
  %87 = sext i32 %.3.1 to i64
  %88 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %87
  store i32 2, ptr %88, align 4, !tbaa !5
  br label %.thread.2

.thread.2:                                        ; preds = %.preheader43.preheader.2, %.preheader.preheader.2, %.thread.1
  %.sroa.7.1 = phi i8 [ 1, %.preheader.preheader.2 ], [ %.sroa.7.0, %.thread.1 ], [ 0, %.preheader43.preheader.2 ]
  %.sroa.33.3 = phi i32 [ %85, %.preheader.preheader.2 ], [ %.sroa.33.2, %.thread.1 ], [ %.sroa.33.2, %.preheader43.preheader.2 ]
  %.sroa.18.3 = phi i32 [ %83, %.preheader.preheader.2 ], [ %.sroa.18.2, %.thread.1 ], [ %.sroa.18.2, %.preheader43.preheader.2 ]
  %.sroa.0.3 = phi i32 [ %81, %.preheader.preheader.2 ], [ %.sroa.0.2, %.thread.1 ], [ %.sroa.0.2, %.preheader43.preheader.2 ]
  %.3.2 = phi i32 [ %86, %.preheader.preheader.2 ], [ %.3.1, %.thread.1 ], [ %.3.1, %.preheader43.preheader.2 ]
  %.2.2 = phi i8 [ 1, %.preheader.preheader.2 ], [ %.2.1, %.thread.1 ], [ %.2.1, %.preheader43.preheader.2 ]
  %89 = icmp eq i8 %.sroa.9.0, 0
  br i1 %89, label %.preheader43.preheader.3, label %.thread.3

.preheader43.preheader.3:                         ; preds = %.thread.2
  %90 = icmp sgt i32 %32, %.sroa.0.3
  %91 = icmp sgt i32 %34, %.sroa.18.3
  %or.cond96 = select i1 %90, i1 true, i1 %91
  %92 = icmp sgt i32 %36, %.sroa.33.3
  %or.cond97 = select i1 %or.cond96, i1 true, i1 %92
  br i1 %or.cond97, label %.thread.3, label %.preheader.preheader.3

.preheader.preheader.3:                           ; preds = %.preheader43.preheader.3
  %93 = load i32, ptr %37, align 4, !tbaa !5
  %94 = add nsw i32 %.sroa.0.3, %93
  %95 = load i32, ptr %38, align 4, !tbaa !5
  %96 = add nsw i32 %.sroa.18.3, %95
  %97 = load i32, ptr %39, align 4, !tbaa !5
  %98 = add nsw i32 %.sroa.33.3, %97
  %99 = add nsw i32 %.3.2, 1
  %100 = sext i32 %.3.2 to i64
  %101 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %100
  store i32 3, ptr %101, align 4, !tbaa !5
  br label %.thread.3

.thread.3:                                        ; preds = %.preheader43.preheader.3, %.preheader.preheader.3, %.thread.2
  %.sroa.9.1 = phi i8 [ 1, %.preheader.preheader.3 ], [ %.sroa.9.0, %.thread.2 ], [ 0, %.preheader43.preheader.3 ]
  %.sroa.33.4 = phi i32 [ %98, %.preheader.preheader.3 ], [ %.sroa.33.3, %.thread.2 ], [ %.sroa.33.3, %.preheader43.preheader.3 ]
  %.sroa.18.4 = phi i32 [ %96, %.preheader.preheader.3 ], [ %.sroa.18.3, %.thread.2 ], [ %.sroa.18.3, %.preheader43.preheader.3 ]
  %.sroa.0.4 = phi i32 [ %94, %.preheader.preheader.3 ], [ %.sroa.0.3, %.thread.2 ], [ %.sroa.0.3, %.preheader43.preheader.3 ]
  %.3.3 = phi i32 [ %99, %.preheader.preheader.3 ], [ %.3.2, %.thread.2 ], [ %.3.2, %.preheader43.preheader.3 ]
  %.2.3 = phi i8 [ 1, %.preheader.preheader.3 ], [ %.2.2, %.thread.2 ], [ %.2.2, %.preheader43.preheader.3 ]
  %102 = icmp eq i8 %.sroa.11.0, 0
  br i1 %102, label %.preheader43.preheader.4, label %.thread.4

.preheader43.preheader.4:                         ; preds = %.thread.3
  %103 = icmp sgt i32 %41, %.sroa.0.4
  %104 = icmp sgt i32 %43, %.sroa.18.4
  %or.cond98 = select i1 %103, i1 true, i1 %104
  %105 = icmp sgt i32 %45, %.sroa.33.4
  %or.cond99 = select i1 %or.cond98, i1 true, i1 %105
  br i1 %or.cond99, label %.thread.4, label %.preheader.preheader.4

.preheader.preheader.4:                           ; preds = %.preheader43.preheader.4
  %106 = load i32, ptr %46, align 4, !tbaa !5
  %107 = add nsw i32 %.sroa.0.4, %106
  %108 = load i32, ptr %47, align 4, !tbaa !5
  %109 = add nsw i32 %.sroa.18.4, %108
  %110 = load i32, ptr %48, align 4, !tbaa !5
  %111 = add nsw i32 %.sroa.33.4, %110
  %112 = add nsw i32 %.3.3, 1
  %113 = sext i32 %.3.3 to i64
  %114 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %113
  store i32 4, ptr %114, align 4, !tbaa !5
  br label %.thread.4

.thread.4:                                        ; preds = %.preheader43.preheader.4, %.preheader.preheader.4, %.thread.3
  %.sroa.11.1 = phi i8 [ 1, %.preheader.preheader.4 ], [ %.sroa.11.0, %.thread.3 ], [ 0, %.preheader43.preheader.4 ]
  %.sroa.33.5 = phi i32 [ %111, %.preheader.preheader.4 ], [ %.sroa.33.4, %.thread.3 ], [ %.sroa.33.4, %.preheader43.preheader.4 ]
  %.sroa.18.5 = phi i32 [ %109, %.preheader.preheader.4 ], [ %.sroa.18.4, %.thread.3 ], [ %.sroa.18.4, %.preheader43.preheader.4 ]
  %.sroa.0.5 = phi i32 [ %107, %.preheader.preheader.4 ], [ %.sroa.0.4, %.thread.3 ], [ %.sroa.0.4, %.preheader43.preheader.4 ]
  %.3.4 = phi i32 [ %112, %.preheader.preheader.4 ], [ %.3.3, %.thread.3 ], [ %.3.3, %.preheader43.preheader.4 ]
  %.2.4 = phi i8 [ 1, %.preheader.preheader.4 ], [ %.2.3, %.thread.3 ], [ %.2.3, %.preheader43.preheader.4 ]
  %.not = icmp eq i8 %.2.4, 0
  br i1 %.not, label %115, label %.critedge

115:                                              ; preds = %.thread.4
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  br label %.loopexit, !llvm.loop !9

.loopexit.loopexit:                               ; preds = %.critedge
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %118 = load i32, ptr %5, align 16, !tbaa !5
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %118)
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %119, ptr noundef nonnull @.str.2)
  %121 = getelementptr inbounds i8, ptr %5, i64 4
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %122)
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef nonnull @.str.2)
  %125 = getelementptr inbounds i8, ptr %5, i64 8
  %126 = load i32, ptr %125, align 8, !tbaa !5
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %126)
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %127, ptr noundef nonnull @.str.2)
  %129 = getelementptr inbounds i8, ptr %5, i64 12
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %130)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef nonnull @.str.2)
  %133 = getelementptr inbounds i8, ptr %5, i64 16
  %134 = load i32, ptr %133, align 16, !tbaa !5
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %134)
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %135, ptr noundef nonnull @.str.2)
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %115
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %4) #5
  ret i1 %49
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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 willreturn memory(argmem: readwrite) }
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 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 }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass