; LLVM IR from ravireddy07/cpp-book :: src/Code-Forces (symmetric-matrix)

; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %14

14:                                               ; preds = %164, %162, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %165

17:                                               ; preds = %14
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = srem i32 %22, 2
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %28

25:                                               ; preds = %17
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 2, ptr %5, align 4
  br label %162, !llvm.loop !9

28:                                               ; preds = %17
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = zext i32 %29 to i64
  %31 = call ptr @llvm.stacksave.p0()
  store ptr %31, ptr %6, align 8
  %32 = alloca [2 x [2 x i32]], i64 %30, align 16
  store i64 %30, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %67, %28
  %34 = load i32, ptr %8, align 4, !tbaa !5
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %63, %38
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = icmp slt i32 %40, 2
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %59, %43
  %45 = load i32, ptr %10, align 4, !tbaa !5
  %46 = icmp slt i32 %45, 2
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %62

48:                                               ; preds = %44
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [2 x [2 x i32]], ptr %32, i64 %50
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [2 x [2 x i32]], ptr %51, i64 0, i64 %53
  %55 = load i32, ptr %10, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [2 x i32], ptr %54, i64 0, i64 %56
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %57)
  br label %59

59:                                               ; preds = %48
  %60 = load i32, ptr %10, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %10, align 4, !tbaa !5
  br label %44, !llvm.loop !11

62:                                               ; preds = %47
  br label %63

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

66:                                               ; preds = %42
  br label %67

67:                                               ; preds = %66
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %8, align 4, !tbaa !5
  br label %33, !llvm.loop !13

70:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = icmp sgt i32 %71, 1
  br i1 %72, label %73, label %115

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

74:                                               ; preds = %111, %73
  %75 = load i32, ptr %12, align 4, !tbaa !5
  %76 = load i32, ptr %3, align 4, !tbaa !5
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 13, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %114

79:                                               ; preds = %74
  %80 = load i32, ptr %12, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [2 x [2 x i32]], ptr %32, i64 %81
  %83 = getelementptr inbounds [2 x [2 x i32]], ptr %82, i64 0, i64 0
  %84 = getelementptr inbounds [2 x i32], ptr %83, i64 0, i64 0
  %85 = load i32, ptr %84, align 16, !tbaa !5
  %86 = load i32, ptr %12, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [2 x [2 x i32]], ptr %32, i64 %87
  %89 = getelementptr inbounds [2 x [2 x i32]], ptr %88, i64 0, i64 1
  %90 = getelementptr inbounds [2 x i32], ptr %89, i64 0, i64 1
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = icmp eq i32 %85, %91
  br i1 %92, label %107, label %93

93:                                               ; preds = %79
  %94 = load i32, ptr %12, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [2 x [2 x i32]], ptr %32, i64 %95
  %97 = getelementptr inbounds [2 x [2 x i32]], ptr %96, i64 0, i64 0
  %98 = getelementptr inbounds [2 x i32], ptr %97, i64 0, i64 1
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = load i32, ptr %12, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [2 x [2 x i32]], ptr %32, i64 %101
  %103 = getelementptr inbounds [2 x [2 x i32]], ptr %102, i64 0, i64 1
  %104 = getelementptr inbounds [2 x i32], ptr %103, i64 0, i64 0
  %105 = load i32, ptr %104, align 8, !tbaa !5
  %106 = icmp eq i32 %99, %105
  br i1 %106, label %107, label %110

107:                                              ; preds = %93, %79
  %108 = load i32, ptr %11, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %11, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %107, %93
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %12, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %12, align 4, !tbaa !5
  br label %74, !llvm.loop !14

114:                                              ; preds = %78
  br label %139

115:                                              ; preds = %70
  %116 = getelementptr inbounds [2 x [2 x i32]], ptr %32, i64 0
  %117 = getelementptr inbounds [2 x [2 x i32]], ptr %116, i64 0, i64 0
  %118 = getelementptr inbounds [2 x i32], ptr %117, i64 0, i64 0
  %119 = load i32, ptr %118, align 16, !tbaa !5
  %120 = getelementptr inbounds [2 x [2 x i32]], ptr %32, i64 0
  %121 = getelementptr inbounds [2 x [2 x i32]], ptr %120, i64 0, i64 1
  %122 = getelementptr inbounds [2 x i32], ptr %121, i64 0, i64 1
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = icmp eq i32 %119, %123
  br i1 %124, label %125, label %138

