; LLVM IR from DionysiosB/CodeForces :: 0400-0499 (490B-Queue)

; 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, long>, std::_Select1st<std::pair<const long, long>>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, std::pair<const long, long>, std::_Select1st<std::pair<const long, 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.3" = type { i64, i64 }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.5" }
%"class.std::_Rb_tree.5" = 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.11" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair.9" = type { i64, i64 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 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 %"class.std::vector", align 8
  %4 = alloca i64, 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 %"struct.std::pair.3", align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %19 = alloca %"class.std::set", align 8
  %20 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %22 = alloca %"struct.std::pair.11", align 8
  %23 = alloca %"struct.std::pair.11", align 8
  %24 = alloca %"struct.std::_Rb_tree_iterator", 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
  %28 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %29 = alloca i64, align 8
  %30 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %31 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %32 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  %34 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %34, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %35 unwind label %41

35:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr %8) #5
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %55, %35
  %37 = load i64, ptr %9, align 8, !tbaa !5
  %38 = load i64, ptr %2, align 8, !tbaa !5
  %39 = icmp slt i64 %37, %38
  br i1 %39, label %45, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %67

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

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %46 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %10, ptr noundef %11)
          to label %47 unwind label %58

47:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  invoke void @_ZNSt4pairIllEC2IRlS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %48 unwind label %62

48:                                               ; preds = %47
  %49 = invoke { ptr, i8 } @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE6insertIS2_IllEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueES2_ISt17_Rb_tree_iteratorIS4_EbEE4typeEOSA_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %50 unwind label %62

50:                                               ; preds = %48
  %51 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 0
  %52 = extractvalue { ptr, i8 } %49, 0
  store ptr %52, ptr %51, align 8
  %53 = getelementptr inbounds { ptr, i8 }, ptr %13, i32 0, i32 1
  %54 = extractvalue { ptr, i8 } %49, 1
  store i8 %54, ptr %53, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %55

55:                                               ; preds = %50
  %56 = load i64, ptr %9, align 8, !tbaa !5
  %57 = add nsw i64 %56, 1
  store i64 %57, ptr %9, align 8, !tbaa !5
  br label %36, !llvm.loop !9

58:                                               ; preds = %45
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %6, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %7, align 4
  br label %66

62:                                               ; preds = %48, %47
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %6, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  br label %66

66:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %258

67:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store i64 0, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 1, ptr %15, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %96, %67
  %69 = load i64, ptr %15, align 8, !tbaa !5
  %70 = load i64, ptr %2, align 8, !tbaa !5
  %71 = icmp slt i64 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 5, ptr %16, align 4
  br label %103

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %74 = invoke ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %75 unwind label %81

75:                                               ; preds = %73
  %76 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %17, i32 0, i32 0
  store ptr %74, ptr %76, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %77 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  %78 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %18, i32 0, i32 0
  store ptr %77, ptr %78, align 8
  %79 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br i1 %79, label %80, label %85

80:                                               ; preds = %75
  store i32 5, ptr %16, align 4
  br label %103

81:                                               ; preds = %73
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %6, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %104

85:                                               ; preds = %75
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %87 unwind label %99

87:                                               ; preds = %85
  %88 = load i64, ptr %86, align 8, !tbaa !5
  %89 = load i64, ptr %15, 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) #5
  store i64 %88, ptr %90, align 8, !tbaa !5
  %91 = invoke noundef i64 @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %92 unwind label %99

92:                                               ; preds = %87
  %93 = load i64, ptr %15, 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) #5
  %95 = load i64, ptr %94, align 8, !tbaa !5
  store i64 %95, ptr %14, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %92
  %97 = load i64, ptr %15, align 8, !tbaa !5
  %98 = add nsw i64 %97, 2
  store i64 %98, ptr %15, align 8, !tbaa !5
  br label %68, !llvm.loop !11

99:                                               ; preds = %87, %85
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %6, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %7, align 4
  br label %104

103:                                              ; preds = %80, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %105

104:                                              ; preds = %99, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %257

105:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 48, ptr %19) #5
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %106 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  %107 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %20, i32 0, i32 0
  store ptr %106, ptr %107, align 8
  br label %108

