; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 07. Matrix (Sparsematrix)

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [38 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.2 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.7 = 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 [20 x [20 x i32]], align 16
  %5 = alloca [20 x [3 x i32]], align 16
  %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 i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 20, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 1600, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 240, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %19 = 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)
  %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) %6)
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %70, %0
  %24 = load i32, ptr %10, align 4, !tbaa !5
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

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

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

29:                                               ; preds = %66, %28
  %30 = load i32, ptr %12, align 4, !tbaa !5
  %31 = load i32, ptr %7, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %69

34:                                               ; preds = %29
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %36 = load i32, ptr %10, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %35, i32 noundef %37)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef @.str.4)
  %40 = load i32, ptr %12, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %39, i32 noundef %41)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %42, ptr noundef @.str.5)
  %44 = load i32, ptr %10, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [20 x [20 x i32]], ptr %4, i64 0, i64 %45
  %47 = load i32, ptr %12, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [20 x i32], ptr %46, i64 0, i64 %48
  %50 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %49)
  %51 = load i32, ptr %10, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [20 x [20 x i32]], ptr %4, i64 0, i64 %52
  %54 = load i32, ptr %12, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [20 x i32], ptr %53, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %62

59:                                               ; preds = %34
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %8, align 4, !tbaa !5
  br label %65

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

65:                                               ; preds = %62, %59
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %12, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %12, align 4, !tbaa !5
  br label %29, !llvm.loop !9

69:                                               ; preds = %33
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %10, align 4, !tbaa !5
  br label %23, !llvm.loop !11

73:                                               ; preds = %27
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = mul nsw i32 %75, %76
  %78 = sdiv i32 %77, 2
  %79 = icmp sgt i32 %74, %78
  br i1 %79, label %80, label %143

80:                                               ; preds = %73
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = getelementptr inbounds [20 x [3 x i32]], ptr %5, i64 0, i64 0
  %83 = getelementptr inbounds [3 x i32], ptr %82, i64 0, i64 0
  store i32 %81, ptr %83, align 16, !tbaa !5
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = getelementptr inbounds [20 x [3 x i32]], ptr %5, i64 0, i64 0
  %86 = getelementptr inbounds [3 x i32], ptr %85, i64 0, i64 1
  store i32 %84, ptr %86, align 4, !tbaa !5
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = getelementptr inbounds [20 x [3 x i32]], ptr %5, i64 0, i64 0
  %89 = getelementptr inbounds [3 x i32], ptr %88, i64 0, i64 2
  store i32 %87, ptr %89, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %139, %80
  %91 = load i32, ptr %13, align 4, !tbaa !5
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %142

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

96:                                               ; preds = %135, %95
  %97 = load i32, ptr %14, align 4, !tbaa !5
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %138

101:                                              ; preds = %96
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [20 x [20 x i32]], ptr %4, i64 0, i64 %103
  %105 = load i32, ptr %14, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [20 x i32], ptr %104, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %134

110:                                              ; preds = %101
  %111 = load i32, ptr %13, align 4, !tbaa !5
  %112 = load i32, ptr %3, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [20 x [3 x i32]], ptr %5, i64 0, i64 %113
  %115 = getelementptr inbounds [3 x i32], ptr %114, i64 0, i64 0
  store i32 %111, ptr %115, align 4, !tbaa !5
  %116 = load i32, ptr %14, align 4, !tbaa !5
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [20 x [3 x i32]], ptr %5, i64 0, i64 %118
  %120 = getelementptr inbounds [3 x i32], ptr %119, i64 0, i64 1
  store i32 %116, ptr %120, align 4, !tbaa !5
  %121 = load i32, ptr %13, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [20 x [20 x i32]], ptr %4, i64 0, i64 %122
  %124 = load i32, ptr %14, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [20 x i32], ptr %123, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = load i32, ptr %3, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [20 x [3 x i32]], ptr %5, i64 0, i64 %129
  %131 = getelementptr inbounds [3 x i32], ptr %130, i64 0, i64 2
  store i32 %127, ptr %131, align 4, !tbaa !5
  %132 = load i32, ptr %3, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %3, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %110, %101
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %14, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %14, align 4, !tbaa !5
  br label %96, !llvm.loop !12

