; LLVM IR from upupming/algorithm :: acwing/算法竞赛进阶指南/0x49-总结与练习/259. 真正的骗子 (main)

; 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::__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" }
%"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" }

@sz = external dso_local global [3030 x i32], align 16
@dp = external dso_local global [610 x [610 x i32]], align 16
@tot = external dso_local global i32, align 4
@vis = external dso_local global [3030 x i32], align 16
@good = external dso_local global [3030 x i32], align 16
@bad = external dso_local global [3030 x i32], align 16
@n = external dso_local global i32, align 4
@p1 = external dso_local global i32, align 4
@p2 = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3geti(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5mergeii(i32 noundef, i32 noundef) #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
  store i32 0, ptr %1, align 4
  br label %11

11:                                               ; preds = %329, %212, %0
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) @p1)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) @p2)
  %15 = load i32, ptr @p2, align 4, !tbaa !5
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %331

17:                                               ; preds = %11
  call void @_Z4initv()
  %18 = load i32, ptr @p1, align 4, !tbaa !5
  %19 = load i32, ptr @p2, align 4, !tbaa !5
  %20 = add nsw i32 %18, %19
  store i32 %20, ptr @m, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %53, %17
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %21
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @x)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) @y)
  %29 = 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) %28, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %30 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef 0)
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = sext i8 %31 to i32
  %33 = icmp eq i32 %32, 121
  br i1 %33, label %34, label %43

34:                                               ; preds = %26
  %35 = load i32, ptr @x, align 4, !tbaa !5
  %36 = load i32, ptr @y, align 4, !tbaa !5
  call void @_Z5mergeii(i32 noundef %35, i32 noundef %36)
  %37 = load i32, ptr @x, align 4, !tbaa !5
  %38 = load i32, ptr @m, align 4, !tbaa !5
  %39 = add nsw i32 %37, %38
  %40 = load i32, ptr @y, align 4, !tbaa !5
  %41 = load i32, ptr @m, align 4, !tbaa !5
  %42 = add nsw i32 %40, %41
  call void @_Z5mergeii(i32 noundef %39, i32 noundef %42)
  br label %52

43:                                               ; preds = %26
  %44 = load i32, ptr @x, align 4, !tbaa !5
  %45 = load i32, ptr @y, align 4, !tbaa !5
  %46 = load i32, ptr @m, align 4, !tbaa !5
  %47 = add nsw i32 %45, %46
  call void @_Z5mergeii(i32 noundef %44, i32 noundef %47)
  %48 = load i32, ptr @x, align 4, !tbaa !5
  %49 = load i32, ptr @m, align 4, !tbaa !5
  %50 = add nsw i32 %48, %49
  %51 = load i32, ptr @y, align 4, !tbaa !5
  call void @_Z5mergeii(i32 noundef %50, i32 noundef %51)
  br label %52

52:                                               ; preds = %43, %34
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !10

56:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %114, %56
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = load i32, ptr @m, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %117

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = call noundef i32 @_Z3geti(i32 noundef %63)
  store i32 %64, ptr %5, align 4, !tbaa !5
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = icmp ne i32 %65, %66
  br i1 %67, label %68, label %69

68:                                               ; preds = %62
  store i32 9, ptr %4, align 4
  br label %111

69:                                               ; preds = %62
  %70 = load i32, ptr @tot, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr @tot, align 4, !tbaa !5
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = load i32, ptr @m, align 4, !tbaa !5
  %74 = add nsw i32 %72, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [3030 x i32], ptr @vis, i64 0, i64 %75
  store i32 %71, ptr %76, align 4, !tbaa !5
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [3030 x i32], ptr @vis, i64 0, i64 %78
  store i32 %71, ptr %79, align 4, !tbaa !5
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [3030 x i32], ptr @sz, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = load i32, ptr @tot, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %85
  store i32 %83, ptr %86, align 4, !tbaa !5
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = load i32, ptr @m, align 4, !tbaa !5
  %89 = add nsw i32 %87, %88
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [3030 x i32], ptr @sz, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = load i32, ptr @tot, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %94
  store i32 %92, ptr %95, align 4, !tbaa !5
  %96 = load i32, ptr %3, align 4, !tbaa !5
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %96)
  %98 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %97, ptr noundef @.str)
  %99 = load i32, ptr @tot, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %98, i32 noundef %102)
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef @.str)
  %105 = load i32, ptr @tot, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %104, i32 noundef %108)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %109, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %4, align 4
  br label %111