108:                                              ; preds = %142, %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %109 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  %110 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %21, i32 0, i32 0
  store ptr %109, ptr %110, align 8
  %111 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br i1 %111, label %113, label %112

112:                                              ; preds = %108
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %149

113:                                              ; preds = %108
  %114 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  %115 = getelementptr inbounds %"struct.std::pair.9", ptr %114, i32 0, i32 1
  %116 = load i64, ptr %115, align 8, !tbaa !12
  %117 = icmp eq i64 %116, 0
  br i1 %117, label %118, label %125

118:                                              ; preds = %113
  %119 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  %120 = getelementptr inbounds %"struct.std::pair.9", ptr %119, i32 0, i32 0
  %121 = load i64, ptr %120, align 8, !tbaa !14
  %122 = load i64, ptr %2, align 8, !tbaa !5
  %123 = sub nsw i64 %122, 2
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %123) #5
  store i64 %121, ptr %124, align 8, !tbaa !5
  br label %142

125:                                              ; preds = %113
  %126 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  %127 = getelementptr inbounds %"struct.std::pair.9", ptr %126, i32 0, i32 0
  %128 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 8 dereferenceable(8) %127)
          to label %129 unwind label %145

129:                                              ; preds = %125
  %130 = getelementptr inbounds { ptr, i8 }, ptr %22, i32 0, i32 0
  %131 = extractvalue { ptr, i8 } %128, 0
  store ptr %131, ptr %130, align 8
  %132 = getelementptr inbounds { ptr, i8 }, ptr %22, i32 0, i32 1
  %133 = extractvalue { ptr, i8 } %128, 1
  store i8 %133, ptr %132, align 8
  %134 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  %135 = getelementptr inbounds %"struct.std::pair.9", ptr %134, i32 0, i32 1
  %136 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 8 dereferenceable(8) %135)
          to label %137 unwind label %145

137:                                              ; preds = %129
  %138 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 0
  %139 = extractvalue { ptr, i8 } %136, 0
  store ptr %139, ptr %138, align 8
  %140 = getelementptr inbounds { ptr, i8 }, ptr %23, i32 0, i32 1
  %141 = extractvalue { ptr, i8 } %136, 1
  store i8 %141, ptr %140, align 8
  br label %142

142:                                              ; preds = %137, %118
  %143 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKllEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %20, i32 noundef 0) #5
  %144 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %24, i32 0, i32 0
  store ptr %143, ptr %144, align 8
  br label %108, !llvm.loop !15

145:                                              ; preds = %129, %125
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %6, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %256

149:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %150 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  %151 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %25, i32 0, i32 0
  store ptr %150, ptr %151, align 8
  br label %152

152:                                              ; preds = %162, %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %153 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  %154 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %26, i32 0, i32 0
  store ptr %153, ptr %154, align 8
  %155 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  br i1 %155, label %157, label %156

156:                                              ; preds = %152
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %169

157:                                              ; preds = %152
  %158 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  %159 = getelementptr inbounds %"struct.std::pair.9", ptr %158, i32 0, i32 1
  %160 = invoke noundef i64 @_ZNSt3setIlSt4lessIlESaIlEE5eraseERKl(ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 8 dereferenceable(8) %159)
          to label %161 unwind label %165

161:                                              ; preds = %157
  br label %162

162:                                              ; preds = %161
  %163 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKllEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %25, i32 noundef 0) #5
  %164 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %27, i32 0, i32 0
  store ptr %163, ptr %164, align 8
  br label %152, !llvm.loop !16

165:                                              ; preds = %157
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %6, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %256

169:                                              ; preds = %156
  %170 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %19) #5
  %171 = icmp ugt i64 %170, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  br i1 %171, label %172, label %177

172:                                              ; preds = %169
  %173 = call ptr @_ZNKSt3setIlSt4lessIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %19) #5
  %174 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %28, i32 0, i32 0
  store ptr %173, ptr %174, align 8
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %28) #5
  %176 = load i64, ptr %175, align 8, !tbaa !5
  br label %178

177:                                              ; preds = %169
  br label %178

178:                                              ; preds = %177, %172
  %179 = phi i64 [ %176, %172 ], [ -1, %177 ]
  store i64 %179, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  store i64 0, ptr %29, align 8, !tbaa !5
  br label %180

180:                                              ; preds = %220, %178
  %181 = load i64, ptr %29, align 8, !tbaa !5
  %182 = load i64, ptr %2, align 8, !tbaa !5
  %183 = icmp slt i64 %181, %182
  br i1 %183, label %185, label %184

184:                                              ; preds = %180
  store i32 14, ptr %16, align 4
  br label %227

185:                                              ; preds = %180
  %186 = load i64, ptr %14, align 8, !tbaa !5
  %187 = icmp slt i64 %186, 0
  br i1 %187, label %188, label %189

188:                                              ; preds = %185
  store i32 14, ptr %16, align 4
  br label %227

189:                                              ; preds = %185
  %190 = load i64, ptr %14, align 8, !tbaa !5
  %191 = load i64, ptr %29, align 8, !tbaa !5
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %191) #5
  store i64 %190, ptr %192, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %193 = invoke ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %194 unwind label %207

194:                                              ; preds = %189
  %195 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %30, i32 0, i32 0
  store ptr %193, ptr %195, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %196 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  %197 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %31, i32 0, i32 0
  store ptr %196, ptr %197, align 8
  %198 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull align 8 dereferenceable(8) %31) #5
  br i1 %198, label %204, label %199

199:                                              ; preds = %194
  %200 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %201 unwind label %211

201:                                              ; preds = %199
  %202 = load i64, ptr %200, align 8, !tbaa !5
  %203 = icmp eq i64 %202, 0
  br label %204

204:                                              ; preds = %201, %194
  %205 = phi i1 [ true, %194 ], [ %203, %201 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  br i1 %205, label %206, label %216

206:                                              ; preds = %204
  store i32 14, ptr %16, align 4
  br label %227

207:                                              ; preds = %189
  %208 = landingpad { ptr, i32 }
          cleanup
  %209 = extractvalue { ptr, i32 } %208, 0
  store ptr %209, ptr %6, align 8
  %210 = extractvalue { ptr, i32 } %208, 1
  store i32 %210, ptr %7, align 4
  br label %215

211:                                              ; preds = %199
  %212 = landingpad { ptr, i32 }
          cleanup
  %213 = extractvalue { ptr, i32 } %212, 0
  store ptr %213, ptr %6, align 8
  %214 = extractvalue { ptr, i32 } %212, 1
  store i32 %214, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  br label %215

215:                                              ; preds = %211, %207
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  br label %228

216:                                              ; preds = %204
  %217 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %218 unwind label %223

218:                                              ; preds = %216
  %219 = load i64, ptr %217, align 8, !tbaa !5
  store i64 %219, ptr %14, align 8, !tbaa !5
  br label %220

220:                                              ; preds = %218
  %221 = load i64, ptr %29, align 8, !tbaa !5
  %222 = add nsw i64 %221, 2
  store i64 %222, ptr %29, align 8, !tbaa !5
  br label %180, !llvm.loop !17

223:                                              ; preds = %216
  %224 = landingpad { ptr, i32 }
          cleanup
  %225 = extractvalue { ptr, i32 } %224, 0
  store ptr %225, ptr %6, align 8
  %226 = extractvalue { ptr, i32 } %224, 1
  store i32 %226, ptr %7, align 4
  br label %228

227:                                              ; preds = %206, %188, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %229

228:                                              ; preds = %223, %215
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %256

229:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  store i64 0, ptr %32, align 8, !tbaa !5
  br label %230

230:                                              ; preds = %241, %229
  %231 = load i64, ptr %32, align 8, !tbaa !5
  %232 = load i64, ptr %2, align 8, !tbaa !5
  %233 = icmp slt i64 %231, %232
  br i1 %233, label %235, label %234

234:                                              ; preds = %230
  store i32 17, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %248

235:                                              ; preds = %230
  %236 = load i64, ptr %32, align 8, !tbaa !5
  %237 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %236) #5
  %238 = load i64, ptr %237, align 8, !tbaa !5
  %239 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %238)
          to label %240 unwind label %244

