; LLVM IR from DionysiosB/CodeForces :: 0200-0299 (246D-ColorfulGraph)

; 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<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long, std::pair<const long, std::set<long>>, std::_Select1st<std::pair<const long, std::set<long>>>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, std::pair<const long, std::set<long>>, std::_Select1st<std::pair<const long, std::set<long>>>, std::less<long>>::_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 }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair.10" = type { i64, %"class.std::set" }
%"struct.std::pair.7" = type <{ %"struct.std::_Rb_tree_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair.12" = type { i64, %"class.std::set" }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::map", align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca %"class.std::set", align 8
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca %"struct.std::pair.10", align 8
  %19 = alloca %"struct.std::pair.7", align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca %"class.std::set", align 8
  %22 = alloca %"struct.std::pair", align 8
  %23 = alloca %"struct.std::pair.10", align 8
  %24 = alloca %"struct.std::pair.7", align 8
  %25 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %26 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %27 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #6
  %29 = load i64, ptr %2, align 8, !tbaa !5
  %30 = add nsw i64 %29, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %30, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %31 unwind label %37

31:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #6
  call void @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 1000000, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 1, ptr %11, align 8, !tbaa !5
  br label %32

32:                                               ; preds = %60, %31
  %33 = load i64, ptr %11, align 8, !tbaa !5
  %34 = load i64, ptr %2, align 8, !tbaa !5
  %35 = icmp sle i64 %33, %34
  br i1 %35, label %41, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %63

37:                                               ; preds = %0
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %6, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  br label %249

41:                                               ; preds = %32
  %42 = load i64, ptr %11, align 8, !tbaa !5
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %42) #6
  %44 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %43)
          to label %45 unwind label %55

45:                                               ; preds = %41
  %46 = load i64, ptr %11, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %46) #6
  %48 = load i64, ptr %47, align 8, !tbaa !5
  %49 = load i64, ptr %9, align 8, !tbaa !5
  %50 = icmp slt i64 %48, %49
  br i1 %50, label %51, label %59

51:                                               ; preds = %45
  %52 = load i64, ptr %11, align 8, !tbaa !5
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %52) #6
  %54 = load i64, ptr %53, align 8, !tbaa !5
  store i64 %54, ptr %9, align 8, !tbaa !5
  br label %59

55:                                               ; preds = %41
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %6, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %248

59:                                               ; preds = %51, %45
  br label %60

60:                                               ; preds = %59
  %61 = load i64, ptr %11, align 8, !tbaa !5
  %62 = add nsw i64 %61, 1
  store i64 %62, ptr %11, align 8, !tbaa !5
  br label %32, !llvm.loop !9

63:                                               ; preds = %36
  br label %64

64:                                               ; preds = %188, %186, %63
  %65 = load i64, ptr %3, align 8, !tbaa !5
  %66 = add nsw i64 %65, -1
  store i64 %66, ptr %3, align 8, !tbaa !5
  %67 = icmp ne i64 %65, 0
  br i1 %67, label %68, label %190

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %69 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %12, ptr noundef %13)
          to label %70 unwind label %79

70:                                               ; preds = %68
  %71 = load i64, ptr %12, align 8, !tbaa !5
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %71) #6
  %73 = load i64, ptr %72, align 8, !tbaa !5
  %74 = load i64, ptr %13, align 8, !tbaa !5
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %74) #6
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = icmp eq i64 %73, %76
  br i1 %77, label %78, label %83

78:                                               ; preds = %70
  store i32 5, ptr %14, align 4
  br label %186, !llvm.loop !11

79:                                               ; preds = %144, %140, %134, %93, %89, %83, %68
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %6, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %7, align 4
  br label %189

83:                                               ; preds = %70
  %84 = load i64, ptr %12, align 8, !tbaa !5
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %84) #6
  %86 = invoke noundef i64 @_ZNKSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE5countERS6_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %85)
          to label %87 unwind label %79

87:                                               ; preds = %83
  %88 = icmp ugt i64 %86, 0
  br i1 %88, label %89, label %102

89:                                               ; preds = %87
  %90 = load i64, ptr %12, align 8, !tbaa !5
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %90) #6
  %92 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %91)
          to label %93 unwind label %79

93:                                               ; preds = %89
  %94 = load i64, ptr %13, align 8, !tbaa !5
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %94) #6
  %96 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %92, ptr noundef nonnull align 8 dereferenceable(8) %95)
          to label %97 unwind label %79

97:                                               ; preds = %93
  %98 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 0
  %99 = extractvalue { ptr, i8 } %96, 0
  store ptr %99, ptr %98, align 8
  %100 = getelementptr inbounds { ptr, i8 }, ptr %15, i32 0, i32 1
  %101 = extractvalue { ptr, i8 } %96, 1
  store i8 %101, ptr %100, align 8
  br label %134

102:                                              ; preds = %87
  call void @llvm.lifetime.start.p0(i64 48, ptr %16) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %16) #6
  %103 = load i64, ptr %13, align 8, !tbaa !5
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %103) #6
  %105 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %16, ptr noundef nonnull align 8 dereferenceable(8) %104)
          to label %106 unwind label %120

106:                                              ; preds = %102
  %107 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 0
  %108 = extractvalue { ptr, i8 } %105, 0
  store ptr %108, ptr %107, align 8
  %109 = getelementptr inbounds { ptr, i8 }, ptr %17, i32 0, i32 1
  %110 = extractvalue { ptr, i8 } %105, 1
  store i8 %110, ptr %109, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr %18) #6
  %111 = load i64, ptr %12, align 8, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %111) #6
  invoke void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEEC2IRlRS4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(56) %18, ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef nonnull align 8 dereferenceable(48) %16)
          to label %113 unwind label %124

113:                                              ; preds = %106
  %114 = invoke { ptr, i8 } @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE6insertIS5_IlS4_EEENSt9enable_ifIXsr16is_constructibleIS7_T_EE5valueES5_ISt17_Rb_tree_iteratorIS7_EbEE4typeEOSD_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %115 unwind label %128

115:                                              ; preds = %113
  %116 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %117 = extractvalue { ptr, i8 } %114, 0
  store ptr %117, ptr %116, align 8
  %118 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %119 = extractvalue { ptr, i8 } %114, 1
  store i8 %119, ptr %118, align 8
  call void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %18) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %18) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %16) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #6
  br label %134

120:                                              ; preds = %102
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %6, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %7, align 4
  br label %133

124:                                              ; preds = %106
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %6, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %7, align 4
  br label %132

128:                                              ; preds = %113
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %6, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %7, align 4
  call void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %18) #6
  br label %132

132:                                              ; preds = %128, %124
  call void @llvm.lifetime.end.p0(i64 56, ptr %18) #6
  br label %133

133:                                              ; preds = %132, %120
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %16) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #6
  br label %189

134:                                              ; preds = %115, %97
  %135 = load i64, ptr %13, align 8, !tbaa !5
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %135) #6
  %137 = invoke noundef i64 @_ZNKSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE5countERS6_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %136)
          to label %138 unwind label %79

138:                                              ; preds = %134
  %139 = icmp ugt i64 %137, 0
  br i1 %139, label %140, label %153

140:                                              ; preds = %138
  %141 = load i64, ptr %13, align 8, !tbaa !5
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %141) #6
  %143 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %142)
          to label %144 unwind label %79

144:                                              ; preds = %140
  %145 = load i64, ptr %12, align 8, !tbaa !5
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %145) #6
  %147 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %143, ptr noundef nonnull align 8 dereferenceable(8) %146)
          to label %148 unwind label %79

