; LLVM IR from abeaumont/competitive-programming :: codeforces/0984 (b)

; 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" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@a = external dso_local global [101 x [101 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@__const.main.y = external hidden unnamed_addr constant [8 x i32], align 16
@__const.main.x = external hidden unnamed_addr constant [8 x i32], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 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 personality ptr @__gxx_personality_v0 {
  %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 %"class.std::__cxx11::basic_string", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca [8 x i32], align 16
  %15 = alloca [8 x i32], align 16
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #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) %2)
  %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) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %80, %0
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %84

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  %28 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %29 unwind label %35

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

30:                                               ; preds = %76, %29
  %31 = load i32, ptr %9, align 4, !tbaa !5
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %39, label %34

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

35:                                               ; preds = %27
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %7, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %8, align 4
  br label %83

39:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #6
  %40 = load i32, ptr %9, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef %41)
          to label %43 unwind label %47

43:                                               ; preds = %39
  %44 = load i8, ptr %42, align 1, !tbaa !9
  store i8 %44, ptr %10, align 1, !tbaa !9
  %45 = load i8, ptr %10, align 1, !tbaa !9
  %46 = sext i8 %45 to i32
  switch i32 %46, label %65 [
    i32 42, label %51
    i32 46, label %58
  ]

47:                                               ; preds = %39
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %7, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %83

51:                                               ; preds = %43
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %53
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [101 x i32], ptr %54, i64 0, i64 %56
  store i32 -1, ptr %57, align 4, !tbaa !5
  br label %75

58:                                               ; preds = %43
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %60
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [101 x i32], ptr %61, i64 0, i64 %63
  store i32 0, ptr %64, align 4, !tbaa !5
  br label %75

65:                                               ; preds = %43
  %66 = load i8, ptr %10, align 1, !tbaa !9
  %67 = sext i8 %66 to i32
  %68 = sub nsw i32 %67, 48
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %70
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [101 x i32], ptr %71, i64 0, i64 %73
  store i32 %68, ptr %74, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %65, %58, %51
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #6
  br label %76

76:                                               ; preds = %75
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %9, align 4, !tbaa !5
  br label %30, !llvm.loop !10

79:                                               ; preds = %34
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #6
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %4, align 4, !tbaa !5
  br label %22, !llvm.loop !12

83:                                               ; preds = %47, %35
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %191

84:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  store i8 1, ptr %11, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %180, %84
  %86 = load i32, ptr %12, align 4, !tbaa !5
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 9, ptr %5, align 4
  br label %183

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

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

95:                                               ; preds = %91
  store i32 12, ptr %5, align 4
  br label %174

96:                                               ; preds = %91
  %97 = load i32, ptr %12, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %98
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [101 x i32], ptr %99, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = icmp eq i32 %103, -1
  br i1 %104, label %105, label %106

105:                                              ; preds = %96
  br label %171

106:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 @__const.main.y, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %15, ptr align 16 @__const.main.x, i64 32, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %153, %106
  %108 = load i32, ptr %17, align 4, !tbaa !5
  %109 = icmp slt i32 %108, 8
  br i1 %109, label %111, label %110

110:                                              ; preds = %107
  store i32 15, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %156

111:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %112 = load i32, ptr %12, align 4, !tbaa !5
  %113 = load i32, ptr %17, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [8 x i32], ptr %14, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = add nsw i32 %112, %116
  store i32 %117, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %118 = load i32, ptr %13, align 4, !tbaa !5
  %119 = load i32, ptr %17, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = add nsw i32 %118, %122
  store i32 %123, ptr %19, align 4, !tbaa !5
  %124 = load i32, ptr %18, align 4, !tbaa !5
  %125 = icmp slt i32 %124, 0
  br i1 %125, label %137, label %126

126:                                              ; preds = %111
  %127 = load i32, ptr %18, align 4, !tbaa !5
  %128 = load i32, ptr %2, align 4, !tbaa !5
  %129 = icmp sge i32 %127, %128
  br i1 %129, label %137, label %130

130:                                              ; preds = %126
  %131 = load i32, ptr %19, align 4, !tbaa !5
  %132 = icmp slt i32 %131, 0
  br i1 %132, label %137, label %133

133:                                              ; preds = %130
  %134 = load i32, ptr %19, align 4, !tbaa !5
  %135 = load i32, ptr %3, align 4, !tbaa !5
  %136 = icmp sge i32 %134, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %133, %130, %126, %111
  store i32 17, ptr %5, align 4
  br label %150

138:                                              ; preds = %133
  %139 = load i32, ptr %18, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %140
  %142 = load i32, ptr %19, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [101 x i32], ptr %141, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = icmp eq i32 %145, -1
  %147 = zext i1 %146 to i32
  %148 = load i32, ptr %16, align 4, !tbaa !5
  %149 = add nsw i32 %148, %147
  store i32 %149, ptr %16, align 4, !tbaa !5
  store i32 0, ptr %5, align 4
  br label %150

150:                                              ; preds = %138, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  %151 = load i32, ptr %5, align 4
  switch i32 %151, label %196 [
    i32 0, label %152
    i32 17, label %153
  ]

152:                                              ; preds = %150
  br label %153

153:                                              ; preds = %152, %150
  %154 = load i32, ptr %17, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %17, align 4, !tbaa !5
  br label %107, !llvm.loop !15

156:                                              ; preds = %110
  %157 = load i32, ptr %16, align 4, !tbaa !5
  %158 = load i32, ptr %12, 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 %13, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [101 x i32], ptr %160, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = icmp ne i32 %157, %164
  br i1 %165, label %166, label %167

166:                                              ; preds = %156
  store i8 0, ptr %11, align 1, !tbaa !13
  store i32 12, ptr %5, align 4
  br label %168

167:                                              ; preds = %156
  store i32 0, ptr %5, align 4
  br label %168

168:                                              ; preds = %167, %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  %169 = load i32, ptr %5, align 4
  switch i32 %169, label %174 [
    i32 0, label %170
  ]

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170, %105
  %172 = load i32, ptr %13, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %13, align 4, !tbaa !5
  br label %91, !llvm.loop !16

174:                                              ; preds = %168, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %175

175:                                              ; preds = %174
  %176 = load i8, ptr %11, align 1, !tbaa !13, !range !17, !noundef !18
  %177 = trunc i8 %176 to i1
  br i1 %177, label %179, label %178

178:                                              ; preds = %175
  store i32 9, ptr %5, align 4
  br label %183

179:                                              ; preds = %175
  br label %180

180:                                              ; preds = %179
  %181 = load i32, ptr %12, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %12, align 4, !tbaa !5
  br label %85, !llvm.loop !19

183:                                              ; preds = %178, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %184

184:                                              ; preds = %183
  %185 = load i8, ptr %11, align 1, !tbaa !13, !range !17, !noundef !18
  %186 = trunc i8 %185 to i1
  %187 = zext i1 %186 to i64
  %188 = select i1 %186, ptr @.str, ptr @.str.1
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef %188)
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %190 = load i32, ptr %1, align 4
  ret i32 %190

191:                                              ; preds = %83
  %192 = load ptr, ptr %7, align 8
  %193 = load i32, ptr %8, align 4
  %194 = insertvalue { ptr, i32 } poison, ptr %192, 0
  %195 = insertvalue { ptr, i32 } %194, i32 %193, 1
  resume { ptr, i32 } %195

196:                                              ; preds = %150
  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: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; 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) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !11}


; 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" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@a = external dso_local local_unnamed_addr global [101 x [101 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@__const.main.y = external hidden unnamed_addr constant [8 x i32], align 16
@__const.main.x = external hidden unnamed_addr constant [8 x i32], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 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 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %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 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph63, label %._crit_edge74

.preheader57:                                     ; preds = %._crit_edge
  %8 = icmp sgt i32 %135, 0
  br i1 %8, label %.preheader56.lr.ph, label %._crit_edge74

.preheader56.lr.ph:                               ; preds = %.preheader57
  %9 = load i32, ptr %2, align 4
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.preheader56.us.preheader, label %._crit_edge74

.preheader56.us.preheader:                        ; preds = %.preheader56.lr.ph
  %11 = zext nneg i32 %135 to i64
  %wide.trip.count = zext nneg i32 %9 to i64
  %12 = load i32, ptr @__const.main.y, align 16
  %13 = load i32, ptr @__const.main.x, align 16
  %14 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.y, i64 4), align 4
  %15 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.x, i64 4), align 4
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.y, i64 8), align 8
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.x, i64 8), align 8
  %18 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.y, i64 12), align 4
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.x, i64 12), align 4
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.y, i64 16), align 16
  %21 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.x, i64 16), align 16
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.y, i64 20), align 4
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.x, i64 20), align 4
  %24 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.y, i64 24), align 8
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.x, i64 24), align 8
  %26 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.y, i64 28), align 4
  %27 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.x, i64 28), align 4
  br label %.preheader56.us

.preheader56.us:                                  ; preds = %.preheader56.us.preheader, %._crit_edge68.us
  %indvars.iv91 = phi i64 [ 0, %.preheader56.us.preheader ], [ %indvars.iv.next92, %._crit_edge68.us ]
  %28 = trunc nuw nsw i64 %indvars.iv91 to i32
  %29 = add nsw i32 %12, %28
  %30 = zext nneg i32 %29 to i64
  %31 = add nsw i32 %14, %28
  %32 = zext nneg i32 %31 to i64
  %33 = add nsw i32 %16, %28
  %34 = zext nneg i32 %33 to i64
  %35 = add nsw i32 %18, %28
  %36 = zext nneg i32 %35 to i64
  %37 = add nsw i32 %20, %28
  %38 = zext nneg i32 %37 to i64
  %39 = add nsw i32 %22, %28
  %40 = zext nneg i32 %39 to i64
  %41 = add nsw i32 %24, %28
  %42 = zext nneg i32 %41 to i64
  %43 = add nsw i32 %26, %28
  %44 = zext nneg i32 %43 to i64
  %45 = icmp ult i32 %29, %135
  %46 = icmp ult i32 %31, %135
  %47 = icmp ult i32 %33, %135
  %48 = icmp ult i32 %35, %135
  %49 = icmp ult i32 %37, %135
  %50 = icmp ult i32 %39, %135
  %51 = icmp ult i32 %41, %135
  %52 = icmp ult i32 %43, %135
  br label %53

53:                                               ; preds = %.preheader56.us, %131
  %indvars.iv88 = phi i64 [ 0, %.preheader56.us ], [ %indvars.iv.next89, %131 ]
  %54 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv91, i64 %indvars.iv88
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp eq i32 %55, -1
  br i1 %56, label %131, label %.preheader.us.preheader

.preheader.us.preheader:                          ; preds = %53
  %57 = trunc nuw nsw i64 %indvars.iv88 to i32
  %58 = add nsw i32 %13, %57
  %59 = icmp ult i32 %58, %9
  %or.cond99 = select i1 %45, i1 %59, i1 false
  br i1 %or.cond99, label %61, label %.preheader.us.1

._crit_edge68.us:                                 ; preds = %131
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %60 = icmp ult i64 %indvars.iv.next92, %11
  br i1 %60, label %.preheader56.us, label %._crit_edge74, !llvm.loop !9

61:                                               ; preds = %.preheader.us.preheader
  %62 = zext nneg i32 %58 to i64
  %63 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %30, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp eq i32 %64, -1
  %66 = zext i1 %65 to i32
  br label %.preheader.us.1

.preheader.us.1:                                  ; preds = %61, %.preheader.us.preheader
  %.1.us = phi i32 [ %66, %61 ], [ 0, %.preheader.us.preheader ]
  %67 = add nsw i32 %15, %57
  %68 = icmp ult i32 %67, %9
  %or.cond100 = select i1 %46, i1 %68, i1 false
  br i1 %or.cond100, label %69, label %.preheader.us.2

69:                                               ; preds = %.preheader.us.1
  %70 = zext nneg i32 %67 to i64
  %71 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %32, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp eq i32 %72, -1
  %74 = zext i1 %73 to i32
  %75 = add nuw nsw i32 %.1.us, %74
  br label %.preheader.us.2

.preheader.us.2:                                  ; preds = %69, %.preheader.us.1
  %.1.us.1 = phi i32 [ %75, %69 ], [ %.1.us, %.preheader.us.1 ]
  %76 = add nsw i32 %17, %57
  %77 = icmp ult i32 %76, %9
  %or.cond101 = select i1 %47, i1 %77, i1 false
  br i1 %or.cond101, label %78, label %.preheader.us.3

78:                                               ; preds = %.preheader.us.2
  %79 = zext nneg i32 %76 to i64
  %80 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %34, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp eq i32 %81, -1
  %83 = zext i1 %82 to i32
  %84 = add nuw nsw i32 %.1.us.1, %83
  br label %.preheader.us.3

.preheader.us.3:                                  ; preds = %78, %.preheader.us.2
  %.1.us.2 = phi i32 [ %84, %78 ], [ %.1.us.1, %.preheader.us.2 ]
  %85 = add nsw i32 %19, %57
  %86 = icmp ult i32 %85, %9
  %or.cond102 = select i1 %48, i1 %86, i1 false
  br i1 %or.cond102, label %87, label %.preheader.us.4

87:                                               ; preds = %.preheader.us.3
  %88 = zext nneg i32 %85 to i64
  %89 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %36, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp eq i32 %90, -1
  %92 = zext i1 %91 to i32
  %93 = add nuw nsw i32 %.1.us.2, %92
  br label %.preheader.us.4

.preheader.us.4:                                  ; preds = %87, %.preheader.us.3
  %.1.us.3 = phi i32 [ %93, %87 ], [ %.1.us.2, %.preheader.us.3 ]
  %94 = add nsw i32 %21, %57
  %95 = icmp ult i32 %94, %9
  %or.cond103 = select i1 %49, i1 %95, i1 false
  br i1 %or.cond103, label %96, label %.preheader.us.5

96:                                               ; preds = %.preheader.us.4
  %97 = zext nneg i32 %94 to i64
  %98 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %38, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp eq i32 %99, -1
  %101 = zext i1 %100 to i32
  %102 = add nuw nsw i32 %.1.us.3, %101
  br label %.preheader.us.5

.preheader.us.5:                                  ; preds = %96, %.preheader.us.4
  %.1.us.4 = phi i32 [ %102, %96 ], [ %.1.us.3, %.preheader.us.4 ]
  %103 = add nsw i32 %23, %57
  %104 = icmp ult i32 %103, %9
  %or.cond104 = select i1 %50, i1 %104, i1 false
  br i1 %or.cond104, label %105, label %.preheader.us.6

105:                                              ; preds = %.preheader.us.5
  %106 = zext nneg i32 %103 to i64
  %107 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %40, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp eq i32 %108, -1
  %110 = zext i1 %109 to i32
  %111 = add nuw nsw i32 %.1.us.4, %110
  br label %.preheader.us.6

.preheader.us.6:                                  ; preds = %105, %.preheader.us.5
  %.1.us.5 = phi i32 [ %111, %105 ], [ %.1.us.4, %.preheader.us.5 ]
  %112 = add nsw i32 %25, %57
  %113 = icmp ult i32 %112, %9
  %or.cond105 = select i1 %51, i1 %113, i1 false
  br i1 %or.cond105, label %114, label %.preheader.us.7

114:                                              ; preds = %.preheader.us.6
  %115 = zext nneg i32 %112 to i64
  %116 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %42, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = icmp eq i32 %117, -1
  %119 = zext i1 %118 to i32
  %120 = add nuw nsw i32 %.1.us.5, %119
  br label %.preheader.us.7

.preheader.us.7:                                  ; preds = %114, %.preheader.us.6
  %.1.us.6 = phi i32 [ %120, %114 ], [ %.1.us.5, %.preheader.us.6 ]
  %121 = add nsw i32 %27, %57
  %122 = icmp ult i32 %121, %9
  %or.cond106 = select i1 %52, i1 %122, i1 false
  br i1 %or.cond106, label %123, label %130

123:                                              ; preds = %.preheader.us.7
  %124 = zext nneg i32 %121 to i64
  %125 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %44, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = icmp eq i32 %126, -1
  %128 = zext i1 %127 to i32
  %129 = add nuw nsw i32 %.1.us.6, %128
  br label %130

130:                                              ; preds = %123, %.preheader.us.7
  %.1.us.7 = phi i32 [ %129, %123 ], [ %.1.us.6, %.preheader.us.7 ]
  %.not.us = icmp eq i32 %.1.us.7, %55
  br i1 %.not.us, label %131, label %._crit_edge74

131:                                              ; preds = %130, %53
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge68.us, label %53, !llvm.loop !11

.lr.ph63:                                         ; preds = %0, %._crit_edge
  %indvars.iv82 = phi i64 [ %indvars.iv.next83, %._crit_edge ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  %132 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %.preheader58 unwind label %138

.preheader58:                                     ; preds = %.lr.ph63
  %133 = load i32, ptr %2, align 4, !tbaa !5
  %134 = icmp sgt i32 %133, 0
  br i1 %134, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %146, %.preheader58
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %135 = load i32, ptr %1, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = icmp slt i64 %indvars.iv.next83, %136
  br i1 %137, label %.lr.ph63, label %.preheader57, !llvm.loop !12

138:                                              ; preds = %.lr.ph63
  %139 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  resume { ptr, i32 } %139

.lr.ph:                                           ; preds = %.preheader58, %146
  %indvars.iv = phi i64 [ %indvars.iv.next, %146 ], [ 0, %.preheader58 ]
  %140 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %indvars.iv)
  %141 = load i8, ptr %140, align 1, !tbaa !13
  switch i8 %141, label %143 [
    i8 42, label %146
    i8 46, label %142
  ]

142:                                              ; preds = %.lr.ph
  br label %146

143:                                              ; preds = %.lr.ph
  %144 = sext i8 %141 to i32
  %145 = add nsw i32 %144, -48
  br label %146

146:                                              ; preds = %.lr.ph, %143, %142
  %.sink = phi i32 [ %145, %143 ], [ 0, %142 ], [ -1, %.lr.ph ]
  %147 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %indvars.iv82, i64 %indvars.iv
  store i32 %.sink, ptr %147, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %148 = load i32, ptr %2, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = icmp slt i64 %indvars.iv.next, %149
  br i1 %150, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge74:                                    ; preds = %._crit_edge68.us, %130, %0, %.preheader56.lr.ph, %.preheader57
  %.5 = phi ptr [ @.str, %.preheader57 ], [ @.str, %.preheader56.lr.ph ], [ @.str, %0 ], [ @.str.1, %130 ], [ @.str, %._crit_edge68.us ]
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, 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

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 nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #3 align 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: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 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 #4

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 = { 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}


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