; LLVM IR from abeaumont/competitive-programming :: uva (00108)

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

@a = external dso_local global [101 x [101 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %12 = 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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %100, %0
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %103

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

19:                                               ; preds = %96, %18
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %99

24:                                               ; preds = %19
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %26
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [101 x i32], ptr %27, i64 0, i64 %29
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %30)
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %51

34:                                               ; preds = %24
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = sub nsw i32 %35, 1
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %37
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [101 x i32], ptr %38, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [101 x i32], ptr %45, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %49, %42
  store i32 %50, ptr %48, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %34, %24
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %71

54:                                               ; preds = %51
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %56
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = sub nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [101 x i32], ptr %57, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %64
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [101 x i32], ptr %65, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %69, %62
  store i32 %70, ptr %68, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %54, %51
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %95

74:                                               ; preds = %71
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %95

77:                                               ; preds = %74
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = sub nsw i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %80
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [101 x i32], ptr %81, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %3, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %88
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [101 x i32], ptr %89, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = sub nsw i32 %93, %86
  store i32 %94, ptr %92, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %77, %74, %71
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %5, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %5, align 4, !tbaa !5
  br label %19, !llvm.loop !9

99:                                               ; preds = %23
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %3, align 4, !tbaa !5
  br label %13, !llvm.loop !11

103:                                              ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 -1295527, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %201, %103
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = load i32, ptr %2, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 1
  %108 = icmp slt i32 %105, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %104
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %204

110:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %197, %110
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = sub nsw i32 %113, 1
  %115 = icmp slt i32 %112, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %111
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %200

117:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %9, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %193, %117
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = load i32, ptr %2, align 4, !tbaa !5
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %196

125:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %126 = load i32, ptr %8, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %10, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %189, %125
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = load i32, ptr %2, align 4, !tbaa !5
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %192

133:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %135
  %137 = load i32, ptr %10, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [101 x i32], ptr %136, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  store i32 %140, ptr %11, align 4, !tbaa !5
  %141 = load i32, ptr %7, align 4, !tbaa !5
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %154

143:                                              ; preds = %133
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 1
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %146
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [101 x i32], ptr %147, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = sub nsw i32 %152, %151
  store i32 %153, ptr %11, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %143, %133
  %155 = load i32, ptr %8, align 4, !tbaa !5
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %168

157:                                              ; preds = %154
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %159
  %161 = load i32, ptr %8, align 4, !tbaa !5
  %162 = sub nsw i32 %161, 1
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [101 x i32], ptr %160, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = load i32, ptr %11, align 4, !tbaa !5
  %167 = sub nsw i32 %166, %165
  store i32 %167, ptr %11, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %157, %154
  %169 = load i32, ptr %7, align 4, !tbaa !5
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %186

171:                                              ; preds = %168
  %172 = load i32, ptr %8, align 4, !tbaa !5
  %173 = icmp ne i32 %172, 0
  br i1 %173, label %174, label %186

174:                                              ; preds = %171
  %175 = load i32, ptr %7, align 4, !tbaa !5
  %176 = sub nsw i32 %175, 1
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %177
  %179 = load i32, ptr %8, align 4, !tbaa !5
  %180 = sub nsw i32 %179, 1
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [101 x i32], ptr %178, i64 0, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = load i32, ptr %11, align 4, !tbaa !5
  %185 = add nsw i32 %184, %183
  store i32 %185, ptr %11, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %174, %171, %168
  %187 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %188 = load i32, ptr %187, align 4, !tbaa !5
  store i32 %188, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %189

189:                                              ; preds = %186
  %190 = load i32, ptr %10, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %10, align 4, !tbaa !5
  br label %128, !llvm.loop !12

192:                                              ; preds = %132
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %9, align 4, !tbaa !5
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %9, align 4, !tbaa !5
  br label %120, !llvm.loop !13

196:                                              ; preds = %124
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %8, align 4, !tbaa !5
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %8, align 4, !tbaa !5
  br label %111, !llvm.loop !14

200:                                              ; preds = %116
  br label %201

201:                                              ; preds = %200
  %202 = load i32, ptr %7, align 4, !tbaa !5
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %7, align 4, !tbaa !5
  br label %104, !llvm.loop !15

204:                                              ; preds = %109
  %205 = load i32, ptr %6, align 4, !tbaa !5
  %206 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %205)
  %207 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %206, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %208 = load i32, ptr %1, align 4
  ret i32 %208
}

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 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) #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)) #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 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 #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 = { 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 #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}
!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_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" }

@a = external dso_local global [101 x [101 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.preheader58, label %._crit_edge61.thread

._crit_edge61.thread:                             ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 -1295527, ptr %2, align 4, !tbaa !5
  br label %._crit_edge74

.preheader58:                                     ; preds = %0, %._crit_edge
  %7 = phi i32 [ %38, %._crit_edge ], [ %5, %0 ]
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %._crit_edge ], [ 0, %0 ]
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader58
  %.not = icmp eq i64 %indvars.iv92, 0
  %9 = add nsw i64 %indvars.iv92, -1
  br i1 %.not, label %.thread.peel, label %.thread.us.peel

.thread.us.peel:                                  ; preds = %.lr.ph
  %10 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv92, i64 0
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %12 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %9, i64 0
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = load i32, ptr %10, align 4, !tbaa !5
  %15 = add nsw i32 %14, %13
  store i32 %15, ptr %10, align 4, !tbaa !5
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 1
  br i1 %17, label %.thread.us, label %._crit_edge

.thread.peel:                                     ; preds = %.lr.ph
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @a)
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 1
  br i1 %20, label %.thread, label %._crit_edge

.thread.us:                                       ; preds = %.thread.us.peel, %.thread.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %.thread.us ], [ 1, %.thread.us.peel ]
  %21 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv92, i64 %indvars.iv
  %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) %21)
  %23 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %9, i64 %indvars.iv
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = load i32, ptr %21, align 4, !tbaa !5
  %26 = add nsw i32 %25, %24
  %27 = add nsw i64 %indvars.iv, -1
  %28 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv92, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %26, %29
  %31 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %9, i64 %27
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sub nsw i32 %30, %32
  store i32 %33, ptr %21, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next, %35
  br i1 %36, label %.thread.us, label %._crit_edge, !llvm.loop !9

._crit_edge61:                                    ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 -1295527, ptr %2, align 4, !tbaa !5
  %37 = icmp sgt i32 %38, 1
  br i1 %37, label %.preheader57, label %._crit_edge74

._crit_edge:                                      ; preds = %.thread.us, %.thread, %.thread.us.peel, %.thread.peel, %.preheader58
  %38 = phi i32 [ %7, %.preheader58 ], [ %19, %.thread.peel ], [ %16, %.thread.us.peel ], [ %48, %.thread ], [ %34, %.thread.us ]
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %39 = sext i32 %38 to i64
  %40 = icmp slt i64 %indvars.iv.next93, %39
  br i1 %40, label %.preheader58, label %._crit_edge61, !llvm.loop !12

.thread:                                          ; preds = %.thread.peel, %.thread
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %.thread ], [ 1, %.thread.peel ]
  %41 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 0, i64 %indvars.iv88
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %41)
  %43 = add nsw i64 %indvars.iv88, -1
  %44 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr %41, align 4, !tbaa !5
  %47 = add nsw i32 %46, %45
  store i32 %47, ptr %41, align 4, !tbaa !5
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %48 = load i32, ptr %1, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next89, %49
  br i1 %50, label %.thread, label %._crit_edge, !llvm.loop !14

.preheader57:                                     ; preds = %._crit_edge61, %._crit_edge72
  %51 = phi i32 [ %70, %._crit_edge72 ], [ -1295527, %._crit_edge61 ]
  %52 = phi i32 [ %71, %._crit_edge72 ], [ %38, %._crit_edge61 ]
  %indvars.iv115 = phi i64 [ %54, %._crit_edge72 ], [ 0, %._crit_edge61 ]
  %indvars.iv106 = phi i64 [ %indvars.iv.next107, %._crit_edge72 ], [ 1, %._crit_edge61 ]
  %53 = icmp sgt i32 %52, 1
  %54 = add nuw nsw i64 %indvars.iv115, 1
  br i1 %53, label %.preheader56.lr.ph, label %._crit_edge72