148:                                              ; preds = %144
  %149 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 0
  %150 = extractvalue { ptr, i8 } %147, 0
  store ptr %150, ptr %149, align 8
  %151 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 1
  %152 = extractvalue { ptr, i8 } %147, 1
  store i8 %152, ptr %151, align 8
  br label %185

153:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 48, ptr %21) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #6
  %154 = load i64, ptr %12, align 8, !tbaa !5
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %154) #6
  %156 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(8) %155)
          to label %157 unwind label %171

157:                                              ; preds = %153
  %158 = getelementptr inbounds { ptr, i8 }, ptr %22, i32 0, i32 0
  %159 = extractvalue { ptr, i8 } %156, 0
  store ptr %159, ptr %158, align 8
  %160 = getelementptr inbounds { ptr, i8 }, ptr %22, i32 0, i32 1
  %161 = extractvalue { ptr, i8 } %156, 1
  store i8 %161, ptr %160, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr %23) #6
  %162 = load i64, ptr %13, align 8, !tbaa !5
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %162) #6
  invoke void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEEC2IRlRS4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(56) %23, ptr noundef nonnull align 8 dereferenceable(8) %163, ptr noundef nonnull align 8 dereferenceable(48) %21)
          to label %164 unwind label %175

164:                                              ; preds = %157
  %165 = invoke { ptr, i8 } @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE6insertIS5_IlS4_EEENSt9enable_ifIXsr16is_constructibleIS7_T_EE5valueES5_ISt17_Rb_tree_iteratorIS7_EbEE4typeEOSD_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(56) %23)
          to label %166 unwind label %179

166:                                              ; preds = %164
  %167 = getelementptr inbounds { ptr, i8 }, ptr %24, i32 0, i32 0
  %168 = extractvalue { ptr, i8 } %165, 0
  store ptr %168, ptr %167, align 8
  %169 = getelementptr inbounds { ptr, i8 }, ptr %24, i32 0, i32 1
  %170 = extractvalue { ptr, i8 } %165, 1
  store i8 %170, ptr %169, align 8
  call void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %23) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %23) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #6
  br label %185

171:                                              ; preds = %153
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %6, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %7, align 4
  br label %184

175:                                              ; preds = %157
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %6, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %7, align 4
  br label %183

179:                                              ; preds = %164
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %6, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %7, align 4
  call void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %23) #6
  br label %183

183:                                              ; preds = %179, %175
  call void @llvm.lifetime.end.p0(i64 56, ptr %23) #6
  br label %184

184:                                              ; preds = %183, %171
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #6
  br label %189

185:                                              ; preds = %166, %148
  store i32 0, ptr %14, align 4
  br label %186

186:                                              ; preds = %185, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %187 = load i32, ptr %14, align 4
  switch i32 %187, label %255 [
    i32 0, label %188
    i32 5, label %64
  ]

188:                                              ; preds = %186
  br label %64, !llvm.loop !11

189:                                              ; preds = %184, %133, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %248

190:                                              ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %191 = call ptr @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  %192 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %25, i32 0, i32 0
  store ptr %191, ptr %192, align 8
  br label %193

193:                                              ; preds = %236, %190
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  %194 = call ptr @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  %195 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %26, i32 0, i32 0
  store ptr %194, ptr %195, align 8
  %196 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br i1 %196, label %198, label %197

197:                                              ; preds = %193
  store i32 7, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %239

198:                                              ; preds = %193
  %199 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #6
  %200 = getelementptr inbounds %"struct.std::pair.12", ptr %199, i32 0, i32 0
  %201 = load i64, ptr %200, align 8, !tbaa !12
  %202 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #6
  %203 = getelementptr inbounds %"struct.std::pair.12", ptr %202, i32 0, i32 1
  %204 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %203) #6
  %205 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %201, i64 noundef %204)
          to label %206 unwind label %231

206:                                              ; preds = %198
  %207 = load i64, ptr %10, align 8, !tbaa !5
  %208 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #6
  %209 = getelementptr inbounds %"struct.std::pair.12", ptr %208, i32 0, i32 1
  %210 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %209) #6
  %211 = icmp ult i64 %207, %210
  br i1 %211, label %224, label %212

