; LLVM IR from eyangch/competitive-programming :: USACOtraining/4.2 (stall4)

; 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 i64, align 8
@M = external dso_local global i64, align 8
@cap = external dso_local global [500 x [500 x i64]], align 16
@vis = external dso_local global [500 x i8], align 16
@prevnode = external dso_local global [500 x i64], align 16
@flow = external dso_local global [500 x i64], align 16
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %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 i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %17 = load ptr, ptr @stdin, align 8, !tbaa !5
  %18 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %17)
  %19 = load ptr, ptr @stdout, align 8, !tbaa !5
  %20 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %19)
  %21 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %22 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !9
  %23 = getelementptr i8, ptr %22, i64 -24
  %24 = load i64, ptr %23, align 8
  %25 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %24
  %26 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %25, ptr noundef null)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) @M)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 1, ptr %2, align 8, !tbaa !11
  br label %29

29:                                               ; preds = %56, %0
  %30 = load i64, ptr %2, align 8, !tbaa !11
  %31 = load i64, ptr @N, align 8, !tbaa !11
  %32 = icmp sle i64 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %59

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #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) %4)
  %36 = load i64, ptr %2, align 8, !tbaa !11
  %37 = getelementptr inbounds [500 x i64], ptr @cap, i64 0, i64 %36
  store i64 1, ptr %37, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !13
  br label %38

38:                                               ; preds = %52, %34
  %39 = load i32, ptr %5, align 4, !tbaa !13
  %40 = load i32, ptr %4, align 4, !tbaa !13
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

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

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %45 = load i64, ptr %2, align 8, !tbaa !11
  %46 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %45
  %47 = load i64, ptr @N, align 8, !tbaa !11
  %48 = load i32, ptr %6, align 4, !tbaa !13
  %49 = sext i32 %48 to i64
  %50 = add nsw i64 %47, %49
  %51 = getelementptr inbounds [500 x i64], ptr %46, i64 0, i64 %50
  store i64 1, ptr %51, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %52

52:                                               ; preds = %43
  %53 = load i32, ptr %5, align 4, !tbaa !13
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %5, align 4, !tbaa !13
  br label %38, !llvm.loop !15

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

56:                                               ; preds = %55
  %57 = load i64, ptr %2, align 8, !tbaa !11
  %58 = add nsw i64 %57, 1
  store i64 %58, ptr %2, align 8, !tbaa !11
  br label %29, !llvm.loop !17

59:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !13
  br label %60

60:                                               ; preds = %77, %59
  %61 = load i32, ptr %7, align 4, !tbaa !13
  %62 = sext i32 %61 to i64
  %63 = load i64, ptr @M, align 8, !tbaa !11
  %64 = icmp sle i64 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %60
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %80

66:                                               ; preds = %60
  %67 = load i64, ptr @N, align 8, !tbaa !11
  %68 = load i32, ptr %7, align 4, !tbaa !13
  %69 = sext i32 %68 to i64
  %70 = add nsw i64 %67, %69
  %71 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %70
  %72 = load i64, ptr @N, align 8, !tbaa !11
  %73 = load i64, ptr @M, align 8, !tbaa !11
  %74 = add nsw i64 %72, %73
  %75 = add nsw i64 %74, 1
  %76 = getelementptr inbounds [500 x i64], ptr %71, i64 0, i64 %75
  store i64 1, ptr %76, align 8, !tbaa !11
  br label %77

77:                                               ; preds = %66
  %78 = load i32, ptr %7, align 4, !tbaa !13
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %7, align 4, !tbaa !13
  br label %60, !llvm.loop !18

80:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %81 = load i64, ptr @N, align 8, !tbaa !11
  %82 = load i64, ptr @M, align 8, !tbaa !11
  %83 = add nsw i64 %81, %82
  %84 = add nsw i64 %83, 2
  %85 = trunc i64 %84 to i32
  store i32 %85, ptr %9, align 4, !tbaa !13
  br label %86

86:                                               ; preds = %228, %80
  br label %87

87:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !11
  br label %88

88:                                               ; preds = %101, %87
  %89 = load i64, ptr %10, align 8, !tbaa !11
  %90 = load i32, ptr %9, align 4, !tbaa !13
  %91 = sext i32 %90 to i64
  %92 = icmp slt i64 %89, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %88
  store i32 13, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %104

94:                                               ; preds = %88
  %95 = load i64, ptr %10, align 8, !tbaa !11
  %96 = getelementptr inbounds [500 x i64], ptr @prevnode, i64 0, i64 %95
  store i64 -1, ptr %96, align 8, !tbaa !11
  %97 = load i64, ptr %10, align 8, !tbaa !11
  %98 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %97
  store i64 0, ptr %98, align 8, !tbaa !11
  %99 = load i64, ptr %10, align 8, !tbaa !11
  %100 = getelementptr inbounds [500 x i8], ptr @vis, i64 0, i64 %99
  store i8 0, ptr %100, align 1, !tbaa !19
  br label %101

101:                                              ; preds = %94
  %102 = load i64, ptr %10, align 8, !tbaa !11
  %103 = add nsw i64 %102, 1
  store i64 %103, ptr %10, align 8, !tbaa !11
  br label %88, !llvm.loop !21

104:                                              ; preds = %93
  store i64 1000000000000, ptr @flow, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 -1, ptr %12, align 8, !tbaa !11
  br label %105

105:                                              ; preds = %179, %104
  br label %106

106:                                              ; preds = %105
  store i64 0, ptr %11, align 8, !tbaa !11
  store i64 -1, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !11
  br label %107

107:                                              ; preds = %130, %106
  %108 = load i64, ptr %13, align 8, !tbaa !11
  %109 = load i32, ptr %9, align 4, !tbaa !13
  %110 = sext i32 %109 to i64
  %111 = icmp slt i64 %108, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %107
  store i32 18, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %133

113:                                              ; preds = %107
  %114 = load i64, ptr %13, align 8, !tbaa !11
  %115 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !11
  %117 = load i64, ptr %11, align 8, !tbaa !11
  %118 = icmp sgt i64 %116, %117
  br i1 %118, label %119, label %129

119:                                              ; preds = %113
  %120 = load i64, ptr %13, align 8, !tbaa !11
  %121 = getelementptr inbounds [500 x i8], ptr @vis, i64 0, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !19, !range !22, !noundef !23
  %123 = trunc i8 %122 to i1
  br i1 %123, label %129, label %124

124:                                              ; preds = %119
  %125 = load i64, ptr %13, align 8, !tbaa !11
  %126 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %125
  %127 = load i64, ptr %126, align 8, !tbaa !11
  store i64 %127, ptr %11, align 8, !tbaa !11
  %128 = load i64, ptr %13, align 8, !tbaa !11
  store i64 %128, ptr %12, align 8, !tbaa !11
  br label %129

129:                                              ; preds = %124, %119, %113
  br label %130

130:                                              ; preds = %129
  %131 = load i64, ptr %13, align 8, !tbaa !11
  %132 = add nsw i64 %131, 1
  store i64 %132, ptr %13, align 8, !tbaa !11
  br label %107, !llvm.loop !24

133:                                              ; preds = %112
  %134 = load i64, ptr %12, align 8, !tbaa !11
  %135 = icmp eq i64 %134, -1
  br i1 %135, label %142, label %136

136:                                              ; preds = %133
  %137 = load i64, ptr %12, align 8, !tbaa !11
  %138 = load i32, ptr %9, align 4, !tbaa !13
  %139 = sub nsw i32 %138, 1
  %140 = sext i32 %139 to i64
  %141 = icmp eq i64 %137, %140
  br i1 %141, label %142, label %143

142:                                              ; preds = %136, %133
  br label %180

143:                                              ; preds = %136
  %144 = load i64, ptr %12, align 8, !tbaa !11
  %145 = getelementptr inbounds [500 x i8], ptr @vis, i64 0, i64 %144
  store i8 1, ptr %145, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %146

146:                                              ; preds = %176, %143
  %147 = load i64, ptr %14, align 8, !tbaa !11
  %148 = load i32, ptr %9, align 4, !tbaa !13
  %149 = sext i32 %148 to i64
  %150 = icmp slt i64 %147, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %146
  store i32 21, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %179

152:                                              ; preds = %146
  %153 = load i64, ptr %14, align 8, !tbaa !11
  %154 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !11
  %156 = load i64, ptr %12, align 8, !tbaa !11
  %157 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %156
  %158 = load i64, ptr %14, align 8, !tbaa !11
  %159 = getelementptr inbounds [500 x i64], ptr %157, i64 0, i64 %158
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %159)
  %161 = load i64, ptr %160, align 8, !tbaa !11
  %162 = icmp slt i64 %155, %161
  br i1 %162, label %163, label %175

163:                                              ; preds = %152
  %164 = load i64, ptr %12, align 8, !tbaa !11
  %165 = load i64, ptr %14, align 8, !tbaa !11
  %166 = getelementptr inbounds [500 x i64], ptr @prevnode, i64 0, i64 %165
  store i64 %164, ptr %166, align 8, !tbaa !11
  %167 = load i64, ptr %12, align 8, !tbaa !11
  %168 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %167
  %169 = load i64, ptr %14, align 8, !tbaa !11
  %170 = getelementptr inbounds [500 x i64], ptr %168, i64 0, i64 %169
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %170)
  %172 = load i64, ptr %171, align 8, !tbaa !11
  %173 = load i64, ptr %14, align 8, !tbaa !11
  %174 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %173
  store i64 %172, ptr %174, align 8, !tbaa !11
  br label %175

175:                                              ; preds = %163, %152
  br label %176

176:                                              ; preds = %175
  %177 = load i64, ptr %14, align 8, !tbaa !11
  %178 = add nsw i64 %177, 1
  store i64 %178, ptr %14, align 8, !tbaa !11
  br label %146, !llvm.loop !25

179:                                              ; preds = %151
  br label %105, !llvm.loop !26

180:                                              ; preds = %142
  %181 = load i64, ptr %12, align 8, !tbaa !11
  %182 = icmp eq i64 %181, -1
  br i1 %182, label %183, label %184

183:                                              ; preds = %180
  store i32 12, ptr %3, align 4
  br label %226

184:                                              ; preds = %180
  %185 = load i32, ptr %9, align 4, !tbaa !13
  %186 = sub nsw i32 %185, 1
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %187
  %189 = load i64, ptr %188, align 8, !tbaa !11
  %190 = load i64, ptr %8, align 8, !tbaa !11
  %191 = add nsw i64 %190, %189
  store i64 %191, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %192 = load i32, ptr %9, align 4, !tbaa !13
  %193 = sub nsw i32 %192, 1
  %194 = sext i32 %193 to i64
  store i64 %194, ptr %15, align 8, !tbaa !11
  br label %195

195:                                              ; preds = %198, %184
  %196 = load i64, ptr %15, align 8, !tbaa !11
  %197 = icmp ne i64 %196, 0
  br i1 %197, label %198, label %225

198:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %199 = load i64, ptr %15, align 8, !tbaa !11
  %200 = getelementptr inbounds [500 x i64], ptr @prevnode, i64 0, i64 %199
  %201 = load i64, ptr %200, align 8, !tbaa !11
  store i64 %201, ptr %16, align 8, !tbaa !11
  %202 = load i32, ptr %9, align 4, !tbaa !13
  %203 = sub nsw i32 %202, 1
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %204
  %206 = load i64, ptr %205, align 8, !tbaa !11
  %207 = load i64, ptr %16, align 8, !tbaa !11
  %208 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %207
  %209 = load i64, ptr %15, align 8, !tbaa !11
  %210 = getelementptr inbounds [500 x i64], ptr %208, i64 0, i64 %209
  %211 = load i64, ptr %210, align 8, !tbaa !11
  %212 = sub nsw i64 %211, %206
  store i64 %212, ptr %210, align 8, !tbaa !11
  %213 = load i32, ptr %9, align 4, !tbaa !13
  %214 = sub nsw i32 %213, 1
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %215
  %217 = load i64, ptr %216, align 8, !tbaa !11
  %218 = load i64, ptr %15, align 8, !tbaa !11
  %219 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %218
  %220 = load i64, ptr %16, align 8, !tbaa !11
  %221 = getelementptr inbounds [500 x i64], ptr %219, i64 0, i64 %220
  %222 = load i64, ptr %221, align 8, !tbaa !11
  %223 = add nsw i64 %222, %217
  store i64 %223, ptr %221, align 8, !tbaa !11
  %224 = load i64, ptr %16, align 8, !tbaa !11
  store i64 %224, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %195, !llvm.loop !27

225:                                              ; preds = %195
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  store i32 0, ptr %3, align 4
  br label %226

226:                                              ; preds = %225, %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %227 = load i32, ptr %3, align 4
  switch i32 %227, label %234 [
    i32 0, label %228
    i32 12, label %229
  ]

228:                                              ; preds = %226
  br label %86, !llvm.loop !28

229:                                              ; preds = %226
  %230 = load i64, ptr %8, align 8, !tbaa !11
  %231 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %230)
  %232 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %231, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %233 = load i32, ptr %1, align 4
  ret i32 %233

234:                                              ; preds = %226
  unreachable
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 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)) #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 = { 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = distinct !{!21, !16}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !16}
!26 = distinct !{!26, !16}
!27 = distinct !{!27, !16}
!28 = distinct !{!28, !16}


; 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 i64, align 8
@M = external dso_local global i64, align 8
@cap = external dso_local global [500 x [500 x i64]], align 16
@vis = external dso_local local_unnamed_addr global [500 x i8], align 16
@prevnode = external dso_local local_unnamed_addr global [500 x i64], align 16
@flow = external dso_local local_unnamed_addr global [500 x i64], align 16
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = load ptr, ptr @stdin, align 8, !tbaa !5
  %5 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %4)
  %6 = load ptr, ptr @stdout, align 8, !tbaa !5
  %7 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %6)
  %8 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !9
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %16 = load i64, ptr @N, align 8, !tbaa !11
  %.not81 = icmp slt i64 %16, 1
  br i1 %.not81, label %.preheader, label %.lr.ph84

.preheader:                                       ; preds = %._crit_edge, %0
  %.lcssa79 = phi i64 [ %16, %0 ], [ %25, %._crit_edge ]
  %17 = load i64, ptr @M, align 8, !tbaa !11
  %.not6885 = icmp slt i64 %17, 1
  br i1 %.not6885, label %._crit_edge88, label %.lr.ph87

.lr.ph87:                                         ; preds = %.preheader
  %18 = add i64 %.lcssa79, 1
  %19 = add i64 %18, %17
  %xtraiter = and i64 %17, 3
  %20 = icmp ult i64 %17, 4
  br i1 %20, label %._crit_edge88.loopexit.unr-lcssa, label %.lr.ph87.new

.lr.ph87.new:                                     ; preds = %.lr.ph87
  %unroll_iter = and i64 %17, 9223372036854775804
  br label %45

.lr.ph84:                                         ; preds = %0, %._crit_edge
  %.05782 = phi i64 [ %26, %._crit_edge ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %21 = 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)
  %22 = getelementptr inbounds [500 x i64], ptr @cap, i64 0, i64 %.05782
  store i64 1, ptr %22, align 8, !tbaa !11
  %23 = load i32, ptr %1, align 4, !tbaa !13
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %.lr.ph84.._crit_edge_crit_edge

.lr.ph84.._crit_edge_crit_edge:                   ; preds = %.lr.ph84
  %.pre = load i64, ptr @N, align 8, !tbaa !11
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph84.._crit_edge_crit_edge
  %25 = phi i64 [ %.pre, %.lr.ph84.._crit_edge_crit_edge ], [ %28, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %26 = add nuw nsw i64 %.05782, 1
  %.not.not = icmp slt i64 %.05782, %25
  br i1 %.not.not, label %.lr.ph84, label %.preheader, !llvm.loop !15

.lr.ph:                                           ; preds = %.lr.ph84, %.lr.ph
  %.06180 = phi i32 [ %33, %.lr.ph ], [ 0, %.lr.ph84 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %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) %2)
  %28 = load i64, ptr @N, align 8, !tbaa !11
  %29 = load i32, ptr %2, align 4, !tbaa !13
  %30 = sext i32 %29 to i64
  %31 = add nsw i64 %28, %30
  %32 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %.05782, i64 %31
  store i64 1, ptr %32, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %33 = add nuw nsw i32 %.06180, 1
  %34 = load i32, ptr %1, align 4, !tbaa !13
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !17

._crit_edge88.loopexit.unr-lcssa:                 ; preds = %45, %.lr.ph87
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph87 ], [ %indvars.iv.next.3, %45 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge88, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge88.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge88.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge88.loopexit.unr-lcssa ]
  %36 = add nsw i64 %indvars.iv.epil, %.lcssa79
  %37 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %36, i64 %19
  store i64 1, ptr %37, align 8, !tbaa !11
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge88, label %.epil.preheader, !llvm.loop !18

._crit_edge88:                                    ; preds = %._crit_edge88.loopexit.unr-lcssa, %.epil.preheader, %.preheader
  %38 = add nsw i64 %17, %.lcssa79
  %39 = shl i64 %38, 32
  %sext69 = add i64 %39, 8589934592
  %40 = ashr exact i64 %sext69, 32
  %41 = icmp sgt i64 %40, 0
  %sext = add i64 %39, 4294967296
  %42 = ashr exact i64 %sext, 32
  %43 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %42
  %.not71105 = icmp eq i64 %sext, 0
  %44 = ashr exact i64 %sext69, 29
  br label %54

45:                                               ; preds = %45, %.lr.ph87.new
  %indvars.iv = phi i64 [ 1, %.lr.ph87.new ], [ %indvars.iv.next.3, %45 ]
  %niter = phi i64 [ 0, %.lr.ph87.new ], [ %niter.next.3, %45 ]
  %46 = add nsw i64 %indvars.iv, %.lcssa79
  %47 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %46, i64 %19
  store i64 1, ptr %47, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = add nsw i64 %indvars.iv.next, %.lcssa79
  %49 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %48, i64 %19
  store i64 1, ptr %49, align 8, !tbaa !11
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %50 = add nsw i64 %indvars.iv.next.1, %.lcssa79
  %51 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %50, i64 %19
  store i64 1, ptr %51, align 8, !tbaa !11
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %52 = add nsw i64 %indvars.iv.next.2, %.lcssa79
  %53 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %52, i64 %19
  store i64 1, ptr %53, align 8, !tbaa !11
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add nuw i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge88.loopexit.unr-lcssa, label %45, !llvm.loop !20

54:                                               ; preds = %.critedge, %._crit_edge88
  %.058 = phi i64 [ 0, %._crit_edge88 ], [ %86, %.critedge ]
  br i1 %41, label %.lr.ph92.preheader, label %._crit_edge93.._crit_edge100.thread_crit_edge.critedge

.lr.ph92.preheader:                               ; preds = %54
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @prevnode, i8 -1, i64 %44, i1 false), !tbaa !11
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @flow, i8 0, i64 %44, i1 false), !tbaa !11
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @vis, i8 0, i64 %40, i1 false), !tbaa !21
  store i64 1000000000000, ptr @flow, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store i64 0, ptr %3, align 8, !tbaa !11
  br label %.lr.ph99

.loopexit:                                        ; preds = %82
  store i64 0, ptr %3, align 8, !tbaa !11
  br i1 %41, label %.lr.ph99.backedge, label %._crit_edge100.thread

._crit_edge100:                                   ; preds = %65
  %55 = icmp eq i64 %.1, -1
  br i1 %55, label %._crit_edge100.thread, label %68

.lr.ph99:                                         ; preds = %.lr.ph99.backedge, %.lr.ph92.preheader
  %.05497 = phi i64 [ 0, %.lr.ph92.preheader ], [ %.05497.be, %.lr.ph99.backedge ]
  %.05596 = phi i64 [ -1, %.lr.ph92.preheader ], [ %.05596.be, %.lr.ph99.backedge ]
  %56 = phi i64 [ 0, %.lr.ph92.preheader ], [ %.be, %.lr.ph99.backedge ]
  %57 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %.05497
  %58 = load i64, ptr %57, align 8, !tbaa !11
  %59 = icmp sgt i64 %58, %56
  br i1 %59, label %60, label %65

60:                                               ; preds = %.lr.ph99
  %61 = getelementptr inbounds [500 x i8], ptr @vis, i64 0, i64 %.05497
  %62 = load i8, ptr %61, align 1, !tbaa !21, !range !23, !noundef !24
  %63 = trunc nuw i8 %62 to i1
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i64 %58, ptr %3, align 8, !tbaa !11
  br label %65

65:                                               ; preds = %.lr.ph99, %60, %64
  %66 = phi i64 [ %56, %60 ], [ %58, %64 ], [ %56, %.lr.ph99 ]
  %.1 = phi i64 [ %.05596, %60 ], [ %.05497, %64 ], [ %.05596, %.lr.ph99 ]
  %67 = add nuw nsw i64 %.05497, 1
  %exitcond110.not = icmp eq i64 %67, %40
  br i1 %exitcond110.not, label %._crit_edge100, label %.lr.ph99.backedge

.lr.ph99.backedge:                                ; preds = %65, %.loopexit
  %.05497.be = phi i64 [ %67, %65 ], [ 0, %.loopexit ]
  %.05596.be = phi i64 [ %.1, %65 ], [ -1, %.loopexit ]
  %.be = phi i64 [ %66, %65 ], [ 0, %.loopexit ]
  br label %.lr.ph99, !llvm.loop !25

68:                                               ; preds = %._crit_edge100
  %69 = icmp eq i64 %.1, %42
  br i1 %69, label %84, label %70

70:                                               ; preds = %68
  %71 = getelementptr inbounds [500 x i8], ptr @vis, i64 0, i64 %.1
  store i8 1, ptr %71, align 1, !tbaa !21
  br i1 %41, label %.lr.ph104, label %.._crit_edge100.thread_crit_edge.critedge

.lr.ph104:                                        ; preds = %70, %82
  %.053102 = phi i64 [ %83, %82 ], [ 0, %70 ]
  %72 = getelementptr inbounds [500 x i64], ptr @flow, i64 0, i64 %.053102
  %73 = load i64, ptr %72, align 8, !tbaa !11
  %74 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %.1, i64 %.053102
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %74)
  %76 = load i64, ptr %75, align 8, !tbaa !11
  %77 = icmp slt i64 %73, %76
  br i1 %77, label %78, label %82

78:                                               ; preds = %.lr.ph104
  %79 = getelementptr inbounds [500 x i64], ptr @prevnode, i64 0, i64 %.053102
  store i64 %.1, ptr %79, align 8, !tbaa !11
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %74)
  %81 = load i64, ptr %80, align 8, !tbaa !11
  store i64 %81, ptr %72, align 8, !tbaa !11
  br label %82

82:                                               ; preds = %.lr.ph104, %78
  %83 = add nuw nsw i64 %.053102, 1
  %exitcond111.not = icmp eq i64 %83, %40
  br i1 %exitcond111.not, label %.loopexit, label %.lr.ph104, !llvm.loop !26

84:                                               ; preds = %68
  %85 = load i64, ptr %43, align 8, !tbaa !11
  %86 = add nsw i64 %85, %.058
  br i1 %.not71105, label %.critedge, label %.lr.ph108

.lr.ph108:                                        ; preds = %84, %.lr.ph108
  %.0106 = phi i64 [ %88, %.lr.ph108 ], [ %42, %84 ]
  %87 = getelementptr inbounds [500 x i64], ptr @prevnode, i64 0, i64 %.0106
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %88, i64 %.0106
  %90 = load i64, ptr %89, align 8, !tbaa !11
  %91 = sub nsw i64 %90, %85
  store i64 %91, ptr %89, align 8, !tbaa !11
  %92 = getelementptr inbounds [500 x [500 x i64]], ptr @cap, i64 0, i64 %.0106, i64 %88
  %93 = load i64, ptr %92, align 8, !tbaa !11
  %94 = add nsw i64 %93, %85
  store i64 %94, ptr %92, align 8, !tbaa !11
  %.not71 = icmp eq i64 %88, 0
  br i1 %.not71, label %.critedge, label %.lr.ph108, !llvm.loop !27

.critedge:                                        ; preds = %.lr.ph108, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  br label %54

._crit_edge93.._crit_edge100.thread_crit_edge.critedge: ; preds = %54
  store i64 1000000000000, ptr @flow, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store i64 0, ptr %3, align 8, !tbaa !11
  br label %._crit_edge100.thread

.._crit_edge100.thread_crit_edge.critedge:        ; preds = %70
  store i64 0, ptr %3, align 8, !tbaa !11
  br label %._crit_edge100.thread

._crit_edge100.thread:                            ; preds = %._crit_edge100, %.loopexit, %.._crit_edge100.thread_crit_edge.critedge, %._crit_edge93.._crit_edge100.thread_crit_edge.critedge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.058)
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %95, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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 = { 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 #3 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !16}
!21 = !{!22, !22, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !16}
!26 = distinct !{!26, !16}
!27 = distinct !{!27, !16}


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