; LLVM IR from Tunghohin/Competitive_Coding :: Daimayuan (378_FEMALE2021_C)

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

%struct.edge = type { i32, i32 }
%"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" }

@c = external dso_local global [40 x i32], align 16
@cw = external dso_local global [40 x i32], align 16
@w = external dso_local global [40 x i32], align 16
@cnt = external dso_local global [40 x i32], align 16
@id = external dso_local global [40 x i32], align 16
@dp = external dso_local global [40 x [1048576 x i32]], align 16
@res = external dso_local global [40 x i32], align 16
@e = external dso_local global [1600 x %struct.edge], align 16
@head = external dso_local global [40 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3biti(i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8add_edgeii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %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
  %24 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %25 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %27
  %29 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %28, ptr noundef null)
  %30 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %31 = getelementptr i8, ptr %30, i64 -24
  %32 = load i64, ptr %31, align 8
  %33 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %32
  %34 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %33, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %37

37:                                               ; preds = %55, %0
  %38 = load i32, ptr %4, align 4, !tbaa !8
  %39 = load i32, ptr %2, align 4, !tbaa !8
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %58

42:                                               ; preds = %37
  %43 = load i32, ptr %4, align 4, !tbaa !8
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %44
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %45)
  %47 = load i32, ptr %4, align 4, !tbaa !8
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [40 x i32], ptr @cnt, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !8
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %52, align 4, !tbaa !8
  br label %55

55:                                               ; preds = %42
  %56 = load i32, ptr %4, align 4, !tbaa !8
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %4, align 4, !tbaa !8
  br label %37, !llvm.loop !11

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

59:                                               ; preds = %69, %58
  %60 = load i32, ptr %5, align 4, !tbaa !8
  %61 = load i32, ptr %2, align 4, !tbaa !8
  %62 = icmp sle i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %72

64:                                               ; preds = %59
  %65 = load i32, ptr %5, align 4, !tbaa !8
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [40 x i32], ptr @cw, i64 0, i64 %66
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %67)
  br label %69

69:                                               ; preds = %64
  %70 = load i32, ptr %5, align 4, !tbaa !8
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %5, align 4, !tbaa !8
  br label %59, !llvm.loop !13

72:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !8
  br label %73

73:                                               ; preds = %89, %72
  %74 = load i32, ptr %6, align 4, !tbaa !8
  %75 = load i32, ptr %2, align 4, !tbaa !8
  %76 = icmp sle i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %92

78:                                               ; preds = %73
  %79 = load i32, ptr %6, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [40 x i32], ptr @cw, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !8
  %86 = load i32, ptr %6, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %87
  store i32 %85, ptr %88, align 4, !tbaa !8
  br label %89

89:                                               ; preds = %78
  %90 = load i32, ptr %6, align 4, !tbaa !8
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %6, align 4, !tbaa !8
  br label %73, !llvm.loop !14

92:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !8
  br label %93

93:                                               ; preds = %115, %92
  %94 = load i32, ptr %8, align 4, !tbaa !8
  %95 = load i32, ptr %2, align 4, !tbaa !8
  %96 = icmp sle i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %118

98:                                               ; preds = %93
  %99 = load i32, ptr %8, align 4, !tbaa !8
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [40 x i32], ptr @cnt, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !8
  %103 = icmp slt i32 %102, 2
  br i1 %103, label %104, label %108

104:                                              ; preds = %98
  %105 = load i32, ptr %8, align 4, !tbaa !8
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %106
  store i32 -1, ptr %107, align 4, !tbaa !8
  br label %114

108:                                              ; preds = %98
  %109 = load i32, ptr %7, align 4, !tbaa !8
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %7, align 4, !tbaa !8
  %111 = load i32, ptr %8, align 4, !tbaa !8
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %112
  store i32 %110, ptr %113, align 4, !tbaa !8
  br label %114

114:                                              ; preds = %108, %104
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %8, align 4, !tbaa !8
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %8, align 4, !tbaa !8
  br label %93, !llvm.loop !15

118:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !8
  br label %119

119:                                              ; preds = %135, %118
  %120 = load i32, ptr %9, align 4, !tbaa !8
  %121 = load i32, ptr %2, align 4, !tbaa !8
  %122 = icmp sle i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %138

124:                                              ; preds = %119
  %125 = load i32, ptr %9, align 4, !tbaa !8
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !8
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !8
  %132 = load i32, ptr %9, align 4, !tbaa !8
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %133
  store i32 %131, ptr %134, align 4, !tbaa !8
  br label %135

135:                                              ; preds = %124
  %136 = load i32, ptr %9, align 4, !tbaa !8
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %9, align 4, !tbaa !8
  br label %119, !llvm.loop !16

138:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !8
  br label %139

139:                                              ; preds = %149, %138
  %140 = load i32, ptr %10, align 4, !tbaa !8
  %141 = load i32, ptr %3, align 4, !tbaa !8
  %142 = icmp sle i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %152

144:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %145 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %146 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %145, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %147 = load i32, ptr %11, align 4, !tbaa !8
  %148 = load i32, ptr %12, align 4, !tbaa !8
  call void @_Z8add_edgeii(i32 noundef %147, i32 noundef %148)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %149

149:                                              ; preds = %144
  %150 = load i32, ptr %10, align 4, !tbaa !8
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %10, align 4, !tbaa !8
  br label %139, !llvm.loop !17

152:                                              ; preds = %143
  call void @llvm.memset.p0.i64(ptr align 16 @dp, i8 -1, i64 167772160, i1 false)
  %153 = load i32, ptr getelementptr inbounds ([40 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !8
  %154 = icmp ne i32 %153, -1
  br i1 %154, label %155, label %162

155:                                              ; preds = %152
  %156 = load i32, ptr getelementptr inbounds ([40 x i32], ptr @w, i64 0, i64 1), align 4, !tbaa !8
  %157 = load i32, ptr getelementptr inbounds ([40 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !8
  %158 = sub nsw i32 %157, 1
  %159 = call noundef i32 @_Z3biti(i32 noundef %158)
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [1048576 x i32], ptr getelementptr inbounds ([40 x [1048576 x i32]], ptr @dp, i64 0, i64 1), i64 0, i64 %160
  store i32 %156, ptr %161, align 4, !tbaa !8
  br label %164

162:                                              ; preds = %152
  %163 = load i32, ptr getelementptr inbounds ([40 x i32], ptr @w, i64 0, i64 1), align 4, !tbaa !8
  store i32 %163, ptr getelementptr inbounds ([40 x [1048576 x i32]], ptr @dp, i64 0, i64 1), align 16, !tbaa !8
  br label %164

164:                                              ; preds = %162, %155
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !8
  br label %165

165:                                              ; preds = %343, %164
  %166 = load i32, ptr %13, align 4, !tbaa !8
  %167 = load i32, ptr %2, align 4, !tbaa !8
  %168 = icmp sle i32 %166, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %165
  store i32 20, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %346

170:                                              ; preds = %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %171 = load i32, ptr %13, align 4, !tbaa !8
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [40 x i32], ptr @head, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !8
  store i32 %174, ptr %15, align 4, !tbaa !8
  br label %175

175:                                              ; preds = %336, %170
  %176 = load i32, ptr %15, align 4, !tbaa !8
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %179, label %178

178:                                              ; preds = %175
  store i32 23, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %342

179:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %180 = load i32, ptr %15, align 4, !tbaa !8
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [1600 x %struct.edge], ptr @e, i64 0, i64 %181
  %183 = getelementptr inbounds %struct.edge, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %183, align 8, !tbaa !18
  store i32 %184, ptr %16, align 4, !tbaa !8
  %185 = load i32, ptr %16, align 4, !tbaa !8
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !8
  %189 = icmp eq i32 %188, -1
  br i1 %189, label %190, label %238

190:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !8
  br label %191

191:                                              ; preds = %234, %190
  %192 = load i32, ptr %17, align 4, !tbaa !8
  %193 = load i32, ptr %7, align 4, !tbaa !8
  %194 = call noundef i32 @_Z3biti(i32 noundef %193)
  %195 = icmp slt i32 %192, %194
  br i1 %195, label %197, label %196

196:                                              ; preds = %191
  store i32 26, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %237

197:                                              ; preds = %191
  %198 = load i32, ptr %13, align 4, !tbaa !8
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %199
  %201 = load i32, ptr %17, align 4, !tbaa !8
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [1048576 x i32], ptr %200, i64 0, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !8
  %205 = icmp eq i32 %204, -1
  br i1 %205, label %206, label %207

206:                                              ; preds = %197
  br label %234

207:                                              ; preds = %197
  %208 = load i32, ptr %16, align 4, !tbaa !8
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %209
  %211 = load i32, ptr %17, align 4, !tbaa !8
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [1048576 x i32], ptr %210, i64 0, i64 %212
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %214 = load i32, ptr %13, align 4, !tbaa !8
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %215
  %217 = load i32, ptr %17, align 4, !tbaa !8
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [1048576 x i32], ptr %216, i64 0, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !8
  %221 = load i32, ptr %16, align 4, !tbaa !8
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !8
  %225 = add nsw i32 %220, %224
  store i32 %225, ptr %18, align 4, !tbaa !8
  %226 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %213, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %227 = load i32, ptr %226, align 4, !tbaa !8
  %228 = load i32, ptr %16, align 4, !tbaa !8
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %229
  %231 = load i32, ptr %17, align 4, !tbaa !8
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [1048576 x i32], ptr %230, i64 0, i64 %232
  store i32 %227, ptr %233, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %234

234:                                              ; preds = %207, %206
  %235 = load i32, ptr %17, align 4, !tbaa !8
  %236 = add nsw i32 %235, 1
  store i32 %236, ptr %17, align 4, !tbaa !8
  br label %191, !llvm.loop !20

237:                                              ; preds = %196
  store i32 25, ptr %14, align 4
  br label %333

238:                                              ; preds = %179
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !8
  br label %239

239:                                              ; preds = %328, %238
  %240 = load i32, ptr %19, align 4, !tbaa !8
  %241 = load i32, ptr %7, align 4, !tbaa !8
  %242 = shl i32 1, %241
  %243 = icmp slt i32 %240, %242
  br i1 %243, label %245, label %244

244:                                              ; preds = %239
  store i32 29, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %331

245:                                              ; preds = %239
  %246 = load i32, ptr %13, align 4, !tbaa !8
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %247
  %249 = load i32, ptr %19, align 4, !tbaa !8
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [1048576 x i32], ptr %248, i64 0, i64 %250
  %252 = load i32, ptr %251, align 4, !tbaa !8
  %253 = icmp eq i32 %252, -1
  br i1 %253, label %254, label %255

254:                                              ; preds = %245
  br label %328

255:                                              ; preds = %245
  %256 = load i32, ptr %19, align 4, !tbaa !8
  %257 = load i32, ptr %16, align 4, !tbaa !8
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !8
  %261 = sub nsw i32 %260, 1
  %262 = call noundef i32 @_Z3biti(i32 noundef %261)
  %263 = and i32 %256, %262
  %264 = icmp eq i32 %263, 0
  br i1 %264, label %265, label %306

265:                                              ; preds = %255
  %266 = load i32, ptr %16, align 4, !tbaa !8
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %267
  %269 = load i32, ptr %19, align 4, !tbaa !8
  %270 = load i32, ptr %16, align 4, !tbaa !8
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !8
  %274 = sub nsw i32 %273, 1
  %275 = call noundef i32 @_Z3biti(i32 noundef %274)
  %276 = add nsw i32 %269, %275
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds [1048576 x i32], ptr %268, i64 0, i64 %277
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %279 = load i32, ptr %13, align 4, !tbaa !8
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %280
  %282 = load i32, ptr %19, align 4, !tbaa !8
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [1048576 x i32], ptr %281, i64 0, i64 %283
  %285 = load i32, ptr %284, align 4, !tbaa !8
  %286 = load i32, ptr %16, align 4, !tbaa !8
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !8
  %290 = add nsw i32 %285, %289
  store i32 %290, ptr %20, align 4, !tbaa !8
  %291 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %278, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %292 = load i32, ptr %291, align 4, !tbaa !8
  %293 = load i32, ptr %16, align 4, !tbaa !8
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %294
  %296 = load i32, ptr %19, align 4, !tbaa !8
  %297 = load i32, ptr %16, align 4, !tbaa !8
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %298
  %300 = load i32, ptr %299, align 4, !tbaa !8
  %301 = sub nsw i32 %300, 1
  %302 = call noundef i32 @_Z3biti(i32 noundef %301)
  %303 = add nsw i32 %296, %302
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [1048576 x i32], ptr %295, i64 0, i64 %304
  store i32 %292, ptr %305, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %327

306:                                              ; preds = %255
  %307 = load i32, ptr %16, align 4, !tbaa !8
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %308
  %310 = load i32, ptr %19, align 4, !tbaa !8
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [1048576 x i32], ptr %309, i64 0, i64 %311
  %313 = load i32, ptr %13, align 4, !tbaa !8
  %314 = sext i32 %313 to i64
  %315 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %314
  %316 = load i32, ptr %19, align 4, !tbaa !8
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [1048576 x i32], ptr %315, i64 0, i64 %317
  %319 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %312, ptr noundef nonnull align 4 dereferenceable(4) %318)
  %320 = load i32, ptr %319, align 4, !tbaa !8
  %321 = load i32, ptr %16, align 4, !tbaa !8
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %322
  %324 = load i32, ptr %19, align 4, !tbaa !8
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [1048576 x i32], ptr %323, i64 0, i64 %325
  store i32 %320, ptr %326, align 4, !tbaa !8
  br label %327

327:                                              ; preds = %306, %265
  br label %328

328:                                              ; preds = %327, %254
  %329 = load i32, ptr %19, align 4, !tbaa !8
  %330 = add nsw i32 %329, 1
  store i32 %330, ptr %19, align 4, !tbaa !8
  br label %239, !llvm.loop !21

331:                                              ; preds = %244
  br label %332

332:                                              ; preds = %331
  store i32 0, ptr %14, align 4
  br label %333

333:                                              ; preds = %332, %237
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  %334 = load i32, ptr %14, align 4
  switch i32 %334, label %402 [
    i32 0, label %335
    i32 25, label %336
  ]

335:                                              ; preds = %333
  br label %336

336:                                              ; preds = %335, %333
  %337 = load i32, ptr %15, align 4, !tbaa !8
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [1600 x %struct.edge], ptr @e, i64 0, i64 %338
  %340 = getelementptr inbounds %struct.edge, ptr %339, i32 0, i32 1
  %341 = load i32, ptr %340, align 4, !tbaa !22
  store i32 %341, ptr %15, align 4, !tbaa !8
  br label %175, !llvm.loop !23

342:                                              ; preds = %178
  br label %343

343:                                              ; preds = %342
  %344 = load i32, ptr %13, align 4, !tbaa !8
  %345 = add nsw i32 %344, 1
  store i32 %345, ptr %13, align 4, !tbaa !8
  br label %165, !llvm.loop !24

346:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 1, ptr %21, align 4, !tbaa !8
  br label %347

347:                                              ; preds = %381, %346
  %348 = load i32, ptr %21, align 4, !tbaa !8
  %349 = load i32, ptr %2, align 4, !tbaa !8
  %350 = icmp sle i32 %348, %349
  br i1 %350, label %352, label %351

351:                                              ; preds = %347
  store i32 32, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %384

352:                                              ; preds = %347
  %353 = load i32, ptr %21, align 4, !tbaa !8
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds [40 x i32], ptr @res, i64 0, i64 %354
  store i32 -1, ptr %355, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !8
  br label %356

356:                                              ; preds = %377, %352
  %357 = load i32, ptr %22, align 4, !tbaa !8
  %358 = load i32, ptr %7, align 4, !tbaa !8
  %359 = call noundef i32 @_Z3biti(i32 noundef %358)
  %360 = icmp slt i32 %357, %359
  br i1 %360, label %362, label %361

361:                                              ; preds = %356
  store i32 35, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %380

362:                                              ; preds = %356
  %363 = load i32, ptr %21, align 4, !tbaa !8
  %364 = sext i32 %363 to i64
  %365 = getelementptr inbounds [40 x i32], ptr @res, i64 0, i64 %364
  %366 = load i32, ptr %21, align 4, !tbaa !8
  %367 = sext i32 %366 to i64
  %368 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %367
  %369 = load i32, ptr %22, align 4, !tbaa !8
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [1048576 x i32], ptr %368, i64 0, i64 %370
  %372 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %365, ptr noundef nonnull align 4 dereferenceable(4) %371)
  %373 = load i32, ptr %372, align 4, !tbaa !8
  %374 = load i32, ptr %21, align 4, !tbaa !8
  %375 = sext i32 %374 to i64
  %376 = getelementptr inbounds [40 x i32], ptr @res, i64 0, i64 %375
  store i32 %373, ptr %376, align 4, !tbaa !8
  br label %377

377:                                              ; preds = %362
  %378 = load i32, ptr %22, align 4, !tbaa !8
  %379 = add nsw i32 %378, 1
  store i32 %379, ptr %22, align 4, !tbaa !8
  br label %356, !llvm.loop !25

380:                                              ; preds = %361
  br label %381

381:                                              ; preds = %380
  %382 = load i32, ptr %21, align 4, !tbaa !8
  %383 = add nsw i32 %382, 1
  store i32 %383, ptr %21, align 4, !tbaa !8
  br label %347, !llvm.loop !26

384:                                              ; preds = %351
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 1, ptr %23, align 4, !tbaa !8
  br label %385

385:                                              ; preds = %397, %384
  %386 = load i32, ptr %23, align 4, !tbaa !8
  %387 = load i32, ptr %2, align 4, !tbaa !8
  %388 = icmp sle i32 %386, %387
  br i1 %388, label %390, label %389

389:                                              ; preds = %385
  store i32 38, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %400

390:                                              ; preds = %385
  %391 = load i32, ptr %23, align 4, !tbaa !8
  %392 = sext i32 %391 to i64
  %393 = getelementptr inbounds [40 x i32], ptr @res, i64 0, i64 %392
  %394 = load i32, ptr %393, align 4, !tbaa !8
  %395 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %394)
  %396 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %395, i8 noundef signext 10)
  br label %397

397:                                              ; preds = %390
  %398 = load i32, ptr %23, align 4, !tbaa !8
  %399 = add nsw i32 %398, 1
  store i32 %399, ptr %23, align 4, !tbaa !8
  br label %385, !llvm.loop !27

400:                                              ; preds = %389
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %401 = load i32, ptr %1, align 4
  ret i32 %401

402:                                              ; preds = %333
  unreachable
}

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

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

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

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

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #6

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !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 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{!19, !9, i64 0}
!19 = !{!"_ZTS4edge", !9, i64 0, !9, i64 4}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = !{!19, !9, i64 4}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}


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

%struct.edge = type { i32, i32 }
%"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" }

@c = external dso_local global [40 x i32], align 16
@cw = external dso_local global [40 x i32], align 16
@w = external dso_local local_unnamed_addr global [40 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [40 x i32], align 16
@id = external dso_local local_unnamed_addr global [40 x i32], align 16
@dp = external dso_local global [40 x [1048576 x i32]], align 16
@res = external dso_local global [40 x i32], align 16
@e = external dso_local local_unnamed_addr global [1600 x %struct.edge], align 16
@head = external dso_local local_unnamed_addr global [40 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3biti(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8add_edgeii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %15
  %17 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %18 = 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)
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %20 = load i32, ptr %1, align 4, !tbaa !8
  %.not111 = icmp slt i32 %20, 1
  br i1 %.not111, label %.preheader106, label %.lr.ph

.preheader110:                                    ; preds = %.lr.ph
  %.not92113 = icmp slt i32 %28, 1
  br i1 %.not92113, label %.preheader106, label %.lr.ph115

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %21 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %23 = load i32, ptr %21, align 4, !tbaa !8
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [40 x i32], ptr @cnt, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !8
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %25, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %28 = load i32, ptr %1, align 4, !tbaa !8
  %29 = sext i32 %28 to i64
  %.not.not = icmp slt i64 %indvars.iv, %29
  br i1 %.not.not, label %.lr.ph, label %.preheader110, !llvm.loop !11

.preheader109:                                    ; preds = %.lr.ph115
  %.not93116 = icmp slt i32 %34, 1
  br i1 %.not93116, label %.preheader106, label %.lr.ph118.preheader

.lr.ph118.preheader:                              ; preds = %.preheader109
  %30 = zext nneg i32 %34 to i64
  %xtraiter = and i64 %30, 3
  %31 = icmp ult i32 %34, 4
  br i1 %31, label %.preheader108.unr-lcssa, label %.lr.ph118.preheader.new

.lr.ph118.preheader.new:                          ; preds = %.lr.ph118.preheader
  %unroll_iter = and i64 %30, 2147483644
  br label %.lr.ph118

.lr.ph115:                                        ; preds = %.preheader110, %.lr.ph115
  %indvars.iv159 = phi i64 [ %indvars.iv.next160, %.lr.ph115 ], [ 1, %.preheader110 ]
  %32 = getelementptr inbounds [40 x i32], ptr @cw, i64 0, i64 %indvars.iv159
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %32)
  %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
  %34 = load i32, ptr %1, align 4, !tbaa !8
  %35 = sext i32 %34 to i64
  %.not92.not = icmp slt i64 %indvars.iv159, %35
  br i1 %.not92.not, label %.lr.ph115, label %.preheader109, !llvm.loop !13

.preheader108.unr-lcssa:                          ; preds = %.lr.ph118, %.lr.ph118.preheader
  %indvars.iv162.unr = phi i64 [ 1, %.lr.ph118.preheader ], [ %indvars.iv.next163.3, %.lr.ph118 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader108, label %.lr.ph118.epil

.lr.ph118.epil:                                   ; preds = %.preheader108.unr-lcssa, %.lr.ph118.epil
  %indvars.iv162.epil = phi i64 [ %indvars.iv.next163.epil, %.lr.ph118.epil ], [ %indvars.iv162.unr, %.preheader108.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph118.epil ], [ 0, %.preheader108.unr-lcssa ]
  %36 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv162.epil
  %37 = load i32, ptr %36, align 4, !tbaa !8
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [40 x i32], ptr @cw, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !8
  %41 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %indvars.iv162.epil
  store i32 %40, ptr %41, align 4, !tbaa !8
  %indvars.iv.next163.epil = add nuw nsw i64 %indvars.iv162.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader108, label %.lr.ph118.epil, !llvm.loop !14

.preheader108:                                    ; preds = %.lr.ph118.epil, %.preheader108.unr-lcssa
  br i1 %.not93116, label %.preheader106, label %.lr.ph122.preheader

.lr.ph122.preheader:                              ; preds = %.preheader108
  %xtraiter239 = and i64 %30, 1
  %42 = icmp eq i32 %34, 1
  br i1 %42, label %.preheader107.unr-lcssa, label %.lr.ph122.preheader.new

.lr.ph122.preheader.new:                          ; preds = %.lr.ph122.preheader
  %unroll_iter243 = and i64 %30, 2147483646
  br label %.lr.ph122

.lr.ph118:                                        ; preds = %.lr.ph118, %.lr.ph118.preheader.new
  %indvars.iv162 = phi i64 [ 1, %.lr.ph118.preheader.new ], [ %indvars.iv.next163.3, %.lr.ph118 ]
  %niter = phi i64 [ 0, %.lr.ph118.preheader.new ], [ %niter.next.3, %.lr.ph118 ]
  %43 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv162
  %44 = load i32, ptr %43, align 4, !tbaa !8
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [40 x i32], ptr @cw, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !8
  %48 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %indvars.iv162
  store i32 %47, ptr %48, align 4, !tbaa !8
  %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
  %49 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv.next163
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [40 x i32], ptr @cw, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !8
  %54 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %indvars.iv.next163
  store i32 %53, ptr %54, align 4, !tbaa !8
  %indvars.iv.next163.1 = add nuw nsw i64 %indvars.iv162, 2
  %55 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv.next163.1
  %56 = load i32, ptr %55, align 4, !tbaa !8
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [40 x i32], ptr @cw, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !8
  %60 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %indvars.iv.next163.1
  store i32 %59, ptr %60, align 4, !tbaa !8
  %indvars.iv.next163.2 = add nuw nsw i64 %indvars.iv162, 3
  %61 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv.next163.2
  %62 = load i32, ptr %61, align 4, !tbaa !8
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [40 x i32], ptr @cw, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !8
  %66 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %indvars.iv.next163.2
  store i32 %65, ptr %66, align 4, !tbaa !8
  %indvars.iv.next163.3 = add nuw nsw i64 %indvars.iv162, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader108.unr-lcssa, label %.lr.ph118, !llvm.loop !16

.preheader107.unr-lcssa:                          ; preds = %.lr.ph122, %.lr.ph122.preheader
  %.088.lcssa.fr.lcssa.ph = phi i32 [ poison, %.lr.ph122.preheader ], [ %.088.lcssa.fr.1, %.lr.ph122 ]
  %indvars.iv165.unr = phi i64 [ 1, %.lr.ph122.preheader ], [ %indvars.iv.next166.1, %.lr.ph122 ]
  %.088120.unr = phi i32 [ 0, %.lr.ph122.preheader ], [ %.088.lcssa.fr.1, %.lr.ph122 ]
  %lcmp.mod241.not = icmp eq i64 %xtraiter239, 0
  br i1 %lcmp.mod241.not, label %.preheader107, label %.lr.ph122.epil

.lr.ph122.epil:                                   ; preds = %.preheader107.unr-lcssa
  %67 = getelementptr inbounds [40 x i32], ptr @cnt, i64 0, i64 %indvars.iv165.unr
  %68 = load i32, ptr %67, align 4, !tbaa !8
  %69 = icmp slt i32 %68, 2
  %70 = add nsw i32 %.088120.unr, 1
  %spec.select.epil = select i1 %69, i32 -1, i32 %70
  %spec.select226.epil = select i1 %69, i32 %.088120.unr, i32 %70
  %.088.lcssa.fr.epil = freeze i32 %spec.select226.epil
  %71 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %indvars.iv165.unr
  store i32 %spec.select.epil, ptr %71, align 4
  br label %.preheader107

.preheader107:                                    ; preds = %.preheader107.unr-lcssa, %.lr.ph122.epil
  %.088.lcssa.fr.lcssa = phi i32 [ %.088.lcssa.fr.lcssa.ph, %.preheader107.unr-lcssa ], [ %.088.lcssa.fr.epil, %.lr.ph122.epil ]
  br i1 %.not93116, label %.preheader106, label %.lr.ph126.preheader

.lr.ph126.preheader:                              ; preds = %.preheader107
  %xtraiter245 = and i64 %30, 3
  %72 = icmp ult i32 %34, 4
  br i1 %72, label %.preheader106.loopexit.unr-lcssa, label %.lr.ph126.preheader.new

.lr.ph126.preheader.new:                          ; preds = %.lr.ph126.preheader
  %unroll_iter248 = and i64 %30, 2147483644
  br label %.lr.ph126

.lr.ph122:                                        ; preds = %.lr.ph122, %.lr.ph122.preheader.new
  %indvars.iv165 = phi i64 [ 1, %.lr.ph122.preheader.new ], [ %indvars.iv.next166.1, %.lr.ph122 ]
  %.088120 = phi i32 [ 0, %.lr.ph122.preheader.new ], [ %.088.lcssa.fr.1, %.lr.ph122 ]
  %niter244 = phi i64 [ 0, %.lr.ph122.preheader.new ], [ %niter244.next.1, %.lr.ph122 ]
  %73 = getelementptr inbounds [40 x i32], ptr @cnt, i64 0, i64 %indvars.iv165
  %74 = load i32, ptr %73, align 4, !tbaa !8
  %75 = icmp slt i32 %74, 2
  %76 = add nsw i32 %.088120, 1
  %spec.select = select i1 %75, i32 -1, i32 %76
  %spec.select226 = select i1 %75, i32 %.088120, i32 %76
  %.088.lcssa.fr = freeze i32 %spec.select226
  %77 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %indvars.iv165
  store i32 %spec.select, ptr %77, align 4
  %indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1
  %78 = getelementptr inbounds [40 x i32], ptr @cnt, i64 0, i64 %indvars.iv.next166
  %79 = load i32, ptr %78, align 4, !tbaa !8
  %80 = icmp slt i32 %79, 2
  %81 = add nsw i32 %.088.lcssa.fr, 1
  %spec.select.1 = select i1 %80, i32 -1, i32 %81
  %spec.select226.1 = select i1 %80, i32 %.088.lcssa.fr, i32 %81
  %.088.lcssa.fr.1 = freeze i32 %spec.select226.1
  %82 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %indvars.iv.next166
  store i32 %spec.select.1, ptr %82, align 4
  %indvars.iv.next166.1 = add nuw nsw i64 %indvars.iv165, 2
  %niter244.next.1 = add i64 %niter244, 2
  %niter244.ncmp.1 = icmp eq i64 %niter244.next.1, %unroll_iter243
  br i1 %niter244.ncmp.1, label %.preheader107.unr-lcssa, label %.lr.ph122, !llvm.loop !17

.preheader106.loopexit.unr-lcssa:                 ; preds = %.lr.ph126, %.lr.ph126.preheader
  %indvars.iv170.unr = phi i64 [ 1, %.lr.ph126.preheader ], [ %indvars.iv.next171.3, %.lr.ph126 ]
  %lcmp.mod247.not = icmp eq i64 %xtraiter245, 0
  br i1 %lcmp.mod247.not, label %.preheader106, label %.lr.ph126.epil

.lr.ph126.epil:                                   ; preds = %.preheader106.loopexit.unr-lcssa, %.lr.ph126.epil
  %indvars.iv170.epil = phi i64 [ %indvars.iv.next171.epil, %.lr.ph126.epil ], [ %indvars.iv170.unr, %.preheader106.loopexit.unr-lcssa ]
  %epil.iter246 = phi i64 [ %epil.iter246.next, %.lr.ph126.epil ], [ 0, %.preheader106.loopexit.unr-lcssa ]
  %83 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv170.epil
  %84 = load i32, ptr %83, align 4, !tbaa !8
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !8
  store i32 %87, ptr %83, align 4, !tbaa !8
  %indvars.iv.next171.epil = add nuw nsw i64 %indvars.iv170.epil, 1
  %epil.iter246.next = add i64 %epil.iter246, 1
  %epil.iter246.cmp.not = icmp eq i64 %epil.iter246.next, %xtraiter245
  br i1 %epil.iter246.cmp.not, label %.preheader106, label %.lr.ph126.epil, !llvm.loop !18

.preheader106:                                    ; preds = %.preheader106.loopexit.unr-lcssa, %.lr.ph126.epil, %.preheader109, %0, %.preheader110, %.preheader108, %.preheader107
  %.088.lcssa.fr217 = phi i32 [ %.088.lcssa.fr.lcssa, %.preheader107 ], [ 0, %.preheader108 ], [ 0, %.preheader110 ], [ 0, %0 ], [ 0, %.preheader109 ], [ %.088.lcssa.fr.lcssa, %.lr.ph126.epil ], [ %.088.lcssa.fr.lcssa, %.preheader106.loopexit.unr-lcssa ]
  %88 = load i32, ptr %2, align 4, !tbaa !8
  %.not96127 = icmp slt i32 %88, 1
  br i1 %.not96127, label %._crit_edge, label %.lr.ph129

.lr.ph126:                                        ; preds = %.lr.ph126, %.lr.ph126.preheader.new
  %indvars.iv170 = phi i64 [ 1, %.lr.ph126.preheader.new ], [ %indvars.iv.next171.3, %.lr.ph126 ]
  %niter249 = phi i64 [ 0, %.lr.ph126.preheader.new ], [ %niter249.next.3, %.lr.ph126 ]
  %89 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv170
  %90 = load i32, ptr %89, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !8
  store i32 %93, ptr %89, align 4, !tbaa !8
  %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
  %94 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv.next171
  %95 = load i32, ptr %94, align 4, !tbaa !8
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !8
  store i32 %98, ptr %94, align 4, !tbaa !8
  %indvars.iv.next171.1 = add nuw nsw i64 %indvars.iv170, 2
  %99 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv.next171.1
  %100 = load i32, ptr %99, align 4, !tbaa !8
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !8
  store i32 %103, ptr %99, align 4, !tbaa !8
  %indvars.iv.next171.2 = add nuw nsw i64 %indvars.iv170, 3
  %104 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %indvars.iv.next171.2
  %105 = load i32, ptr %104, align 4, !tbaa !8
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [40 x i32], ptr @id, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !8
  store i32 %108, ptr %104, align 4, !tbaa !8
  %indvars.iv.next171.3 = add nuw nsw i64 %indvars.iv170, 4
  %niter249.next.3 = add i64 %niter249, 4
  %niter249.ncmp.3 = icmp eq i64 %niter249.next.3, %unroll_iter248
  br i1 %niter249.ncmp.3, label %.preheader106.loopexit.unr-lcssa, label %.lr.ph126, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph129, %.preheader106
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(167772160) @dp, i8 -1, i64 167772160, i1 false)
  %109 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 4), align 4, !tbaa !8
  %.not97 = icmp eq i32 %109, -1
  %110 = load i32, ptr getelementptr inbounds (i8, ptr @w, i64 4), align 4, !tbaa !8
  br i1 %.not97, label %122, label %117

