; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/SHORT/COOK70/Problem C (brute)

; 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 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.8" }
%"class.std::_Rb_tree.8" = type { %"struct.std::_Rb_tree<std::pair<std::pair<int, int>, std::pair<int, int>>, std::pair<std::pair<int, int>, std::pair<int, int>>, std::_Identity<std::pair<std::pair<int, int>, std::pair<int, int>>>, std::less<std::pair<std::pair<int, int>, std::pair<int, int>>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<std::pair<int, int>, std::pair<int, int>>, std::pair<std::pair<int, int>, std::pair<int, int>>, std::_Identity<std::pair<std::pair<int, int>, std::pair<int, int>>>, std::less<std::pair<std::pair<int, int>, std::pair<int, int>>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.17" = type { %"struct.std::pair", %"struct.std::pair" }
%"struct.std::pair.15" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@parent = external dso_local global %"class.std::vector", align 8
@pts = external dso_local global %"class.std::vector.0", align 8
@indices = external dso_local global %"class.std::map", align 8
@edges = external dso_local global %"class.std::set", align 8
@r = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@di = external dso_local global [5 x i32], align 16
@dj = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5indexiib(i32 noundef, i32 noundef, i1 noundef zeroext) #0

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

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 %"struct.std::pair", align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca %"struct.std::pair.17", align 4
  %13 = alloca %"struct.std::pair.15", align 8
  %14 = alloca %"struct.std::pair.17", align 4
  %15 = alloca %"struct.std::pair.15", align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"struct.std::pair", align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %"struct.std::pair", align 4
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %28 = alloca %"struct.std::pair.17", align 4
  %29 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  br label %31

31:                                               ; preds = %262, %0
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr %2, align 4, !tbaa !5
  %34 = icmp ne i32 %32, 0
  br i1 %34, label %35, label %263

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef @r, ptr noundef @c, ptr noundef %3)
  %37 = load i32, ptr @r, align 4, !tbaa !5
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %42, label %39

39:                                               ; preds = %35
  %40 = load i32, ptr @c, align 4, !tbaa !5
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %64

42:                                               ; preds = %39, %35
  %43 = load i32, ptr @r, align 4, !tbaa !5
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %45, label %50

45:                                               ; preds = %42
  %46 = load i32, ptr @c, align 4, !tbaa !5
  %47 = icmp eq i32 %46, 1
  br i1 %47, label %48, label %50

48:                                               ; preds = %45
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %56

50:                                               ; preds = %45, %42
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = icmp ne i32 %51, 0
  %53 = xor i1 %52, true
  %54 = zext i1 %53 to i32
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %54)
  br label %56

56:                                               ; preds = %50, %48
  br label %57

57:                                               ; preds = %61, %56
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = add nsw i32 %58, -1
  store i32 %59, ptr %3, align 4, !tbaa !5
  %60 = icmp ne i32 %58, 0
  br i1 %60, label %61, label %63

61:                                               ; preds = %57
  %62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.7)
  br label %57, !llvm.loop !9

63:                                               ; preds = %57
  br label %262

64:                                               ; preds = %39
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @parent) #6
  call void @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @indices) #6
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 2, ptr %4, align 4, !tbaa !5
  call void @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @edges) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %65 = call noundef i32 @_Z5indexiib(i32 noundef 0, i32 noundef 0, i1 noundef zeroext true)
  store i32 %65, ptr %5, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %163, %64
  %67 = load i32, ptr %3, align 4, !tbaa !5
  %68 = add nsw i32 %67, -1
  store i32 %68, ptr %3, align 4, !tbaa !5
  %69 = icmp ne i32 %67, 0
  br i1 %69, label %70, label %164

70:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %71 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.8, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9)
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr %6, align 4, !tbaa !5
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %7, align 4, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr %8, align 4, !tbaa !5
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = add nsw i32 %78, -1
  store i32 %79, ptr %9, align 4, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = icmp eq i32 %80, %81
  br i1 %82, label %83, label %87