212:                                              ; preds = %206
  %213 = load i64, ptr %10, align 8, !tbaa !5
  %214 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #6
  %215 = getelementptr inbounds %"struct.std::pair.12", ptr %214, i32 0, i32 1
  %216 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %215) #6
  %217 = icmp eq i64 %213, %216
  br i1 %217, label %218, label %235

218:                                              ; preds = %212
  %219 = load i64, ptr %9, align 8, !tbaa !5
  %220 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #6
  %221 = getelementptr inbounds %"struct.std::pair.12", ptr %220, i32 0, i32 0
  %222 = load i64, ptr %221, align 8, !tbaa !12
  %223 = icmp sge i64 %219, %222
  br i1 %223, label %224, label %235

224:                                              ; preds = %218, %206
  %225 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #6
  %226 = getelementptr inbounds %"struct.std::pair.12", ptr %225, i32 0, i32 0
  %227 = load i64, ptr %226, align 8, !tbaa !12
  store i64 %227, ptr %9, align 8, !tbaa !5
  %228 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #6
  %229 = getelementptr inbounds %"struct.std::pair.12", ptr %228, i32 0, i32 1
  %230 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %229) #6
  store i64 %230, ptr %10, align 8, !tbaa !5
  br label %235

231:                                              ; preds = %198
  %232 = landingpad { ptr, i32 }
          cleanup
  %233 = extractvalue { ptr, i32 } %232, 0
  store ptr %233, ptr %6, align 8
  %234 = extractvalue { ptr, i32 } %232, 1
  store i32 %234, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %248

235:                                              ; preds = %224, %218, %212
  br label %236

236:                                              ; preds = %235
  %237 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %25, i32 noundef 0) #6
  %238 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %27, i32 0, i32 0
  store ptr %237, ptr %238, align 8
  br label %193, !llvm.loop !23

239:                                              ; preds = %197
  %240 = load i64, ptr %9, align 8, !tbaa !5
  %241 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %240)
          to label %242 unwind label %244

242:                                              ; preds = %239
  store i32 0, ptr %1, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %243 = load i32, ptr %1, align 4
  ret i32 %243

244:                                              ; preds = %239
  %245 = landingpad { ptr, i32 }
          cleanup
  %246 = extractvalue { ptr, i32 } %245, 0
  store ptr %246, ptr %6, align 8
  %247 = extractvalue { ptr, i32 } %245, 1
  store i32 %247, ptr %7, align 4
  br label %248

248:                                              ; preds = %244, %231, %189, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br label %249

249:                                              ; preds = %248, %37
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %250

250:                                              ; preds = %249
  %251 = load ptr, ptr %6, align 8
  %252 = load i32, ptr %7, align 4
  %253 = insertvalue { ptr, i32 } poison, ptr %251, 0
  %254 = insertvalue { ptr, i32 } %253, i32 %252, 1
  resume { ptr, i32 } %254