.lr.ph129:                                        ; preds = %.preheader106, %.lr.ph129
  %.085128 = phi i32 [ %115, %.lr.ph129 ], [ 1, %.preheader106 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %111 = 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)
  %112 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %111, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %113 = load i32, ptr %3, align 4, !tbaa !8
  %114 = load i32, ptr %4, align 4, !tbaa !8
  call void @_Z8add_edgeii(i32 noundef %113, i32 noundef %114)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %115 = add nuw nsw i32 %.085128, 1
  %116 = load i32, ptr %2, align 4, !tbaa !8
  %.not96.not = icmp slt i32 %.085128, %116
  br i1 %.not96.not, label %.lr.ph129, label %._crit_edge, !llvm.loop !20

117:                                              ; preds = %._crit_edge
  %118 = add nsw i32 %109, -1
  %119 = call noundef i32 @_Z3biti(i32 noundef %118)
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [1048576 x i32], ptr getelementptr inbounds (i8, ptr @dp, i64 4194304), i64 0, i64 %120
  store i32 %110, ptr %121, align 4, !tbaa !8
  br label %123

122:                                              ; preds = %._crit_edge
  store i32 %110, ptr getelementptr inbounds (i8, ptr @dp, i64 4194304), align 16, !tbaa !8
  br label %123

123:                                              ; preds = %122, %117
  %124 = load i32, ptr %1, align 4, !tbaa !8
  %.not98140 = icmp slt i32 %124, 1
  br i1 %.not98140, label %._crit_edge154, label %.lr.ph143

.lr.ph143:                                        ; preds = %123
  %.not = icmp eq i32 %.088.lcssa.fr217, 31
  br i1 %.not, label %.lr.ph143.split, label %.lr.ph143.split.us.preheader

.lr.ph143.split.us.preheader:                     ; preds = %.lr.ph143
  %125 = shl nuw nsw i32 1, %.088.lcssa.fr217
  %wide.trip.count178 = zext nneg i32 %125 to i64
  br label %.lr.ph143.split.us

.lr.ph143.split.us:                               ; preds = %.lr.ph143.split.us.preheader, %._crit_edge139.split.us.us
  %126 = phi i32 [ %124, %.lr.ph143.split.us.preheader ], [ %128, %._crit_edge139.split.us.us ]
  %indvars.iv183 = phi i64 [ 1, %.lr.ph143.split.us.preheader ], [ %indvars.iv.next184, %._crit_edge139.split.us.us ]
  %127 = getelementptr inbounds [40 x i32], ptr @head, i64 0, i64 %indvars.iv183
  %.083134.us = load i32, ptr %127, align 4, !tbaa !8
  %.not101135.us = icmp eq i32 %.083134.us, 0
  br i1 %.not101135.us, label %._crit_edge139.split.us.us, label %.lr.ph138.us

._crit_edge139.split.us.us.loopexit:              ; preds = %.loopexit.us.us
  %.pre = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge139.split.us.us

._crit_edge139.split.us.us:                       ; preds = %._crit_edge139.split.us.us.loopexit, %.lr.ph143.split.us
  %128 = phi i32 [ %.pre, %._crit_edge139.split.us.us.loopexit ], [ %126, %.lr.ph143.split.us ]
  %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
  %129 = sext i32 %128 to i64
  %.not98.us.not = icmp slt i64 %indvars.iv183, %129
  br i1 %.not98.us.not, label %.lr.ph143.split.us, label %.preheader102, !llvm.loop !21

.lr.ph138.us:                                     ; preds = %.lr.ph143.split.us, %.loopexit.us.us
  %.083136.us.us = phi i32 [ %.083.us.us, %.loopexit.us.us ], [ %.083134.us, %.lr.ph143.split.us ]
  %130 = sext i32 %.083136.us.us to i64
  %131 = getelementptr inbounds [1600 x %struct.edge], ptr @e, i64 0, i64 %130
  %132 = load i32, ptr %131, align 8, !tbaa !22
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !8
  %136 = icmp eq i32 %135, -1
  br i1 %136, label %.preheader103.us.us, label %.preheader104.us.us

137:                                              ; preds = %.preheader104.us.us, %170
  %indvars.iv175 = phi i64 [ 0, %.preheader104.us.us ], [ %indvars.iv.next176, %170 ]
  %138 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %indvars.iv183, i64 %indvars.iv175
  %139 = load i32, ptr %138, align 4, !tbaa !8
  %140 = icmp eq i32 %139, -1
  br i1 %140, label %170, label %141

141:                                              ; preds = %137
  %142 = load i32, ptr %134, align 4, !tbaa !8
  %143 = add nsw i32 %142, -1
  %144 = call noundef i32 @_Z3biti(i32 noundef %143)
  %145 = trunc nuw nsw i64 %indvars.iv175 to i32
  %146 = and i32 %144, %145
  %147 = icmp eq i32 %146, 0
  br i1 %147, label %152, label %148

148:                                              ; preds = %141
  %149 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %133, i64 %indvars.iv175
  %150 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %149, ptr noundef nonnull align 4 dereferenceable(4) %138)
  %151 = load i32, ptr %150, align 4, !tbaa !8
  store i32 %151, ptr %149, align 4, !tbaa !8
  br label %170

152:                                              ; preds = %141
  %153 = load i32, ptr %134, align 4, !tbaa !8
  %154 = add nsw i32 %153, -1
  %155 = call noundef i32 @_Z3biti(i32 noundef %154)
  %156 = add nsw i32 %155, %145
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %133, i64 %157
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %159 = load i32, ptr %138, align 4, !tbaa !8
  %160 = load i32, ptr %188, align 4, !tbaa !8
  %161 = add nsw i32 %160, %159
  store i32 %161, ptr %6, align 4, !tbaa !8
  %162 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %158, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %163 = load i32, ptr %162, align 4, !tbaa !8
  %164 = load i32, ptr %134, align 4, !tbaa !8
  %165 = add nsw i32 %164, -1
  %166 = call noundef i32 @_Z3biti(i32 noundef %165)
  %167 = add nsw i32 %166, %145
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %133, i64 %168
  store i32 %163, ptr %169, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  br label %170

170:                                              ; preds = %152, %148, %137
  %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
  %exitcond179.not = icmp eq i64 %indvars.iv.next176, %wide.trip.count178
  br i1 %exitcond179.not, label %.loopexit.us.us, label %137, !llvm.loop !24

.loopexit.us.us:                                  ; preds = %170, %182, %.preheader103.us.us
  %171 = getelementptr inbounds i8, ptr %131, i64 4
  %.083.us.us = load i32, ptr %171, align 4, !tbaa !8
  %.not101.us.us = icmp eq i32 %.083.us.us, 0
  br i1 %.not101.us.us, label %._crit_edge139.split.us.us.loopexit, label %.lr.ph138.us, !llvm.loop !25

172:                                              ; preds = %.lr.ph133.us.us, %182
  %indvars.iv180 = phi i64 [ 0, %.lr.ph133.us.us ], [ %indvars.iv.next181, %182 ]
  %173 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %indvars.iv183, i64 %indvars.iv180
  %174 = load i32, ptr %173, align 4, !tbaa !8
  %175 = icmp eq i32 %174, -1
  br i1 %175, label %182, label %176

176:                                              ; preds = %172
  %177 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %133, i64 %indvars.iv180
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %178 = load i32, ptr %189, align 4, !tbaa !8
  %179 = add nsw i32 %178, %174
  store i32 %179, ptr %5, align 4, !tbaa !8
  %180 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %177, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %181 = load i32, ptr %180, align 4, !tbaa !8
  store i32 %181, ptr %177, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %182

182:                                              ; preds = %176, %172
  %indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
  %183 = call noundef i32 @_Z3biti(i32 noundef %.088.lcssa.fr217)
  %184 = sext i32 %183 to i64
  %185 = icmp slt i64 %indvars.iv.next181, %184
  br i1 %185, label %172, label %.loopexit.us.us, !llvm.loop !26

.preheader103.us.us:                              ; preds = %.lr.ph138.us
  %186 = call noundef i32 @_Z3biti(i32 noundef %.088.lcssa.fr217)
  %187 = icmp sgt i32 %186, 0
  br i1 %187, label %.lr.ph133.us.us, label %.loopexit.us.us

.preheader104.us.us:                              ; preds = %.lr.ph138.us
  %188 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %133
  br label %137

.lr.ph133.us.us:                                  ; preds = %.preheader103.us.us
  %189 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %133
  br label %172

.preheader102:                                    ; preds = %._crit_edge139.split.us.us, %._crit_edge139.split
  %190 = phi i32 [ %193, %._crit_edge139.split ], [ %128, %._crit_edge139.split.us.us ]
  %.not99148 = icmp slt i32 %190, 1
  br i1 %.not99148, label %._crit_edge154, label %.lr.ph150

.lr.ph143.split:                                  ; preds = %.lr.ph143, %._crit_edge139.split
  %191 = phi i32 [ %193, %._crit_edge139.split ], [ %124, %.lr.ph143 ]
  %indvars.iv189 = phi i64 [ %indvars.iv.next190, %._crit_edge139.split ], [ 1, %.lr.ph143 ]
  %192 = getelementptr inbounds [40 x i32], ptr @head, i64 0, i64 %indvars.iv189
  %.083134 = load i32, ptr %192, align 4, !tbaa !8
  %.not101135 = icmp eq i32 %.083134, 0
  br i1 %.not101135, label %._crit_edge139.split, label %.lr.ph138

._crit_edge139.split.loopexit:                    ; preds = %.preheader104
  %.pre201 = load i32, ptr %1, align 4, !tbaa !8
  br label %._crit_edge139.split

._crit_edge139.split:                             ; preds = %._crit_edge139.split.loopexit, %.lr.ph143.split
  %193 = phi i32 [ %.pre201, %._crit_edge139.split.loopexit ], [ %191, %.lr.ph143.split ]
  %indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
  %194 = sext i32 %193 to i64
  %.not98.not = icmp slt i64 %indvars.iv189, %194
  br i1 %.not98.not, label %.lr.ph143.split, label %.preheader102, !llvm.loop !21

.lr.ph138:                                        ; preds = %.lr.ph143.split, %.preheader104
  %.083136 = phi i32 [ %.083, %.preheader104 ], [ %.083134, %.lr.ph143.split ]
  %195 = sext i32 %.083136 to i64
  %196 = getelementptr inbounds [1600 x %struct.edge], ptr @e, i64 0, i64 %195
  %197 = load i32, ptr %196, align 8, !tbaa !22
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [40 x i32], ptr @c, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !8
  %201 = icmp eq i32 %200, -1
  br i1 %201, label %.preheader103, label %.preheader104

.preheader103:                                    ; preds = %.lr.ph138
  %202 = call noundef i32 @_Z3biti(i32 noundef 31)
  %203 = icmp sgt i32 %202, 0
  br i1 %203, label %.lr.ph133, label %.preheader104

.lr.ph133:                                        ; preds = %.preheader103
  %204 = getelementptr inbounds [40 x i32], ptr @w, i64 0, i64 %198
  br label %205

205:                                              ; preds = %.lr.ph133, %215
  %indvars.iv186 = phi i64 [ 0, %.lr.ph133 ], [ %indvars.iv.next187, %215 ]
  %206 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %indvars.iv189, i64 %indvars.iv186
  %207 = load i32, ptr %206, align 4, !tbaa !8
  %208 = icmp eq i32 %207, -1
  br i1 %208, label %215, label %209

209:                                              ; preds = %205
  %210 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %198, i64 %indvars.iv186
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %211 = load i32, ptr %204, align 4, !tbaa !8
  %212 = add nsw i32 %211, %207
  store i32 %212, ptr %5, align 4, !tbaa !8
  %213 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %210, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %214 = load i32, ptr %213, align 4, !tbaa !8
  store i32 %214, ptr %210, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %215

215:                                              ; preds = %205, %209
  %indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1
  %216 = call noundef i32 @_Z3biti(i32 noundef 31)
  %217 = sext i32 %216 to i64
  %218 = icmp slt i64 %indvars.iv.next187, %217
  br i1 %218, label %205, label %.preheader104, !llvm.loop !26

.preheader104:                                    ; preds = %215, %.preheader103, %.lr.ph138
  %219 = getelementptr inbounds i8, ptr %196, i64 4
  %.083 = load i32, ptr %219, align 4, !tbaa !8
  %.not101 = icmp eq i32 %.083, 0
  br i1 %.not101, label %._crit_edge139.split.loopexit, label %.lr.ph138, !llvm.loop !25

.preheader:                                       ; preds = %._crit_edge147
  %220 = icmp slt i32 %224, 1
  br i1 %220, label %._crit_edge154, label %.lr.ph153

.lr.ph150:                                        ; preds = %.preheader102, %._crit_edge147
  %indvars.iv195 = phi i64 [ %indvars.iv.next196, %._crit_edge147 ], [ 1, %.preheader102 ]
  %221 = getelementptr inbounds [40 x i32], ptr @res, i64 0, i64 %indvars.iv195
  store i32 -1, ptr %221, align 4, !tbaa !8
  %222 = call noundef i32 @_Z3biti(i32 noundef %.088.lcssa.fr217)
  %223 = icmp sgt i32 %222, 0
  br i1 %223, label %.lr.ph146, label %._crit_edge147

._crit_edge147:                                   ; preds = %.lr.ph146, %.lr.ph150
  %indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1
  %224 = load i32, ptr %1, align 4, !tbaa !8
  %225 = sext i32 %224 to i64
  %.not99.not = icmp slt i64 %indvars.iv195, %225
  br i1 %.not99.not, label %.lr.ph150, label %.preheader, !llvm.loop !27

.lr.ph146:                                        ; preds = %.lr.ph150, %.lr.ph146
  %indvars.iv192 = phi i64 [ %indvars.iv.next193, %.lr.ph146 ], [ 0, %.lr.ph150 ]
  %226 = getelementptr inbounds [40 x [1048576 x i32]], ptr @dp, i64 0, i64 %indvars.iv195, i64 %indvars.iv192
  %227 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %221, ptr noundef nonnull align 4 dereferenceable(4) %226)
  %228 = load i32, ptr %227, align 4, !tbaa !8
  store i32 %228, ptr %221, align 4, !tbaa !8
  %indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1
  %229 = call noundef i32 @_Z3biti(i32 noundef %.088.lcssa.fr217)
  %230 = sext i32 %229 to i64
  %231 = icmp slt i64 %indvars.iv.next193, %230
  br i1 %231, label %.lr.ph146, label %._crit_edge147, !llvm.loop !28

._crit_edge154:                                   ; preds = %.lr.ph153, %123, %.preheader102, %.preheader
  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.ph153:                                        ; preds = %.preheader, %.lr.ph153
  %indvars.iv198 = phi i64 [ %indvars.iv.next199, %.lr.ph153 ], [ 1, %.preheader ]
  %232 = getelementptr inbounds [40 x i32], ptr @res, i64 0, i64 %indvars.iv198
  %233 = load i32, ptr %232, align 4, !tbaa !8
  %234 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %233)
  %235 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %234, i8 noundef signext 10)
  %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
  %236 = load i32, ptr %1, align 4, !tbaa !8
  %237 = sext i32 %236 to i64
  %.not100.not = icmp slt i64 %indvars.iv198, %237
  br i1 %.not100.not, label %.lr.ph153, label %._crit_edge154, !llvm.loop !29
}

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #6

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

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

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

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


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