125:                                              ; preds = %115
  %126 = getelementptr inbounds [2 x [2 x i32]], ptr %32, i64 0
  %127 = getelementptr inbounds [2 x [2 x i32]], ptr %126, i64 0, i64 0
  %128 = getelementptr inbounds [2 x i32], ptr %127, i64 0, i64 1
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = getelementptr inbounds [2 x [2 x i32]], ptr %32, i64 0
  %131 = getelementptr inbounds [2 x [2 x i32]], ptr %130, i64 0, i64 1
  %132 = getelementptr inbounds [2 x i32], ptr %131, i64 0, i64 0
  %133 = load i32, ptr %132, align 8, !tbaa !5
  %134 = icmp eq i32 %129, %133
  br i1 %134, label %135, label %138

135:                                              ; preds = %125
  %136 = load i32, ptr %11, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %11, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %135, %125, %115
  br label %139

139:                                              ; preds = %138, %114
  %140 = load i32, ptr %11, align 4, !tbaa !5
  %141 = icmp sgt i32 %140, 0
  br i1 %141, label %142, label %149

142:                                              ; preds = %139
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = load i32, ptr %4, align 4, !tbaa !5
  %145 = icmp slt i32 %143, %144
  br i1 %145, label %146, label %149

146:                                              ; preds = %142
  store i32 4, ptr %11, align 4, !tbaa !5
  %147 = 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)
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %147, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %160

149:                                              ; preds = %142, %139
  %150 = load i32, ptr %11, align 4, !tbaa !5
  %151 = load i32, ptr %4, align 4, !tbaa !5
  %152 = icmp eq i32 %150, %151
  br i1 %152, label %153, label %156

153:                                              ; preds = %149
  %154 = 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)
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %159

156:                                              ; preds = %149
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %157, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %159

159:                                              ; preds = %156, %153
  br label %160

160:                                              ; preds = %159, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %161 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %161)
  store i32 0, ptr %5, align 4
  br label %162

162:                                              ; preds = %160, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  %163 = load i32, ptr %5, align 4
  switch i32 %163, label %167 [
    i32 0, label %164
    i32 2, label %14
  ]

164:                                              ; preds = %162
  br label %14, !llvm.loop !9

165:                                              ; preds = %14
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %166 = load i32, ptr %1, align 4
  ret i32 %166

167:                                              ; preds = %162
  unreachable
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; 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) #3

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

attributes #0 = { mustprogress norecurse 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 = { "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 = { 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 = { nocallback nofree nosync nounwind willreturn }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; 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_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %.not39 = icmp eq i32 %5, 0
  br i1 %.not39, label %._crit_edge41, label %.lr.ph

.lr.ph:                                           ; preds = %0, %94
  %6 = phi i32 [ %95, %94 ], [ %5, %0 ]
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %10 = load i32, ptr %3, align 4, !tbaa !5
  %11 = and i32 %10, 1
  %.not27 = icmp eq i32 %11, 0
  br i1 %.not27, label %15, label %12

12:                                               ; preds = %.lr.ph
  %13 = 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)
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %94, !llvm.loop !9

15:                                               ; preds = %.lr.ph
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = zext i32 %16 to i64
  %18 = call ptr @llvm.stacksave.p0()
  %19 = alloca [2 x [2 x i32]], i64 %17, align 16
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.preheader32, label %._crit_edge.thread

.preheader32:                                     ; preds = %15, %.preheader32
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader32 ], [ 0, %15 ]
  %22 = getelementptr inbounds [2 x [2 x i32]], ptr %19, i64 %indvars.iv, i64 0, i64 0
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %24 = getelementptr inbounds [2 x [2 x i32]], ptr %19, i64 %indvars.iv, i64 0, i64 1
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %26 = getelementptr inbounds [2 x [2 x i32]], ptr %19, i64 %indvars.iv, i64 1, i64 0
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %28 = getelementptr inbounds [2 x [2 x i32]], ptr %19, i64 %indvars.iv, i64 1, i64 1
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = icmp slt i64 %indvars.iv.next, %31
  br i1 %32, label %.preheader32, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.preheader32
  %33 = icmp sgt i32 %30, 1
  br i1 %33, label %.preheader33.preheader, label %._crit_edge.thread

.preheader33.preheader:                           ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %30 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.preheader33

.preheader33:                                     ; preds = %60, %.preheader33.preheader
  %indvars.iv46 = phi i64 [ 0, %.preheader33.preheader ], [ %indvars.iv.next47.1, %60 ]
  %.02137 = phi i32 [ 0, %.preheader33.preheader ], [ %.1.1, %60 ]
  %niter = phi i64 [ 0, %.preheader33.preheader ], [ %niter.next.1, %60 ]
  %34 = getelementptr inbounds [2 x [2 x i32]], ptr %19, i64 %indvars.iv46
  %35 = load i32, ptr %34, align 16, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %34, i64 12
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = icmp eq i32 %35, %37
  br i1 %38, label %45, label %39