83:                                               ; preds = %70
  %84 = load i32, ptr %8, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %8, align 4, !tbaa !5
  store i32 %84, ptr %6, align 4, !tbaa !5
  %86 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %86, ptr %7, align 4, !tbaa !5
  br label %91

87:                                               ; preds = %70
  %88 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %88, ptr %6, align 4, !tbaa !5
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %9, align 4, !tbaa !5
  store i32 %89, ptr %7, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %87, %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %92 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  store i64 %92, ptr %10, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %93 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %93, ptr %11, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %94 = call { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %95 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 0
  %96 = extractvalue { i64, i64 } %94, 0
  store i64 %96, ptr %95, align 4
  %97 = getelementptr inbounds { i64, i64 }, ptr %12, i32 0, i32 1
  %98 = extractvalue { i64, i64 } %94, 1
  store i64 %98, ptr %97, align 4
  %99 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @edges, ptr noundef nonnull align 4 dereferenceable(16) %12)
  %100 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 0
  %101 = extractvalue { ptr, i8 } %99, 0
  store ptr %101, ptr %100, align 8
  %102 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 1
  %103 = extractvalue { ptr, i8 } %99, 1
  store i8 %103, ptr %102, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %104 = call { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %105 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %106 = extractvalue { i64, i64 } %104, 0
  store i64 %106, ptr %105, align 4
  %107 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %108 = extractvalue { i64, i64 } %104, 1
  store i64 %108, ptr %107, align 4
  %109 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @edges, ptr noundef nonnull align 4 dereferenceable(16) %14)
  %110 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 0
  %111 = extractvalue { ptr, i8 } %109, 0
  store ptr %111, ptr %110, align 8
  %112 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 1
  %113 = extractvalue { ptr, i8 } %109, 1
  store i8 %113, ptr %112, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %114 = load i32, ptr %6, align 4, !tbaa !5
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = call noundef i32 @_Z5indexiib(i32 noundef %114, i32 noundef %115, i1 noundef zeroext true)
  %117 = call noundef i32 @_Z4findi(i32 noundef %116)
  store i32 %117, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = call noundef i32 @_Z5indexiib(i32 noundef %118, i32 noundef %119, i1 noundef zeroext true)
  %121 = call noundef i32 @_Z4findi(i32 noundef %120)
  store i32 %121, ptr %17, align 4, !tbaa !5
  %122 = load i32, ptr %16, align 4, !tbaa !5
  %123 = load i32, ptr %17, align 4, !tbaa !5
  %124 = icmp eq i32 %122, %123
  br i1 %124, label %125, label %126

125:                                              ; preds = %91
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %163

126:                                              ; preds = %91
  %127 = load i32, ptr %16, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %128) #6
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = load i32, ptr %17, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %132) #6
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = icmp eq i32 %130, %134
  br i1 %135, label %136, label %142

136:                                              ; preds = %126
  %137 = load i32, ptr %17, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %138) #6
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = add nsw i32 %140, -1
  store i32 %141, ptr %139, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %136, %126
  %143 = load i32, ptr %16, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %144) #6
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = load i32, ptr %17, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %148) #6
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = icmp sgt i32 %146, %150
  br i1 %151, label %152, label %157

152:                                              ; preds = %142
  %153 = load i32, ptr %17, align 4, !tbaa !5
  %154 = load i32, ptr %16, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %155) #6
  store i32 %153, ptr %156, align 4, !tbaa !5
  br label %162

157:                                              ; preds = %142
  %158 = load i32, ptr %16, align 4, !tbaa !5
  %159 = load i32, ptr %17, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %160) #6
  store i32 %158, ptr %161, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %157, %152
  br label %163

163:                                              ; preds = %162, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %66, !llvm.loop !11

164:                                              ; preds = %66
  %165 = load i32, ptr %4, align 4, !tbaa !5
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %259

167:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %254, %167
  %169 = load i32, ptr %18, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #6
  %172 = icmp ult i64 %170, %171
  br i1 %172, label %174, label %173

173:                                              ; preds = %168
  store i32 8, ptr %19, align 4
  br label %257

174:                                              ; preds = %168
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %175 = load i32, ptr %18, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %176) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %177, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %178 = getelementptr inbounds %"struct.std::pair", ptr %20, i32 0, i32 0
  %179 = load i32, ptr %178, align 4, !tbaa !12
  %180 = getelementptr inbounds %"struct.std::pair", ptr %20, i32 0, i32 1
  %181 = load i32, ptr %180, align 4, !tbaa !14
  %182 = call noundef i32 @_Z5indexiib(i32 noundef %179, i32 noundef %181, i1 noundef zeroext true)
  store i32 %182, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %242, %174
  %184 = load i32, ptr %22, align 4, !tbaa !5
  %185 = icmp slt i32 %184, 4
  br i1 %185, label %187, label %186

186:                                              ; preds = %183
  store i32 11, ptr %19, align 4
  br label %245

187:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %188 = getelementptr inbounds %"struct.std::pair", ptr %20, i32 0, i32 0
  %189 = load i32, ptr %188, align 4, !tbaa !12
  %190 = load i32, ptr %22, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [5 x i32], ptr @di, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = add nsw i32 %189, %193
  store i32 %194, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %195 = getelementptr inbounds %"struct.std::pair", ptr %20, i32 0, i32 1
  %196 = load i32, ptr %195, align 4, !tbaa !14
  %197 = load ptr, ptr @dj, align 8, !tbaa !15
  %198 = load i32, ptr %22, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds i32, ptr %197, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = add nsw i32 %196, %201
  store i32 %202, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %203 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
  store i64 %203, ptr %25, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %204 = load i32, ptr %23, align 4, !tbaa !5
  %205 = load i32, ptr %24, align 4, !tbaa !5
  %206 = call noundef i32 @_Z5indexiib(i32 noundef %204, i32 noundef %205, i1 noundef zeroext false)
  store i32 %206, ptr %26, align 4, !tbaa !5
  %207 = load i32, ptr %26, align 4, !tbaa !5
  %208 = icmp sge i32 %207, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  br i1 %208, label %209, label %228

209:                                              ; preds = %187
  %210 = load i32, ptr %21, align 4, !tbaa !5
  %211 = load i32, ptr %26, align 4, !tbaa !5
  %212 = icmp eq i32 %210, %211
  br i1 %212, label %213, label %217

213:                                              ; preds = %209
  %214 = load i32, ptr %21, align 4, !tbaa !5
  %215 = load i32, ptr %5, align 4, !tbaa !5
  %216 = icmp eq i32 %214, %215
  br i1 %216, label %228, label %217

217:                                              ; preds = %213, %209
  %218 = call { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %20, ptr noundef nonnull align 4 dereferenceable(8) %25)
  %219 = getelementptr inbounds { i64, i64 }, ptr %28, i32 0, i32 0
  %220 = extractvalue { i64, i64 } %218, 0
  store i64 %220, ptr %219, align 4
  %221 = getelementptr inbounds { i64, i64 }, ptr %28, i32 0, i32 1
  %222 = extractvalue { i64, i64 } %218, 1
  store i64 %222, ptr %221, align 4
  %223 = call ptr @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE4findERKS2_(ptr noundef nonnull align 8 dereferenceable(48) @edges, ptr noundef nonnull align 4 dereferenceable(16) %28)
  %224 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %27, i32 0, i32 0
  store ptr %223, ptr %224, align 8
  %225 = call ptr @_ZNKSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @edges) #6
  %226 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %29, i32 0, i32 0
  store ptr %225, ptr %226, align 8
  %227 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiES1_EES5_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %29) #6
  br label %228

228:                                              ; preds = %217, %213, %187
  %229 = phi i1 [ false, %213 ], [ false, %187 ], [ %227, %217 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br i1 %229, label %230, label %238

230:                                              ; preds = %228
  %231 = load i32, ptr %21, align 4, !tbaa !5
  %232 = call noundef i32 @_Z4findi(i32 noundef %231)
  %233 = load i32, ptr %26, align 4, !tbaa !5
  %234 = call noundef i32 @_Z4findi(i32 noundef %233)
  %235 = icmp eq i32 %232, %234
  br i1 %235, label %236, label %237

236:                                              ; preds = %230
  store i32 1, ptr %4, align 4, !tbaa !5
  store i32 11, ptr %19, align 4
  br label %239

237:                                              ; preds = %230
  br label %238

238:                                              ; preds = %237, %228
  store i32 0, ptr %19, align 4
  br label %239

239:                                              ; preds = %238, %236
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  %240 = load i32, ptr %19, align 4
  switch i32 %240, label %245 [
    i32 0, label %241
  ]

241:                                              ; preds = %239
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %22, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %22, align 4, !tbaa !5
  br label %183, !llvm.loop !17

245:                                              ; preds = %239, %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %4, align 4, !tbaa !5
  %248 = icmp eq i32 %247, 1
  br i1 %248, label %249, label %250

249:                                              ; preds = %246
  store i32 8, ptr %19, align 4
  br label %251

250:                                              ; preds = %246
  store i32 0, ptr %19, align 4
  br label %251

251:                                              ; preds = %250, %249
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  %252 = load i32, ptr %19, align 4
  switch i32 %252, label %257 [
    i32 0, label %253
  ]

253:                                              ; preds = %251
  br label %254

254:                                              ; preds = %253
  %255 = load i32, ptr %18, align 4, !tbaa !5
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %18, align 4, !tbaa !5
  br label %168, !llvm.loop !18

257:                                              ; preds = %251, %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %258

258:                                              ; preds = %257
  br label %259

259:                                              ; preds = %258, %164
  %260 = load i32, ptr %4, align 4, !tbaa !5
  %261 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %260)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %262

262:                                              ; preds = %259, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %31, !llvm.loop !19

263:                                              ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %264 = load i32, ptr %1, align 4
  ret i32 %264
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

declare i32 @printf(ptr noundef, ...) #4

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

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

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

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

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

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


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

%"class.std::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 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<int, int>, std::pair<const std::pair<int, int>, int>, std::_Select1st<std::pair<const std::pair<int, int>, int>>, std::less<std::pair<int, int>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.8" }
%"class.std::_Rb_tree.8" = type { %"struct.std::_Rb_tree<std::pair<std::pair<int, int>, std::pair<int, int>>, std::pair<std::pair<int, int>, std::pair<int, int>>, std::_Identity<std::pair<std::pair<int, int>, std::pair<int, int>>>, std::less<std::pair<std::pair<int, int>, std::pair<int, int>>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<std::pair<int, int>, std::pair<int, int>>, std::pair<std::pair<int, int>, std::pair<int, int>>, std::_Identity<std::pair<std::pair<int, int>, std::pair<int, int>>>, std::less<std::pair<std::pair<int, int>, std::pair<int, int>>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.17" = type { %"struct.std::pair", %"struct.std::pair" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@parent = external dso_local global %"class.std::vector", align 8
@pts = external dso_local global %"class.std::vector.0", align 8
@indices = external dso_local global %"class.std::map", align 8
@edges = external dso_local global %"class.std::set", align 8
@r = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@di = external dso_local local_unnamed_addr global [5 x i32], align 16
@dj = external dso_local local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5indexiib(i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #0

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

; 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 uwtable
declare dso_local noundef i32 @_Z4findi(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %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 %"struct.std::pair", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"struct.std::pair.17", align 8
  %10 = alloca %"struct.std::pair.17", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::pair.17", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr %1, align 4, !tbaa !5
  %.not72 = icmp eq i32 %19, 0
  br i1 %.not72, label %._crit_edge75, label %.lr.ph74

.lr.ph74:                                         ; preds = %0
  %21 = getelementptr inbounds i8, ptr %9, i64 8
  %22 = getelementptr inbounds i8, ptr %10, i64 8
  %23 = getelementptr inbounds i8, ptr %11, i64 4
  %24 = getelementptr inbounds i8, ptr %16, i64 8
  br label %25

25:                                               ; preds = %.lr.ph74, %.loopexit
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @r, ptr noundef nonnull @c, ptr noundef nonnull %2)
  %27 = load i32, ptr @r, align 4, !tbaa !5
  %28 = icmp eq i32 %27, 1
  %29 = load i32, ptr @c, align 4
  %30 = icmp eq i32 %29, 1
  %or.cond = select i1 %28, i1 true, i1 %30
  br i1 %or.cond, label %31, label %44

31:                                               ; preds = %25
  %or.cond4 = select i1 %28, i1 %30, i1 false
  br i1 %or.cond4, label %32, label %34

32:                                               ; preds = %31
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %38

34:                                               ; preds = %31
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %.not51 = icmp eq i32 %35, 0
  %36 = zext i1 %.not51 to i32
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %36)
  br label %38

38:                                               ; preds = %34, %32
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %2, align 4, !tbaa !5
  %.not5269 = icmp eq i32 %39, 0
  br i1 %.not5269, label %.loopexit, label %.lr.ph71

.lr.ph71:                                         ; preds = %38, %.lr.ph71
  %41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7)
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  store i32 %43, ptr %2, align 4, !tbaa !5
  %.not52 = icmp eq i32 %42, 0
  br i1 %.not52, label %.loopexit, label %.lr.ph71, !llvm.loop !9

44:                                               ; preds = %25
  call void @_ZNSt6vectorIiSaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @parent) #5
  call void @_ZNSt3mapISt4pairIiiEiSt4lessIS1_ESaIS0_IKS1_iEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @indices) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #5
  call void @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @edges) #5
  %45 = call noundef i32 @_Z5indexiib(i32 noundef 0, i32 noundef 0, i1 noundef zeroext true)
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = add nsw i32 %46, -1
  store i32 %47, ptr %2, align 4, !tbaa !5
  %.not4861 = icmp eq i32 %46, 0
  br i1 %.not4861, label %.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %44, %95
  %.062 = phi i32 [ %.1, %95 ], [ 2, %44 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.8, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6)
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %5, align 4, !tbaa !5
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %6, align 4, !tbaa !5
  %54 = icmp eq i32 %49, %50
  br i1 %54, label %55, label %56

55:                                               ; preds = %.lr.ph
  store i32 %49, ptr %5, align 4, !tbaa !5
  br label %57

56:                                               ; preds = %.lr.ph
  store i32 %52, ptr %6, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %56, %55
  store i32 %51, ptr %3, align 4
  store i32 %53, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %58 = 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 %58, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %59 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %59, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  %60 = call { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %8)
  %61 = extractvalue { i64, i64 } %60, 0
  store i64 %61, ptr %9, align 8
  %62 = extractvalue { i64, i64 } %60, 1
  store i64 %62, ptr %21, align 8
  %63 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @edges, ptr noundef nonnull align 4 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #5
  %64 = call { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %7)
  %65 = extractvalue { i64, i64 } %64, 0
  store i64 %65, ptr %10, align 8
  %66 = extractvalue { i64, i64 } %64, 1
  store i64 %66, ptr %22, align 8
  %67 = call { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48) @edges, ptr noundef nonnull align 4 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #5
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = call noundef i32 @_Z5indexiib(i32 noundef %68, i32 noundef %69, i1 noundef zeroext true)
  %71 = call noundef i32 @_Z4findi(i32 noundef %70)
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = call noundef i32 @_Z5indexiib(i32 noundef %72, i32 noundef %73, i1 noundef zeroext true)
  %75 = call noundef i32 @_Z4findi(i32 noundef %74)
  %76 = icmp eq i32 %71, %75
  br i1 %76, label %95, label %77

77:                                               ; preds = %57
  %78 = sext i32 %71 to i64
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %78) #5
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sext i32 %75 to i64
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %81) #5
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = icmp eq i32 %80, %83
  br i1 %84, label %85, label %.sink.split

85:                                               ; preds = %77
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %81) #5
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %87, -1
  store i32 %88, ptr %86, align 4, !tbaa !5
  br label %.sink.split

.sink.split:                                      ; preds = %85, %77
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %78) #5
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %81) #5
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp sgt i32 %90, %92
  %. = select i1 %93, i64 %78, i64 %81
  %.85 = select i1 %93, i32 %75, i32 %71
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @parent, i64 noundef %.) #5
  store i32 %.85, ptr %94, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %.sink.split, %57
  %.1 = phi i32 [ 0, %57 ], [ %.062, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %96 = load i32, ptr %2, align 4, !tbaa !5
  %97 = add nsw i32 %96, -1
  store i32 %97, ptr %2, align 4, !tbaa !5
  %.not48 = icmp eq i32 %96, 0
  br i1 %.not48, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %95
  %.not49 = icmp eq i32 %.1, 0
  br i1 %.not49, label %.loopexit60, label %.preheader

.preheader:                                       ; preds = %44, %._crit_edge
  %.0.lcssa82 = phi i32 [ %.1, %._crit_edge ], [ 2, %44 ]
  %98 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #5
  %.not77 = icmp eq i64 %98, 0
  br i1 %.not77, label %.loopexit60, label %.lr.ph65

.lr.ph65:                                         ; preds = %.preheader
  %.not50 = icmp eq i32 %.0.lcssa82, 1
  br label %102

99:                                               ; preds = %212
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %100 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @pts) #5
  %101 = icmp ugt i64 %100, %indvars.iv.next
  br i1 %101, label %102, label %.loopexit60, !llvm.loop !12

102:                                              ; preds = %.lr.ph65, %99
  %indvars.iv = phi i64 [ 0, %.lr.ph65 ], [ %indvars.iv.next, %99 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %103 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @pts, i64 noundef %indvars.iv) #5
  %104 = load i64, ptr %103, align 4
  store i64 %104, ptr %11, align 8
  %105 = trunc i64 %104 to i32
  %106 = lshr i64 %104, 32
  %107 = trunc nuw i64 %106 to i32
  %108 = call noundef i32 @_Z5indexiib(i32 noundef %105, i32 noundef %107, i1 noundef zeroext true)
  %109 = icmp eq i32 %108, %45
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  %110 = load i32, ptr %11, align 8, !tbaa !13
  %111 = load i32, ptr @di, align 16, !tbaa !5
  %112 = add nsw i32 %111, %110
  store i32 %112, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  %113 = load i32, ptr %23, align 4, !tbaa !15
  %114 = load ptr, ptr @dj, align 8, !tbaa !16
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = add nsw i32 %115, %113
  store i32 %116, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %117 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %117, ptr %14, align 8
  %118 = load i32, ptr %12, align 4, !tbaa !5
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %120 = call noundef i32 @_Z5indexiib(i32 noundef %118, i32 noundef %119, i1 noundef zeroext false)
  %121 = icmp slt i32 %120, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  %122 = icmp eq i32 %108, %120
  %or.cond53 = and i1 %109, %122
  %or.cond76 = or i1 %121, %or.cond53
  br i1 %or.cond76, label %.critedge, label %123

123:                                              ; preds = %102
  %124 = call { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %14)
  %125 = extractvalue { i64, i64 } %124, 0
  store i64 %125, ptr %16, align 8
  %126 = extractvalue { i64, i64 } %124, 1
  store i64 %126, ptr %24, align 8
  %127 = call ptr @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE4findERKS2_(ptr noundef nonnull align 8 dereferenceable(48) @edges, ptr noundef nonnull align 4 dereferenceable(16) %16)
  store ptr %127, ptr %15, align 8
  %128 = call ptr @_ZNKSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @edges) #5
  store ptr %128, ptr %17, align 8
  %129 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiES1_EES5_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br i1 %129, label %130, label %134

130:                                              ; preds = %123
  %131 = call noundef i32 @_Z4findi(i32 noundef %108)
  %132 = call noundef i32 @_Z4findi(i32 noundef %120)
  %133 = icmp eq i32 %131, %132
  br i1 %133, label %.thread57, label %134

.critedge:                                        ; preds = %102
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %134

.thread57:                                        ; preds = %208, %182, %156, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %.loopexit60

134:                                              ; preds = %123, %.critedge, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  %135 = load i32, ptr %11, align 8, !tbaa !13
  %136 = load i32, ptr getelementptr inbounds (i8, ptr @di, i64 4), align 4, !tbaa !5
  %137 = add nsw i32 %136, %135
  store i32 %137, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  %138 = load i32, ptr %23, align 4, !tbaa !15
  %139 = load ptr, ptr @dj, align 8, !tbaa !16
  %140 = getelementptr inbounds i8, ptr %139, i64 4
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = add nsw i32 %141, %138
  store i32 %142, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %143 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %143, ptr %14, align 8
  %144 = load i32, ptr %12, align 4, !tbaa !5
  %145 = load i32, ptr %13, align 4, !tbaa !5
  %146 = call noundef i32 @_Z5indexiib(i32 noundef %144, i32 noundef %145, i1 noundef zeroext false)
  %147 = icmp slt i32 %146, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  %148 = icmp eq i32 %108, %146
  %or.cond53.1 = and i1 %109, %148
  %or.cond76.1 = or i1 %147, %or.cond53.1
  br i1 %or.cond76.1, label %.critedge.1, label %149

149:                                              ; preds = %134
  %150 = call { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %14)
  %151 = extractvalue { i64, i64 } %150, 0
  store i64 %151, ptr %16, align 8
  %152 = extractvalue { i64, i64 } %150, 1
  store i64 %152, ptr %24, align 8
  %153 = call ptr @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE4findERKS2_(ptr noundef nonnull align 8 dereferenceable(48) @edges, ptr noundef nonnull align 4 dereferenceable(16) %16)
  store ptr %153, ptr %15, align 8
  %154 = call ptr @_ZNKSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @edges) #5
  store ptr %154, ptr %17, align 8
  %155 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiES1_EES5_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br i1 %155, label %156, label %160

156:                                              ; preds = %149
  %157 = call noundef i32 @_Z4findi(i32 noundef %108)
  %158 = call noundef i32 @_Z4findi(i32 noundef %146)
  %159 = icmp eq i32 %157, %158
  br i1 %159, label %.thread57, label %160

.critedge.1:                                      ; preds = %134
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %160

160:                                              ; preds = %.critedge.1, %156, %149
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  %161 = load i32, ptr %11, align 8, !tbaa !13
  %162 = load i32, ptr getelementptr inbounds (i8, ptr @di, i64 8), align 8, !tbaa !5
  %163 = add nsw i32 %162, %161
  store i32 %163, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  %164 = load i32, ptr %23, align 4, !tbaa !15
  %165 = load ptr, ptr @dj, align 8, !tbaa !16
  %166 = getelementptr inbounds i8, ptr %165, i64 8
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = add nsw i32 %167, %164
  store i32 %168, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %169 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %169, ptr %14, align 8
  %170 = load i32, ptr %12, align 4, !tbaa !5
  %171 = load i32, ptr %13, align 4, !tbaa !5
  %172 = call noundef i32 @_Z5indexiib(i32 noundef %170, i32 noundef %171, i1 noundef zeroext false)
  %173 = icmp slt i32 %172, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  %174 = icmp eq i32 %108, %172
  %or.cond53.2 = and i1 %109, %174
  %or.cond76.2 = or i1 %173, %or.cond53.2
  br i1 %or.cond76.2, label %.critedge.2, label %175

175:                                              ; preds = %160
  %176 = call { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %14)
  %177 = extractvalue { i64, i64 } %176, 0
  store i64 %177, ptr %16, align 8
  %178 = extractvalue { i64, i64 } %176, 1
  store i64 %178, ptr %24, align 8
  %179 = call ptr @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE4findERKS2_(ptr noundef nonnull align 8 dereferenceable(48) @edges, ptr noundef nonnull align 4 dereferenceable(16) %16)
  store ptr %179, ptr %15, align 8
  %180 = call ptr @_ZNKSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @edges) #5
  store ptr %180, ptr %17, align 8
  %181 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiES1_EES5_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br i1 %181, label %182, label %186

182:                                              ; preds = %175
  %183 = call noundef i32 @_Z4findi(i32 noundef %108)
  %184 = call noundef i32 @_Z4findi(i32 noundef %172)
  %185 = icmp eq i32 %183, %184
  br i1 %185, label %.thread57, label %186

.critedge.2:                                      ; preds = %160
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %186

186:                                              ; preds = %.critedge.2, %182, %175
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  %187 = load i32, ptr %11, align 8, !tbaa !13
  %188 = load i32, ptr getelementptr inbounds (i8, ptr @di, i64 12), align 4, !tbaa !5
  %189 = add nsw i32 %188, %187
  store i32 %189, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  %190 = load i32, ptr %23, align 4, !tbaa !15
  %191 = load ptr, ptr @dj, align 8, !tbaa !16
  %192 = getelementptr inbounds i8, ptr %191, i64 12
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = add nsw i32 %193, %190
  store i32 %194, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %195 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %195, ptr %14, align 8
  %196 = load i32, ptr %12, align 4, !tbaa !5
  %197 = load i32, ptr %13, align 4, !tbaa !5
  %198 = call noundef i32 @_Z5indexiib(i32 noundef %196, i32 noundef %197, i1 noundef zeroext false)
  %199 = icmp slt i32 %198, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  %200 = icmp eq i32 %108, %198
  %or.cond53.3 = and i1 %109, %200
  %or.cond76.3 = or i1 %199, %or.cond53.3
  br i1 %or.cond76.3, label %.critedge.3, label %201

201:                                              ; preds = %186
  %202 = call { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %14)
  %203 = extractvalue { i64, i64 } %202, 0
  store i64 %203, ptr %16, align 8
  %204 = extractvalue { i64, i64 } %202, 1
  store i64 %204, ptr %24, align 8
  %205 = call ptr @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE4findERKS2_(ptr noundef nonnull align 8 dereferenceable(48) @edges, ptr noundef nonnull align 4 dereferenceable(16) %16)
  store ptr %205, ptr %15, align 8
  %206 = call ptr @_ZNKSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @edges) #5
  store ptr %206, ptr %17, align 8
  %207 = call noundef zeroext i1 @_ZSteqRKSt23_Rb_tree_const_iteratorISt4pairIS0_IiiES1_EES5_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br i1 %207, label %208, label %212

208:                                              ; preds = %201
  %209 = call noundef i32 @_Z4findi(i32 noundef %108)
  %210 = call noundef i32 @_Z4findi(i32 noundef %198)
  %211 = icmp eq i32 %209, %210
  br i1 %211, label %.thread57, label %212

.critedge.3:                                      ; preds = %186
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %212

212:                                              ; preds = %.critedge.3, %208, %201
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br i1 %.not50, label %.loopexit60, label %99

.loopexit60:                                      ; preds = %99, %212, %.preheader, %.thread57, %._crit_edge
  %.7 = phi i32 [ 0, %._crit_edge ], [ 1, %.thread57 ], [ %.0.lcssa82, %.preheader ], [ %.0.lcssa82, %99 ], [ 1, %212 ]
  %213 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %.7)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph71, %38, %.loopexit60
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %214 = load i32, ptr %1, align 4, !tbaa !5
  %215 = add nsw i32 %214, -1
  store i32 %215, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %214, 0
  br i1 %.not, label %._crit_edge75, label %25, !llvm.loop !18

._crit_edge75:                                    ; preds = %.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIS0_IiiES1_ESt4lessIS2_ESaIS2_EE6insertEOS2_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i64 } @_ZSt9make_pairIRSt4pairIiiES2_ES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

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

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

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { nofree nounwind "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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!15 = !{!14, !6, i64 4}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = distinct !{!18, !10}


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