255:                                              ; preds = %186
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; 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 void @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEEC2IRlRS4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"long", !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 = !{!"_ZTSSt4pairIKlSt3setIlSt4lessIlESaIlEEE", !6, i64 0, !14, i64 8}
!14 = !{!"_ZTSSt3setIlSt4lessIlESaIlEE", !15, i64 0}
!15 = !{!"_ZTSSt8_Rb_treeIllSt9_IdentityIlESt4lessIlESaIlEE", !16, i64 0}
!16 = !{!"_ZTSNSt8_Rb_treeIllSt9_IdentityIlESt4lessIlESaIlEE13_Rb_tree_implIS3_Lb1EEE", !17, i64 0, !19, i64 8}
!17 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIlEE", !18, i64 0}
!18 = !{!"_ZTSSt4lessIlE"}
!19 = !{!"_ZTSSt15_Rb_tree_header", !20, i64 0, !6, i64 32}
!20 = !{!"_ZTSSt18_Rb_tree_node_base", !21, i64 0, !22, i64 8, !22, i64 16, !22, i64 24}
!21 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = distinct !{!23, !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<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long, std::pair<const long, std::set<long>>, std::_Select1st<std::pair<const long, std::set<long>>>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, std::pair<const long, std::set<long>>, std::_Select1st<std::pair<const long, std::set<long>>>, std::less<long>>::_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.3" }
%"class.std::_Rb_tree.3" = type { %"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::pair.10" = type { i64, %"class.std::set" }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::map", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"class.std::set", align 8
  %9 = alloca %"struct.std::pair.10", align 8
  %10 = alloca %"class.std::set", align 8
  %11 = alloca %"struct.std::pair.10", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %15 = load i64, ptr %1, align 8, !tbaa !5
  %16 = add nsw i64 %15, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %16, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %17 unwind label %21

17:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #6
  call void @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  %18 = load i64, ptr %1, align 8, !tbaa !5
  %.not48 = icmp slt i64 %18, 1
  br i1 %.not48, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %31, %17
  %.029.lcssa = phi i64 [ 1000000, %17 ], [ %.130, %31 ]
  %19 = load i64, ptr %2, align 8, !tbaa !5
  %20 = add nsw i64 %19, -1
  store i64 %20, ptr %2, align 8, !tbaa !5
  %.not3651 = icmp eq i64 %19, 0
  br i1 %.not3651, label %._crit_edge, label %.lr.ph52

21:                                               ; preds = %0
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %142

.lr.ph:                                           ; preds = %17, %31
  %.02950 = phi i64 [ %.130, %31 ], [ 1000000, %17 ]
  %.03549 = phi i64 [ %32, %31 ], [ 1, %17 ]
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03549) #6
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %23)
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03549) #6
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = icmp slt i64 %26, %.02950
  br i1 %27, label %28, label %31

28:                                               ; preds = %.lr.ph
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.03549) #6
  %30 = load i64, ptr %29, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %.lr.ph, %28
  %.130 = phi i64 [ %30, %28 ], [ %.02950, %.lr.ph ]
  %32 = add nuw nsw i64 %.03549, 1
  %33 = load i64, ptr %1, align 8, !tbaa !5
  %.not.not = icmp slt i64 %.03549, %33
  br i1 %.not.not, label %.lr.ph, label %.preheader, !llvm.loop !9

.lr.ph52:                                         ; preds = %.preheader, %106
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %35 = load i64, ptr %6, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %35) #6
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = load i64, ptr %7, align 8, !tbaa !5
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %38) #6
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = icmp eq i64 %37, %40
  br i1 %41, label %106, label %44, !llvm.loop !11

42:                                               ; preds = %84, %80, %75, %53, %49, %44
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %109

44:                                               ; preds = %.lr.ph52
  %45 = load i64, ptr %6, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %45) #6
  %47 = invoke noundef i64 @_ZNKSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE5countERS6_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %46)
          to label %48 unwind label %42

48:                                               ; preds = %44
  %.not38 = icmp eq i64 %47, 0
  br i1 %.not38, label %57, label %49

49:                                               ; preds = %48
  %50 = load i64, ptr %6, align 8, !tbaa !5
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %50) #6
  %52 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %51)
          to label %53 unwind label %42

53:                                               ; preds = %49
  %54 = load i64, ptr %7, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %54) #6
  %56 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %52, ptr noundef nonnull align 8 dereferenceable(8) %55)
          to label %75 unwind label %42

57:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  %58 = load i64, ptr %7, align 8, !tbaa !5
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %58) #6
  %60 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %59)
          to label %61 unwind label %67

61:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %9) #6
  %62 = load i64, ptr %6, align 8, !tbaa !5
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %62) #6
  invoke void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEEC2IRlRS4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(56) %9, ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull align 8 dereferenceable(48) %8)
          to label %64 unwind label %69

