; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 19. Backtracking (maxmin1)

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

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [18 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1

; 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 ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %25 = 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)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %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) %3)
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = zext i32 %28 to i64
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = zext i32 %30 to i64
  %32 = call ptr @llvm.stacksave.p0()
  store ptr %32, ptr %4, align 8
  %33 = mul nuw i64 %29, %31
  %34 = alloca i32, i64 %33, align 16
  store i64 %29, ptr %5, align 8
  store i64 %31, ptr %6, align 8
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %64, %0
  %37 = load i32, ptr %7, align 4, !tbaa !5
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %42, i32 noundef %44)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %60, %41
  %47 = load i32, ptr %9, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %51, label %50

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

51:                                               ; preds = %46
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = mul nsw i64 %53, %31
  %55 = getelementptr inbounds i32, ptr %34, i64 %54
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i32, ptr %55, i64 %57
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %58)
  br label %60

60:                                               ; preds = %51
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %9, align 4, !tbaa !5
  br label %46, !llvm.loop !9

63:                                               ; preds = %50
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %7, align 4, !tbaa !5
  br label %36, !llvm.loop !11

67:                                               ; preds = %40
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = zext i32 %68 to i64
  %70 = alloca i32, i64 %69, align 16
  store i64 %69, ptr %10, align 8
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = zext i32 %71 to i64
  %73 = alloca i32, i64 %72, align 16
  store i64 %72, ptr %11, align 8
  %74 = mul nuw i64 4, %69
  call void @llvm.memset.p0.i64(ptr align 16 %70, i8 0, i64 %74, i1 false)
  %75 = mul nuw i64 4, %72
  call void @llvm.memset.p0.i64(ptr align 16 %73, i8 0, i64 %75, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %198, %67
  %77 = load i32, ptr %12, align 4, !tbaa !5
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %236

80:                                               ; preds = %76
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = zext i32 %81 to i64
  %83 = call ptr @llvm.stacksave.p0()
  store ptr %83, ptr %13, align 8
  %84 = alloca i32, i64 %82, align 16
  store i64 %82, ptr %14, align 8
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = zext i32 %85 to i64
  %87 = alloca i32, i64 %86, align 16
  store i64 %86, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %165, %80
  %89 = load i32, ptr %16, align 4, !tbaa !5
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

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

93:                                               ; preds = %88
  %94 = load i32, ptr %16, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %70, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = icmp eq i32 %97, 0
  br i1 %98, label %99, label %160

99:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %100 = load i32, ptr %16, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = mul nsw i64 %101, %31
  %103 = getelementptr inbounds i32, ptr %34, i64 %102
  %104 = getelementptr inbounds i32, ptr %103, i64 0
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = getelementptr inbounds i32, ptr %73, i64 0
  %107 = load i32, ptr %106, align 16, !tbaa !5
  %108 = add nsw i32 %105, %107
  store i32 %108, ptr %17, align 4, !tbaa !5
  %109 = load i32, ptr %16, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds i32, ptr %87, i64 %110
  store i32 0, ptr %111, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 1, ptr %18, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %152, %99
  %113 = load i32, ptr %18, align 4, !tbaa !5
  %114 = load i32, ptr %3, align 4, !tbaa !5
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %117, label %116

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

117:                                              ; preds = %112
  %118 = load i32, ptr %16, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = mul nsw i64 %119, %31
  %121 = getelementptr inbounds i32, ptr %34, i64 %120
  %122 = load i32, ptr %18, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i32, ptr %121, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = load i32, ptr %18, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %73, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = add nsw i32 %125, %129
  %131 = load i32, ptr %17, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %133, label %151

133:                                              ; preds = %117
  %134 = load i32, ptr %16, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = mul nsw i64 %135, %31
  %137 = getelementptr inbounds i32, ptr %34, i64 %136
  %138 = load i32, ptr %18, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds i32, ptr %137, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = load i32, ptr %18, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds i32, ptr %73, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = add nsw i32 %141, %145
  store i32 %146, ptr %17, align 4, !tbaa !5
  %147 = load i32, ptr %18, align 4, !tbaa !5
  %148 = load i32, ptr %16, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i32, ptr %87, i64 %149
  store i32 %147, ptr %150, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %133, %117
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %18, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %18, align 4, !tbaa !5
  br label %112, !llvm.loop !12

155:                                              ; preds = %116
  %156 = load i32, ptr %17, align 4, !tbaa !5
  %157 = load i32, ptr %16, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds i32, ptr %84, i64 %158
  store i32 %156, ptr %159, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %164

160:                                              ; preds = %93
  %161 = load i32, ptr %16, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i32, ptr %84, i64 %162
  store i32 2147483647, ptr %163, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %160, %155
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %16, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %16, align 4, !tbaa !5
  br label %88, !llvm.loop !13

168:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 -1, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %195, %168
  %170 = load i32, ptr %21, align 4, !tbaa !5
  %171 = load i32, ptr %2, align 4, !tbaa !5
  %172 = icmp slt i32 %170, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %169
  store i32 16, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %198

174:                                              ; preds = %169
  %175 = load i32, ptr %21, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds i32, ptr %70, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = icmp eq i32 %178, 0
  br i1 %179, label %180, label %194

180:                                              ; preds = %174
  %181 = load i32, ptr %19, align 4, !tbaa !5
  %182 = load i32, ptr %21, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds i32, ptr %84, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = icmp slt i32 %181, %185
  br i1 %186, label %187, label %193

187:                                              ; preds = %180
  %188 = load i32, ptr %21, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %84, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  store i32 %191, ptr %19, align 4, !tbaa !5
  %192 = load i32, ptr %21, align 4, !tbaa !5
  store i32 %192, ptr %20, align 4, !tbaa !5
  br label %193

193:                                              ; preds = %187, %180
  br label %194

194:                                              ; preds = %193, %174
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %21, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %21, align 4, !tbaa !5
  br label %169, !llvm.loop !14

198:                                              ; preds = %173
  %199 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
  %200 = load i32, ptr %20, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  %202 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %199, i32 noundef %201)
  %203 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %202, ptr noundef @.str.5)
  %204 = load i32, ptr %20, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds i32, ptr %87, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %203, i32 noundef %208)
  %210 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %209, ptr noundef @.str.6)
  %211 = load i32, ptr %20, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds i32, ptr %70, i64 %212
  store i32 1, ptr %213, align 4, !tbaa !5
  %214 = load i32, ptr %20, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = mul nsw i64 %215, %31
  %217 = getelementptr inbounds i32, ptr %34, i64 %216
  %218 = load i32, ptr %20, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds i32, ptr %87, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds i32, ptr %217, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = load i32, ptr %20, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds i32, ptr %87, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds i32, ptr %73, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !5
  %232 = add nsw i32 %231, %224
  store i32 %232, ptr %230, align 4, !tbaa !5
  %233 = load i32, ptr %12, align 4, !tbaa !5
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  %235 = load ptr, ptr %13, align 8
  call void @llvm.stackrestore.p0(ptr %235)
  br label %76, !llvm.loop !15

236:                                              ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %237 = getelementptr inbounds i32, ptr %73, i64 0
  %238 = load i32, ptr %237, align 16, !tbaa !5
  store i32 %238, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %239

239:                                              ; preds = %257, %236
  %240 = load i32, ptr %23, align 4, !tbaa !5
  %241 = load i32, ptr %3, align 4, !tbaa !5
  %242 = icmp slt i32 %240, %241
  br i1 %242, label %244, label %243

243:                                              ; preds = %239
  store i32 19, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %260

244:                                              ; preds = %239
  %245 = load i32, ptr %22, align 4, !tbaa !5
  %246 = load i32, ptr %23, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds i32, ptr %73, i64 %247
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = icmp slt i32 %245, %249
  br i1 %250, label %251, label %256

251:                                              ; preds = %244
  %252 = load i32, ptr %23, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds i32, ptr %73, i64 %253
  %255 = load i32, ptr %254, align 4, !tbaa !5
  store i32 %255, ptr %22, align 4, !tbaa !5
  br label %256

256:                                              ; preds = %251, %244
  br label %257

257:                                              ; preds = %256
  %258 = load i32, ptr %23, align 4, !tbaa !5
  %259 = add nsw i32 %258, 1
  store i32 %259, ptr %23, align 4, !tbaa !5
  br label %239, !llvm.loop !16

260:                                              ; preds = %243
  %261 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.7)
  %262 = load i32, ptr %22, align 4, !tbaa !5
  %263 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %261, i32 noundef %262)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %264 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %264)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %265 = load i32, ptr %1, align 4
  ret i32 %265
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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


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

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [18 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [12 x i8], align 1

; 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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %3 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %5 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %6 = 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)
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = zext i32 %7 to i64
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = zext i32 %9 to i64
  %11 = call ptr @llvm.stacksave.p0()
  %12 = mul nuw i64 %10, %8
  %13 = alloca i32, i64 %12, align 16
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph71, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge

.loopexit:                                        ; preds = %37, %.lr.ph71
  %17 = phi i32 [ %33, %.lr.ph71 ], [ %40, %37 ]
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next102, %19
  br i1 %20, label %.lr.ph71, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.loopexit, %.._crit_edge_crit_edge
  %21 = phi i32 [ %.pre, %.._crit_edge_crit_edge ], [ %17, %.loopexit ]
  %22 = phi i32 [ %15, %.._crit_edge_crit_edge ], [ %18, %.loopexit ]
  %23 = zext i32 %22 to i64
  %24 = alloca i32, i64 %23, align 16
  %25 = zext i32 %21 to i64
  %26 = alloca i32, i64 %25, align 16
  %27 = shl nuw nsw i64 %23, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %24, i8 0, i64 %27, i1 false)
  %28 = shl nuw nsw i64 %25, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %26, i8 0, i64 %28, i1 false)
  %29 = icmp sgt i32 %22, 0
  br i1 %29, label %.lr.ph89, label %._crit_edge90

.lr.ph71:                                         ; preds = %0, %.loopexit
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %.loopexit ], [ 0, %0 ]
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %31 = trunc nuw nsw i64 %indvars.iv.next102 to i32
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %30, i32 noundef %31)
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.lr.ph71
  %35 = mul nuw nsw i64 %indvars.iv101, %10
  %36 = getelementptr inbounds i32, ptr %13, i64 %35
  br label %37

37:                                               ; preds = %.lr.ph, %37
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %37 ]
  %38 = getelementptr inbounds i32, ptr %36, i64 %indvars.iv
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %38)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = icmp slt i64 %indvars.iv.next, %41
  br i1 %42, label %37, label %.loopexit, !llvm.loop !11

.lr.ph89:                                         ; preds = %._crit_edge, %._crit_edge85
  %43 = phi i32 [ %155, %._crit_edge85 ], [ %22, %._crit_edge ]
  %.06187 = phi i32 [ %154, %._crit_edge85 ], [ 0, %._crit_edge ]
  %44 = zext i32 %43 to i64
  %45 = call ptr @llvm.stacksave.p0()
  %46 = alloca i32, i64 %44, align 16
  %47 = load i32, ptr %1, align 4, !tbaa !5
  %48 = zext i32 %47 to i64
  %49 = alloca i32, i64 %48, align 16
  %50 = icmp sgt i32 %47, 0
  br i1 %50, label %.lr.ph80, label %._crit_edge85

.lr.ph80:                                         ; preds = %.lr.ph89
  %51 = load i32, ptr %2, align 4
  %.fr97 = freeze i32 %51
  %52 = icmp sgt i32 %.fr97, 1
  br i1 %52, label %.lr.ph80.split.us.preheader, label %.lr.ph80.split.preheader

.lr.ph80.split.preheader:                         ; preds = %.lr.ph80
  %xtraiter = and i64 %48, 1
  %53 = icmp eq i32 %47, 1
  br i1 %53, label %.preheader.loopexit139.unr-lcssa, label %.lr.ph80.split.preheader.new

.lr.ph80.split.preheader.new:                     ; preds = %.lr.ph80.split.preheader
  %unroll_iter = and i64 %48, 2147483646
  br label %.lr.ph80.split

.lr.ph80.split.us.preheader:                      ; preds = %.lr.ph80
  %wide.trip.count110 = zext nneg i32 %.fr97 to i64
  %54 = add nsw i64 %wide.trip.count110, -1
  %xtraiter143 = and i64 %54, 1
  %55 = icmp eq i32 %.fr97, 2
  %unroll_iter146 = and i64 %54, -2
  %lcmp.mod144.not = icmp eq i64 %xtraiter143, 0
  br label %.lr.ph80.split.us

.lr.ph80.split.us:                                ; preds = %.lr.ph80.split.us.preheader, %._crit_edge76.us
  %indvars.iv112 = phi i64 [ 0, %.lr.ph80.split.us.preheader ], [ %indvars.iv.next113, %._crit_edge76.us ]
  %56 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv112
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %.lr.ph75.us, label %._crit_edge76.us

.lr.ph75.us:                                      ; preds = %.lr.ph80.split.us
  %59 = mul nuw nsw i64 %indvars.iv112, %10
  %60 = getelementptr inbounds i32, ptr %13, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load i32, ptr %26, align 16, !tbaa !5
  %63 = add nsw i32 %62, %61
  %64 = getelementptr inbounds i32, ptr %49, i64 %indvars.iv112
  store i32 0, ptr %64, align 4, !tbaa !5
  br i1 %55, label %._crit_edge76.us.loopexit.unr-lcssa, label %.lr.ph75.us.new

._crit_edge76.us.loopexit.unr-lcssa:              ; preds = %91, %.lr.ph75.us
  %.157.us.lcssa.ph = phi i32 [ poison, %.lr.ph75.us ], [ %.157.us.1, %91 ]
  %indvars.iv107.unr = phi i64 [ 1, %.lr.ph75.us ], [ %indvars.iv.next108.1, %91 ]
  %.05672.us.unr = phi i32 [ %63, %.lr.ph75.us ], [ %.157.us.1, %91 ]
  br i1 %lcmp.mod144.not, label %._crit_edge76.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge76.us.loopexit.unr-lcssa
  %65 = getelementptr inbounds i32, ptr %60, i64 %indvars.iv107.unr
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = getelementptr inbounds i32, ptr %26, i64 %indvars.iv107.unr
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = add nsw i32 %68, %66
  %70 = icmp slt i32 %69, %.05672.us.unr
  br i1 %70, label %71, label %._crit_edge76.us

71:                                               ; preds = %.epil.preheader
  %72 = trunc nuw nsw i64 %indvars.iv107.unr to i32
  store i32 %72, ptr %64, align 4, !tbaa !5
  br label %._crit_edge76.us

._crit_edge76.us:                                 ; preds = %._crit_edge76.us.loopexit.unr-lcssa, %71, %.epil.preheader, %.lr.ph80.split.us
  %.157.us.lcssa.sink = phi i32 [ 2147483647, %.lr.ph80.split.us ], [ %.157.us.lcssa.ph, %._crit_edge76.us.loopexit.unr-lcssa ], [ %69, %71 ], [ %.05672.us.unr, %.epil.preheader ]
  %73 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv112
  store i32 %.157.us.lcssa.sink, ptr %73, align 4, !tbaa !5
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %exitcond116.not = icmp eq i64 %indvars.iv.next113, %48
  br i1 %exitcond116.not, label %.preheader, label %.lr.ph80.split.us, !llvm.loop !12

.lr.ph75.us.new:                                  ; preds = %.lr.ph75.us, %91
  %indvars.iv107 = phi i64 [ %indvars.iv.next108.1, %91 ], [ 1, %.lr.ph75.us ]
  %.05672.us = phi i32 [ %.157.us.1, %91 ], [ %63, %.lr.ph75.us ]
  %niter147 = phi i64 [ %niter147.next.1, %91 ], [ 0, %.lr.ph75.us ]
  %74 = getelementptr inbounds i32, ptr %60, i64 %indvars.iv107
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = getelementptr inbounds i32, ptr %26, i64 %indvars.iv107
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %77, %75
  %79 = icmp slt i32 %78, %.05672.us
  br i1 %79, label %80, label %82

80:                                               ; preds = %.lr.ph75.us.new
  %81 = trunc nuw nsw i64 %indvars.iv107 to i32
  store i32 %81, ptr %64, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %80, %.lr.ph75.us.new
  %.157.us = phi i32 [ %78, %80 ], [ %.05672.us, %.lr.ph75.us.new ]
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %83 = getelementptr inbounds i32, ptr %60, i64 %indvars.iv.next108
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = getelementptr inbounds i32, ptr %26, i64 %indvars.iv.next108
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, %84
  %88 = icmp slt i32 %87, %.157.us
  br i1 %88, label %89, label %91

89:                                               ; preds = %82
  %90 = trunc nuw nsw i64 %indvars.iv.next108 to i32
  store i32 %90, ptr %64, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %89, %82
  %.157.us.1 = phi i32 [ %87, %89 ], [ %.157.us, %82 ]
  %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 2
  %niter147.next.1 = add i64 %niter147, 2
  %niter147.ncmp.1 = icmp eq i64 %niter147.next.1, %unroll_iter146
  br i1 %niter147.ncmp.1, label %._crit_edge76.us.loopexit.unr-lcssa, label %.lr.ph75.us.new, !llvm.loop !13

.preheader.loopexit139.unr-lcssa:                 ; preds = %125, %.lr.ph80.split.preheader
  %indvars.iv104.unr = phi i64 [ 0, %.lr.ph80.split.preheader ], [ %indvars.iv.next105.1, %125 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph80.split.epil

.lr.ph80.split.epil:                              ; preds = %.preheader.loopexit139.unr-lcssa
  %92 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv104.unr
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %.preheader.loopexit139.epilog-lcssa

95:                                               ; preds = %.lr.ph80.split.epil
  %96 = mul nuw nsw i64 %indvars.iv104.unr, %10
  %97 = getelementptr inbounds i32, ptr %13, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %26, align 16, !tbaa !5
  %100 = add nsw i32 %99, %98
  %101 = getelementptr inbounds i32, ptr %49, i64 %indvars.iv104.unr
  store i32 0, ptr %101, align 4, !tbaa !5
  br label %.preheader.loopexit139.epilog-lcssa

.preheader.loopexit139.epilog-lcssa:              ; preds = %95, %.lr.ph80.split.epil
  %.sink.epil = phi i32 [ %100, %95 ], [ 2147483647, %.lr.ph80.split.epil ]
  %102 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv104.unr
  store i32 %.sink.epil, ptr %102, align 4
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit139.epilog-lcssa, %.preheader.loopexit139.unr-lcssa, %._crit_edge76.us
  br i1 %50, label %.lr.ph84.preheader, label %._crit_edge85

.lr.ph84.preheader:                               ; preds = %.preheader
  %xtraiter148 = and i64 %48, 1
  %103 = icmp eq i32 %47, 1
  br i1 %103, label %._crit_edge85.loopexit.unr-lcssa, label %.lr.ph84.preheader.new

.lr.ph84.preheader.new:                           ; preds = %.lr.ph84.preheader
  %unroll_iter151 = and i64 %48, 2147483646
  br label %.lr.ph84

.lr.ph80.split:                                   ; preds = %125, %.lr.ph80.split.preheader.new
  %indvars.iv104 = phi i64 [ 0, %.lr.ph80.split.preheader.new ], [ %indvars.iv.next105.1, %125 ]
  %niter = phi i64 [ 0, %.lr.ph80.split.preheader.new ], [ %niter.next.1, %125 ]
  %104 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv104
  %105 = load i32, ptr %104, align 8, !tbaa !5
  %106 = icmp eq i32 %105, 0
  br i1 %106, label %107, label %.lr.ph80.split.1

107:                                              ; preds = %.lr.ph80.split
  %108 = mul nuw nsw i64 %indvars.iv104, %10
  %109 = getelementptr inbounds i32, ptr %13, i64 %108
  %110 = load i32, ptr %109, align 8, !tbaa !5
  %111 = load i32, ptr %26, align 16, !tbaa !5
  %112 = add nsw i32 %111, %110
  %113 = getelementptr inbounds i32, ptr %49, i64 %indvars.iv104
  store i32 0, ptr %113, align 8, !tbaa !5
  br label %.lr.ph80.split.1

.lr.ph80.split.1:                                 ; preds = %.lr.ph80.split, %107
  %.sink = phi i32 [ %112, %107 ], [ 2147483647, %.lr.ph80.split ]
  %114 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv104
  store i32 %.sink, ptr %114, align 8
  %indvars.iv.next105 = or disjoint i64 %indvars.iv104, 1
  %115 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv.next105
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %118, label %125

118:                                              ; preds = %.lr.ph80.split.1
  %119 = mul nuw nsw i64 %indvars.iv.next105, %10
  %120 = getelementptr inbounds i32, ptr %13, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = load i32, ptr %26, align 16, !tbaa !5
  %123 = add nsw i32 %122, %121
  %124 = getelementptr inbounds i32, ptr %49, i64 %indvars.iv.next105
  store i32 0, ptr %124, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %118, %.lr.ph80.split.1
  %.sink.1 = phi i32 [ %123, %118 ], [ 2147483647, %.lr.ph80.split.1 ]
  %126 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv.next105
  store i32 %.sink.1, ptr %126, align 4
  %indvars.iv.next105.1 = add nuw nsw i64 %indvars.iv104, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.loopexit139.unr-lcssa, label %.lr.ph80.split, !llvm.loop !12

._crit_edge85.loopexit.unr-lcssa:                 ; preds = %173, %.lr.ph84.preheader
  %.152.lcssa.ph = phi i32 [ poison, %.lr.ph84.preheader ], [ %.152.1, %173 ]
  %indvars.iv117.unr = phi i64 [ 0, %.lr.ph84.preheader ], [ %indvars.iv.next118.1, %173 ]
  %.05182.unr = phi i32 [ 0, %.lr.ph84.preheader ], [ %.152.1, %173 ]
  %.05381.unr = phi i32 [ -1, %.lr.ph84.preheader ], [ %.154.1, %173 ]
  %lcmp.mod149.not = icmp eq i64 %xtraiter148, 0
  br i1 %lcmp.mod149.not, label %._crit_edge85, label %.lr.ph84.epil

.lr.ph84.epil:                                    ; preds = %._crit_edge85.loopexit.unr-lcssa
  %127 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv117.unr
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = icmp eq i32 %128, 0
  br i1 %129, label %130, label %._crit_edge85

130:                                              ; preds = %.lr.ph84.epil
  %131 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv117.unr
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = icmp slt i32 %.05381.unr, %132
  %134 = trunc nuw nsw i64 %indvars.iv117.unr to i32
  %spec.select67.epil = select i1 %133, i32 %134, i32 %.05182.unr
  br label %._crit_edge85

._crit_edge85:                                    ; preds = %._crit_edge85.loopexit.unr-lcssa, %130, %.lr.ph84.epil, %.lr.ph89, %.preheader
  %.051.lcssa = phi i32 [ 0, %.preheader ], [ 0, %.lr.ph89 ], [ %.152.lcssa.ph, %._crit_edge85.loopexit.unr-lcssa ], [ %.05182.unr, %.lr.ph84.epil ], [ %spec.select67.epil, %130 ]
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
  %136 = add nsw i32 %.051.lcssa, 1
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %135, i32 noundef %136)
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef nonnull @.str.5)
  %139 = sext i32 %.051.lcssa to i64
  %140 = getelementptr inbounds i32, ptr %49, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef %142)
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %143, ptr noundef nonnull @.str.6)
  %145 = getelementptr inbounds i32, ptr %24, i64 %139
  store i32 1, ptr %145, align 4, !tbaa !5
  %146 = mul nsw i64 %139, %10
  %147 = getelementptr inbounds i32, ptr %13, i64 %146
  %148 = sext i32 %141 to i64
  %149 = getelementptr inbounds i32, ptr %147, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = getelementptr inbounds i32, ptr %26, i64 %148
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = add nsw i32 %152, %150
  store i32 %153, ptr %151, align 4, !tbaa !5
  %154 = add nuw nsw i32 %.06187, 1
  call void @llvm.stackrestore.p0(ptr %45)
  %155 = load i32, ptr %1, align 4, !tbaa !5
  %156 = icmp slt i32 %154, %155
  br i1 %156, label %.lr.ph89, label %._crit_edge90.loopexit, !llvm.loop !14

.lr.ph84:                                         ; preds = %173, %.lr.ph84.preheader.new
  %indvars.iv117 = phi i64 [ 0, %.lr.ph84.preheader.new ], [ %indvars.iv.next118.1, %173 ]
  %.05182 = phi i32 [ 0, %.lr.ph84.preheader.new ], [ %.152.1, %173 ]
  %.05381 = phi i32 [ -1, %.lr.ph84.preheader.new ], [ %.154.1, %173 ]
  %niter152 = phi i64 [ 0, %.lr.ph84.preheader.new ], [ %niter152.next.1, %173 ]
  %157 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv117
  %158 = load i32, ptr %157, align 8, !tbaa !5
  %159 = icmp eq i32 %158, 0
  br i1 %159, label %160, label %.lr.ph84.1

160:                                              ; preds = %.lr.ph84
  %161 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv117
  %162 = load i32, ptr %161, align 8, !tbaa !5
  %163 = icmp slt i32 %.05381, %162
  %spec.select = call i32 @llvm.smax.i32(i32 %.05381, i32 %162)
  %164 = trunc nuw nsw i64 %indvars.iv117 to i32
  %spec.select67 = select i1 %163, i32 %164, i32 %.05182
  br label %.lr.ph84.1

.lr.ph84.1:                                       ; preds = %160, %.lr.ph84
  %.154 = phi i32 [ %.05381, %.lr.ph84 ], [ %spec.select, %160 ]
  %.152 = phi i32 [ %.05182, %.lr.ph84 ], [ %spec.select67, %160 ]
  %indvars.iv.next118 = or disjoint i64 %indvars.iv117, 1
  %165 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv.next118
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = icmp eq i32 %166, 0
  br i1 %167, label %168, label %173

168:                                              ; preds = %.lr.ph84.1
  %169 = getelementptr inbounds i32, ptr %46, i64 %indvars.iv.next118
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = icmp slt i32 %.154, %170
  %spec.select.1 = call i32 @llvm.smax.i32(i32 %.154, i32 %170)
  %172 = trunc nuw nsw i64 %indvars.iv.next118 to i32
  %spec.select67.1 = select i1 %171, i32 %172, i32 %.152
  br label %173

173:                                              ; preds = %168, %.lr.ph84.1
  %.154.1 = phi i32 [ %.154, %.lr.ph84.1 ], [ %spec.select.1, %168 ]
  %.152.1 = phi i32 [ %.152, %.lr.ph84.1 ], [ %spec.select67.1, %168 ]
  %indvars.iv.next118.1 = add nuw nsw i64 %indvars.iv117, 2
  %niter152.next.1 = add i64 %niter152, 2
  %niter152.ncmp.1 = icmp eq i64 %niter152.next.1, %unroll_iter151
  br i1 %niter152.ncmp.1, label %._crit_edge85.loopexit.unr-lcssa, label %.lr.ph84, !llvm.loop !15

._crit_edge90.loopexit:                           ; preds = %._crit_edge85
  %.pre127 = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge90

._crit_edge90:                                    ; preds = %._crit_edge90.loopexit, %._crit_edge
  %174 = phi i32 [ %.pre127, %._crit_edge90.loopexit ], [ %21, %._crit_edge ]
  %175 = load i32, ptr %26, align 16, !tbaa !5
  %176 = icmp sgt i32 %174, 0
  br i1 %176, label %.lr.ph94.preheader, label %._crit_edge95

.lr.ph94.preheader:                               ; preds = %._crit_edge90
  %wide.trip.count125 = zext nneg i32 %174 to i64
  %min.iters.check = icmp ult i32 %174, 8
  br i1 %min.iters.check, label %.lr.ph94.preheader137, label %vector.ph

.lr.ph94.preheader137:                            ; preds = %middle.block, %.lr.ph94.preheader
  %indvars.iv122.ph = phi i64 [ 0, %.lr.ph94.preheader ], [ %n.vec, %middle.block ]
  %.04991.ph = phi i32 [ %175, %.lr.ph94.preheader ], [ %182, %middle.block ]
  br label %.lr.ph94

vector.ph:                                        ; preds = %.lr.ph94.preheader
  %n.vec = and i64 %wide.trip.count125, 2147483640
  %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %175, i64 0
  %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %179, %vector.body ]
  %vec.phi135 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %180, %vector.body ]
  %177 = getelementptr inbounds i32, ptr %26, i64 %index
  %178 = getelementptr inbounds i8, ptr %177, i64 16
  %wide.load = load <4 x i32>, ptr %177, align 16, !tbaa !5
  %wide.load136 = load <4 x i32>, ptr %178, align 16, !tbaa !5
  %179 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
  %180 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi135, <4 x i32> %wide.load136)
  %index.next = add nuw i64 %index, 8
  %181 = icmp eq i64 %index.next, %n.vec
  br i1 %181, label %middle.block, label %vector.body, !llvm.loop !16

middle.block:                                     ; preds = %vector.body
  %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %179, <4 x i32> %180)
  %182 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count125
  br i1 %cmp.n, label %._crit_edge95, label %.lr.ph94.preheader137

._crit_edge95:                                    ; preds = %.lr.ph94, %middle.block, %._crit_edge90
  %.049.lcssa = phi i32 [ %175, %._crit_edge90 ], [ %182, %middle.block ], [ %spec.select68, %.lr.ph94 ]
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.7)
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %183, i32 noundef %.049.lcssa)
  call void @llvm.stackrestore.p0(ptr %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph94:                                         ; preds = %.lr.ph94.preheader137, %.lr.ph94
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %.lr.ph94 ], [ %indvars.iv122.ph, %.lr.ph94.preheader137 ]
  %.04991 = phi i32 [ %spec.select68, %.lr.ph94 ], [ %.04991.ph, %.lr.ph94.preheader137 ]
  %185 = getelementptr inbounds i32, ptr %26, i64 %indvars.iv122
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %spec.select68 = call i32 @llvm.smax.i32(i32 %.04991, i32 %186)
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %exitcond126.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count125
  br i1 %exitcond126.not, label %._crit_edge95, label %.lr.ph94, !llvm.loop !19
}

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !10, !18, !17}


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