39:                                               ; preds = %.preheader33
  %40 = getelementptr inbounds i8, ptr %34, i64 8
  %41 = getelementptr inbounds i8, ptr %34, i64 4
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = load i32, ptr %40, align 8, !tbaa !5
  %44 = icmp eq i32 %42, %43
  br i1 %44, label %45, label %.preheader33.1

45:                                               ; preds = %39, %.preheader33
  %46 = add nsw i32 %.02137, 1
  br label %.preheader33.1

.preheader33.1:                                   ; preds = %39, %45
  %.1 = phi i32 [ %46, %45 ], [ %.02137, %39 ]
  %indvars.iv.next47 = or disjoint i64 %indvars.iv46, 1
  %47 = getelementptr inbounds [2 x [2 x i32]], ptr %19, i64 %indvars.iv.next47
  %48 = load i32, ptr %47, align 16, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %47, i64 12
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp eq i32 %48, %50
  br i1 %51, label %58, label %52

52:                                               ; preds = %.preheader33.1
  %53 = getelementptr inbounds i8, ptr %47, i64 8
  %54 = getelementptr inbounds i8, ptr %47, i64 4
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %53, align 8, !tbaa !5
  %57 = icmp eq i32 %55, %56
  br i1 %57, label %58, label %60

58:                                               ; preds = %52, %.preheader33.1
  %59 = add nsw i32 %.1, 1
  br label %60

60:                                               ; preds = %58, %52
  %.1.1 = phi i32 [ %59, %58 ], [ %.1, %52 ]
  %indvars.iv.next47.1 = add nuw nsw i64 %indvars.iv46, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit.loopexit.unr-lcssa, label %.preheader33, !llvm.loop !12

._crit_edge.thread:                               ; preds = %15, %._crit_edge
  %61 = load i32, ptr %19, align 16, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %19, i64 12
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = icmp eq i32 %61, %63
  br i1 %64, label %66, label %.thread

.thread:                                          ; preds = %._crit_edge.thread
  %65 = load i32, ptr %3, align 4
  br label %88

66:                                               ; preds = %._crit_edge.thread
  %67 = getelementptr inbounds i8, ptr %19, i64 8
  %68 = getelementptr inbounds i8, ptr %19, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = load i32, ptr %67, align 8, !tbaa !5
  %71 = icmp eq i32 %69, %70
  %spec.select = zext i1 %71 to i32
  br label %.loopexit

.loopexit.loopexit.unr-lcssa:                     ; preds = %60
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.preheader33.epil

.preheader33.epil:                                ; preds = %.loopexit.loopexit.unr-lcssa
  %72 = getelementptr inbounds [2 x [2 x i32]], ptr %19, i64 %indvars.iv.next47.1
  %73 = load i32, ptr %72, align 16, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %72, i64 12
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = icmp eq i32 %73, %75
  br i1 %76, label %83, label %77

77:                                               ; preds = %.preheader33.epil
  %78 = getelementptr inbounds i8, ptr %72, i64 8
  %79 = getelementptr inbounds i8, ptr %72, i64 4
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %78, align 8, !tbaa !5
  %82 = icmp eq i32 %80, %81
  br i1 %82, label %83, label %.loopexit

83:                                               ; preds = %77, %.preheader33.epil
  %84 = add nsw i32 %.1.1, 1
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %83, %77, %66
  %.2 = phi i32 [ %spec.select, %66 ], [ %.1.1, %.loopexit.loopexit.unr-lcssa ], [ %84, %83 ], [ %.1.1, %77 ]
  %85 = icmp sgt i32 %.2, 0
  %86 = load i32, ptr %3, align 4
  %87 = icmp slt i32 %.2, %86
  %or.cond = select i1 %85, i1 %87, i1 false
  br i1 %or.cond, label %91, label %88

88:                                               ; preds = %.thread, %.loopexit
  %89 = phi i32 [ %65, %.thread ], [ %86, %.loopexit ]
  %.231 = phi i32 [ 0, %.thread ], [ %.2, %.loopexit ]
  %90 = icmp eq i32 %.231, %89
  %.str.1..str = select i1 %90, ptr @.str.1, ptr @.str
  br label %91

91:                                               ; preds = %88, %.loopexit
  %.str.1.sink = phi ptr [ @.str.1, %.loopexit ], [ %.str.1..str, %88 ]
  %92 = 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.sink)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %18)
  br label %94

94:                                               ; preds = %91, %12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %95 = load i32, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %95, 0
  br i1 %.not, label %._crit_edge41, label %.lr.ph

._crit_edge41:                                    ; preds = %94, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; 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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

; 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 nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

attributes #0 = { mustprogress norecurse 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 = { "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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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