; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 28. Codechef Problems (shortestRoute)

; 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" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

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

30:                                               ; preds = %335, %0
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = add nsw i64 %31, -1
  store i64 %32, ptr %2, align 8, !tbaa !8
  %33 = icmp ne i64 %31, 0
  br i1 %33, label %34, label %338

34:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #11
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #11
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %37 = load i64, ptr %3, align 8, !tbaa !8
  %38 = call ptr @llvm.stacksave.p0()
  store ptr %38, ptr %5, align 8
  %39 = alloca i64, i64 %37, align 16
  store i64 %37, ptr %6, align 8
  %40 = load i64, ptr %4, align 8, !tbaa !8
  %41 = alloca i64, i64 %40, align 16
  store i64 %40, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #11
  store i64 -1, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #11
  store i64 -1, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #11
  store i64 0, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #11
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %42

42:                                               ; preds = %62, %34
  %43 = load i32, ptr %11, align 4, !tbaa !11
  %44 = sext i32 %43 to i64
  %45 = load i64, ptr %3, align 8, !tbaa !8
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #11
  br label %65

48:                                               ; preds = %42
  %49 = load i32, ptr %11, align 4, !tbaa !11
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds i64, ptr %39, i64 %50
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %51)
  %53 = load i32, ptr %11, align 4, !tbaa !11
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i64, ptr %39, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !8
  %57 = icmp eq i64 %56, 2
  br i1 %57, label %58, label %61

58:                                               ; preds = %48
  %59 = load i32, ptr %11, align 4, !tbaa !11
  %60 = sext i32 %59 to i64
  store i64 %60, ptr %8, align 8, !tbaa !8
  br label %61

61:                                               ; preds = %58, %48
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %11, align 4, !tbaa !11
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %11, align 4, !tbaa !11
  br label %42, !llvm.loop !13

65:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #11
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %66

66:                                               ; preds = %82, %65
  %67 = load i32, ptr %12, align 4, !tbaa !11
  %68 = sext i32 %67 to i64
  %69 = load i64, ptr %3, align 8, !tbaa !8
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %66
  store i32 7, ptr %13, align 4
  br label %85

72:                                               ; preds = %66
  %73 = load i32, ptr %12, align 4, !tbaa !11
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i64, ptr %39, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = icmp eq i64 %76, 1
  br i1 %77, label %78, label %81

78:                                               ; preds = %72
  %79 = load i32, ptr %12, align 4, !tbaa !11
  %80 = sext i32 %79 to i64
  store i64 %80, ptr %9, align 8, !tbaa !8
  store i32 7, ptr %13, align 4
  br label %85

81:                                               ; preds = %72
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %12, align 4, !tbaa !11
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %12, align 4, !tbaa !11
  br label %66, !llvm.loop !15

85:                                               ; preds = %78, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #11
  br label %86

86:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #11
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %87

87:                                               ; preds = %98, %86
  %88 = load i32, ptr %14, align 4, !tbaa !11
  %89 = sext i32 %88 to i64
  %90 = load i64, ptr %4, align 8, !tbaa !8
  %91 = icmp slt i64 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %87
  store i32 10, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #11
  br label %101

93:                                               ; preds = %87
  %94 = load i32, ptr %14, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i64, ptr %41, i64 %95
  %97 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %96)
  br label %98

98:                                               ; preds = %93
  %99 = load i32, ptr %14, align 4, !tbaa !11
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %14, align 4, !tbaa !11
  br label %87, !llvm.loop !16

101:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #11
  %102 = load i64, ptr %3, align 8, !tbaa !8
  %103 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %102, i64 4)
  %104 = extractvalue { i64, i1 } %103, 1
  %105 = extractvalue { i64, i1 } %103, 0
  %106 = select i1 %104, i64 -1, i64 %105
  %107 = call noalias noundef nonnull ptr @_Znam(i64 noundef %106) #12
  call void @llvm.memset.p0.i64(ptr align 4 %107, i8 0, i64 %106, i1 false)
  store ptr %107, ptr %15, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #11
  %108 = load i64, ptr %3, align 8, !tbaa !8
  %109 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %108, i64 4)
  %110 = extractvalue { i64, i1 } %109, 1
  %111 = extractvalue { i64, i1 } %109, 0
  %112 = select i1 %110, i64 -1, i64 %111
  %113 = call noalias noundef nonnull ptr @_Znam(i64 noundef %112) #12
  call void @llvm.memset.p0.i64(ptr align 4 %113, i8 0, i64 %112, i1 false)
  store ptr %113, ptr %16, align 8, !tbaa !17
  %114 = load i64, ptr %9, align 8, !tbaa !8
  %115 = icmp ne i64 %114, -1
  br i1 %115, label %116, label %169

116:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #11
  %117 = load i64, ptr %9, align 8, !tbaa !8
  %118 = trunc i64 %117 to i32
  store i32 %118, ptr %17, align 4, !tbaa !11
  br label %119

119:                                              ; preds = %165, %116
  %120 = load i32, ptr %17, align 4, !tbaa !11
  %121 = sext i32 %120 to i64
  %122 = load i64, ptr %3, align 8, !tbaa !8
  %123 = icmp slt i64 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %119
  store i32 13, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #11
  br label %168

125:                                              ; preds = %119
  %126 = load i32, ptr %17, align 4, !tbaa !11
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i64, ptr %39, i64 %127
  %129 = load i64, ptr %128, align 8, !tbaa !8
  %130 = icmp eq i64 %129, 0
  br i1 %130, label %131, label %140

131:                                              ; preds = %125
  %132 = load i64, ptr %10, align 8, !tbaa !8
  %133 = add nsw i64 %132, 1
  store i64 %133, ptr %10, align 8, !tbaa !8
  %134 = load i64, ptr %10, align 8, !tbaa !8
  %135 = trunc i64 %134 to i32
  %136 = load ptr, ptr %15, align 8, !tbaa !17
  %137 = load i32, ptr %17, align 4, !tbaa !11
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i32, ptr %136, i64 %138
  store i32 %135, ptr %139, align 4, !tbaa !11
  br label %140

140:                                              ; preds = %131, %125
  %141 = load i32, ptr %17, align 4, !tbaa !11
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i64, ptr %39, i64 %142
  %144 = load i64, ptr %143, align 8, !tbaa !8
  %145 = icmp eq i64 %144, 1
  br i1 %145, label %146, label %151

146:                                              ; preds = %140
  store i64 0, ptr %10, align 8, !tbaa !8
  %147 = load ptr, ptr %15, align 8, !tbaa !17
  %148 = load i32, ptr %17, align 4, !tbaa !11
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds i32, ptr %147, i64 %149
  store i32 -1, ptr %150, align 4, !tbaa !11
  br label %151

151:                                              ; preds = %146, %140
  %152 = load i32, ptr %17, align 4, !tbaa !11
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i64, ptr %39, i64 %153
  %155 = load i64, ptr %154, align 8, !tbaa !8
  %156 = icmp eq i64 %155, 2
  br i1 %156, label %157, label %164

157:                                              ; preds = %151
  %158 = load i64, ptr %10, align 8, !tbaa !8
  %159 = add nsw i64 %158, 1
  store i64 %159, ptr %10, align 8, !tbaa !8
  %160 = load ptr, ptr %15, align 8, !tbaa !17
  %161 = load i32, ptr %17, align 4, !tbaa !11
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i32, ptr %160, i64 %162
  store i32 -1, ptr %163, align 4, !tbaa !11
  br label %164

164:                                              ; preds = %157, %151
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %17, align 4, !tbaa !11
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %17, align 4, !tbaa !11
  br label %119, !llvm.loop !19

168:                                              ; preds = %124
  br label %169

169:                                              ; preds = %168, %101
  %170 = load i64, ptr %8, align 8, !tbaa !8
  %171 = icmp ne i64 %170, -1
  br i1 %171, label %172, label %223

172:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #11
  %173 = load i64, ptr %8, align 8, !tbaa !8
  %174 = trunc i64 %173 to i32
  store i32 %174, ptr %18, align 4, !tbaa !11
  br label %175

175:                                              ; preds = %219, %172
  %176 = load i32, ptr %18, align 4, !tbaa !11
  %177 = icmp sge i32 %176, 0
  br i1 %177, label %179, label %178

178:                                              ; preds = %175
  store i32 16, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #11
  br label %222

179:                                              ; preds = %175
  %180 = load i32, ptr %18, align 4, !tbaa !11
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i64, ptr %39, i64 %181
  %183 = load i64, ptr %182, align 8, !tbaa !8
  %184 = icmp eq i64 %183, 0
  br i1 %184, label %185, label %194

185:                                              ; preds = %179
  %186 = load i64, ptr %10, align 8, !tbaa !8
  %187 = add nsw i64 %186, 1
  store i64 %187, ptr %10, align 8, !tbaa !8
  %188 = load i64, ptr %10, align 8, !tbaa !8
  %189 = trunc i64 %188 to i32
  %190 = load ptr, ptr %16, align 8, !tbaa !17
  %191 = load i32, ptr %18, align 4, !tbaa !11
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds i32, ptr %190, i64 %192
  store i32 %189, ptr %193, align 4, !tbaa !11
  br label %194

194:                                              ; preds = %185, %179
  %195 = load i32, ptr %18, align 4, !tbaa !11
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i64, ptr %39, i64 %196
  %198 = load i64, ptr %197, align 8, !tbaa !8
  %199 = icmp eq i64 %198, 2
  br i1 %199, label %200, label %205

200:                                              ; preds = %194
  store i64 0, ptr %10, align 8, !tbaa !8
  %201 = load ptr, ptr %16, align 8, !tbaa !17
  %202 = load i32, ptr %18, align 4, !tbaa !11
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds i32, ptr %201, i64 %203
  store i32 -1, ptr %204, align 4, !tbaa !11
  br label %205

205:                                              ; preds = %200, %194
  %206 = load i32, ptr %18, align 4, !tbaa !11
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds i64, ptr %39, i64 %207
  %209 = load i64, ptr %208, align 8, !tbaa !8
  %210 = icmp eq i64 %209, 1
  br i1 %210, label %211, label %218

211:                                              ; preds = %205
  %212 = load i64, ptr %10, align 8, !tbaa !8
  %213 = add nsw i64 %212, 1
  store i64 %213, ptr %10, align 8, !tbaa !8
  %214 = load ptr, ptr %16, align 8, !tbaa !17
  %215 = load i32, ptr %18, align 4, !tbaa !11
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds i32, ptr %214, i64 %216
  store i32 -1, ptr %217, align 4, !tbaa !11
  br label %218

218:                                              ; preds = %211, %205
  br label %219

219:                                              ; preds = %218
  %220 = load i32, ptr %18, align 4, !tbaa !11
  %221 = add nsw i32 %220, -1
  store i32 %221, ptr %18, align 4, !tbaa !11
  br label %175, !llvm.loop !20

222:                                              ; preds = %178
  br label %223

223:                                              ; preds = %222, %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #11
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %224

224:                                              ; preds = %279, %223
  %225 = load i32, ptr %19, align 4, !tbaa !11
  %226 = sext i32 %225 to i64
  %227 = load i64, ptr %3, align 8, !tbaa !8
  %228 = icmp slt i64 %226, %227
  br i1 %228, label %230, label %229

229:                                              ; preds = %224
  store i32 19, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #11
  br label %282

230:                                              ; preds = %224
  %231 = load ptr, ptr %15, align 8, !tbaa !17
  %232 = load i32, ptr %19, align 4, !tbaa !11
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds i32, ptr %231, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !11
  %236 = icmp eq i32 %235, 0
  br i1 %236, label %237, label %242

237:                                              ; preds = %230
  %238 = load ptr, ptr %15, align 8, !tbaa !17
  %239 = load i32, ptr %19, align 4, !tbaa !11
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds i32, ptr %238, i64 %240
  store i32 2147483647, ptr %241, align 4, !tbaa !11
  br label %242

242:                                              ; preds = %237, %230
  %243 = load ptr, ptr %16, align 8, !tbaa !17
  %244 = load i32, ptr %19, align 4, !tbaa !11
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds i32, ptr %243, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !11
  %248 = icmp eq i32 %247, 0
  br i1 %248, label %249, label %254

249:                                              ; preds = %242
  %250 = load ptr, ptr %16, align 8, !tbaa !17
  %251 = load i32, ptr %19, align 4, !tbaa !11
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds i32, ptr %250, i64 %252
  store i32 2147483647, ptr %253, align 4, !tbaa !11
  br label %254

254:                                              ; preds = %249, %242
  %255 = load ptr, ptr %15, align 8, !tbaa !17
  %256 = load i32, ptr %19, align 4, !tbaa !11
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds i32, ptr %255, i64 %257
  %259 = load i32, ptr %258, align 4, !tbaa !11
  %260 = icmp eq i32 %259, -1
  br i1 %260, label %261, label %266

261:                                              ; preds = %254
  %262 = load ptr, ptr %15, align 8, !tbaa !17
  %263 = load i32, ptr %19, align 4, !tbaa !11
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds i32, ptr %262, i64 %264
  store i32 0, ptr %265, align 4, !tbaa !11
  br label %266

266:                                              ; preds = %261, %254
  %267 = load ptr, ptr %16, align 8, !tbaa !17
  %268 = load i32, ptr %19, align 4, !tbaa !11
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds i32, ptr %267, i64 %269
  %271 = load i32, ptr %270, align 4, !tbaa !11
  %272 = icmp eq i32 %271, -1
  br i1 %272, label %273, label %278

273:                                              ; preds = %266
  %274 = load ptr, ptr %16, align 8, !tbaa !17
  %275 = load i32, ptr %19, align 4, !tbaa !11
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds i32, ptr %274, i64 %276
  store i32 0, ptr %277, align 4, !tbaa !11
  br label %278

278:                                              ; preds = %273, %266
  br label %279

279:                                              ; preds = %278
  %280 = load i32, ptr %19, align 4, !tbaa !11
  %281 = add nsw i32 %280, 1
  store i32 %281, ptr %19, align 4, !tbaa !11
  br label %224, !llvm.loop !21

282:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #11
  store i32 0, ptr %20, align 4, !tbaa !11
  br label %283

283:                                              ; preds = %332, %282
  %284 = load i32, ptr %20, align 4, !tbaa !11
  %285 = sext i32 %284 to i64
  %286 = load i64, ptr %4, align 8, !tbaa !8
  %287 = icmp slt i64 %285, %286
  br i1 %287, label %289, label %288

288:                                              ; preds = %283
  store i32 22, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #11
  br label %335

289:                                              ; preds = %283
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #11
  %290 = load i32, ptr %20, align 4, !tbaa !11
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds i64, ptr %41, i64 %291
  %293 = load i64, ptr %292, align 8, !tbaa !8
  %294 = trunc i64 %293 to i32
  %295 = sext i32 %294 to i64
  store i64 %295, ptr %21, align 8, !tbaa !8
  %296 = load i64, ptr %21, align 8, !tbaa !8
  %297 = sub nsw i64 %296, 1
  %298 = getelementptr inbounds i64, ptr %39, i64 %297
  %299 = load i64, ptr %298, align 8, !tbaa !8
  %300 = icmp ne i64 %299, 0
  br i1 %300, label %307, label %301

301:                                              ; preds = %289
  %302 = load i32, ptr %20, align 4, !tbaa !11
  %303 = sext i32 %302 to i64
  %304 = getelementptr inbounds i64, ptr %41, i64 %303
  %305 = load i64, ptr %304, align 8, !tbaa !8
  %306 = icmp eq i64 %305, 1
  br i1 %306, label %307, label %310

307:                                              ; preds = %301, %289
  %308 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %309 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %308, ptr noundef @.str)
  br label %331

310:                                              ; preds = %301
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #11
  %311 = load ptr, ptr %15, align 8, !tbaa !17
  %312 = load i64, ptr %21, align 8, !tbaa !8
  %313 = sub nsw i64 %312, 1
  %314 = getelementptr inbounds i32, ptr %311, i64 %313
  %315 = load ptr, ptr %16, align 8, !tbaa !17
  %316 = load i64, ptr %21, align 8, !tbaa !8
  %317 = sub nsw i64 %316, 1
  %318 = getelementptr inbounds i32, ptr %315, i64 %317
  %319 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %314, ptr noundef nonnull align 4 dereferenceable(4) %318)
  %320 = load i32, ptr %319, align 4, !tbaa !11
  %321 = sext i32 %320 to i64
  store i64 %321, ptr %22, align 8, !tbaa !8
  %322 = load i64, ptr %22, align 8, !tbaa !8
  %323 = icmp eq i64 %322, 2147483647
  br i1 %323, label %324, label %326

324:                                              ; preds = %310
  %325 = 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)
  br label %330

326:                                              ; preds = %310
  %327 = load i64, ptr %22, align 8, !tbaa !8
  %328 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %327)
  %329 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %328, ptr noundef @.str)
  br label %330

330:                                              ; preds = %326, %324
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #11
  br label %331

331:                                              ; preds = %330, %307
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #11
  br label %332

332:                                              ; preds = %331
  %333 = load i32, ptr %20, align 4, !tbaa !11
  %334 = add nsw i32 %333, 1
  store i32 %334, ptr %20, align 4, !tbaa !11
  br label %283, !llvm.loop !22

335:                                              ; preds = %288
  %336 = 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.end.p0(i64 8, ptr %16) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #11
  %337 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %337)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #11
  br label %30, !llvm.loop !23

338:                                              ; preds = %30
  store i32 0, ptr %1, align 4
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #11
  %339 = load i32, ptr %1, align 4
  ret i32 %339
}

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #6

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #7

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

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

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

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

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

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

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

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !10, i64 0}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}


; 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" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #10
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %11 = load i64, ptr %1, align 8, !tbaa !8
  %12 = add nsw i64 %11, -1
  store i64 %12, ptr %1, align 8, !tbaa !8
  %.not131 = icmp eq i64 %11, 0
  br i1 %.not131, label %._crit_edge134, label %.lr.ph133

.lr.ph133:                                        ; preds = %0, %._crit_edge130
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #10
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %15 = load i64, ptr %2, align 8, !tbaa !8
  %16 = call ptr @llvm.stacksave.p0()
  %17 = alloca i64, i64 %15, align 16
  %18 = load i64, ptr %3, align 8, !tbaa !8
  %19 = alloca i64, i64 %18, align 16
  %20 = load i64, ptr %2, align 8, !tbaa !8
  %21 = icmp sgt i64 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

.preheader103:                                    ; preds = %.lr.ph
  %22 = icmp sgt i64 %27, 0
  br i1 %22, label %.lr.ph108, label %._crit_edgethread-pre-split

.lr.ph:                                           ; preds = %.lr.ph133, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph133 ]
  %.0105 = phi i64 [ %spec.select, %.lr.ph ], [ -1, %.lr.ph133 ]
  %23 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %25 = load i64, ptr %23, align 8, !tbaa !8
  %26 = icmp eq i64 %25, 2
  %spec.select = select i1 %26, i64 %indvars.iv, i64 %.0105
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i64, ptr %2, align 8, !tbaa !8
  %28 = icmp sgt i64 %27, %indvars.iv.next
  br i1 %28, label %.lr.ph, label %.preheader103, !llvm.loop !11

29:                                               ; preds = %.lr.ph108
  %indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next143, %27
  br i1 %exitcond.not, label %._crit_edgethread-pre-split, label %.lr.ph108, !llvm.loop !13

.lr.ph108:                                        ; preds = %.preheader103, %29
  %indvars.iv142 = phi i64 [ %indvars.iv.next143, %29 ], [ 0, %.preheader103 ]
  %30 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv142
  %31 = load i64, ptr %30, align 8, !tbaa !8
  %32 = icmp eq i64 %31, 1
  br i1 %32, label %._crit_edgethread-pre-split, label %29

._crit_edgethread-pre-split:                      ; preds = %.lr.ph108, %29, %.preheader103
  %.078.ph = phi i64 [ -1, %.preheader103 ], [ -1, %29 ], [ %indvars.iv142, %.lr.ph108 ]
  %.pr = load i64, ptr %3, align 8, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph133, %._crit_edgethread-pre-split
  %33 = phi i64 [ %.pr, %._crit_edgethread-pre-split ], [ %18, %.lr.ph133 ]
  %.lcssa165 = phi i64 [ %27, %._crit_edgethread-pre-split ], [ %20, %.lr.ph133 ]
  %.0.lcssa164 = phi i64 [ %spec.select, %._crit_edgethread-pre-split ], [ -1, %.lr.ph133 ]
  %.078 = phi i64 [ %.078.ph, %._crit_edgethread-pre-split ], [ -1, %.lr.ph133 ]
  %34 = icmp sgt i64 %33, 0
  br i1 %34, label %.lr.ph114, label %._crit_edge115

._crit_edge115.loopexit:                          ; preds = %.lr.ph114
  %.pre = load i64, ptr %2, align 8, !tbaa !8
  br label %._crit_edge115

._crit_edge115:                                   ; preds = %._crit_edge115.loopexit, %._crit_edge
  %35 = phi i64 [ %46, %._crit_edge115.loopexit ], [ %33, %._crit_edge ]
  %36 = phi i64 [ %.pre, %._crit_edge115.loopexit ], [ %.lcssa165, %._crit_edge ]
  %37 = icmp ugt i64 %36, 4611686018427387903
  %38 = shl i64 %36, 2
  %39 = select i1 %37, i64 -1, i64 %38
  %40 = call noalias noundef nonnull ptr @_Znam(i64 noundef %39) #11
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %40, i8 0, i64 %39, i1 false)
  %41 = call noalias noundef nonnull ptr @_Znam(i64 noundef %39) #11
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %41, i8 0, i64 %39, i1 false)
  %.not91 = icmp ne i64 %.078, -1
  %42 = icmp sgt i64 %36, %.078
  %or.cond137 = and i1 %.not91, %42
  br i1 %or.cond137, label %.lr.ph119.preheader, label %.loopexit102

.lr.ph119.preheader:                              ; preds = %._crit_edge115
  %sext161 = shl i64 %.078, 32
  %43 = ashr exact i64 %sext161, 32
  br label %.lr.ph119

.lr.ph114:                                        ; preds = %._crit_edge, %.lr.ph114
  %indvars.iv145 = phi i64 [ %indvars.iv.next146, %.lr.ph114 ], [ 0, %._crit_edge ]
  %44 = getelementptr inbounds i64, ptr %19, i64 %indvars.iv145
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %44)
  %indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
  %46 = load i64, ptr %3, align 8, !tbaa !8
  %47 = icmp sgt i64 %46, %indvars.iv.next146
  br i1 %47, label %.lr.ph114, label %._crit_edge115.loopexit, !llvm.loop !14

.lr.ph119:                                        ; preds = %.lr.ph119.preheader, %.thread95
  %indvars.iv148 = phi i64 [ %43, %.lr.ph119.preheader ], [ %indvars.iv.next149, %.thread95 ]
  %48 = phi i64 [ %.078, %.lr.ph119.preheader ], [ %indvars.iv.next149, %.thread95 ]
  %.079116 = phi i64 [ 0, %.lr.ph119.preheader ], [ %.3, %.thread95 ]
  %49 = getelementptr inbounds i64, ptr %17, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !8
  switch i64 %50, label %.thread95 [
    i64 0, label %.thread
    i64 1, label %.thread95.sink.split
    i64 2, label %53
  ]

.thread:                                          ; preds = %.lr.ph119
  %51 = add nsw i64 %.079116, 1
  %52 = trunc i64 %51 to i32
  br label %.thread95.sink.split

53:                                               ; preds = %.lr.ph119
  %54 = add nsw i64 %.079116, 1
  br label %.thread95.sink.split

.thread95.sink.split:                             ; preds = %.lr.ph119, %53, %.thread
  %.sink = phi i32 [ %52, %.thread ], [ -1, %53 ], [ -1, %.lr.ph119 ]
  %.3.ph = phi i64 [ %51, %.thread ], [ %54, %53 ], [ 0, %.lr.ph119 ]
  %55 = getelementptr inbounds i32, ptr %40, i64 %48
  store i32 %.sink, ptr %55, align 4, !tbaa !15
  br label %.thread95

.thread95:                                        ; preds = %.thread95.sink.split, %.lr.ph119
  %.3 = phi i64 [ %.079116, %.lr.ph119 ], [ %.3.ph, %.thread95.sink.split ]
  %indvars.iv.next149 = add nsw i64 %indvars.iv148, 1
  %56 = icmp sgt i64 %36, %indvars.iv.next149
  br i1 %56, label %.lr.ph119, label %.loopexit102, !llvm.loop !17

.loopexit102:                                     ; preds = %.thread95, %._crit_edge115
  %.4 = phi i64 [ 0, %._crit_edge115 ], [ %.3, %.thread95 ]
  %57 = and i64 %.0.lcssa164, 2147483648
  %58 = icmp eq i64 %57, 0
  br i1 %58, label %.lr.ph124.preheader, label %.loopexit

.lr.ph124.preheader:                              ; preds = %.loopexit102
  %59 = and i64 %.0.lcssa164, 2147483647
  %60 = and i64 %.0.lcssa164, 1
  %lcmp.mod.not.not = icmp eq i64 %60, 0
  br i1 %lcmp.mod.not.not, label %.lr.ph124.prol, label %.lr.ph124.prol.loopexit

.lr.ph124.prol:                                   ; preds = %.lr.ph124.preheader
  %61 = getelementptr inbounds i64, ptr %17, i64 %59
  %62 = load i64, ptr %61, align 8, !tbaa !8
  switch i64 %62, label %.thread100.prol [
    i64 0, label %.thread97.prol
    i64 2, label %.thread100.sink.split.prol
    i64 1, label %63
  ]

63:                                               ; preds = %.lr.ph124.prol
  %64 = add nsw i64 %.4, 1
  br label %.thread100.sink.split.prol

.thread97.prol:                                   ; preds = %.lr.ph124.prol
  %65 = add nsw i64 %.4, 1
  %66 = trunc i64 %65 to i32
  br label %.thread100.sink.split.prol

.thread100.sink.split.prol:                       ; preds = %.thread97.prol, %63, %.lr.ph124.prol
  %.sink168.prol = phi i32 [ %66, %.thread97.prol ], [ -1, %63 ], [ -1, %.lr.ph124.prol ]
  %.8.ph.prol = phi i64 [ %65, %.thread97.prol ], [ %64, %63 ], [ 0, %.lr.ph124.prol ]
  %67 = getelementptr inbounds i32, ptr %41, i64 %59
  store i32 %.sink168.prol, ptr %67, align 4, !tbaa !15
  br label %.thread100.prol

.thread100.prol:                                  ; preds = %.thread100.sink.split.prol, %.lr.ph124.prol
  %.8.prol = phi i64 [ %.4, %.lr.ph124.prol ], [ %.8.ph.prol, %.thread100.sink.split.prol ]
  %indvars.iv.next152.prol = add nsw i64 %59, -1
  br label %.lr.ph124.prol.loopexit

.lr.ph124.prol.loopexit:                          ; preds = %.thread100.prol, %.lr.ph124.preheader
  %indvars.iv151.unr = phi i64 [ %59, %.lr.ph124.preheader ], [ %indvars.iv.next152.prol, %.thread100.prol ]
  %.5121.unr = phi i64 [ %.4, %.lr.ph124.preheader ], [ %.8.prol, %.thread100.prol ]
  %68 = icmp eq i64 %59, 0
  br i1 %68, label %.loopexit, label %.lr.ph124

.lr.ph124:                                        ; preds = %.lr.ph124.prol.loopexit, %.thread100.1
  %indvars.iv151 = phi i64 [ %indvars.iv.next152.1, %.thread100.1 ], [ %indvars.iv151.unr, %.lr.ph124.prol.loopexit ]
  %.5121 = phi i64 [ %.8.1, %.thread100.1 ], [ %.5121.unr, %.lr.ph124.prol.loopexit ]
  %69 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv151
  %70 = load i64, ptr %69, align 8, !tbaa !8
  switch i64 %70, label %.thread100 [
    i64 0, label %.thread97
    i64 2, label %.thread100.sink.split
    i64 1, label %73
  ]

.thread97:                                        ; preds = %.lr.ph124
  %71 = add nsw i64 %.5121, 1
  %72 = trunc i64 %71 to i32
  br label %.thread100.sink.split

73:                                               ; preds = %.lr.ph124
  %74 = add nsw i64 %.5121, 1
  br label %.thread100.sink.split

.thread100.sink.split:                            ; preds = %.lr.ph124, %73, %.thread97
  %.sink168 = phi i32 [ %72, %.thread97 ], [ -1, %73 ], [ -1, %.lr.ph124 ]
  %.8.ph = phi i64 [ %71, %.thread97 ], [ %74, %73 ], [ 0, %.lr.ph124 ]
  %75 = getelementptr inbounds i32, ptr %41, i64 %indvars.iv151
  store i32 %.sink168, ptr %75, align 4, !tbaa !15
  br label %.thread100

.thread100:                                       ; preds = %.thread100.sink.split, %.lr.ph124
  %.8 = phi i64 [ %.5121, %.lr.ph124 ], [ %.8.ph, %.thread100.sink.split ]
  %indvars.iv.next152 = add nsw i64 %indvars.iv151, -1
  %76 = getelementptr inbounds i64, ptr %17, i64 %indvars.iv.next152
  %77 = load i64, ptr %76, align 8, !tbaa !8
  switch i64 %77, label %.thread100.1 [
    i64 0, label %.thread97.1
    i64 2, label %.thread100.sink.split.1
    i64 1, label %78
  ]

78:                                               ; preds = %.thread100
  %79 = add nsw i64 %.8, 1
  br label %.thread100.sink.split.1

.thread97.1:                                      ; preds = %.thread100
  %80 = add nsw i64 %.8, 1
  %81 = trunc i64 %80 to i32
  br label %.thread100.sink.split.1

.thread100.sink.split.1:                          ; preds = %.thread97.1, %78, %.thread100
  %.sink168.1 = phi i32 [ %81, %.thread97.1 ], [ -1, %78 ], [ -1, %.thread100 ]
  %.8.ph.1 = phi i64 [ %80, %.thread97.1 ], [ %79, %78 ], [ 0, %.thread100 ]
  %82 = getelementptr inbounds i32, ptr %41, i64 %indvars.iv.next152
  store i32 %.sink168.1, ptr %82, align 4, !tbaa !15
  br label %.thread100.1

.thread100.1:                                     ; preds = %.thread100.sink.split.1, %.thread100
  %.8.1 = phi i64 [ %.8, %.thread100 ], [ %.8.ph.1, %.thread100.sink.split.1 ]
  %indvars.iv.next152.1 = add nsw i64 %indvars.iv151, -2
  %83 = icmp sgt i64 %indvars.iv151, 1
  br i1 %83, label %.lr.ph124, label %.loopexit, !llvm.loop !18

