; LLVM IR from kazunetakahashi/atcoder :: 2019/0611_ABC129 (D)

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@H = external dso_local global i32, align 4
@W = external dso_local global i32, align 4
@_Z1SB5cxx11 = external dso_local global [100010 x %"class.std::__cxx11::basic_string"], align 16
@X = external dso_local global [2010 x [2010 x i32]], align 16
@Y = external dso_local global [2010 x [2010 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 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) #0

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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
  %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
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %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) @H)
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 4 dereferenceable(4) @W)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %34, %0
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = load i32, ptr @H, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %37

29:                                               ; preds = %24
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %31
  %33 = call 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) %32)
  br label %34

34:                                               ; preds = %29
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !5
  br label %24, !llvm.loop !9

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

38:                                               ; preds = %110, %37
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = load i32, ptr @H, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

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

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

44:                                               ; preds = %85, %43
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = load i32, ptr @W, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

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

49:                                               ; preds = %44
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %51
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %52, i64 noundef %54)
  %56 = load i8, ptr %55, align 1, !tbaa !11
  %57 = sext i8 %56 to i32
  %58 = icmp eq i32 %57, 46
  br i1 %58, label %59, label %62

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

62:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sub nsw i32 %63, 1
  store i32 %64, ptr %7, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %80, %62
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = sub nsw i32 %67, %68
  %70 = icmp sge i32 %66, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %65
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %83

72:                                               ; preds = %65
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [2010 x [2010 x i32]], ptr @X, i64 0, i64 %75
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [2010 x i32], ptr %76, i64 0, i64 %78
  store i32 %73, ptr %79, align 4, !tbaa !5
  br label %80

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

83:                                               ; preds = %71
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %83, %59
  br label %85

85:                                               ; preds = %84
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %6, align 4, !tbaa !5
  br label %44, !llvm.loop !13

88:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %89 = load i32, ptr @W, align 4, !tbaa !5
  %90 = sub nsw i32 %89, 1
  store i32 %90, ptr %8, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %106, %88
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = load i32, ptr @W, align 4, !tbaa !5
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = sub nsw i32 %93, %94
  %96 = icmp sge i32 %92, %95
  br i1 %96, label %98, label %97

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

98:                                               ; preds = %91
  %99 = load i32, ptr %5, align 4, !tbaa !5
  %100 = load i32, ptr %3, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [2010 x [2010 x i32]], ptr @X, i64 0, i64 %101
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [2010 x i32], ptr %102, i64 0, i64 %104
  store i32 %99, ptr %105, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %98
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr %8, align 4, !tbaa !5
  br label %91, !llvm.loop !14

109:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %3, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %3, align 4, !tbaa !5
  br label %38, !llvm.loop !15

113:                                              ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %186, %113
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = load i32, ptr @W, align 4, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %189

119:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %120

120:                                              ; preds = %161, %119
  %121 = load i32, ptr %11, align 4, !tbaa !5
  %122 = load i32, ptr @H, align 4, !tbaa !5
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %164

125:                                              ; preds = %120
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %127
  %129 = load i32, ptr %9, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %128, i64 noundef %130)
  %132 = load i8, ptr %131, align 1, !tbaa !11
  %133 = sext i8 %132 to i32
  %134 = icmp eq i32 %133, 46
  br i1 %134, label %135, label %138

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

138:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %139 = load i32, ptr %11, align 4, !tbaa !5
  %140 = sub nsw i32 %139, 1
  store i32 %140, ptr %12, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %156, %138
  %142 = load i32, ptr %12, align 4, !tbaa !5
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = load i32, ptr %10, align 4, !tbaa !5
  %145 = sub nsw i32 %143, %144
  %146 = icmp sge i32 %142, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %141
  store i32 23, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %159

148:                                              ; preds = %141
  %149 = load i32, ptr %10, align 4, !tbaa !5
  %150 = load i32, ptr %12, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [2010 x [2010 x i32]], ptr @Y, i64 0, i64 %151
  %153 = load i32, ptr %9, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [2010 x i32], ptr %152, i64 0, i64 %154
  store i32 %149, ptr %155, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %148
  %157 = load i32, ptr %12, align 4, !tbaa !5
  %158 = add nsw i32 %157, -1
  store i32 %158, ptr %12, align 4, !tbaa !5
  br label %141, !llvm.loop !16

159:                                              ; preds = %147
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %159, %135
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %11, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %11, align 4, !tbaa !5
  br label %120, !llvm.loop !17

164:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %165 = load i32, ptr @H, align 4, !tbaa !5
  %166 = sub nsw i32 %165, 1
  store i32 %166, ptr %13, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %182, %164
  %168 = load i32, ptr %13, align 4, !tbaa !5
  %169 = load i32, ptr @H, align 4, !tbaa !5
  %170 = load i32, ptr %10, align 4, !tbaa !5
  %171 = sub nsw i32 %169, %170
  %172 = icmp sge i32 %168, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %167
  store i32 26, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %185

174:                                              ; preds = %167
  %175 = load i32, ptr %10, align 4, !tbaa !5
  %176 = load i32, ptr %13, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [2010 x [2010 x i32]], ptr @Y, i64 0, i64 %177
  %179 = load i32, ptr %9, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [2010 x i32], ptr %178, i64 0, i64 %180
  store i32 %175, ptr %181, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %174
  %183 = load i32, ptr %13, align 4, !tbaa !5
  %184 = add nsw i32 %183, -1
  store i32 %184, ptr %13, align 4, !tbaa !5
  br label %167, !llvm.loop !18

185:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %9, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %9, align 4, !tbaa !5
  br label %114, !llvm.loop !19

189:                                              ; preds = %118
  %190 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.6)
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %190, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %217, %189
  %193 = load i32, ptr %14, align 4, !tbaa !5
  %194 = load i32, ptr @H, align 4, !tbaa !5
  %195 = icmp slt i32 %193, %194
  br i1 %195, label %197, label %196

196:                                              ; preds = %192
  store i32 29, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %220

197:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %212, %197
  %199 = load i32, ptr %15, align 4, !tbaa !5
  %200 = load i32, ptr @W, align 4, !tbaa !5
  %201 = icmp slt i32 %199, %200
  br i1 %201, label %203, label %202

202:                                              ; preds = %198
  store i32 32, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %215

203:                                              ; preds = %198
  %204 = load i32, ptr %14, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [2010 x [2010 x i32]], ptr @X, i64 0, i64 %205
  %207 = load i32, ptr %15, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [2010 x i32], ptr %206, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, i32 noundef %210)
  br label %212

212:                                              ; preds = %203
  %213 = load i32, ptr %15, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %15, align 4, !tbaa !5
  br label %198, !llvm.loop !20

215:                                              ; preds = %202
  %216 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %217

217:                                              ; preds = %215
  %218 = load i32, ptr %14, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %14, align 4, !tbaa !5
  br label %192, !llvm.loop !21

220:                                              ; preds = %196
  %221 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.7)
  %222 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %221, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %248, %220
  %224 = load i32, ptr %16, align 4, !tbaa !5
  %225 = load i32, ptr @H, align 4, !tbaa !5
  %226 = icmp slt i32 %224, %225
  br i1 %226, label %228, label %227

227:                                              ; preds = %223
  store i32 35, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %251

228:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %229

229:                                              ; preds = %243, %228
  %230 = load i32, ptr %17, align 4, !tbaa !5
  %231 = load i32, ptr @W, align 4, !tbaa !5
  %232 = icmp slt i32 %230, %231
  br i1 %232, label %234, label %233

233:                                              ; preds = %229
  store i32 38, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %246

234:                                              ; preds = %229
  %235 = load i32, ptr %16, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [2010 x [2010 x i32]], ptr @Y, i64 0, i64 %236
  %238 = load i32, ptr %17, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [2010 x i32], ptr %237, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, i32 noundef %241)
  br label %243

243:                                              ; preds = %234
  %244 = load i32, ptr %17, align 4, !tbaa !5
  %245 = add nsw i32 %244, 1
  store i32 %245, ptr %17, align 4, !tbaa !5
  br label %229, !llvm.loop !22

246:                                              ; preds = %233
  %247 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %248

248:                                              ; preds = %246
  %249 = load i32, ptr %16, align 4, !tbaa !5
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %16, align 4, !tbaa !5
  br label %223, !llvm.loop !23

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

252:                                              ; preds = %286, %251
  %253 = load i32, ptr %19, align 4, !tbaa !5
  %254 = load i32, ptr @H, align 4, !tbaa !5
  %255 = icmp slt i32 %253, %254
  br i1 %255, label %257, label %256