240:                                              ; preds = %235
  br label %241

241:                                              ; preds = %240
  %242 = load i64, ptr %32, align 8, !tbaa !5
  %243 = add nsw i64 %242, 1
  store i64 %243, ptr %32, align 8, !tbaa !5
  br label %230, !llvm.loop !18

244:                                              ; preds = %235
  %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
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %256

248:                                              ; preds = %234
  %249 = invoke i32 @puts(ptr noundef @.str.3)
          to label %250 unwind label %252

250:                                              ; preds = %248
  store i32 0, ptr %1, align 4
  store i32 1, ptr %16, align 4
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %19) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %251 = load i32, ptr %1, align 4
  ret i32 %251

252:                                              ; preds = %248
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %6, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %7, align 4
  br label %256

256:                                              ; preds = %252, %244, %228, %165, %145
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %19) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %19) #5
  br label %257

257:                                              ; preds = %256, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %258

258:                                              ; preds = %257, %66
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %8) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %8) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  br label %259

259:                                              ; preds = %258, %41
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %260

260:                                              ; preds = %259
  %261 = load ptr, ptr %6, align 8
  %262 = load i32, ptr %7, align 4
  %263 = insertvalue { ptr, i32 } poison, ptr %261, 0
  %264 = insertvalue { ptr, i32 } %263, i32 %262, 1
  resume { ptr, i32 } %264
}

; 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 @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), 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 @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE4findERS3_(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 ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(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 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 @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5eraseERS3_(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 nounwind uwtable
declare dso_local ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 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 ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKllEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setIlSt4lessIlESaIlEE5eraseERKl(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 noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

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

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

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

declare i32 @puts(ptr noundef) #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 void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(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 = { 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 8}
!13 = !{!"_ZTSSt4pairIKllE", !6, i64 0, !6, i64 8}
!14 = !{!13, !6, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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, long>, std::_Select1st<std::pair<const long, long>>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, std::pair<const long, long>, std::_Select1st<std::pair<const long, 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.3" = type { i64, i64 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.std::set" = type { %"class.std::_Rb_tree.5" }
%"class.std::_Rb_tree.5" = 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::_Rb_tree_const_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [1 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 %"class.std::vector", align 8
  %3 = alloca i64, 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 %"struct.std::pair.3", align 8
  %9 = alloca i64, align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %12 = alloca %"class.std::set", align 8
  %13 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  %21 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %21, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %22 unwind label %26

22:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  %23 = load i64, ptr %1, align 8, !tbaa !5
  %24 = icmp sgt i64 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %._crit_edge47

._crit_edge:                                      ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  %25 = icmp sgt i64 %32, 1
  br i1 %25, label %.lr.ph46, label %._crit_edge47

26:                                               ; preds = %0
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %141

.lr.ph:                                           ; preds = %22, %30
  %.02943 = phi i64 [ %31, %30 ], [ 0, %22 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6, ptr noundef nonnull %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  call void @_ZNSt4pairIllEC2IRlS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %29 = invoke { ptr, i8 } @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE6insertIS2_IllEEENSt9enable_ifIXsr16is_constructibleIS4_T_EE5valueES2_ISt17_Rb_tree_iteratorIS4_EbEE4typeEOSA_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %30 unwind label %34

30:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %31 = add nuw nsw i64 %.02943, 1
  %32 = load i64, ptr %1, align 8, !tbaa !5
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !9

34:                                               ; preds = %.lr.ph
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %140

.lr.ph46:                                         ; preds = %._crit_edge, %48
  %.03044 = phi i64 [ %51, %48 ], [ 1, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %36 = invoke ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %37 unwind label %40

37:                                               ; preds = %.lr.ph46
  store ptr %36, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %38 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %38, ptr %11, align 8
  %39 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br i1 %39, label %._crit_edge47, label %42

40:                                               ; preds = %.lr.ph46
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %139

42:                                               ; preds = %37
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %44 unwind label %54

44:                                               ; preds = %42
  %45 = load i64, ptr %43, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03044) #5
  store i64 %45, ptr %46, align 8, !tbaa !5
  %47 = invoke noundef i64 @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5eraseERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %48 unwind label %54

48:                                               ; preds = %44
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03044) #5
  %50 = load i64, ptr %49, align 8, !tbaa !5
  store i64 %50, ptr %9, align 8, !tbaa !5
  %51 = add nuw nsw i64 %.03044, 2
  %52 = load i64, ptr %1, align 8, !tbaa !5
  %53 = icmp slt i64 %51, %52
  br i1 %53, label %.lr.ph46, label %._crit_edge47, !llvm.loop !11

54:                                               ; preds = %44, %42
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %139

._crit_edge47:                                    ; preds = %48, %37, %._crit_edge.thread, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %12) #5
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %56 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %56, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %57 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %57, ptr %14, align 8
  %58 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br i1 %58, label %.lr.ph50, label %._crit_edge51

._crit_edge51:                                    ; preds = %78, %._crit_edge47
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %59 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %59, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #5
  %60 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %60, ptr %16, align 8
  %61 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  br i1 %61, label %.lr.ph53, label %._crit_edge54

.lr.ph50:                                         ; preds = %._crit_edge47, %78
  %62 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  %64 = load i64, ptr %63, align 8, !tbaa !12
  %65 = icmp eq i64 %64, 0
  %66 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br i1 %65, label %67, label %72

67:                                               ; preds = %.lr.ph50
  %68 = load i64, ptr %66, align 8, !tbaa !14
  %69 = load i64, ptr %1, align 8, !tbaa !5
  %70 = add nsw i64 %69, -2
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %70) #5
  store i64 %68, ptr %71, align 8, !tbaa !5
  br label %78

72:                                               ; preds = %.lr.ph50
  %73 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %66)
          to label %74 unwind label %82

74:                                               ; preds = %72
  %75 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %77 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %76)
          to label %78 unwind label %82

78:                                               ; preds = %74, %67
  %79 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKllEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %13, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %80 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %80, ptr %14, align 8
  %81 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br i1 %81, label %.lr.ph50, label %._crit_edge51, !llvm.loop !15

82:                                               ; preds = %74, %72
  %83 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  br label %138

._crit_edge54:                                    ; preds = %88, %._crit_edge51
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  %84 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  %.not = icmp eq i64 %84, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  br i1 %.not, label %98, label %94

.lr.ph53:                                         ; preds = %._crit_edge51, %88
  %85 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  %86 = getelementptr inbounds i8, ptr %85, i64 8
  %87 = invoke noundef i64 @_ZNSt3setIlSt4lessIlESaIlEE5eraseERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %86)
          to label %88 unwind label %92

88:                                               ; preds = %.lr.ph53
  %89 = call ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKllEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #5
  %90 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %90, ptr %16, align 8
  %91 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  br i1 %91, label %.lr.ph53, label %._crit_edge54, !llvm.loop !16

92:                                               ; preds = %.lr.ph53
  %93 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %138

94:                                               ; preds = %._crit_edge54
  %95 = call ptr @_ZNKSt3setIlSt4lessIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  store ptr %95, ptr %17, align 8
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIlEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %97 = load i64, ptr %96, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %._crit_edge54, %94
  %99 = phi i64 [ %97, %94 ], [ -1, %._crit_edge54 ]
  store i64 %99, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  %100 = load i64, ptr %1, align 8, !tbaa !5
  %101 = icmp sgt i64 %100, 0
  br i1 %101, label %.lr.ph57, label %._crit_edge63

.lr.ph57:                                         ; preds = %98, %122
  %102 = phi i64 [ %123, %122 ], [ %99, %98 ]
  %.02055 = phi i64 [ %124, %122 ], [ 0, %98 ]
  %103 = icmp slt i64 %102, 0
  br i1 %103, label %.loopexitthread-pre-split, label %104

104:                                              ; preds = %.lr.ph57
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.02055) #5
  store i64 %102, ptr %105, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #5
  %106 = invoke ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE4findERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %107 unwind label %115