.loopexit:                                        ; preds = %.lr.ph124.prol.loopexit, %.thread100.1, %.loopexit102
  %84 = icmp sgt i64 %36, 0
  br i1 %84, label %.lr.ph127, label %.preheader

.preheader:                                       ; preds = %103, %.loopexit
  %85 = icmp sgt i64 %35, 0
  br i1 %85, label %.lr.ph129, label %._crit_edge130

.lr.ph127:                                        ; preds = %.loopexit, %103
  %indvars.iv154 = phi i64 [ %indvars.iv.next155, %103 ], [ 0, %.loopexit ]
  %86 = getelementptr inbounds i32, ptr %40, i64 %indvars.iv154
  %87 = load i32, ptr %86, align 4, !tbaa !15
  %88 = icmp eq i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %.lr.ph127
  store i32 2147483647, ptr %86, align 4, !tbaa !15
  br label %90

90:                                               ; preds = %89, %.lr.ph127
  %91 = phi i32 [ 2147483647, %89 ], [ %87, %.lr.ph127 ]
  %92 = getelementptr inbounds i32, ptr %41, i64 %indvars.iv154
  %93 = load i32, ptr %92, align 4, !tbaa !15
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %90
  store i32 2147483647, ptr %92, align 4, !tbaa !15
  br label %96

96:                                               ; preds = %95, %90
  %97 = phi i32 [ 2147483647, %95 ], [ %93, %90 ]
  %98 = icmp eq i32 %91, -1
  br i1 %98, label %99, label %100

99:                                               ; preds = %96
  store i32 0, ptr %86, align 4, !tbaa !15
  br label %100

100:                                              ; preds = %99, %96
  %101 = icmp eq i32 %97, -1
  br i1 %101, label %102, label %103

102:                                              ; preds = %100
  store i32 0, ptr %92, align 4, !tbaa !15
  br label %103

103:                                              ; preds = %100, %102
  %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
  %exitcond157.not = icmp eq i64 %indvars.iv.next155, %36
  br i1 %exitcond157.not, label %.preheader, label %.lr.ph127, !llvm.loop !19

._crit_edge130:                                   ; preds = %129, %.preheader
  %104 = 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)
  call void @llvm.stackrestore.p0(ptr %16)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #10
  %105 = load i64, ptr %1, align 8, !tbaa !8
  %106 = add nsw i64 %105, -1
  store i64 %106, ptr %1, align 8, !tbaa !8
  %.not = icmp eq i64 %105, 0
  br i1 %.not, label %._crit_edge134, label %.lr.ph133, !llvm.loop !20

.lr.ph129:                                        ; preds = %.preheader, %129
  %indvars.iv158 = phi i64 [ %indvars.iv.next159, %129 ], [ 0, %.preheader ]
  %107 = getelementptr inbounds i64, ptr %19, i64 %indvars.iv158
  %108 = load i64, ptr %107, align 8, !tbaa !8
  %sext = shl i64 %108, 32
  %109 = ashr exact i64 %sext, 32
  %110 = add nsw i64 %109, -1
  %111 = getelementptr inbounds i64, ptr %17, i64 %110
  %112 = load i64, ptr %111, align 8, !tbaa !8
  %.not93 = icmp ne i64 %112, 0
  %113 = icmp eq i64 %108, 1
  %or.cond = or i1 %113, %.not93
  br i1 %or.cond, label %114, label %117

114:                                              ; preds = %.lr.ph129
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %115, ptr noundef nonnull @.str)
  br label %129

117:                                              ; preds = %.lr.ph129
  %118 = getelementptr inbounds i32, ptr %40, i64 %110
  %119 = getelementptr inbounds i32, ptr %41, i64 %110
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %118, ptr noundef nonnull align 4 dereferenceable(4) %119)
  %121 = load i32, ptr %120, align 4, !tbaa !15
  %122 = icmp eq i32 %121, 2147483647
  br i1 %122, label %123, label %125

123:                                              ; preds = %117
  %124 = 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)
  br label %129

125:                                              ; preds = %117
  %126 = sext i32 %121 to i64
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %126)
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %127, ptr noundef nonnull @.str)
  br label %129

129:                                              ; preds = %123, %125, %114
  %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
  %130 = load i64, ptr %3, align 8, !tbaa !8
  %131 = icmp sgt i64 %130, %indvars.iv.next159
  br i1 %131, label %.lr.ph129, label %._crit_edge130, !llvm.loop !21

._crit_edge134:                                   ; preds = %._crit_edge130, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #10
  ret i32 0
}

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

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

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #6

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

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

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

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

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

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

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

!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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !10, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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