138:                                              ; preds = %100
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %13, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %13, align 4, !tbaa !5
  br label %90, !llvm.loop !13

142:                                              ; preds = %94
  br label %143

143:                                              ; preds = %142, %73
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %170, %143
  %146 = load i32, ptr %15, align 4, !tbaa !5
  %147 = load i32, ptr %3, align 4, !tbaa !5
  %148 = icmp slt i32 %146, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %145
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %173

150:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %165, %150
  %152 = load i32, ptr %16, align 4, !tbaa !5
  %153 = icmp slt i32 %152, 3
  br i1 %153, label %155, label %154

154:                                              ; preds = %151
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %168

155:                                              ; preds = %151
  %156 = load i32, ptr %15, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [20 x [3 x i32]], ptr %5, i64 0, i64 %157
  %159 = load i32, ptr %16, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [3 x i32], ptr %158, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %162)
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %163, ptr noundef @.str.7)
  br label %165

165:                                              ; preds = %155
  %166 = load i32, ptr %16, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %16, align 4, !tbaa !5
  br label %151, !llvm.loop !14

168:                                              ; preds = %154
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %170

170:                                              ; preds = %168
  %171 = load i32, ptr %15, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %15, align 4, !tbaa !5
  br label %145, !llvm.loop !15

173:                                              ; preds = %149
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 240, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 1600, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %174 = load i32, ptr %1, align 4
  ret i32 %174
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #2

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

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

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

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 = { 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 #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 = { "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"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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_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 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [38 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.2 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.7 = 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 [20 x [20 x i32]], align 16
  %2 = alloca [20 x [3 x i32]], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail 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)
  %6 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 1600, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %7 = tail 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)
  %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) %3)
  %9 = 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.2)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  %.pre100 = load i32, ptr %4, align 4, !tbaa !5
  %13 = icmp sgt i32 %.pre100, 0
  %or.cond = select i1 %12, i1 %13, i1 false
  br i1 %or.cond, label %.preheader50, label %.loopexit.thread

.preheader50:                                     ; preds = %0, %._crit_edge
  %14 = phi i32 [ %22, %._crit_edge ], [ %11, %0 ]
  %15 = phi i32 [ %23, %._crit_edge ], [ %.pre100, %0 ]
  %indvars.iv80 = phi i64 [ %17, %._crit_edge ], [ 0, %0 ]
  %.04156 = phi i32 [ %.1.lcssa, %._crit_edge ], [ undef, %0 ]
  %.04255 = phi i32 [ %.143.lcssa, %._crit_edge ], [ undef, %0 ]
  %16 = icmp sgt i32 %15, 0
  %17 = add nuw nsw i64 %indvars.iv80, 1
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader50
  %18 = trunc nuw nsw i64 %17 to i32
  br label %26

._crit_edge58:                                    ; preds = %._crit_edge
  %19 = mul nsw i32 %23, %22
  %20 = sdiv i32 %19, 2
  %21 = icmp sgt i32 %.143.lcssa, %20
  br i1 %21, label %42, label %.loopexit.thread

._crit_edge.loopexit:                             ; preds = %26
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader50, %._crit_edge.loopexit
  %22 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %14, %.preheader50 ]
  %23 = phi i32 [ %39, %._crit_edge.loopexit ], [ %15, %.preheader50 ]
  %.143.lcssa = phi i32 [ %.244, %._crit_edge.loopexit ], [ %.04255, %.preheader50 ]
  %.1.lcssa = phi i32 [ %.2, %._crit_edge.loopexit ], [ %.04156, %.preheader50 ]
  %24 = sext i32 %22 to i64
  %25 = icmp slt i64 %17, %24
  br i1 %25, label %.preheader50, label %._crit_edge58, !llvm.loop !9

26:                                               ; preds = %.lr.ph, %26
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %26 ]
  %.152 = phi i32 [ %.04156, %.lr.ph ], [ %.2, %26 ]
  %.14351 = phi i32 [ %.04255, %.lr.ph ], [ %.244, %26 ]
  %27 = 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.3)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %27, i32 noundef %18)
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @.str.4)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %30 = trunc nuw nsw i64 %indvars.iv.next to i32
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %29, i32 noundef %30)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @.str.5)
  %33 = getelementptr inbounds [20 x [20 x i32]], ptr %1, i64 0, i64 %indvars.iv80, i64 %indvars.iv
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %33)
  %35 = load i32, ptr %33, align 4, !tbaa !5
  %36 = icmp eq i32 %35, 0
  %37 = zext i1 %36 to i32
  %.244 = add nsw i32 %.14351, %37
  %not. = xor i1 %36, true
  %38 = zext i1 %not. to i32
  %.2 = add nsw i32 %.152, %38
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next, %40
  br i1 %41, label %26, label %._crit_edge.loopexit, !llvm.loop !12

42:                                               ; preds = %._crit_edge58
  store i32 %22, ptr %2, align 16, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %23, ptr %43, align 4, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 %.1.lcssa, ptr %44, align 8, !tbaa !5
  %45 = icmp sgt i32 %22, 0
  %46 = icmp sgt i32 %23, 0
  %or.cond109 = and i1 %45, %46
  br i1 %or.cond109, label %.preheader49.us.preheader, label %.loopexit.thread

.preheader49.us.preheader:                        ; preds = %42
  %wide.trip.count89 = zext nneg i32 %22 to i64
  %wide.trip.count = zext nneg i32 %23 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %47 = icmp eq i32 %23, 1
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader49.us

.preheader49.us:                                  ; preds = %.preheader49.us.preheader, %._crit_edge67.us
  %indvars.iv86 = phi i64 [ 0, %.preheader49.us.preheader ], [ %indvars.iv.next87, %._crit_edge67.us ]
  %.04569.us = phi i32 [ 1, %.preheader49.us.preheader ], [ %.247.us.lcssa, %._crit_edge67.us ]
  %48 = trunc nuw nsw i64 %indvars.iv86 to i32
  br i1 %47, label %._crit_edge67.us.unr-lcssa, label %.preheader49.us.new

.preheader49.us.new:                              ; preds = %.preheader49.us, %68
  %indvars.iv83 = phi i64 [ %indvars.iv.next84.1, %68 ], [ 0, %.preheader49.us ]
  %.14664.us = phi i32 [ %.247.us.1, %68 ], [ %.04569.us, %.preheader49.us ]
  %niter = phi i64 [ %niter.next.1, %68 ], [ 0, %.preheader49.us ]
  %49 = getelementptr inbounds [20 x [20 x i32]], ptr %1, i64 0, i64 %indvars.iv86, i64 %indvars.iv83
  %50 = load i32, ptr %49, align 8, !tbaa !5
  %.not.us = icmp eq i32 %50, 0
  br i1 %.not.us, label %58, label %51

51:                                               ; preds = %.preheader49.us.new
  %52 = sext i32 %.14664.us to i64
  %53 = getelementptr inbounds [20 x [3 x i32]], ptr %2, i64 0, i64 %52
  store i32 %48, ptr %53, align 4, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 4
  %55 = trunc nuw nsw i64 %indvars.iv83 to i32
  store i32 %55, ptr %54, align 4, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %53, i64 8
  store i32 %50, ptr %56, align 4, !tbaa !5
  %57 = add nsw i32 %.14664.us, 1
  br label %58

58:                                               ; preds = %51, %.preheader49.us.new
  %.247.us = phi i32 [ %57, %51 ], [ %.14664.us, %.preheader49.us.new ]
  %indvars.iv.next84 = or disjoint i64 %indvars.iv83, 1
  %59 = getelementptr inbounds [20 x [20 x i32]], ptr %1, i64 0, i64 %indvars.iv86, i64 %indvars.iv.next84
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %.not.us.1 = icmp eq i32 %60, 0
  br i1 %.not.us.1, label %68, label %61

61:                                               ; preds = %58
  %62 = sext i32 %.247.us to i64
  %63 = getelementptr inbounds [20 x [3 x i32]], ptr %2, i64 0, i64 %62
  store i32 %48, ptr %63, align 4, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %63, i64 4
  %65 = trunc nuw nsw i64 %indvars.iv.next84 to i32
  store i32 %65, ptr %64, align 4, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %63, i64 8
  store i32 %60, ptr %66, align 4, !tbaa !5
  %67 = add nsw i32 %.247.us, 1
  br label %68