256:                                              ; preds = %252
  store i32 41, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %289

257:                                              ; preds = %252
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %258

258:                                              ; preds = %282, %257
  %259 = load i32, ptr %20, align 4, !tbaa !5
  %260 = load i32, ptr @W, align 4, !tbaa !5
  %261 = icmp slt i32 %259, %260
  br i1 %261, label %263, label %262

262:                                              ; preds = %258
  store i32 44, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %285

263:                                              ; preds = %258
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %264 = load i32, ptr %19, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [2010 x [2010 x i32]], ptr @X, i64 0, i64 %265
  %267 = load i32, ptr %20, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [2010 x i32], ptr %266, i64 0, i64 %268
  %270 = load i32, ptr %269, align 4, !tbaa !5
  %271 = load i32, ptr %19, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [2010 x [2010 x i32]], ptr @Y, i64 0, i64 %272
  %274 = load i32, ptr %20, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [2010 x i32], ptr %273, i64 0, i64 %275
  %277 = load i32, ptr %276, align 4, !tbaa !5
  %278 = add nsw i32 %270, %277
  %279 = sub nsw i32 %278, 1
  store i32 %279, ptr %21, align 4, !tbaa !5
  %280 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %281 = load i32, ptr %280, align 4, !tbaa !5
  store i32 %281, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %282

282:                                              ; preds = %263
  %283 = load i32, ptr %20, align 4, !tbaa !5
  %284 = add nsw i32 %283, 1
  store i32 %284, ptr %20, align 4, !tbaa !5
  br label %258, !llvm.loop !24

285:                                              ; preds = %262
  br label %286

286:                                              ; preds = %285
  %287 = load i32, ptr %19, align 4, !tbaa !5
  %288 = add nsw i32 %287, 1
  store i32 %288, ptr %19, align 4, !tbaa !5
  br label %252, !llvm.loop !25

289:                                              ; preds = %256
  %290 = load i32, ptr %18, align 4, !tbaa !5
  %291 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %290)
  %292 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %291, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  %293 = load i32, ptr %1, align 4
  ret i32 %293
}

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { 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 #6 = { 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 #7 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !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::__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] }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@H = external dso_local global i32, align 4
@W = external dso_local global i32, align 4
@_Z1SB5cxx11 = external dso_local global [100010 x %"class.std::__cxx11::basic_string"], align 16
@X = external dso_local local_unnamed_addr global [2010 x [2010 x i32]], align 16
@Y = external dso_local local_unnamed_addr global [2010 x [2010 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 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 #0

; 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 #1 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)) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @H)
  %4 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) @W)
  %5 = load i32, ptr @H, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %.preheader98.thread

.preheader98.thread:                              ; preds = %0
  %.pre189190 = load i32, ptr @W, align 4, !tbaa !5
  br label %.preheader93

.preheader98:                                     ; preds = %.lr.ph
  %7 = icmp sgt i32 %10, 0
  %.pre189 = load i32, ptr @W, align 4, !tbaa !5
  br i1 %7, label %.preheader97, label %.preheader93

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %8 = getelementptr inbounds [100010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %indvars.iv
  %9 = tail call 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) %8)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = load i32, ptr @H, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = icmp slt i64 %indvars.iv.next, %11
  br i1 %12, label %.lr.ph, label %.preheader98, !llvm.loop !9

.preheader97:                                     ; preds = %.preheader98, %._crit_edge
  %13 = phi i32 [ %51, %._crit_edge ], [ %.pre189, %.preheader98 ]
  %indvars.iv156 = phi i64 [ %indvars.iv.next157, %._crit_edge ], [ 0, %.preheader98 ]
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph107, label %._crit_edge

.lr.ph107:                                        ; preds = %.preheader97
  %15 = getelementptr inbounds [100010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %indvars.iv156
  br label %30

.preheader93:                                     ; preds = %._crit_edge, %.preheader98.thread, %.preheader98
  %16 = phi i32 [ %10, %.preheader98 ], [ %5, %.preheader98.thread ], [ %52, %._crit_edge ]
  %17 = phi i32 [ %.pre189, %.preheader98 ], [ %.pre189190, %.preheader98.thread ], [ %51, %._crit_edge ]
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.preheader92, label %._crit_edge127

.preheader96:                                     ; preds = %.loopexit95
  %.not.not86109 = icmp sgt i32 %.180, 0
  br i1 %.not.not86109, label %.lr.ph111, label %._crit_edge

.lr.ph111:                                        ; preds = %.preheader96
  %19 = sub nsw i32 %48, %.180
  %20 = sext i32 %48 to i64
  %21 = sext i32 %19 to i64
  %22 = add nsw i64 %20, -1
  %smin = tail call i64 @llvm.smin.i64(i64 %21, i64 %22)
  %23 = sub i64 %20, %smin
  %min.iters.check = icmp ult i64 %23, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph111
  %indvars.iv153.ph = phi i64 [ %20, %.lr.ph111 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph111
  %n.vec = and i64 %23, -8
  %ind.end = sub i64 %20, %n.vec
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.180, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %24 = xor i64 %index, -1
  %25 = add i64 %24, %20
  %26 = getelementptr inbounds [2010 x [2010 x i32]], ptr @X, i64 0, i64 %indvars.iv156, i64 %25
  %27 = getelementptr inbounds i8, ptr %26, i64 -12
  %28 = getelementptr inbounds i8, ptr %26, i64 -28
  store <4 x i32> %broadcast.splat, ptr %27, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat, ptr %28, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %29 = icmp eq i64 %index.next, %n.vec
  br i1 %29, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %23, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

30:                                               ; preds = %.lr.ph107, %.loopexit95
  %indvars.iv147 = phi i64 [ 0, %.lr.ph107 ], [ %indvars.iv.next148, %.loopexit95 ]
  %.079104 = phi i32 [ 0, %.lr.ph107 ], [ %.180, %.loopexit95 ]
  %31 = add nsw i64 %indvars.iv147, -1
  %32 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %15, i64 noundef %indvars.iv147)
  %33 = load i8, ptr %32, align 1, !tbaa !14
  %34 = icmp eq i8 %33, 46
  br i1 %34, label %45, label %.preheader94

.preheader94:                                     ; preds = %30
  %.not.not87101 = icmp sgt i32 %.079104, 0
  br i1 %.not.not87101, label %.lr.ph103.preheader, label %.loopexit95

.lr.ph103.preheader:                              ; preds = %.preheader94
  %35 = trunc nuw nsw i64 %indvars.iv147 to i32
  %36 = sub nsw i32 %35, %.079104
  %37 = sext i32 %36 to i64
  %smin213 = tail call i64 @llvm.smin.i64(i64 %31, i64 %37)
  %38 = sub i64 %indvars.iv147, %smin213
  %min.iters.check216 = icmp ult i64 %38, 8
  br i1 %min.iters.check216, label %.lr.ph103.preheader235, label %vector.ph217

.lr.ph103.preheader235:                           ; preds = %middle.block214, %.lr.ph103.preheader
  %indvars.iv149.ph = phi i64 [ %indvars.iv147, %.lr.ph103.preheader ], [ %ind.end220, %middle.block214 ]
  br label %.lr.ph103

vector.ph217:                                     ; preds = %.lr.ph103.preheader
  %n.vec219 = and i64 %38, -8
  %ind.end220 = sub i64 %indvars.iv147, %n.vec219
  %broadcast.splatinsert225 = insertelement <4 x i32> poison, i32 %.079104, i64 0
  %broadcast.splat226 = shufflevector <4 x i32> %broadcast.splatinsert225, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body222

vector.body222:                                   ; preds = %vector.body222, %vector.ph217
  %index223 = phi i64 [ 0, %vector.ph217 ], [ %index.next229, %vector.body222 ]
  %39 = xor i64 %index223, -1
  %40 = add i64 %indvars.iv147, %39
  %41 = getelementptr inbounds [2010 x [2010 x i32]], ptr @X, i64 0, i64 %indvars.iv156, i64 %40
  %42 = getelementptr inbounds i8, ptr %41, i64 -12
  %43 = getelementptr inbounds i8, ptr %41, i64 -28
  store <4 x i32> %broadcast.splat226, ptr %42, align 4, !tbaa !5
  store <4 x i32> %broadcast.splat226, ptr %43, align 4, !tbaa !5
  %index.next229 = add nuw i64 %index223, 8
  %44 = icmp eq i64 %index.next229, %n.vec219
  br i1 %44, label %middle.block214, label %vector.body222, !llvm.loop !15

middle.block214:                                  ; preds = %vector.body222
  %cmp.n230 = icmp eq i64 %38, %n.vec219
  br i1 %cmp.n230, label %.loopexit95, label %.lr.ph103.preheader235

45:                                               ; preds = %30
  %46 = add nsw i32 %.079104, 1
  br label %.loopexit95

.lr.ph103:                                        ; preds = %.lr.ph103.preheader235, %.lr.ph103
  %indvars.iv149 = phi i64 [ %indvars.iv.next150, %.lr.ph103 ], [ %indvars.iv149.ph, %.lr.ph103.preheader235 ]
  %indvars.iv.next150 = add nsw i64 %indvars.iv149, -1
  %47 = getelementptr inbounds [2010 x [2010 x i32]], ptr @X, i64 0, i64 %indvars.iv156, i64 %indvars.iv.next150
  store i32 %.079104, ptr %47, align 4, !tbaa !5
  %.not.not87 = icmp sgt i64 %indvars.iv.next150, %37
  br i1 %.not.not87, label %.lr.ph103, label %.loopexit95, !llvm.loop !16

.loopexit95:                                      ; preds = %.lr.ph103, %middle.block214, %.preheader94, %45
  %.180 = phi i32 [ %46, %45 ], [ 0, %.preheader94 ], [ 0, %middle.block214 ], [ 0, %.lr.ph103 ]
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %48 = load i32, ptr @W, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = icmp slt i64 %indvars.iv.next148, %49
  br i1 %50, label %30, label %.preheader96, !llvm.loop !17

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %.preheader97, %.preheader96
  %51 = phi i32 [ %48, %.preheader96 ], [ %13, %.preheader97 ], [ %48, %middle.block ], [ %48, %scalar.ph ]
  %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
  %52 = load i32, ptr @H, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = icmp slt i64 %indvars.iv.next157, %53
  br i1 %54, label %.preheader97, label %.preheader93, !llvm.loop !18

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv153 = phi i64 [ %indvars.iv.next154, %scalar.ph ], [ %indvars.iv153.ph, %scalar.ph.preheader ]
  %indvars.iv.next154 = add nsw i64 %indvars.iv153, -1
  %55 = getelementptr inbounds [2010 x [2010 x i32]], ptr @X, i64 0, i64 %indvars.iv156, i64 %indvars.iv.next154
  store i32 %.180, ptr %55, align 4, !tbaa !5
  %.not.not86 = icmp sgt i64 %indvars.iv.next154, %21
  br i1 %.not.not86, label %scalar.ph, label %._crit_edge, !llvm.loop !19

.preheader92:                                     ; preds = %.preheader93, %._crit_edge125
  %56 = phi i32 [ %78, %._crit_edge125 ], [ %16, %.preheader93 ]
  %indvars.iv168 = phi i64 [ %indvars.iv.next169, %._crit_edge125 ], [ 0, %.preheader93 ]
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph119, label %._crit_edge125

._crit_edge127:                                   ; preds = %._crit_edge125, %.preheader93
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.6)
  %59 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %60 = load i32, ptr @H, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %.preheader89, label %._crit_edge132

.preheader91:                                     ; preds = %.loopexit
  %.not.not122 = icmp sgt i32 %.1, 0
  br i1 %.not.not122, label %.lr.ph124, label %._crit_edge125

.lr.ph124:                                        ; preds = %.preheader91
  %62 = sub nsw i32 %75, %.1
  %63 = sext i32 %75 to i64
  %64 = sext i32 %62 to i64
  br label %82

.lr.ph119:                                        ; preds = %.preheader92, %.loopexit
  %indvars.iv159 = phi i64 [ %indvars.iv.next160, %.loopexit ], [ 0, %.preheader92 ]
  %.074116 = phi i32 [ %.1, %.loopexit ], [ 0, %.preheader92 ]
  %65 = getelementptr inbounds [100010 x %"class.std::__cxx11::basic_string"], ptr @_Z1SB5cxx11, i64 0, i64 %indvars.iv159
  %66 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %65, i64 noundef %indvars.iv168)
  %67 = load i8, ptr %66, align 1, !tbaa !14
  %68 = icmp eq i8 %67, 46
  br i1 %68, label %72, label %.preheader90

.preheader90:                                     ; preds = %.lr.ph119
  %.not.not85113 = icmp sgt i32 %.074116, 0
  br i1 %.not.not85113, label %.lr.ph115.preheader, label %.loopexit

.lr.ph115.preheader:                              ; preds = %.preheader90
  %69 = trunc nuw nsw i64 %indvars.iv159 to i32
  %70 = sub nsw i32 %69, %.074116
  %71 = sext i32 %70 to i64
  br label %.lr.ph115

72:                                               ; preds = %.lr.ph119
  %73 = add nsw i32 %.074116, 1
  br label %.loopexit

.lr.ph115:                                        ; preds = %.lr.ph115.preheader, %.lr.ph115
  %indvars.iv161 = phi i64 [ %indvars.iv159, %.lr.ph115.preheader ], [ %indvars.iv.next162, %.lr.ph115 ]
  %indvars.iv.next162 = add nsw i64 %indvars.iv161, -1
  %74 = getelementptr inbounds [2010 x [2010 x i32]], ptr @Y, i64 0, i64 %indvars.iv.next162, i64 %indvars.iv168
  store i32 %.074116, ptr %74, align 4, !tbaa !5
  %.not.not85 = icmp sgt i64 %indvars.iv.next162, %71
  br i1 %.not.not85, label %.lr.ph115, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %.lr.ph115, %.preheader90, %72
  %.1 = phi i32 [ %73, %72 ], [ 0, %.preheader90 ], [ 0, %.lr.ph115 ]
  %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
  %75 = load i32, ptr @H, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next160, %76
  br i1 %77, label %.lr.ph119, label %.preheader91, !llvm.loop !21

._crit_edge125:                                   ; preds = %82, %.preheader92, %.preheader91
  %78 = phi i32 [ %75, %.preheader91 ], [ %56, %.preheader92 ], [ %75, %82 ]
  %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
  %79 = load i32, ptr @W, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = icmp slt i64 %indvars.iv.next169, %80
  br i1 %81, label %.preheader92, label %._crit_edge127, !llvm.loop !22

82:                                               ; preds = %.lr.ph124, %82
  %indvars.iv165 = phi i64 [ %63, %.lr.ph124 ], [ %indvars.iv.next166, %82 ]
  %indvars.iv.next166 = add nsw i64 %indvars.iv165, -1
  %83 = getelementptr inbounds [2010 x [2010 x i32]], ptr @Y, i64 0, i64 %indvars.iv.next166, i64 %indvars.iv168
  store i32 %.1, ptr %83, align 4, !tbaa !5
  %.not.not = icmp sgt i64 %indvars.iv.next166, %64
  br i1 %.not.not, label %82, label %._crit_edge125, !llvm.loop !23

.preheader89:                                     ; preds = %._crit_edge127, %._crit_edge130
  %indvars.iv174 = phi i64 [ %indvars.iv.next175, %._crit_edge130 ], [ 0, %._crit_edge127 ]
  %84 = load i32, ptr @W, align 4, !tbaa !5
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %.lr.ph129, label %._crit_edge130

._crit_edge132:                                   ; preds = %._crit_edge130, %._crit_edge127
  %86 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.7)
  %87 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %88 = load i32, ptr @H, align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 0
  br i1 %89, label %.preheader88, label %._crit_edge137.thread

._crit_edge137.thread:                            ; preds = %._crit_edge132
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %._crit_edge142

._crit_edge130:                                   ; preds = %.lr.ph129, %.preheader89
  %90 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1
  %91 = load i32, ptr @H, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = icmp slt i64 %indvars.iv.next175, %92
  br i1 %93, label %.preheader89, label %._crit_edge132, !llvm.loop !24

.lr.ph129:                                        ; preds = %.preheader89, %.lr.ph129
  %indvars.iv171 = phi i64 [ %indvars.iv.next172, %.lr.ph129 ], [ 0, %.preheader89 ]
  %94 = getelementptr inbounds [2010 x [2010 x i32]], ptr @X, i64 0, i64 %indvars.iv174, i64 %indvars.iv171
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, i32 noundef %95)
  %indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
  %97 = load i32, ptr @W, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = icmp slt i64 %indvars.iv.next172, %98
  br i1 %99, label %.lr.ph129, label %._crit_edge130, !llvm.loop !25

.preheader88:                                     ; preds = %._crit_edge132, %._crit_edge135
  %indvars.iv180 = phi i64 [ %indvars.iv.next181, %._crit_edge135 ], [ 0, %._crit_edge132 ]
  %100 = load i32, ptr @W, align 4, !tbaa !5
  %101 = icmp sgt i32 %100, 0
  br i1 %101, label %.lr.ph134, label %._crit_edge135

._crit_edge137:                                   ; preds = %._crit_edge135
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 0, ptr %1, align 4, !tbaa !5
  %102 = icmp sgt i32 %106, 0
  %103 = load i32, ptr @W, align 4
  %104 = icmp sgt i32 %103, 0
  %or.cond = select i1 %102, i1 %104, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge142

._crit_edge135:                                   ; preds = %.lr.ph134, %.preheader88
  %105 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
  %106 = load i32, ptr @H, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = icmp slt i64 %indvars.iv.next181, %107
  br i1 %108, label %.preheader88, label %._crit_edge137, !llvm.loop !26

.lr.ph134:                                        ; preds = %.preheader88, %.lr.ph134
  %indvars.iv177 = phi i64 [ %indvars.iv.next178, %.lr.ph134 ], [ 0, %.preheader88 ]
  %109 = getelementptr inbounds [2010 x [2010 x i32]], ptr @Y, i64 0, i64 %indvars.iv180, i64 %indvars.iv177
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, i32 noundef %110)
  %indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1
  %112 = load i32, ptr @W, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = icmp slt i64 %indvars.iv.next178, %113
  br i1 %114, label %.lr.ph134, label %._crit_edge135, !llvm.loop !27

.preheader:                                       ; preds = %._crit_edge137, %._crit_edge140
  %115 = phi i32 [ %122, %._crit_edge140 ], [ 0, %._crit_edge137 ]
  %116 = phi i32 [ %123, %._crit_edge140 ], [ %106, %._crit_edge137 ]
  %117 = phi i32 [ %124, %._crit_edge140 ], [ %103, %._crit_edge137 ]
  %indvars.iv186 = phi i64 [ %indvars.iv.next187, %._crit_edge140 ], [ 0, %._crit_edge137 ]
  %118 = icmp sgt i32 %117, 0
  br i1 %118, label %.lr.ph139, label %._crit_edge140

._crit_edge142:                                   ; preds = %._crit_edge140, %._crit_edge137.thread, %._crit_edge137
  %119 = phi i32 [ 0, %._crit_edge137 ], [ 0, %._crit_edge137.thread ], [ %122, %._crit_edge140 ]
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %119)
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0

._crit_edge140.loopexit:                          ; preds = %.lr.ph139
  %.pre = load i32, ptr @H, align 4, !tbaa !5
  br label %._crit_edge140

._crit_edge140:                                   ; preds = %._crit_edge140.loopexit, %.preheader
  %122 = phi i32 [ %134, %._crit_edge140.loopexit ], [ %115, %.preheader ]
  %123 = phi i32 [ %.pre, %._crit_edge140.loopexit ], [ %116, %.preheader ]
  %124 = phi i32 [ %135, %._crit_edge140.loopexit ], [ %117, %.preheader ]
  %indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1
  %125 = sext i32 %123 to i64
  %126 = icmp slt i64 %indvars.iv.next187, %125
  br i1 %126, label %.preheader, label %._crit_edge142, !llvm.loop !28

.lr.ph139:                                        ; preds = %.preheader, %.lr.ph139
  %indvars.iv183 = phi i64 [ %indvars.iv.next184, %.lr.ph139 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %127 = getelementptr inbounds [2010 x [2010 x i32]], ptr @X, i64 0, i64 %indvars.iv186, i64 %indvars.iv183
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = getelementptr inbounds [2010 x [2010 x i32]], ptr @Y, i64 0, i64 %indvars.iv186, i64 %indvars.iv183
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = add i32 %128, -1
  %132 = add i32 %131, %130
  store i32 %132, ptr %2, align 4, !tbaa !5
  %133 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %134 = load i32, ptr %133, align 4, !tbaa !5
  store i32 %134, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
  %135 = load i32, ptr @W, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = icmp slt i64 %indvars.iv.next184, %136
  br i1 %137, label %.lr.ph139, label %._crit_edge140.loopexit, !llvm.loop !30
}

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #7

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10, !12, !13}
!16 = distinct !{!16, !10, !13, !12}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !13, !12}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10, !29}
!29 = !{!"llvm.loop.unswitch.partial.disable"}
!30 = distinct !{!30, !10}


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