111:                                              ; preds = %69, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  %112 = load i32, ptr %4, align 4
  switch i32 %112, label %332 [
    i32 0, label %113
    i32 9, label %114
  ]

113:                                              ; preds = %111
  br label %114

114:                                              ; preds = %113, %111
  %115 = load i32, ptr %3, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %3, align 4, !tbaa !5
  br label %57, !llvm.loop !12

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

118:                                              ; preds = %200, %117
  %119 = load i32, ptr %6, align 4, !tbaa !5
  %120 = load i32, ptr @tot, align 4, !tbaa !5
  %121 = icmp sle i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %203

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %125
  %127 = load i32, ptr %6, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %128
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %126, ptr noundef nonnull align 4 dereferenceable(4) %129)
  %131 = load i32, ptr %130, align 4, !tbaa !5
  store i32 %131, ptr %7, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %196, %123
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = load i32, ptr @p1, align 4, !tbaa !5
  %135 = icmp sle i32 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 13, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %199

137:                                              ; preds = %132
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = icmp sge i32 %138, %142
  br i1 %143, label %144, label %166

144:                                              ; preds = %137
  %145 = load i32, ptr %6, align 4, !tbaa !5
  %146 = sub nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %147
  %149 = load i32, ptr %7, align 4, !tbaa !5
  %150 = load i32, ptr %6, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = sub nsw i32 %149, %153
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [610 x i32], ptr %148, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = load i32, ptr %6, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %159
  %161 = load i32, ptr %7, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [610 x i32], ptr %160, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = add nsw i32 %164, %157
  store i32 %165, ptr %163, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %144, %137
  %167 = load i32, ptr %7, align 4, !tbaa !5
  %168 = load i32, ptr %6, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = icmp sge i32 %167, %171
  br i1 %172, label %173, label %195

173:                                              ; preds = %166
  %174 = load i32, ptr %6, align 4, !tbaa !5
  %175 = sub nsw i32 %174, 1
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %176
  %178 = load i32, ptr %7, align 4, !tbaa !5
  %179 = load i32, ptr %6, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = sub nsw i32 %178, %182
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [610 x i32], ptr %177, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = load i32, ptr %6, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %188
  %190 = load i32, ptr %7, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [610 x i32], ptr %189, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = add nsw i32 %193, %186
  store i32 %194, ptr %192, align 4, !tbaa !5
  br label %195

195:                                              ; preds = %173, %166
  br label %196

196:                                              ; preds = %195
  %197 = load i32, ptr %7, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %7, align 4, !tbaa !5
  br label %132, !llvm.loop !13

199:                                              ; preds = %136
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %6, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %6, align 4, !tbaa !5
  br label %118, !llvm.loop !14

203:                                              ; preds = %122
  %204 = load i32, ptr @tot, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %205
  %207 = load i32, ptr @x, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [610 x i32], ptr %206, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = icmp ne i32 %210, 1
  br i1 %211, label %212, label %214

212:                                              ; preds = %203
  %213 = call i32 @puts(ptr noundef @.str.2)
  br label %11, !llvm.loop !15

214:                                              ; preds = %203
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %215 = load i32, ptr @tot, align 4, !tbaa !5
  store i32 %215, ptr %8, align 4, !tbaa !5
  br label %216