68:                                               ; preds = %61, %58
  %.247.us.1 = phi i32 [ %67, %61 ], [ %.247.us, %58 ]
  %indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 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 %._crit_edge67.us.unr-lcssa, label %.preheader49.us.new, !llvm.loop !13

._crit_edge67.us.unr-lcssa:                       ; preds = %68, %.preheader49.us
  %.247.us.lcssa.ph = phi i32 [ poison, %.preheader49.us ], [ %.247.us.1, %68 ]
  %indvars.iv83.unr = phi i64 [ 0, %.preheader49.us ], [ %indvars.iv.next84.1, %68 ]
  %.14664.us.unr = phi i32 [ %.04569.us, %.preheader49.us ], [ %.247.us.1, %68 ]
  br i1 %lcmp.mod.not, label %._crit_edge67.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge67.us.unr-lcssa
  %69 = getelementptr inbounds [20 x [20 x i32]], ptr %1, i64 0, i64 %indvars.iv86, i64 %indvars.iv83.unr
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %.not.us.epil = icmp eq i32 %70, 0
  br i1 %.not.us.epil, label %._crit_edge67.us, label %71

71:                                               ; preds = %.epil.preheader
  %72 = sext i32 %.14664.us.unr to i64
  %73 = getelementptr inbounds [20 x [3 x i32]], ptr %2, i64 0, i64 %72
  store i32 %48, ptr %73, align 4, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 4
  %75 = trunc nuw nsw i64 %indvars.iv83.unr to i32
  store i32 %75, ptr %74, align 4, !tbaa !5
  %76 = getelementptr inbounds i8, ptr %73, i64 8
  store i32 %70, ptr %76, align 4, !tbaa !5
  %77 = add nsw i32 %.14664.us.unr, 1
  br label %._crit_edge67.us

._crit_edge67.us:                                 ; preds = %.epil.preheader, %71, %._crit_edge67.us.unr-lcssa
  %.247.us.lcssa = phi i32 [ %.247.us.lcssa.ph, %._crit_edge67.us.unr-lcssa ], [ %77, %71 ], [ %.14664.us.unr, %.epil.preheader ]
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %exitcond90.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count89
  br i1 %exitcond90.not, label %.loopexit, label %.preheader49.us, !llvm.loop !14

.loopexit.thread:                                 ; preds = %._crit_edge58, %42, %0
  %78 = 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.6)
  br label %.preheader.preheader

.loopexit:                                        ; preds = %._crit_edge67.us
  %79 = 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.6)
  %80 = icmp sgt i32 %.247.us.lcssa, 0
  br i1 %80, label %.preheader.preheader, label %._crit_edge75

.preheader.preheader:                             ; preds = %.loopexit.thread, %.loopexit
  %.3106 = phi i32 [ 1, %.loopexit.thread ], [ %.247.us.lcssa, %.loopexit ]
  %wide.trip.count98 = zext nneg i32 %.3106 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvars.iv95 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next96, %.preheader ]
  %81 = getelementptr inbounds [20 x [3 x i32]], ptr %2, i64 0, i64 %indvars.iv95, i64 0
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %82)
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %83, ptr noundef nonnull @.str.7)
  %85 = getelementptr inbounds [20 x [3 x i32]], ptr %2, i64 0, i64 %indvars.iv95, i64 1
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %86)
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef nonnull @.str.7)
  %89 = getelementptr inbounds [20 x [3 x i32]], ptr %2, i64 0, i64 %indvars.iv95, i64 2
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %90)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %91, ptr noundef nonnull @.str.7)
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count98
  br i1 %exitcond99.not, label %._crit_edge75, label %.preheader, !llvm.loop !15

._crit_edge75:                                    ; preds = %.preheader, %.loopexit
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 1600, ptr nonnull %1) #5
  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

; 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 #2

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

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 #4

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

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

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 = { 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 #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 = { "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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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