.preheader56.lr.ph:                               ; preds = %.preheader57
  %.not77 = icmp eq i64 %indvars.iv115, 0
  %55 = add nsw i64 %indvars.iv115, -1
  %56 = zext nneg i32 %52 to i64
  %57 = icmp ult i64 %54, %56
  br i1 %57, label %.preheader56, label %._crit_edge72

._crit_edge74:                                    ; preds = %._crit_edge72, %._crit_edge61.thread, %._crit_edge61
  %58 = phi i32 [ -1295527, %._crit_edge61 ], [ -1295527, %._crit_edge61.thread ], [ %70, %._crit_edge72 ]
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %58)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.preheader56:                                     ; preds = %.preheader56.lr.ph, %._crit_edge70
  %61 = phi i32 [ %115, %._crit_edge70 ], [ %51, %.preheader56.lr.ph ]
  %62 = phi i32 [ %116, %._crit_edge70 ], [ %52, %.preheader56.lr.ph ]
  %63 = phi i32 [ %117, %._crit_edge70 ], [ %52, %.preheader56.lr.ph ]
  %indvars.iv111 = phi i64 [ %66, %._crit_edge70 ], [ 0, %.preheader56.lr.ph ]
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %._crit_edge70 ], [ 1, %.preheader56.lr.ph ]
  %64 = sext i32 %63 to i64
  %65 = icmp slt i64 %54, %64
  %66 = add nuw nsw i64 %indvars.iv111, 1
  br i1 %65, label %.preheader.lr.ph, label %._crit_edge70

.preheader.lr.ph:                                 ; preds = %.preheader56
  %.not78 = icmp eq i64 %indvars.iv111, 0
  %67 = add nsw i64 %indvars.iv111, -1
  %68 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %55, i64 %67
  %69 = icmp slt i64 %66, %64
  br i1 %69, label %.preheader, label %._crit_edge70

._crit_edge72:                                    ; preds = %._crit_edge70, %.preheader57, %.preheader56.lr.ph
  %70 = phi i32 [ %51, %.preheader56.lr.ph ], [ %51, %.preheader57 ], [ %115, %._crit_edge70 ]
  %71 = phi i32 [ %52, %.preheader56.lr.ph ], [ %52, %.preheader57 ], [ %116, %._crit_edge70 ]
  %72 = add nsw i32 %71, -1
  %73 = sext i32 %72 to i64
  %74 = icmp slt i64 %54, %73
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  br i1 %74, label %.preheader57, label %._crit_edge74, !llvm.loop !15

.loopexit:                                        ; preds = %.thread54.us, %.thread54.us66, %.thread54, %.preheader
  %75 = phi i32 [ %81, %.preheader ], [ %124, %.thread54 ], [ %111, %.thread54.us66 ], [ %101, %.thread54.us ]
  %76 = phi i32 [ %82, %.preheader ], [ %125, %.thread54 ], [ %112, %.thread54.us66 ], [ %102, %.thread54.us ]
  %77 = phi i32 [ %83, %.preheader ], [ %125, %.thread54 ], [ %112, %.thread54.us66 ], [ %102, %.thread54.us ]
  %78 = phi i32 [ %84, %.preheader ], [ %125, %.thread54 ], [ %112, %.thread54.us66 ], [ %102, %.thread54.us ]
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %79 = trunc nuw i64 %indvars.iv.next109 to i32
  %80 = icmp sgt i32 %78, %79
  br i1 %80, label %.preheader, label %._crit_edge70, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.lr.ph, %.loopexit
  %81 = phi i32 [ %75, %.loopexit ], [ %61, %.preheader.lr.ph ]
  %82 = phi i32 [ %76, %.loopexit ], [ %62, %.preheader.lr.ph ]
  %83 = phi i32 [ %77, %.loopexit ], [ %63, %.preheader.lr.ph ]
  %84 = phi i32 [ %78, %.loopexit ], [ %63, %.preheader.lr.ph ]
  %indvars.iv108 = phi i64 [ %indvars.iv.next109, %.loopexit ], [ %indvars.iv106, %.preheader.lr.ph ]
  %85 = sext i32 %84 to i64
  %86 = icmp slt i64 %66, %85
  br i1 %86, label %.lr.ph64, label %.loopexit

.lr.ph64:                                         ; preds = %.preheader
  %87 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv108, i64 %67
  br i1 %.not78, label %.lr.ph64.split, label %.lr.ph64.split.us

.lr.ph64.split.us:                                ; preds = %.lr.ph64, %.thread54.us
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %.thread54.us ], [ %indvars.iv95, %.lr.ph64 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %88 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv108, i64 %indvars.iv97
  %89 = load i32, ptr %88, align 4, !tbaa !5
  br i1 %.not77, label %.thread54.us.critedge, label %90

90:                                               ; preds = %.lr.ph64.split.us
  %91 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %55, i64 %indvars.iv97
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = load i32, ptr %87, align 4, !tbaa !5
  %94 = add i32 %92, %93
  %95 = sub i32 %89, %94
  %96 = load i32, ptr %68, align 4, !tbaa !5
  %97 = add nsw i32 %95, %96
  br label %.thread54.us

.thread54.us.critedge:                            ; preds = %.lr.ph64.split.us
  %98 = load i32, ptr %87, align 4, !tbaa !5
  %99 = sub nsw i32 %89, %98
  br label %.thread54.us

.thread54.us:                                     ; preds = %.thread54.us.critedge, %90
  %storemerge = phi i32 [ %99, %.thread54.us.critedge ], [ %97, %90 ]
  store i32 %storemerge, ptr %3, align 4, !tbaa !5
  %100 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %101 = load i32, ptr %100, align 4, !tbaa !5
  store i32 %101, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %102 = load i32, ptr %1, align 4, !tbaa !5
  %103 = trunc nuw i64 %indvars.iv.next98 to i32
  %104 = icmp sgt i32 %102, %103
  br i1 %104, label %.lr.ph64.split.us, label %.loopexit, !llvm.loop !17

.lr.ph64.split:                                   ; preds = %.lr.ph64
  br i1 %.not77, label %.thread54, label %.thread54.us66

.thread54.us66:                                   ; preds = %.lr.ph64.split, %.thread54.us66
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %.thread54.us66 ], [ %indvars.iv95, %.lr.ph64.split ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %105 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv108, i64 %indvars.iv100
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %55, i64 %indvars.iv100
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = sub nsw i32 %106, %108
  store i32 %109, ptr %3, align 4, !tbaa !5
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %111 = load i32, ptr %110, align 4, !tbaa !5
  store i32 %111, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %112 = load i32, ptr %1, align 4, !tbaa !5
  %113 = trunc nuw i64 %indvars.iv.next101 to i32
  %114 = icmp sgt i32 %112, %113
  br i1 %114, label %.thread54.us66, label %.loopexit, !llvm.loop !17

._crit_edge70:                                    ; preds = %.loopexit, %.preheader56, %.preheader.lr.ph
  %115 = phi i32 [ %61, %.preheader.lr.ph ], [ %61, %.preheader56 ], [ %75, %.loopexit ]
  %116 = phi i32 [ %62, %.preheader.lr.ph ], [ %62, %.preheader56 ], [ %76, %.loopexit ]
  %117 = phi i32 [ %63, %.preheader.lr.ph ], [ %63, %.preheader56 ], [ %77, %.loopexit ]
  %118 = add nsw i32 %117, -1
  %119 = sext i32 %118 to i64
  %120 = icmp slt i64 %66, %119
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  br i1 %120, label %.preheader56, label %._crit_edge72, !llvm.loop !18

.thread54:                                        ; preds = %.lr.ph64.split, %.thread54
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %.thread54 ], [ %indvars.iv95, %.lr.ph64.split ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %121 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv108, i64 %indvars.iv103
  %122 = load i32, ptr %121, align 4, !tbaa !5
  store i32 %122, ptr %3, align 4, !tbaa !5
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %124 = load i32, ptr %123, align 4, !tbaa !5
  store i32 %124, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %125 = load i32, ptr %1, align 4, !tbaa !5
  %126 = trunc nuw i64 %indvars.iv.next104 to i32
  %127 = icmp sgt i32 %125, %126
  br i1 %127, label %.thread54, label %.loopexit, !llvm.loop !17
}

; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) 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 #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 #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)) #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 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 #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 = { 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 #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !10, !11}
!15 = distinct !{!15, !10, !13}
!16 = distinct !{!16, !10, !13}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !13}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass