; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-07-08/G - Voting - tjz.ll (Z3pfsii)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Status = type { i32, i32, i32 }
%struct.Node = type { i32, i32 }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@p = external dso_local global i32, align 4
@f = external dso_local global [10010 x [4 x i32]], align 16
@e = external dso_local global [10010 x %"class.std::vector"], align 16
@status = external dso_local global [1771 x %struct.Status], align 16
@tot = external dso_local global i32, align 4
@lnk = external dso_local global [10010 x i32], align 16
@nxt = external dso_local global [10010 x i32], align 16
@h = external dso_local global [10010 x [1771 x %struct.Node]], align 16
@out = external dso_local global [10010 x %"struct.std::pair"], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3pfsii(i32 noundef %0, i32 noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %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 %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [10010 x %"class.std::vector"], ptr @e, i64 0, i64 %25
  %27 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %26) #5
  %28 = icmp ne i64 %27, 0
  br i1 %28, label %46, label %29

29:                                               ; preds = %2
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [10010 x [4 x i32]], ptr @f, i64 0, i64 %31
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [4 x i32], ptr %32, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %45

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %39 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %39, ptr %5, align 4
  %40 = load i32, ptr @tot, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @tot, align 4, !tbaa !5
  %42 = sext i32 %40 to i64
  %43 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @out, i64 0, i64 %42
  %44 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %43, ptr noundef nonnull align 4 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %45

45:                                               ; preds = %38, %29
  br label %353

46:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 -1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [10010 x i32], ptr @lnk, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  store i32 %50, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [10010 x i32], ptr @lnk, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [10010 x [1771 x %struct.Node]], ptr @h, i64 0, i64 %55
  %57 = getelementptr inbounds [1771 x %struct.Node], ptr %56, i64 0, i64 0
  store ptr %57, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %230, %46
  %59 = load i32, ptr %10, align 4, !tbaa !5
  %60 = icmp slt i32 %59, 1771
  br i1 %60, label %61, label %64

61:                                               ; preds = %58
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = icmp eq i32 %62, -1
  br label %64

64:                                               ; preds = %61, %58
  %65 = phi i1 [ false, %58 ], [ %63, %61 ]
  br i1 %65, label %67, label %66

66:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %233

67:                                               ; preds = %64
  %68 = load ptr, ptr %8, align 8, !tbaa !9
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds %struct.Node, ptr %68, i64 %70
  %72 = getelementptr inbounds %struct.Node, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 4, !tbaa !11
  %74 = icmp eq i32 %73, -1
  br i1 %74, label %85, label %75

75:                                               ; preds = %67
  %76 = load i32, ptr @p, align 4, !tbaa !5
  %77 = icmp eq i32 %76, 2
  br i1 %77, label %78, label %86

78:                                               ; preds = %75
  %79 = load i32, ptr %10, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.Status, ptr %81, i32 0, i32 2
  %83 = load i32, ptr %82, align 4, !tbaa !13
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %85, label %86

85:                                               ; preds = %78, %67
  br label %230

86:                                               ; preds = %78, %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.Status, ptr %89, i32 0, i32 0
  %91 = load i32, ptr %90, align 4, !tbaa !15
  store i32 %91, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %92 = load i32, ptr %10, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %93
  %95 = getelementptr inbounds %struct.Status, ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !16
  store i32 %96, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %97 = load i32, ptr %10, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %98
  %100 = getelementptr inbounds %struct.Status, ptr %99, i32 0, i32 2
  %101 = load i32, ptr %100, align 4, !tbaa !13
  store i32 %101, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %102)
  %104 = load i32, ptr %103, align 4, !tbaa !5
  store i32 %104, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %105 = load i32, ptr %14, align 4, !tbaa !5
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = icmp eq i32 %105, %106
  %108 = zext i1 %107 to i32
  %109 = load i32, ptr %14, align 4, !tbaa !5
  %110 = load i32, ptr %12, align 4, !tbaa !5
  %111 = icmp eq i32 %109, %110
  %112 = zext i1 %111 to i32
  %113 = add nsw i32 %108, %112
  %114 = load i32, ptr %14, align 4, !tbaa !5
  %115 = load i32, ptr %13, align 4, !tbaa !5
  %116 = icmp eq i32 %114, %115
  %117 = zext i1 %116 to i32
  %118 = add nsw i32 %113, %117
  store i32 %118, ptr %15, align 4, !tbaa !5
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %121, label %142

121:                                              ; preds = %86
  %122 = load i32, ptr %15, align 4, !tbaa !5
  %123 = icmp sgt i32 %122, 1
  br i1 %123, label %124, label %141

124:                                              ; preds = %121
  %125 = load ptr, ptr %8, align 8, !tbaa !9
  %126 = load i32, ptr %10, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds %struct.Node, ptr %125, i64 %127
  %129 = getelementptr inbounds %struct.Node, ptr %128, i32 0, i32 1
  %130 = load i32, ptr %129, align 4, !tbaa !11
  %131 = load i32, ptr %3, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [10010 x [4 x i32]], ptr @f, i64 0, i64 %132
  %134 = load i32, ptr %4, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [4 x i32], ptr %133, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = icmp eq i32 %130, %137
  br i1 %138, label %139, label %141

139:                                              ; preds = %124
  %140 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %140, ptr %6, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %139, %124, %121
  br label %229

142:                                              ; preds = %86
  %143 = load i32, ptr %4, align 4, !tbaa !5
  %144 = icmp eq i32 %143, 1
  br i1 %144, label %145, label %170

145:                                              ; preds = %142
  %146 = load i32, ptr %15, align 4, !tbaa !5
  %147 = icmp eq i32 %146, 1
  br i1 %147, label %148, label %169

148:                                              ; preds = %145
  %149 = load i32, ptr %14, align 4, !tbaa !5
  %150 = load i32, ptr %11, align 4, !tbaa !5
  %151 = icmp eq i32 %149, %150
  br i1 %151, label %152, label %169

152:                                              ; preds = %148
  %153 = load ptr, ptr %8, align 8, !tbaa !9
  %154 = load i32, ptr %10, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds %struct.Node, ptr %153, i64 %155
  %157 = getelementptr inbounds %struct.Node, ptr %156, i32 0, i32 1
  %158 = load i32, ptr %157, align 4, !tbaa !11
  %159 = load i32, ptr %3, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [10010 x [4 x i32]], ptr @f, i64 0, i64 %160
  %162 = load i32, ptr %4, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [4 x i32], ptr %161, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = icmp eq i32 %158, %165
  br i1 %166, label %167, label %169

167:                                              ; preds = %152
  %168 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %168, ptr %6, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %167, %152, %148, %145
  br label %228

170:                                              ; preds = %142
  %171 = load i32, ptr %4, align 4, !tbaa !5
  %172 = icmp eq i32 %171, 2
  br i1 %172, label %173, label %198

173:                                              ; preds = %170
  %174 = load i32, ptr %15, align 4, !tbaa !5
  %175 = icmp eq i32 %174, 1
  br i1 %175, label %176, label %197

176:                                              ; preds = %173
  %177 = load i32, ptr %14, align 4, !tbaa !5
  %178 = load i32, ptr %12, align 4, !tbaa !5
  %179 = icmp eq i32 %177, %178
  br i1 %179, label %180, label %197

180:                                              ; preds = %176
  %181 = load ptr, ptr %8, align 8, !tbaa !9
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds %struct.Node, ptr %181, i64 %183
  %185 = getelementptr inbounds %struct.Node, ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !11
  %187 = load i32, ptr %3, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [10010 x [4 x i32]], ptr @f, i64 0, i64 %188
  %190 = load i32, ptr %4, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [4 x i32], ptr %189, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = icmp eq i32 %186, %193
  br i1 %194, label %195, label %197

195:                                              ; preds = %180
  %196 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %196, ptr %6, align 4, !tbaa !5
  br label %197

197:                                              ; preds = %195, %180, %176, %173
  br label %227

198:                                              ; preds = %170
  %199 = load i32, ptr @p, align 4, !tbaa !5
  %200 = icmp eq i32 %199, 3
  br i1 %200, label %201, label %226

201:                                              ; preds = %198
  %202 = load i32, ptr %15, align 4, !tbaa !5
  %203 = icmp eq i32 %202, 1
  br i1 %203, label %204, label %225

204:                                              ; preds = %201
  %205 = load i32, ptr %14, align 4, !tbaa !5
  %206 = load i32, ptr %13, align 4, !tbaa !5
  %207 = icmp eq i32 %205, %206
  br i1 %207, label %208, label %225

208:                                              ; preds = %204
  %209 = load ptr, ptr %8, align 8, !tbaa !9
  %210 = load i32, ptr %10, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds %struct.Node, ptr %209, i64 %211
  %213 = getelementptr inbounds %struct.Node, ptr %212, i32 0, i32 1
  %214 = load i32, ptr %213, align 4, !tbaa !11
  %215 = load i32, ptr %3, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [10010 x [4 x i32]], ptr @f, i64 0, i64 %216
  %218 = load i32, ptr %4, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [4 x i32], ptr %217, i64 0, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !5
  %222 = icmp eq i32 %214, %221
  br i1 %222, label %223, label %225

223:                                              ; preds = %208
  %224 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %224, ptr %6, align 4, !tbaa !5
  br label %225

225:                                              ; preds = %223, %208, %204, %201
  br label %226

226:                                              ; preds = %225, %198
  br label %227

227:                                              ; preds = %226, %197
  br label %228

228:                                              ; preds = %227, %169
  br label %229

229:                                              ; preds = %228, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %230

230:                                              ; preds = %229, %85
  %231 = load i32, ptr %10, align 4, !tbaa !5
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %10, align 4, !tbaa !5
  br label %58, !llvm.loop !17

233:                                              ; preds = %66
  %234 = load i32, ptr %3, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [10010 x %"class.std::vector"], ptr @e, i64 0, i64 %235
  %237 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %236) #5
  %238 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %237, ptr %238, align 8
  %239 = load i32, ptr %3, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [10010 x %"class.std::vector"], ptr @e, i64 0, i64 %240
  %242 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %241) #5
  %243 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %242, ptr %243, align 8
  %244 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %245 = load ptr, ptr %244, align 8
  %246 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  %247 = load ptr, ptr %246, align 8
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %245, ptr %247)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %248 = load i32, ptr %3, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [10010 x %"class.std::vector"], ptr @e, i64 0, i64 %249
  %251 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %250) #5
  %252 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %251, ptr %252, align 8
  br label %253

253:                                              ; preds = %350, %233
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %254 = load i32, ptr %3, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [10010 x %"class.std::vector"], ptr @e, i64 0, i64 %255
  %257 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %256) #5
  %258 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %257, ptr %258, align 8
  %259 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br i1 %259, label %261, label %260

260:                                              ; preds = %253
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %352

261:                                              ; preds = %253
  %262 = load i32, ptr %7, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [10010 x [1771 x %struct.Node]], ptr @h, i64 0, i64 %263
  %265 = getelementptr inbounds [1771 x %struct.Node], ptr %264, i64 0, i64 0
  store ptr %265, ptr %8, align 8, !tbaa !9
  %266 = load i32, ptr %7, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [10010 x i32], ptr @nxt, i64 0, i64 %267
  %269 = load i32, ptr %268, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [10010 x [1771 x %struct.Node]], ptr @h, i64 0, i64 %270
  %272 = getelementptr inbounds [1771 x %struct.Node], ptr %271, i64 0, i64 0
  store ptr %272, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %273 = load ptr, ptr %8, align 8, !tbaa !9
  %274 = load i32, ptr %6, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds %struct.Node, ptr %273, i64 %275
  %277 = getelementptr inbounds %struct.Node, ptr %276, i32 0, i32 0
  %278 = load i32, ptr %277, align 4, !tbaa !19
  store i32 %278, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %279 = load i32, ptr %6, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %280
  %282 = getelementptr inbounds %struct.Status, ptr %281, i32 0, i32 0
  %283 = load i32, ptr %282, align 4, !tbaa !15
  %284 = load i32, ptr %20, align 4, !tbaa !5
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %285
  %287 = getelementptr inbounds %struct.Status, ptr %286, i32 0, i32 0
  %288 = load i32, ptr %287, align 4, !tbaa !15
  %289 = sub nsw i32 %283, %288
  store i32 %289, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %290 = load i32, ptr %6, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %291
  %293 = getelementptr inbounds %struct.Status, ptr %292, i32 0, i32 1
  %294 = load i32, ptr %293, align 4, !tbaa !16
  %295 = load i32, ptr %20, align 4, !tbaa !5
  %296 = sext i32 %295 to i64
  %297 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %296
  %298 = getelementptr inbounds %struct.Status, ptr %297, i32 0, i32 1
  %299 = load i32, ptr %298, align 4, !tbaa !16
  %300 = sub nsw i32 %294, %299
  store i32 %300, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %301 = load i32, ptr %6, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %302
  %304 = getelementptr inbounds %struct.Status, ptr %303, i32 0, i32 2
  %305 = load i32, ptr %304, align 4, !tbaa !13
  %306 = load i32, ptr %20, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %307
  %309 = getelementptr inbounds %struct.Status, ptr %308, i32 0, i32 2
  %310 = load i32, ptr %309, align 4, !tbaa !13
  %311 = sub nsw i32 %305, %310
  store i32 %311, ptr %23, align 4, !tbaa !5
  %312 = load i32, ptr %21, align 4, !tbaa !5
  %313 = icmp ne i32 %312, 0
  br i1 %313, label %323, label %314

314:                                              ; preds = %261
  %315 = load i32, ptr %22, align 4, !tbaa !5
  %316 = icmp ne i32 %315, 0
  br i1 %316, label %323, label %317

317:                                              ; preds = %314
  %318 = load i32, ptr %23, align 4, !tbaa !5
  %319 = icmp ne i32 %318, 0
  br i1 %319, label %323, label %320

320:                                              ; preds = %317
  %321 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %322 = load i32, ptr %321, align 4, !tbaa !5
  call void @_Z3pfsii(i32 noundef %322, i32 noundef 0)
  br label %344

323:                                              ; preds = %317, %314, %261
  %324 = load i32, ptr %21, align 4, !tbaa !5
  %325 = icmp ne i32 %324, 0
  br i1 %325, label %326, label %329

326:                                              ; preds = %323
  %327 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %328 = load i32, ptr %327, align 4, !tbaa !5
  call void @_Z3pfsii(i32 noundef %328, i32 noundef 1)
  br label %343

329:                                              ; preds = %323
  %330 = load i32, ptr %22, align 4, !tbaa !5
  %331 = icmp ne i32 %330, 0
  br i1 %331, label %332, label %335

332:                                              ; preds = %329
  %333 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %334 = load i32, ptr %333, align 4, !tbaa !5
  call void @_Z3pfsii(i32 noundef %334, i32 noundef 2)
  br label %342

335:                                              ; preds = %329
  %336 = load i32, ptr @p, align 4, !tbaa !5
  %337 = icmp eq i32 %336, 3
  br i1 %337, label %338, label %341

338:                                              ; preds = %335
  %339 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %340 = load i32, ptr %339, align 4, !tbaa !5
  call void @_Z3pfsii(i32 noundef %340, i32 noundef 3)
  br label %341

341:                                              ; preds = %338, %335
  br label %342

342:                                              ; preds = %341, %332
  br label %343

343:                                              ; preds = %342, %326
  br label %344

344:                                              ; preds = %343, %320
  %345 = load i32, ptr %7, align 4, !tbaa !5
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds [10010 x i32], ptr @nxt, i64 0, i64 %346
  %348 = load i32, ptr %347, align 4, !tbaa !5
  store i32 %348, ptr %7, align 4, !tbaa !5
  %349 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %349, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %350

350:                                              ; preds = %344
  %351 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  br label %253, !llvm.loop !20

352:                                              ; preds = %260
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %353

353:                                              ; preds = %352, %45
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) #4

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

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

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


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Status = type { i32, i32, i32 }
%struct.Node = type { i32, i32 }
%"struct.std::pair" = type { i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@p = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [10010 x [4 x i32]], align 16
@e = external dso_local global [10010 x %"class.std::vector"], align 16
@status = external dso_local local_unnamed_addr global [1771 x %struct.Status], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@lnk = external dso_local local_unnamed_addr global [10010 x i32], align 16
@nxt = external dso_local local_unnamed_addr global [10010 x i32], align 16
@h = external dso_local local_unnamed_addr global [10010 x [1771 x %struct.Node]], align 16
@out = external dso_local global [10010 x %"struct.std::pair"], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) 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) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3pfsii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #3 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %11 = sext i32 %0 to i64
  %12 = getelementptr inbounds [10010 x %"class.std::vector"], ptr @e, i64 0, i64 %11
  %13 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %14, label %25

14:                                               ; preds = %2
  %15 = sext i32 %1 to i64
  %16 = getelementptr inbounds [10010 x [4 x i32]], ptr @f, i64 0, i64 %11, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %.not57 = icmp eq i32 %17, 0
  br i1 %.not57, label %123, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %19 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %19, ptr %5, align 8
  %20 = load i32, ptr @tot, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr @tot, align 4, !tbaa !5
  %22 = sext i32 %20 to i64
  %23 = getelementptr inbounds [10010 x %"struct.std::pair"], ptr @out, i64 0, i64 %22
  %24 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %23, ptr noundef nonnull align 4 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %123

25:                                               ; preds = %2
  %26 = getelementptr inbounds [10010 x i32], ptr @lnk, i64 0, i64 %11
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [10010 x [1771 x %struct.Node]], ptr @h, i64 0, i64 %28
  %30 = sext i32 %0 to i64
  %31 = getelementptr inbounds [10010 x [4 x i32]], ptr @f, i64 0, i64 %30, i64 2
  %32 = sext i32 %0 to i64
  %33 = getelementptr inbounds [10010 x [4 x i32]], ptr @f, i64 0, i64 %32, i64 1
  %34 = sext i32 %0 to i64
  %35 = getelementptr inbounds [10010 x [4 x i32]], ptr @f, i64 0, i64 %34
  %36 = sext i32 %1 to i64
  %37 = getelementptr inbounds [10010 x [4 x i32]], ptr @f, i64 0, i64 %11, i64 %36
  br label %44

38:                                               ; preds = %87
  %39 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %40 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %39, ptr %40)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %41 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  store ptr %41, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %42 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  store ptr %42, ptr %10, align 8
  %43 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br i1 %43, label %.lr.ph, label %._crit_edge

44:                                               ; preds = %25, %87
  %indvars.iv = phi i64 [ 0, %25 ], [ %indvars.iv.next, %87 ]
  %45 = getelementptr inbounds %struct.Node, ptr %29, i64 %indvars.iv, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = icmp eq i32 %46, -1
  br i1 %47, label %87, label %48

48:                                               ; preds = %44
  %49 = load i32, ptr @p, align 4, !tbaa !5
  %50 = icmp eq i32 %49, 2
  %51 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %indvars.iv, i32 2
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = icmp sgt i32 %52, 0
  %or.cond83 = select i1 %50, i1 %53, i1 false
  br i1 %or.cond83, label %87, label %._crit_edge81

._crit_edge81:                                    ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %54 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %indvars.iv
  %55 = load i32, ptr %54, align 4, !tbaa !13
  store i32 %55, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %56 = getelementptr inbounds i8, ptr %54, i64 4
  %57 = load i32, ptr %56, align 4, !tbaa !14
  store i32 %57, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store i32 %52, ptr %8, align 4, !tbaa !5
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %58)
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = icmp eq i32 %60, %61
  %63 = zext i1 %62 to i32
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = icmp eq i32 %60, %64
  %66 = zext i1 %65 to i32
  %67 = add nuw nsw i32 %66, %63
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = icmp eq i32 %60, %68
  %70 = zext i1 %69 to i32
  %71 = add nuw nsw i32 %67, %70
  switch i32 %1, label %78 [
    i32 0, label %72
    i32 1, label %74
    i32 2, label %76
  ]

72:                                               ; preds = %._crit_edge81
  %73 = icmp ugt i32 %71, 1
  br i1 %73, label %.sink.split, label %86

74:                                               ; preds = %._crit_edge81
  %75 = icmp eq i32 %71, 1
  %brmerge.not = select i1 %75, i1 %62, i1 false
  br i1 %brmerge.not, label %.sink.split, label %86

76:                                               ; preds = %._crit_edge81
  %77 = icmp eq i32 %71, 1
  %brmerge63.not = select i1 %77, i1 %65, i1 false
  br i1 %brmerge63.not, label %.sink.split, label %86

78:                                               ; preds = %._crit_edge81
  %79 = load i32, ptr @p, align 4, !tbaa !5
  %80 = icmp eq i32 %79, 3
  %81 = icmp eq i32 %71, 1
  %or.cond5.not72.not75 = select i1 %80, i1 %81, i1 false
  %brmerge66.not = select i1 %or.cond5.not72.not75, i1 %69, i1 false
  br i1 %brmerge66.not, label %.sink.split, label %86

.sink.split:                                      ; preds = %78, %76, %74, %72
  %.sink = phi ptr [ %35, %72 ], [ %33, %74 ], [ %31, %76 ], [ %37, %78 ]
  %82 = load i32, ptr %45, align 4, !tbaa !9
  %83 = load i32, ptr %.sink, align 4, !tbaa !5
  %84 = icmp eq i32 %82, %83
  %85 = trunc nuw nsw i64 %indvars.iv to i32
  %spec.select67 = select i1 %84, i32 %85, i32 -1
  br label %86

86:                                               ; preds = %.sink.split, %78, %76, %74, %72
  %.1 = phi i32 [ -1, %72 ], [ -1, %74 ], [ -1, %76 ], [ -1, %78 ], [ %spec.select67, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  br label %87

87:                                               ; preds = %48, %44, %86
  %.2 = phi i32 [ -1, %44 ], [ %.1, %86 ], [ -1, %48 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %88 = icmp ult i64 %indvars.iv, 1770
  %89 = icmp eq i32 %.2, -1
  %90 = and i1 %88, %89
  br i1 %90, label %44, label %38, !llvm.loop !15

._crit_edge:                                      ; preds = %118, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %123

.lr.ph:                                           ; preds = %38, %118
  %.379 = phi i32 [ %96, %118 ], [ %.2, %38 ]
  %.05378 = phi i32 [ %119, %118 ], [ %27, %38 ]
  %91 = sext i32 %.05378 to i64
  %92 = getelementptr inbounds [10010 x [1771 x %struct.Node]], ptr @h, i64 0, i64 %91
  %93 = getelementptr inbounds [10010 x i32], ptr @nxt, i64 0, i64 %91
  %94 = sext i32 %.379 to i64
  %95 = getelementptr inbounds %struct.Node, ptr %92, i64 %94
  %96 = load i32, ptr %95, align 8, !tbaa !17
  %97 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %94
  %98 = load i32, ptr %97, align 4, !tbaa !13
  %99 = sext i32 %96 to i64
  %100 = getelementptr inbounds [1771 x %struct.Status], ptr @status, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !13
  %102 = getelementptr inbounds i8, ptr %97, i64 4
  %103 = load i32, ptr %102, align 4, !tbaa !14
  %104 = getelementptr inbounds i8, ptr %100, i64 4
  %105 = load i32, ptr %104, align 4, !tbaa !14
  %106 = getelementptr inbounds i8, ptr %97, i64 8
  %107 = load i32, ptr %106, align 4, !tbaa !11
  %108 = getelementptr inbounds i8, ptr %100, i64 8
  %109 = load i32, ptr %108, align 4, !tbaa !11
  %110 = icmp ne i32 %98, %101
  %111 = icmp ne i32 %103, %105
  %or.cond = select i1 %110, i1 true, i1 %111
  %112 = icmp eq i32 %107, %109
  %not.or.cond = xor i1 %or.cond, true
  %or.cond3 = select i1 %not.or.cond, i1 %112, i1 false
  %brmerge = or i1 %or.cond3, %110
  %not.or.cond3 = xor i1 %or.cond3, true
  %.mux = zext i1 %not.or.cond3 to i32
  %brmerge91 = select i1 %brmerge, i1 true, i1 %111
  %.mux.mux = select i1 %brmerge, i32 %.mux, i32 2
  br i1 %brmerge91, label %.sink.split87, label %113

113:                                              ; preds = %.lr.ph
  %114 = load i32, ptr @p, align 4, !tbaa !5
  %115 = icmp eq i32 %114, 3
  br i1 %115, label %.sink.split87, label %118

.sink.split87:                                    ; preds = %.lr.ph, %113
  %.sink89 = phi i32 [ %.mux.mux, %.lr.ph ], [ 3, %113 ]
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %117 = load i32, ptr %116, align 4, !tbaa !5
  call void @_Z3pfsii(i32 noundef %117, i32 noundef %.sink89)
  br label %118

118:                                              ; preds = %.sink.split87, %113
  %119 = load i32, ptr %93, align 4, !tbaa !5
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %121 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  store ptr %121, ptr %10, align 8
  %122 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br i1 %122, label %.lr.ph, label %._crit_edge, !llvm.loop !18

123:                                              ; preds = %14, %18, %._crit_edge
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr, ptr) local_unnamed_addr #4

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

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

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


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