107:                                              ; preds = %104
  store ptr %106, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #5
  %108 = call ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  store ptr %108, ptr %19, align 8
  %109 = call noundef zeroext i1 @_ZSteqRKSt17_Rb_tree_iteratorISt4pairIKllEES5_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  br i1 %109, label %.critedge, label %110

110:                                              ; preds = %107
  %111 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %112 unwind label %117

112:                                              ; preds = %110
  %113 = load i64, ptr %111, align 8, !tbaa !5
  %114 = icmp eq i64 %113, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  br i1 %114, label %.loopexitthread-pre-split, label %120

.critedge:                                        ; preds = %107
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  br label %.loopexitthread-pre-split

115:                                              ; preds = %104
  %116 = landingpad { ptr, i32 }
          cleanup
  br label %119

117:                                              ; preds = %110
  %118 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  br label %119

119:                                              ; preds = %117, %115
  %.pn33 = phi { ptr, i32 } [ %118, %117 ], [ %116, %115 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #5
  br label %138

120:                                              ; preds = %112
  %121 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %122 unwind label %127

122:                                              ; preds = %120
  %123 = load i64, ptr %121, align 8, !tbaa !5
  store i64 %123, ptr %9, align 8, !tbaa !5
  %124 = add nuw nsw i64 %.02055, 2
  %125 = load i64, ptr %1, align 8, !tbaa !5
  %126 = icmp slt i64 %124, %125
  br i1 %126, label %.lr.ph57, label %.loopexit, !llvm.loop !17

127:                                              ; preds = %120
  %128 = landingpad { ptr, i32 }
          cleanup
  br label %138

.loopexitthread-pre-split:                        ; preds = %112, %.lr.ph57, %.critedge
  %.pr = load i64, ptr %1, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %122, %.loopexitthread-pre-split
  %129 = phi i64 [ %.pr, %.loopexitthread-pre-split ], [ %125, %122 ]
  %130 = icmp sgt i64 %129, 0
  br i1 %130, label %.lr.ph62, label %._crit_edge63

._crit_edge63:                                    ; preds = %.lr.ph62, %98, %.loopexit
  %131 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0

.lr.ph62:                                         ; preds = %.loopexit, %.lr.ph62
  %.060 = phi i64 [ %135, %.lr.ph62 ], [ 0, %.loopexit ]
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.060) #5
  %133 = load i64, ptr %132, align 8, !tbaa !5
  %134 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %133)
  %135 = add nuw nsw i64 %.060, 1
  %136 = load i64, ptr %1, align 8, !tbaa !5
  %137 = icmp slt i64 %135, %136
  br i1 %137, label %.lr.ph62, label %._crit_edge63, !llvm.loop !18

138:                                              ; preds = %119, %127, %92, %82
  %.pn37 = phi { ptr, i32 } [ %83, %82 ], [ %93, %92 ], [ %128, %127 ], [ %.pn33, %119 ]
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #5
  br label %139

139:                                              ; preds = %40, %54, %138
  %.pn37.pn = phi { ptr, i32 } [ %.pn37, %138 ], [ %55, %54 ], [ %41, %40 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %140

140:                                              ; preds = %139, %34
  %.pn40 = phi { ptr, i32 } [ %35, %34 ], [ %.pn37.pn, %139 ]
  call void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #5
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  br label %141

141:                                              ; preds = %140, %26
  %.pn40.pn = phi { ptr, i32 } [ %.pn40, %140 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn40.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 @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), 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 @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE4findERS3_(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 ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEEixERS3_(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 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 @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5eraseERS3_(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 nounwind uwtable
declare dso_local ptr @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEE5beginEv(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_iteratorISt4pairIKllEES5_(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 noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKllEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 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 ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKllEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setIlSt4lessIlESaIlEE5eraseERKl(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 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 @_ZNKSt3setIlSt4lessIlESaIlEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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 void @_ZNSt3mapIllSt4lessIlESaISt4pairIKllEEED2Ev(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 = { 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 8}
!13 = !{!"_ZTSSt4pairIKllE", !6, i64 0, !6, i64 8}
!14 = !{!13, !6, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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