216:                                              ; preds = %272, %214
  %217 = load i32, ptr %8, align 4, !tbaa !5
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %220, label %219

219:                                              ; preds = %216
  store i32 16, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %275

220:                                              ; preds = %216
  %221 = load i32, ptr %8, align 4, !tbaa !5
  %222 = sub nsw i32 %221, 1
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %223
  %225 = load i32, ptr @x, align 4, !tbaa !5
  %226 = load i32, ptr %8, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !5
  %230 = sub nsw i32 %225, %229
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [610 x i32], ptr %224, i64 0, i64 %231
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = icmp ne i32 %233, 0
  br i1 %234, label %235, label %245

235:                                              ; preds = %220
  %236 = load i32, ptr %8, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = load i32, ptr @p1, align 4, !tbaa !5
  %241 = sub nsw i32 %240, %239
  store i32 %241, ptr @p1, align 4, !tbaa !5
  %242 = load i32, ptr %8, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %243
  store i32 -1, ptr %244, align 4, !tbaa !5
  br label %271

245:                                              ; preds = %220
  %246 = load i32, ptr %8, align 4, !tbaa !5
  %247 = sub nsw i32 %246, 1
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %248
  %250 = load i32, ptr @x, align 4, !tbaa !5
  %251 = load i32, ptr %8, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = sub nsw i32 %250, %254
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [610 x i32], ptr %249, i64 0, i64 %256
  %258 = load i32, ptr %257, align 4, !tbaa !5
  %259 = icmp ne i32 %258, 0
  br i1 %259, label %260, label %270

260:                                              ; preds = %245
  %261 = load i32, ptr %8, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !5
  %265 = load i32, ptr @p1, align 4, !tbaa !5
  %266 = sub nsw i32 %265, %264
  store i32 %266, ptr @p1, align 4, !tbaa !5
  %267 = load i32, ptr %8, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %268
  store i32 -2, ptr %269, align 4, !tbaa !5
  br label %270

270:                                              ; preds = %260, %245
  br label %271

271:                                              ; preds = %270, %235
  br label %272

272:                                              ; preds = %271
  %273 = load i32, ptr %8, align 4, !tbaa !5
  %274 = add nsw i32 %273, -1
  store i32 %274, ptr %8, align 4, !tbaa !5
  br label %216, !llvm.loop !16

275:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %276 = call noundef i32 @_Z3geti(i32 noundef 1)
  store i32 %276, ptr %10, align 4, !tbaa !5
  br label %277

277:                                              ; preds = %325, %275
  %278 = load i32, ptr %9, align 4, !tbaa !5
  %279 = load i32, ptr @m, align 4, !tbaa !5
  %280 = icmp sle i32 %278, %279
  br i1 %280, label %282, label %281

281:                                              ; preds = %277
  store i32 19, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %329

282:                                              ; preds = %277
  %283 = load i32, ptr %10, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [3030 x i32], ptr @vis, i64 0, i64 %284
  %286 = load i32, ptr %285, align 4, !tbaa !5
  %287 = icmp ne i32 %286, 0
  br i1 %287, label %288, label %324

288:                                              ; preds = %282
  %289 = load i32, ptr %10, align 4, !tbaa !5
  %290 = load i32, ptr @m, align 4, !tbaa !5
  %291 = icmp sgt i32 %289, %290
  br i1 %291, label %292, label %305

292:                                              ; preds = %288
  %293 = load i32, ptr %9, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [3030 x i32], ptr @vis, i64 0, i64 %294
  %296 = load i32, ptr %295, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %297
  %299 = load i32, ptr %298, align 4, !tbaa !5
  %300 = icmp eq i32 %299, -2
  br i1 %300, label %301, label %305

301:                                              ; preds = %292
  %302 = load i32, ptr %9, align 4, !tbaa !5
  %303 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %302)
  %304 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %303, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %323

305:                                              ; preds = %292, %288
  %306 = load i32, ptr %10, align 4, !tbaa !5
  %307 = load i32, ptr @m, align 4, !tbaa !5
  %308 = icmp sle i32 %306, %307
  br i1 %308, label %309, label %322

309:                                              ; preds = %305
  %310 = load i32, ptr %9, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [3030 x i32], ptr @vis, i64 0, i64 %311
  %313 = load i32, ptr %312, align 4, !tbaa !5
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %314
  %316 = load i32, ptr %315, align 4, !tbaa !5
  %317 = icmp eq i32 %316, -1
  br i1 %317, label %318, label %322

318:                                              ; preds = %309
  %319 = load i32, ptr %9, align 4, !tbaa !5
  %320 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %319)
  %321 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %320, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %322

322:                                              ; preds = %318, %309, %305
  br label %323

323:                                              ; preds = %322, %301
  br label %324

324:                                              ; preds = %323, %282
  br label %325

325:                                              ; preds = %324
  %326 = load i32, ptr %9, align 4, !tbaa !5
  %327 = add nsw i32 %326, 1
  store i32 %327, ptr %9, align 4, !tbaa !5
  %328 = call noundef i32 @_Z3geti(i32 noundef %327)
  store i32 %328, ptr %10, align 4, !tbaa !5
  br label %277, !llvm.loop !17

329:                                              ; preds = %281
  %330 = call i32 @puts(ptr noundef @.str.3)
  br label %11, !llvm.loop !15

331:                                              ; preds = %11
  ret i32 0

332:                                              ; preds = %111
  unreachable
}

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) #0 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) #5

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

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

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

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

declare i32 @puts(ptr noundef) #4

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { 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 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !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::__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" }
%"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" }

@sz = external dso_local local_unnamed_addr global [3030 x i32], align 16
@dp = external dso_local local_unnamed_addr global [610 x [610 x i32]], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@vis = external dso_local local_unnamed_addr global [3030 x i32], align 16
@good = external dso_local global [3030 x i32], align 16
@bad = external dso_local global [3030 x i32], align 16
@n = external dso_local global i32, align 4
@p1 = external dso_local global i32, align 4
@p2 = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3geti(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5mergeii(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = 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) @n)
  %2 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) @p1)
  %3 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) @p2)
  %4 = load i32, ptr @p2, align 4, !tbaa !5
  %.not100 = icmp eq i32 %4, 0
  br i1 %.not100, label %._crit_edge103, label %.lr.ph102

.lr.ph102:                                        ; preds = %0, %.backedge
  tail call void @_Z4initv()
  %5 = load i32, ptr @p1, align 4, !tbaa !5
  %6 = load i32, ptr @p2, align 4, !tbaa !5
  %7 = add nsw i32 %6, %5
  store i32 %7, ptr @m, align 4, !tbaa !5
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %.not6278 = icmp slt i32 %8, 1
  br i1 %.not6278, label %.preheader77, label %.lr.ph

.preheader77.loopexit:                            ; preds = %31
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %.preheader77

.preheader77:                                     ; preds = %.preheader77.loopexit, %.lr.ph102
  %9 = phi i32 [ %.pre, %.preheader77.loopexit ], [ %7, %.lr.ph102 ]
  %.not6380 = icmp slt i32 %9, 1
  br i1 %.not6380, label %.preheader76, label %.lr.ph82

.lr.ph:                                           ; preds = %.lr.ph102, %31
  %.05579 = phi i32 [ %32, %31 ], [ 1, %.lr.ph102 ]
  %10 = 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) @x)
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) @y)
  %12 = 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) %11, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %13 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef 0)
  %14 = load i8, ptr %13, align 1, !tbaa !9
  %15 = icmp eq i8 %14, 121
  %16 = load i32, ptr @x, align 4, !tbaa !5
  %17 = load i32, ptr @y, align 4, !tbaa !5
  br i1 %15, label %18, label %24

18:                                               ; preds = %.lr.ph
  tail call void @_Z5mergeii(i32 noundef %16, i32 noundef %17)
  %19 = load i32, ptr @x, align 4, !tbaa !5
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = add nsw i32 %20, %19
  %22 = load i32, ptr @y, align 4, !tbaa !5
  %23 = add nsw i32 %22, %20
  tail call void @_Z5mergeii(i32 noundef %21, i32 noundef %23)
  br label %31

24:                                               ; preds = %.lr.ph
  %25 = load i32, ptr @m, align 4, !tbaa !5
  %26 = add nsw i32 %25, %17
  tail call void @_Z5mergeii(i32 noundef %16, i32 noundef %26)
  %27 = load i32, ptr @x, align 4, !tbaa !5
  %28 = load i32, ptr @m, align 4, !tbaa !5
  %29 = add nsw i32 %28, %27
  %30 = load i32, ptr @y, align 4, !tbaa !5
  tail call void @_Z5mergeii(i32 noundef %29, i32 noundef %30)
  br label %31

31:                                               ; preds = %18, %24
  %32 = add nuw nsw i32 %.05579, 1
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %.not62.not = icmp slt i32 %.05579, %33
  br i1 %.not62.not, label %.lr.ph, label %.preheader77.loopexit, !llvm.loop !10

.preheader76:                                     ; preds = %66, %.preheader77
  %34 = load i32, ptr @tot, align 4, !tbaa !5
  %.not6486 = icmp slt i32 %34, 1
  br i1 %.not6486, label %.preheader76.._crit_edge89_crit_edge, label %.lr.ph88

.preheader76.._crit_edge89_crit_edge:             ; preds = %.preheader76
  %.pre115 = sext i32 %34 to i64
  br label %._crit_edge89

.lr.ph82:                                         ; preds = %.preheader77, %66
  %.05681 = phi i32 [ %67, %66 ], [ 1, %.preheader77 ]
  %35 = tail call noundef i32 @_Z3geti(i32 noundef %.05681)
  %.not75 = icmp eq i32 %35, %.05681
  br i1 %.not75, label %36, label %66

36:                                               ; preds = %.lr.ph82
  %37 = load i32, ptr @tot, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr @tot, align 4, !tbaa !5
  %39 = load i32, ptr @m, align 4, !tbaa !5
  %40 = add nsw i32 %39, %.05681
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [3030 x i32], ptr @vis, i64 0, i64 %41
  store i32 %38, ptr %42, align 4, !tbaa !5
  %43 = zext nneg i32 %.05681 to i64
  %44 = getelementptr inbounds [3030 x i32], ptr @vis, i64 0, i64 %43
  store i32 %38, ptr %44, align 4, !tbaa !5
  %45 = getelementptr inbounds [3030 x i32], ptr @sz, i64 0, i64 %43
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %38 to i64
  %48 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %47
  store i32 %46, ptr %48, align 4, !tbaa !5
  %49 = getelementptr inbounds [3030 x i32], ptr @sz, i64 0, i64 %41
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %47
  store i32 %50, ptr %51, align 4, !tbaa !5
  %52 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.05681)
  %53 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull @.str)
  %54 = load i32, ptr @tot, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %53, i32 noundef %57)
  %59 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @.str)
  %60 = load i32, ptr @tot, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %59, i32 noundef %63)
  %65 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %66

66:                                               ; preds = %.lr.ph82, %36
  %67 = add nuw nsw i32 %.05681, 1
  %68 = load i32, ptr @m, align 4, !tbaa !5
  %.not63.not = icmp slt i32 %.05681, %68
  br i1 %.not63.not, label %.lr.ph82, label %.preheader76, !llvm.loop !12

._crit_edge89:                                    ; preds = %._crit_edge, %.preheader76.._crit_edge89_crit_edge
  %.pre-phi = phi i64 [ %.pre115, %.preheader76.._crit_edge89_crit_edge ], [ %86, %._crit_edge ]
  %.lcssa = phi i32 [ %34, %.preheader76.._crit_edge89_crit_edge ], [ %85, %._crit_edge ]
  %69 = load i32, ptr @x, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %.pre-phi, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %.not65 = icmp eq i32 %72, 1
  br i1 %.not65, label %.preheader, label %.backedge

.preheader:                                       ; preds = %._crit_edge89
  %.not6690 = icmp eq i32 %.lcssa, 0
  br i1 %.not6690, label %._crit_edge93, label %.lr.ph92.preheader

.lr.ph92.preheader:                               ; preds = %.preheader
  %p1.promoted = load i32, ptr @p1, align 4, !tbaa !5
  br label %.lr.ph92

.lr.ph88:                                         ; preds = %.preheader76, %._crit_edge
  %indvars.iv106 = phi i64 [ %indvars.iv.next107, %._crit_edge ], [ 1, %.preheader76 ]
  %73 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %indvars.iv106
  %74 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %indvars.iv106
  %75 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %73, ptr noundef nonnull align 4 dereferenceable(4) %74)
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = load i32, ptr @p1, align 4, !tbaa !5
  %.not7283 = icmp sgt i32 %76, %77
  br i1 %.not7283, label %._crit_edge, label %.lr.ph85

.lr.ph85:                                         ; preds = %.lr.ph88
  %78 = load i32, ptr %73, align 4, !tbaa !5
  %79 = add nsw i64 %indvars.iv106, -1
  %80 = load i32, ptr %74, align 4, !tbaa !5
  %81 = sext i32 %76 to i64
  %82 = sext i32 %80 to i64
  %83 = sext i32 %78 to i64
  %84 = add i32 %77, 1
  br label %87

._crit_edge:                                      ; preds = %103, %.lr.ph88
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %85 = load i32, ptr @tot, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %.not64.not = icmp slt i64 %indvars.iv106, %86
  br i1 %.not64.not, label %.lr.ph88, label %._crit_edge89, !llvm.loop !13

87:                                               ; preds = %.lr.ph85, %103
  %indvars.iv = phi i64 [ %81, %.lr.ph85 ], [ %indvars.iv.next, %103 ]
  %.not73 = icmp slt i64 %indvars.iv, %83
  br i1 %.not73, label %95, label %88

88:                                               ; preds = %87
  %89 = sub nsw i64 %indvars.iv, %83
  %90 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %79, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %indvars.iv106, i64 %indvars.iv
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = add nsw i32 %93, %91
  store i32 %94, ptr %92, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %88, %87
  %.not74 = icmp slt i64 %indvars.iv, %82
  br i1 %.not74, label %103, label %96

96:                                               ; preds = %95
  %97 = sub nsw i64 %indvars.iv, %82
  %98 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %79, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %indvars.iv106, i64 %indvars.iv
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = add nsw i32 %101, %99
  store i32 %102, ptr %100, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %95, %96
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %84, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %87, !llvm.loop !14

.backedge:                                        ; preds = %.thread, %._crit_edge89, %._crit_edge93
  %.str.2.sink = phi ptr [ @.str.3, %._crit_edge93 ], [ @.str.2, %._crit_edge89 ], [ @.str.3, %.thread ]
  %104 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
  %105 = 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) @n)
  %106 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %105, ptr noundef nonnull align 4 dereferenceable(4) @p1)
  %107 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %106, ptr noundef nonnull align 4 dereferenceable(4) @p2)
  %108 = load i32, ptr @p2, align 4, !tbaa !5
  %.not = icmp eq i32 %108, 0
  br i1 %.not, label %._crit_edge103, label %.lr.ph102, !llvm.loop !15

._crit_edge93:                                    ; preds = %126, %.preheader
  %109 = tail call noundef i32 @_Z3geti(i32 noundef 1)
  %110 = load i32, ptr @m, align 4, !tbaa !5
  %.not6794 = icmp slt i32 %110, 1
  br i1 %.not6794, label %.backedge, label %.lr.ph98

.lr.ph92:                                         ; preds = %.lr.ph92.preheader, %126
  %indvars.iv109 = phi i64 [ %.pre-phi, %.lr.ph92.preheader ], [ %indvars.iv.next110, %126 ]
  %111 = phi i32 [ %p1.promoted, %.lr.ph92.preheader ], [ %127, %126 ]
  %indvars.iv.next110 = add nsw i64 %indvars.iv109, -1
  %112 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %indvars.iv109
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sub nsw i32 %69, %113
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next110, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %.not70 = icmp eq i32 %117, 0
  br i1 %.not70, label %118, label %.sink.split

118:                                              ; preds = %.lr.ph92
  %119 = getelementptr inbounds [3030 x i32], ptr @bad, i64 0, i64 %indvars.iv109
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sub nsw i32 %69, %120
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [610 x [610 x i32]], ptr @dp, i64 0, i64 %indvars.iv.next110, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %.not71 = icmp eq i32 %124, 0
  br i1 %.not71, label %126, label %.sink.split

.sink.split:                                      ; preds = %118, %.lr.ph92
  %.sink119 = phi i32 [ %113, %.lr.ph92 ], [ %120, %118 ]
  %.sink = phi i32 [ -1, %.lr.ph92 ], [ -2, %118 ]
  %125 = sub nsw i32 %111, %.sink119
  store i32 %125, ptr @p1, align 4, !tbaa !5
  store i32 %.sink, ptr %112, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %.sink.split, %118
  %127 = phi i32 [ %111, %118 ], [ %125, %.sink.split ]
  %.not66 = icmp eq i64 %indvars.iv.next110, 0
  br i1 %.not66, label %._crit_edge93, label %.lr.ph92, !llvm.loop !16

.lr.ph98:                                         ; preds = %._crit_edge93, %.thread
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %.thread ], [ 1, %._crit_edge93 ]
  %128 = phi i32 [ %148, %.thread ], [ %110, %._crit_edge93 ]
  %.096 = phi i32 [ %147, %.thread ], [ %109, %._crit_edge93 ]
  %129 = sext i32 %.096 to i64
  %130 = getelementptr inbounds [3030 x i32], ptr @vis, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %.not68 = icmp eq i32 %131, 0
  br i1 %.not68, label %.thread, label %132

132:                                              ; preds = %.lr.ph98
  %133 = icmp sgt i32 %.096, %128
  %134 = getelementptr inbounds [3030 x i32], ptr @vis, i64 0, i64 %indvars.iv112
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [3030 x i32], ptr @good, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  br i1 %133, label %139, label %141

139:                                              ; preds = %132
  %140 = icmp eq i32 %138, -2
  br i1 %140, label %.thread.sink.split, label %.thread

141:                                              ; preds = %132
  %142 = icmp eq i32 %138, -1
  br i1 %142, label %.thread.sink.split, label %.thread

.thread.sink.split:                               ; preds = %141, %139
  %143 = trunc nuw nsw i64 %indvars.iv112 to i32
  %144 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %143)
  %145 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %144, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.thread

.thread:                                          ; preds = %.thread.sink.split, %139, %.lr.ph98, %141
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %146 = trunc nuw i64 %indvars.iv.next113 to i32
  %147 = tail call noundef i32 @_Z3geti(i32 noundef %146)
  %148 = load i32, ptr @m, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %.not67.not = icmp slt i64 %indvars.iv112, %149
  br i1 %.not67.not, label %.lr.ph98, label %.backedge, !llvm.loop !17

._crit_edge103:                                   ; preds = %.backedge, %0
  ret i32 0
}

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

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6

attributes #0 = { 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 #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 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 #3 = { "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 = { 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 #6 = { nofree nounwind "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" }

!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 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}


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