64:                                               ; preds = %61
  %65 = invoke { ptr, i8 } @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE6insertIS5_IlS4_EEENSt9enable_ifIXsr16is_constructibleIS7_T_EE5valueES5_ISt17_Rb_tree_iteratorIS7_EbEE4typeEOSD_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(56) %9)
          to label %66 unwind label %71

66:                                               ; preds = %64
  call void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #6
  br label %75

67:                                               ; preds = %57
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %74

69:                                               ; preds = %61
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %73

71:                                               ; preds = %64
  %72 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %9) #6
  br label %73

73:                                               ; preds = %71, %69
  %.pn = phi { ptr, i32 } [ %72, %71 ], [ %70, %69 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #6
  br label %74

74:                                               ; preds = %73, %67
  %.pn.pn = phi { ptr, i32 } [ %.pn, %73 ], [ %68, %67 ]
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #6
  br label %109

75:                                               ; preds = %53, %66
  %76 = load i64, ptr %7, align 8, !tbaa !5
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %76) #6
  %78 = invoke noundef i64 @_ZNKSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE5countERS6_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %77)
          to label %79 unwind label %42

79:                                               ; preds = %75
  %.not41 = icmp eq i64 %78, 0
  br i1 %.not41, label %88, label %80

80:                                               ; preds = %79
  %81 = load i64, ptr %7, align 8, !tbaa !5
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %81) #6
  %83 = invoke noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEEixERS6_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %82)
          to label %84 unwind label %42

84:                                               ; preds = %80
  %85 = load i64, ptr %6, align 8, !tbaa !5
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %85) #6
  %87 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %83, ptr noundef nonnull align 8 dereferenceable(8) %86)
          to label %106 unwind label %42

88:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %10) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #6
  %89 = load i64, ptr %6, align 8, !tbaa !5
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %89) #6
  %91 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %10, ptr noundef nonnull align 8 dereferenceable(8) %90)
          to label %92 unwind label %98

92:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %11) #6
  %93 = load i64, ptr %7, align 8, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %93) #6
  invoke void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEEC2IRlRS4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(56) %11, ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef nonnull align 8 dereferenceable(48) %10)
          to label %95 unwind label %100

95:                                               ; preds = %92
  %96 = invoke { ptr, i8 } @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE6insertIS5_IlS4_EEENSt9enable_ifIXsr16is_constructibleIS7_T_EE5valueES5_ISt17_Rb_tree_iteratorIS7_EbEE4typeEOSD_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(56) %11)
          to label %97 unwind label %102

97:                                               ; preds = %95
  call void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #6
  br label %106

98:                                               ; preds = %88
  %99 = landingpad { ptr, i32 }
          cleanup
  br label %105

100:                                              ; preds = %92
  %101 = landingpad { ptr, i32 }
          cleanup
  br label %104

102:                                              ; preds = %95
  %103 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #6
  br label %104

104:                                              ; preds = %102, %100
  %.pn42 = phi { ptr, i32 } [ %103, %102 ], [ %101, %100 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #6
  br label %105

105:                                              ; preds = %104, %98
  %.pn42.pn = phi { ptr, i32 } [ %.pn42, %104 ], [ %99, %98 ]
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %10) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #6
  br label %109

106:                                              ; preds = %97, %84, %.lr.ph52
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %107 = load i64, ptr %2, align 8, !tbaa !5
  %108 = add nsw i64 %107, -1
  store i64 %108, ptr %2, align 8, !tbaa !5
  %.not36 = icmp eq i64 %107, 0
  br i1 %.not36, label %._crit_edge, label %.lr.ph52

109:                                              ; preds = %105, %74, %42
  %.pn45 = phi { ptr, i32 } [ %43, %42 ], [ %.pn42.pn, %105 ], [ %.pn.pn, %74 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %142

._crit_edge:                                      ; preds = %106, %.preheader
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %110 = call ptr @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  store ptr %110, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %111 = call ptr @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  store ptr %111, ptr %13, align 8
  %112 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br i1 %112, label %.lr.ph56, label %._crit_edge57

._crit_edge57:                                    ; preds = %138, %._crit_edge
  %.231.lcssa = phi i64 [ %.029.lcssa, %._crit_edge ], [ %.332, %138 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %113 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.231.lcssa)
  call void @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

.lr.ph56:                                         ; preds = %._crit_edge, %138
  %.23154 = phi i64 [ %.332, %138 ], [ %.029.lcssa, %._crit_edge ]
  %.03353 = phi i64 [ %.134, %138 ], [ 0, %._crit_edge ]
  %114 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %115 = load i64, ptr %114, align 8, !tbaa !12
  %116 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %117 = getelementptr inbounds i8, ptr %116, i64 8
  %118 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %117) #6
  %119 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %115, i64 noundef %118)
  %120 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %121 = getelementptr inbounds i8, ptr %120, i64 8
  %122 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %121) #6
  %123 = icmp ult i64 %.03353, %122
  br i1 %123, label %132, label %124

124:                                              ; preds = %.lr.ph56
  %125 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %126 = getelementptr inbounds i8, ptr %125, i64 8
  %127 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %126) #6
  %128 = icmp eq i64 %.03353, %127
  br i1 %128, label %129, label %138

129:                                              ; preds = %124
  %130 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %131 = load i64, ptr %130, align 8, !tbaa !12
  %.not37 = icmp slt i64 %.23154, %131
  br i1 %.not37, label %138, label %132

132:                                              ; preds = %129, %.lr.ph56
  %133 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %134 = load i64, ptr %133, align 8, !tbaa !12
  %135 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %136 = getelementptr inbounds i8, ptr %135, i64 8
  %137 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %136) #6
  br label %138

138:                                              ; preds = %124, %129, %132
  %.134 = phi i64 [ %137, %132 ], [ %.03353, %129 ], [ %.03353, %124 ]
  %.332 = phi i64 [ %134, %132 ], [ %.23154, %129 ], [ %.23154, %124 ]
  %139 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %140 = call ptr @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  store ptr %140, ptr %13, align 8
  %141 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br i1 %141, label %.lr.ph56, label %._crit_edge57, !llvm.loop !23

142:                                              ; preds = %109, %21
  %.pn45.pn = phi { ptr, i32 } [ %.pn45, %109 ], [ %22, %21 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn45.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; 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 void @_ZNSt3mapIlSt3setIlSt4lessIlESaIlEES2_SaISt4pairIKlS4_EEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEEC2IRlRS4_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairISA_SB_EEEbE4typeELb1EEEOSA_OSB_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIlSt3setIlSt4lessIlESaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKlSt3setIlSt4lessIlESaIlEEEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"long", !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 = !{!"_ZTSSt4pairIKlSt3setIlSt4lessIlESaIlEEE", !6, i64 0, !14, i64 8}
!14 = !{!"_ZTSSt3setIlSt4lessIlESaIlEE", !15, i64 0}
!15 = !{!"_ZTSSt8_Rb_treeIllSt9_IdentityIlESt4lessIlESaIlEE", !16, i64 0}
!16 = !{!"_ZTSNSt8_Rb_treeIllSt9_IdentityIlESt4lessIlESaIlEE13_Rb_tree_implIS3_Lb1EEE", !17, i64 0, !19, i64 8}
!17 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIlEE", !18, i64 0}
!18 = !{!"_ZTSSt4lessIlE"}
!19 = !{!"_ZTSSt15_Rb_tree_header", !20, i64 0, !6, i64 32}
!20 = !{!"_ZTSSt18_Rb_tree_node_base", !21, i64 0, !22, i64 8, !22, i64 16, !22, i64 24}
!21 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = distinct !{!23, !10}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass