; LLVM IR from kazunetakahashi/atcoder :: 2017/0715_ARC078 (F)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@edge = external dso_local global [15 x [15 x i32]], align 16
@setcost = external dso_local global [32768 x i32], align 16
@dp = external dso_local global [32768 x [15 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZL5infty = external hidden constant i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %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
  store i32 0, ptr %1, align 4
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 4 dereferenceable(4) @M)
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @edge, ptr noundef getelementptr inbounds (i32, ptr @edge, i64 225), ptr noundef nonnull align 4 dereferenceable(4) @_ZL5infty)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %22

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

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

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr %3, align 4, !tbaa !5
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %4, align 4, !tbaa !5
  %35 = load i32, ptr %5, align 4, !tbaa !5
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [15 x [15 x i32]], ptr @edge, i64 0, i64 %37
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [15 x i32], ptr %38, i64 0, i64 %40
  store i32 %35, ptr %41, align 4, !tbaa !5
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [15 x [15 x i32]], ptr @edge, i64 0, i64 %44
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [15 x i32], ptr %45, i64 0, i64 %47
  store i32 %42, ptr %48, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %49

49:                                               ; preds = %27
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %2, align 4, !tbaa !5
  br label %22, !llvm.loop !9

52:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @setcost, ptr noundef getelementptr inbounds (i32, ptr @setcost, i64 32768), ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %118, %52
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = load i32, ptr @N, align 4, !tbaa !5
  %56 = shl i32 1, %55
  %57 = icmp slt i32 %54, %56
  br i1 %57, label %59, label %58

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

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

60:                                               ; preds = %114, %59
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = load i32, ptr @N, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %117

65:                                               ; preds = %60
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = ashr i32 %66, %67
  %69 = and i32 %68, 1
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %65
  br label %114

72:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %73 = load i32, ptr %9, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %10, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %110, %72
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = load i32, ptr @N, align 4, !tbaa !5
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %80, label %79

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

80:                                               ; preds = %75
  %81 = load i32, ptr %7, align 4, !tbaa !5
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = ashr i32 %81, %82
  %84 = and i32 %83, 1
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %86, label %87

86:                                               ; preds = %80
  br label %110

87:                                               ; preds = %80
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [15 x [15 x i32]], ptr @edge, i64 0, i64 %89
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [15 x i32], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp eq i32 %94, 1000000007
  br i1 %95, label %96, label %97

96:                                               ; preds = %87
  br label %110

97:                                               ; preds = %87
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [15 x [15 x i32]], ptr @edge, i64 0, i64 %99
  %101 = load i32, ptr %10, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [15 x i32], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = add nsw i32 %108, %104
  store i32 %109, ptr %107, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %97, %96, %86
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %10, align 4, !tbaa !5
  br label %75, !llvm.loop !11

113:                                              ; preds = %79
  br label %114

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

117:                                              ; preds = %64
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %7, align 4, !tbaa !5
  br label %53, !llvm.loop !13

121:                                              ; preds = %58
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef @dp, ptr noundef getelementptr inbounds (i32, ptr @dp, i64 491520), ptr noundef nonnull align 4 dereferenceable(4) @_ZL5infty)
  store i32 0, ptr getelementptr inbounds ([32768 x [15 x i32]], ptr @dp, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %291, %121
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = load i32, ptr @N, align 4, !tbaa !5
  %125 = shl i32 1, %124
  %126 = icmp slt i32 %123, %125
  br i1 %126, label %128, label %127

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

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

129:                                              ; preds = %287, %128
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = load i32, ptr @N, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %290

134:                                              ; preds = %129
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = load i32, ptr %12, align 4, !tbaa !5
  %137 = ashr i32 %135, %136
  %138 = and i32 %137, 1
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %140, label %141

140:                                              ; preds = %134
  br label %287

141:                                              ; preds = %134
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %143
  %145 = load i32, ptr %12, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [15 x i32], ptr %144, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = icmp sge i32 %148, 1000000007
  br i1 %149, label %150, label %151

150:                                              ; preds = %141
  br label %287

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

152:                                              ; preds = %217, %151
  %153 = load i32, ptr %13, align 4, !tbaa !5
  %154 = load i32, ptr @N, align 4, !tbaa !5
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  store i32 20, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %220

157:                                              ; preds = %152
  %158 = load i32, ptr %11, align 4, !tbaa !5
  %159 = load i32, ptr %13, align 4, !tbaa !5
  %160 = ashr i32 %158, %159
  %161 = and i32 %160, 1
  %162 = icmp eq i32 %161, 1
  br i1 %162, label %172, label %163

163:                                              ; preds = %157
  %164 = load i32, ptr %12, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [15 x [15 x i32]], ptr @edge, i64 0, i64 %165
  %167 = load i32, ptr %13, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [15 x i32], ptr %166, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = icmp eq i32 %170, 1000000007
  br i1 %171, label %172, label %173

172:                                              ; preds = %163, %157
  br label %217

173:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %174 = load i32, ptr %11, align 4, !tbaa !5
  %175 = load i32, ptr %13, align 4, !tbaa !5
  %176 = shl i32 1, %175
  %177 = or i32 %174, %176
  store i32 %177, ptr %14, align 4, !tbaa !5
  %178 = load i32, ptr %14, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %179
  %181 = load i32, ptr %13, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [15 x i32], ptr %180, i64 0, i64 %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %184 = load i32, ptr %11, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %185
  %187 = load i32, ptr %12, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [15 x i32], ptr %186, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = load i32, ptr %14, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = add nsw i32 %190, %194
  %196 = load i32, ptr %11, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = sub nsw i32 %195, %199
  %201 = load i32, ptr %12, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [15 x [15 x i32]], ptr @edge, i64 0, i64 %202
  %204 = load i32, ptr %13, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [15 x i32], ptr %203, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = sub nsw i32 %200, %207
  store i32 %208, ptr %15, align 4, !tbaa !5
  %209 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %183, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = load i32, ptr %14, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %212
  %214 = load i32, ptr %13, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [15 x i32], ptr %213, i64 0, i64 %215
  store i32 %210, ptr %216, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %217

217:                                              ; preds = %173, %172
  %218 = load i32, ptr %13, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %13, align 4, !tbaa !5
  br label %152, !llvm.loop !14

220:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %221 = load i32, ptr @N, align 4, !tbaa !5
  %222 = shl i32 1, %221
  %223 = sub nsw i32 %222, 1
  %224 = load i32, ptr %11, align 4, !tbaa !5
  %225 = xor i32 %223, %224
  %226 = load i32, ptr @N, align 4, !tbaa !5
  %227 = shl i32 1, %226
  %228 = sub nsw i32 %227, 1
  %229 = and i32 %225, %228
  store i32 %229, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %230 = load i32, ptr %11, align 4, !tbaa !5
  %231 = load i32, ptr %12, align 4, !tbaa !5
  %232 = shl i32 1, %231
  %233 = sub nsw i32 %230, %232
  store i32 %233, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %234 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %234, ptr %18, align 4, !tbaa !5
  br label %235

235:                                              ; preds = %282, %220
  %236 = load i32, ptr %11, align 4, !tbaa !5
  %237 = load i32, ptr %18, align 4, !tbaa !5
  %238 = or i32 %236, %237
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %239
  %241 = load i32, ptr %12, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [15 x i32], ptr %240, i64 0, i64 %242
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %244 = load i32, ptr %11, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %245
  %247 = load i32, ptr %12, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [15 x i32], ptr %246, i64 0, i64 %248
  %250 = load i32, ptr %249, align 4, !tbaa !5
  %251 = load i32, ptr %17, align 4, !tbaa !5
  %252 = load i32, ptr %18, align 4, !tbaa !5
  %253 = or i32 %251, %252
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = add nsw i32 %250, %256
  %258 = load i32, ptr %17, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !5
  %262 = sub nsw i32 %257, %261
  %263 = load i32, ptr %18, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %264
  %266 = load i32, ptr %265, align 4, !tbaa !5
  %267 = sub nsw i32 %262, %266
  store i32 %267, ptr %19, align 4, !tbaa !5
  %268 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %243, ptr noundef nonnull align 4 dereferenceable(4) %19)
  %269 = load i32, ptr %268, align 4, !tbaa !5
  %270 = load i32, ptr %11, align 4, !tbaa !5
  %271 = load i32, ptr %18, align 4, !tbaa !5
  %272 = or i32 %270, %271
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %273
  %275 = load i32, ptr %12, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [15 x i32], ptr %274, i64 0, i64 %276
  store i32 %269, ptr %277, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %278 = load i32, ptr %18, align 4, !tbaa !5
  %279 = sub nsw i32 %278, 1
  %280 = load i32, ptr %16, align 4, !tbaa !5
  %281 = and i32 %279, %280
  store i32 %281, ptr %18, align 4, !tbaa !5
  br label %282

282:                                              ; preds = %235
  %283 = load i32, ptr %18, align 4, !tbaa !5
  %284 = load i32, ptr %16, align 4, !tbaa !5
  %285 = icmp ne i32 %283, %284
  br i1 %285, label %235, label %286, !llvm.loop !15

286:                                              ; preds = %282
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %287

287:                                              ; preds = %286, %150, %140
  %288 = load i32, ptr %12, align 4, !tbaa !5
  %289 = add nsw i32 %288, 1
  store i32 %289, ptr %12, align 4, !tbaa !5
  br label %129, !llvm.loop !16

290:                                              ; preds = %133
  br label %291

291:                                              ; preds = %290
  %292 = load i32, ptr %11, align 4, !tbaa !5
  %293 = add nsw i32 %292, 1
  store i32 %293, ptr %11, align 4, !tbaa !5
  br label %122, !llvm.loop !17

294:                                              ; preds = %127
  %295 = load i32, ptr @N, align 4, !tbaa !5
  %296 = shl i32 1, %295
  %297 = sub nsw i32 %296, 1
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %298
  %300 = load i32, ptr @N, align 4, !tbaa !5
  %301 = sub nsw i32 %300, 1
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [15 x i32], ptr %299, i64 0, i64 %302
  %304 = load i32, ptr %303, align 4, !tbaa !5
  %305 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %304)
  %306 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %305, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %307 = load i32, ptr %1, align 4
  ret i32 %307
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@edge = external dso_local global [15 x [15 x i32]], align 16
@setcost = external dso_local global [32768 x i32], align 16
@dp = external dso_local global [32768 x [15 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZL5infty = external hidden constant i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = 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)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) @M)
  tail call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @edge, ptr noundef nonnull getelementptr inbounds (i8, ptr @edge, i64 900), ptr noundef nonnull align 4 dereferenceable(4) @_ZL5infty)
  %9 = load i32, ptr @M, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @setcost, ptr noundef nonnull getelementptr inbounds (i8, ptr @setcost, i64 131072), ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %11 = load i32, ptr @N, align 4, !tbaa !5
  %.not110 = icmp ne i32 %11, 31
  %12 = icmp sgt i32 %11, 0
  %or.cond = and i1 %.not110, %12
  br i1 %or.cond, label %.preheader85.us.preheader, label %._crit_edge98

.preheader85.us.preheader:                        ; preds = %._crit_edge
  %13 = shl nuw i32 1, %11
  %14 = zext nneg i32 %11 to i64
  %smax = call i32 @llvm.smax.i32(i32 %13, i32 1)
  %wide.trip.count128 = zext nneg i32 %smax to i64
  %wide.trip.count123 = zext nneg i32 %11 to i64
  br label %.preheader85.us

.preheader85.us:                                  ; preds = %.preheader85.us.preheader, %._crit_edge96.us
  %indvars.iv125 = phi i64 [ 0, %.preheader85.us.preheader ], [ %indvars.iv.next126, %._crit_edge96.us ]
  %15 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %indvars.iv125
  %16 = trunc nuw nsw i64 %indvars.iv125 to i32
  br label %17

17:                                               ; preds = %.preheader85.us, %.loopexit84.us
  %indvars.iv119 = phi i64 [ 0, %.preheader85.us ], [ %.pre140, %.loopexit84.us ]
  %indvars.iv = phi i64 [ 1, %.preheader85.us ], [ %indvars.iv.next, %.loopexit84.us ]
  %18 = trunc nuw nsw i64 %indvars.iv119 to i32
  %19 = shl nuw i32 1, %18
  %20 = and i32 %19, %16
  %21 = icmp ne i32 %20, 0
  %.pre140 = add nuw nsw i64 %indvars.iv119, 1
  %22 = icmp ult i64 %.pre140, %14
  %or.cond145 = select i1 %21, i1 %22, i1 false
  br i1 %or.cond145, label %.lr.ph92.us, label %.loopexit84.us

.lr.ph92.us:                                      ; preds = %17, %33
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %33 ], [ %indvars.iv, %17 ]
  %.070.in90.us = phi i32 [ %34, %33 ], [ %18, %17 ]
  %23 = shl i32 2, %.070.in90.us
  %24 = and i32 %23, %16
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %33, label %26

26:                                               ; preds = %.lr.ph92.us
  %27 = getelementptr inbounds [15 x [15 x i32]], ptr @edge, i64 0, i64 %indvars.iv119, i64 %indvars.iv116
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = icmp eq i32 %28, 1000000007
  br i1 %29, label %33, label %30

30:                                               ; preds = %26
  %31 = load i32, ptr %15, align 4, !tbaa !5
  %32 = add nsw i32 %31, %28
  store i32 %32, ptr %15, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %30, %26, %.lr.ph92.us
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %34 = trunc nuw nsw i64 %indvars.iv116 to i32
  %exitcond.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count123
  br i1 %exitcond.not, label %.loopexit84.us, label %.lr.ph92.us, !llvm.loop !9

.loopexit84.us:                                   ; preds = %33, %17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond124.not = icmp eq i64 %.pre140, %wide.trip.count123
  br i1 %exitcond124.not, label %._crit_edge96.us, label %17, !llvm.loop !11

._crit_edge96.us:                                 ; preds = %.loopexit84.us
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %exitcond129.not = icmp eq i64 %indvars.iv.next126, %wide.trip.count128
  br i1 %exitcond129.not, label %._crit_edge98, label %.preheader85.us, !llvm.loop !12

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.06588 = phi i32 [ %47, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = add nsw i32 %38, -1
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = add nsw i32 %40, -1
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %39 to i64
  %44 = sext i32 %41 to i64
  %45 = getelementptr inbounds [15 x [15 x i32]], ptr @edge, i64 0, i64 %43, i64 %44
  store i32 %42, ptr %45, align 4, !tbaa !5
  %46 = getelementptr inbounds [15 x [15 x i32]], ptr @edge, i64 0, i64 %44, i64 %43
  store i32 %42, ptr %46, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %47 = add nuw nsw i32 %.06588, 1
  %48 = load i32, ptr @M, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge98:                                    ; preds = %._crit_edge96.us, %._crit_edge
  call void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef nonnull @dp, ptr noundef nonnull getelementptr inbounds (i8, ptr @dp, i64 1966080), ptr noundef nonnull align 4 dereferenceable(4) @_ZL5infty)
  store i32 0, ptr getelementptr inbounds (i8, ptr @dp, i64 60), align 4, !tbaa !5
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %51 = shl nuw i32 1, %50
  %52 = icmp sgt i32 %51, 1
  %53 = icmp sgt i32 %50, 0
  %or.cond146 = and i1 %52, %53
  br i1 %or.cond146, label %.preheader82, label %._crit_edge106

.preheader82:                                     ; preds = %._crit_edge98, %._crit_edge104
  %54 = phi i32 [ %66, %._crit_edge104 ], [ %50, %._crit_edge98 ]
  %indvars.iv136 = phi i64 [ %indvars.iv.next137, %._crit_edge104 ], [ 1, %._crit_edge98 ]
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.lr.ph103, label %._crit_edge104

.lr.ph103:                                        ; preds = %.preheader82
  %56 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %indvars.iv136
  %57 = trunc nuw nsw i64 %indvars.iv136 to i32
  br label %70

._crit_edge106:                                   ; preds = %._crit_edge104, %._crit_edge98
  %.lcssa87 = phi i32 [ %50, %._crit_edge98 ], [ %66, %._crit_edge104 ]
  %.lcssa86 = phi i32 [ %51, %._crit_edge98 ], [ %67, %._crit_edge104 ]
  %58 = add nsw i32 %.lcssa86, -1
  %59 = sext i32 %58 to i64
  %60 = add nsw i32 %.lcssa87, -1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %59, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %63)
  %65 = 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_)
  ret i32 0

._crit_edge104:                                   ; preds = %.loopexit, %.preheader82
  %66 = phi i32 [ %54, %.preheader82 ], [ %130, %.loopexit ]
  %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
  %67 = shl nuw i32 1, %66
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv.next137, %68
  br i1 %69, label %.preheader82, label %._crit_edge106, !llvm.loop !14

70:                                               ; preds = %.lr.ph103, %.loopexit
  %71 = phi i32 [ %54, %.lr.ph103 ], [ %130, %.loopexit ]
  %72 = phi i32 [ %54, %.lr.ph103 ], [ %131, %.loopexit ]
  %indvars.iv133 = phi i64 [ 0, %.lr.ph103 ], [ %indvars.iv.next134, %.loopexit ]
  %73 = trunc nuw nsw i64 %indvars.iv133 to i32
  %74 = shl nuw i32 1, %73
  %75 = and i32 %74, %57
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %.loopexit, label %77

77:                                               ; preds = %70
  %78 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %indvars.iv136, i64 %indvars.iv133
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp sgt i32 %79, 1000000006
  br i1 %80, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %77
  %81 = icmp sgt i32 %72, 0
  br i1 %81, label %.lr.ph100, label %._crit_edge101

._crit_edge101:                                   ; preds = %107, %.preheader
  %.lcssa = phi i32 [ %72, %.preheader ], [ %108, %107 ]
  %notmask = shl nsw i32 -1, %.lcssa
  %.demorgan = or i32 %notmask, %57
  %82 = xor i32 %.demorgan, -1
  %.neg = shl nsw i32 -1, %73
  %83 = add nsw i32 %.neg, %57
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %84
  br label %111

.lr.ph100:                                        ; preds = %.preheader, %107
  %86 = phi i32 [ %108, %107 ], [ %72, %.preheader ]
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %107 ], [ 0, %.preheader ]
  %87 = trunc nuw nsw i64 %indvars.iv130 to i32
  %88 = shl nuw i32 1, %87
  %89 = and i32 %88, %57
  %.not75 = icmp eq i32 %89, 0
  br i1 %.not75, label %90, label %107

90:                                               ; preds = %.lr.ph100
  %91 = getelementptr inbounds [15 x [15 x i32]], ptr @edge, i64 0, i64 %indvars.iv133, i64 %indvars.iv130
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp eq i32 %92, 1000000007
  br i1 %93, label %107, label %94

94:                                               ; preds = %90
  %95 = or i32 %88, %57
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %96, i64 %indvars.iv130
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %98 = load i32, ptr %78, align 4, !tbaa !5
  %99 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %96
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %56, align 4, !tbaa !5
  %102 = add i32 %98, %100
  %103 = add i32 %92, %101
  %104 = sub i32 %102, %103
  store i32 %104, ptr %5, align 4, !tbaa !5
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %97, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %106 = load i32, ptr %105, align 4, !tbaa !5
  store i32 %106, ptr %97, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %.pre = load i32, ptr @N, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %.lr.ph100, %90, %94
  %108 = phi i32 [ %86, %.lr.ph100 ], [ %86, %90 ], [ %.pre, %94 ]
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %109 = sext i32 %108 to i64
  %110 = icmp slt i64 %indvars.iv.next131, %109
  br i1 %110, label %.lr.ph100, label %._crit_edge101, !llvm.loop !16

111:                                              ; preds = %111, %._crit_edge101
  %.0 = phi i32 [ %82, %._crit_edge101 ], [ %129, %111 ]
  %112 = or i32 %.0, %57
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [32768 x [15 x i32]], ptr @dp, i64 0, i64 %113, i64 %indvars.iv133
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %115 = load i32, ptr %78, align 4, !tbaa !5
  %116 = or i32 %.0, %83
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = load i32, ptr %85, align 4, !tbaa !5
  %121 = sext i32 %.0 to i64
  %122 = getelementptr inbounds [32768 x i32], ptr @setcost, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %.neg78 = add i32 %119, %115
  %124 = add i32 %120, %123
  %125 = sub i32 %.neg78, %124
  store i32 %125, ptr %6, align 4, !tbaa !5
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %114, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %127 = load i32, ptr %126, align 4, !tbaa !5
  store i32 %127, ptr %114, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  %128 = add nuw i32 %.0, 2147483647
  %129 = and i32 %128, %82
  %.not = icmp eq i32 %129, %82
  br i1 %.not, label %.loopexit.loopexit, label %111, !llvm.loop !17

.loopexit.loopexit:                               ; preds = %111
  %.pre139 = load i32, ptr @N, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %77, %70
  %130 = phi i32 [ %.pre139, %.loopexit.loopexit ], [ %71, %77 ], [ %71, %70 ]
  %131 = phi i32 [ %.pre139, %.loopexit.loopexit ], [ %72, %77 ], [ %72, %70 ]
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %132 = sext i32 %131 to i64
  %133 = icmp slt i64 %indvars.iv.next134, %132
  br i1 %133, label %70, label %._crit_edge104, !llvm.loop !18
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPiiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

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


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