; LLVM IR from DionysiosB/CodeForces :: 0300-0399 (353B-TwoHeaps)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.obj = type { i64, i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<obj, std::allocator<obj>>::_Vector_impl" }
%"struct.std::_Vector_base<obj, std::allocator<obj>>::_Vector_impl" = type { %"struct.std::_Vector_base<obj, std::allocator<obj>>::_Vector_impl_data" }
%"struct.std::_Vector_base<obj, std::allocator<obj>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = 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_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 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7compVal3objS_(ptr noundef byval(%struct.obj) align 8, ptr noundef byval(%struct.obj) align 8) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7compPos3objS_(ptr noundef byval(%struct.obj) align 8, ptr noundef byval(%struct.obj) align 8) #0

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

30:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI3objED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %55, %30
  %32 = load i64, ptr %7, align 8, !tbaa !5
  %33 = load i64, ptr %2, align 8, !tbaa !5
  %34 = mul nsw i64 2, %33
  %35 = icmp slt i64 %32, %34
  br i1 %35, label %41, label %36

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

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

41:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %42 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %8)
          to label %43 unwind label %58

43:                                               ; preds = %41
  %44 = load i64, ptr %7, align 8, !tbaa !5
  %45 = load i64, ptr %7, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %45) #6
  %47 = getelementptr inbounds %struct.obj, ptr %46, i32 0, i32 0
  store i64 %44, ptr %47, align 8, !tbaa !9
  %48 = load i64, ptr %8, align 8, !tbaa !5
  %49 = load i64, ptr %7, align 8, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %49) #6
  %51 = getelementptr inbounds %struct.obj, ptr %50, i32 0, i32 1
  store i64 %48, ptr %51, align 8, !tbaa !11
  %52 = load i64, ptr %7, align 8, !tbaa !5
  %53 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %52) #6
  %54 = getelementptr inbounds %struct.obj, ptr %53, i32 0, i32 2
  store i64 -1, ptr %54, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %55

55:                                               ; preds = %43
  %56 = load i64, ptr %7, align 8, !tbaa !5
  %57 = add nsw i64 %56, 1
  store i64 %57, ptr %7, align 8, !tbaa !5
  br label %31, !llvm.loop !13

58:                                               ; preds = %41
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %5, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %252

62:                                               ; preds = %36
  %63 = call ptr @_ZNSt6vectorI3objSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %64 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %63, ptr %64, align 8
  %65 = call ptr @_ZNSt6vectorI3objSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %66 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %65, ptr %66, align 8
  %67 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8
  %69 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP3objSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr %68, ptr %70, ptr noundef @_Z7compVal3objS_)
          to label %71 unwind label %78

71:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store i64 0, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %171, %71
  %73 = load i64, ptr %16, align 8, !tbaa !5
  %74 = load i64, ptr %2, align 8, !tbaa !5
  %75 = mul nsw i64 2, %74
  %76 = icmp slt i64 %73, %75
  br i1 %76, label %82, label %77

77:                                               ; preds = %72
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %174

78:                                               ; preds = %62
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %5, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %6, align 4
  br label %252

82:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %83 = load i64, ptr %16, align 8, !tbaa !5
  %84 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %83) #6
  %85 = getelementptr inbounds %struct.obj, ptr %84, i32 0, i32 1
  %86 = load i64, ptr %85, align 8, !tbaa !11
  store i64 %86, ptr %18, align 8, !tbaa !5
  %87 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %88 unwind label %95

88:                                               ; preds = %82
  %89 = icmp ne i64 %87, 0
  br i1 %89, label %90, label %99

90:                                               ; preds = %88
  %91 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %92 unwind label %95

92:                                               ; preds = %90
  %93 = icmp ne i64 %91, 0
  br i1 %93, label %94, label %99

94:                                               ; preds = %92
  store i32 7, ptr %17, align 4
  br label %168

95:                                               ; preds = %151, %135, %119, %115, %103, %99, %90, %82
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %5, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %251

99:                                               ; preds = %92, %88
  %100 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %101 unwind label %95

101:                                              ; preds = %99
  %102 = icmp ne i64 %100, 0
  br i1 %102, label %103, label %115

103:                                              ; preds = %101
  %104 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %105 unwind label %95

105:                                              ; preds = %103
  %106 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 0
  %107 = extractvalue { ptr, i8 } %104, 0
  store ptr %107, ptr %106, align 8
  %108 = getelementptr inbounds { ptr, i8 }, ptr %19, i32 0, i32 1
  %109 = extractvalue { ptr, i8 } %104, 1
  store i8 %109, ptr %108, align 8
  %110 = load i64, ptr %16, align 8, !tbaa !5
  %111 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %110) #6
  %112 = getelementptr inbounds %struct.obj, ptr %111, i32 0, i32 2
  store i64 2, ptr %112, align 8, !tbaa !12
  %113 = load i64, ptr %15, align 8, !tbaa !5
  %114 = add nsw i64 %113, 1
  store i64 %114, ptr %15, align 8, !tbaa !5
  br label %166

115:                                              ; preds = %101
  %116 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %117 unwind label %95

117:                                              ; preds = %115
  %118 = icmp ne i64 %116, 0
  br i1 %118, label %119, label %131

119:                                              ; preds = %117
  %120 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %121 unwind label %95

121:                                              ; preds = %119
  %122 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 0
  %123 = extractvalue { ptr, i8 } %120, 0
  store ptr %123, ptr %122, align 8
  %124 = getelementptr inbounds { ptr, i8 }, ptr %20, i32 0, i32 1
  %125 = extractvalue { ptr, i8 } %120, 1
  store i8 %125, ptr %124, align 8
  %126 = load i64, ptr %16, align 8, !tbaa !5
  %127 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %126) #6
  %128 = getelementptr inbounds %struct.obj, ptr %127, i32 0, i32 2
  store i64 1, ptr %128, align 8, !tbaa !12
  %129 = load i64, ptr %14, align 8, !tbaa !5
  %130 = add nsw i64 %129, 1
  store i64 %130, ptr %14, align 8, !tbaa !5
  br label %165

131:                                              ; preds = %117
  %132 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #6
  %133 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  %134 = icmp ugt i64 %132, %133
  br i1 %134, label %135, label %147

135:                                              ; preds = %131
  %136 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %137 unwind label %95

137:                                              ; preds = %135
  %138 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 0
  %139 = extractvalue { ptr, i8 } %136, 0
  store ptr %139, ptr %138, align 8
  %140 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 1
  %141 = extractvalue { ptr, i8 } %136, 1
  store i8 %141, ptr %140, align 8
  %142 = load i64, ptr %16, align 8, !tbaa !5
  %143 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %142) #6
  %144 = getelementptr inbounds %struct.obj, ptr %143, i32 0, i32 2
  store i64 2, ptr %144, align 8, !tbaa !12
  %145 = load i64, ptr %15, align 8, !tbaa !5
  %146 = add nsw i64 %145, 1
  store i64 %146, ptr %15, align 8, !tbaa !5
  br label %164

147:                                              ; preds = %131
  %148 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  %149 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #6
  %150 = icmp uge i64 %148, %149
  br i1 %150, label %151, label %163

151:                                              ; preds = %147
  %152 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %153 unwind label %95

153:                                              ; preds = %151
  %154 = getelementptr inbounds { ptr, i8 }, ptr %22, i32 0, i32 0
  %155 = extractvalue { ptr, i8 } %152, 0
  store ptr %155, ptr %154, align 8
  %156 = getelementptr inbounds { ptr, i8 }, ptr %22, i32 0, i32 1
  %157 = extractvalue { ptr, i8 } %152, 1
  store i8 %157, ptr %156, align 8
  %158 = load i64, ptr %16, align 8, !tbaa !5
  %159 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %158) #6
  %160 = getelementptr inbounds %struct.obj, ptr %159, i32 0, i32 2
  store i64 1, ptr %160, align 8, !tbaa !12
  %161 = load i64, ptr %14, align 8, !tbaa !5
  %162 = add nsw i64 %161, 1
  store i64 %162, ptr %14, align 8, !tbaa !5
  br label %163

163:                                              ; preds = %153, %147
  br label %164

164:                                              ; preds = %163, %137
  br label %165

165:                                              ; preds = %164, %121
  br label %166

166:                                              ; preds = %165, %105
  br label %167

167:                                              ; preds = %166
  store i32 0, ptr %17, align 4
  br label %168

168:                                              ; preds = %167, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %169 = load i32, ptr %17, align 4
  switch i32 %169, label %259 [
    i32 0, label %170
    i32 7, label %171
  ]

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170, %168
  %172 = load i64, ptr %16, align 8, !tbaa !5
  %173 = add nsw i64 %172, 1
  store i64 %173, ptr %16, align 8, !tbaa !5
  br label %72, !llvm.loop !15

174:                                              ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i64 0, ptr %23, align 8, !tbaa !5
  br label %175

175:                                              ; preds = %205, %174
  %176 = load i64, ptr %23, align 8, !tbaa !5
  %177 = load i64, ptr %2, align 8, !tbaa !5
  %178 = mul nsw i64 2, %177
  %179 = icmp slt i64 %176, %178
  br i1 %179, label %181, label %180

180:                                              ; preds = %175
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %208

181:                                              ; preds = %175
  %182 = load i64, ptr %23, align 8, !tbaa !5
  %183 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %182) #6
  %184 = getelementptr inbounds %struct.obj, ptr %183, i32 0, i32 2
  %185 = load i64, ptr %184, align 8, !tbaa !12
  %186 = icmp sgt i64 %185, 0
  br i1 %186, label %187, label %188

187:                                              ; preds = %181
  br label %205

188:                                              ; preds = %181
  %189 = load i64, ptr %14, align 8, !tbaa !5
  %190 = load i64, ptr %2, align 8, !tbaa !5
  %191 = icmp slt i64 %189, %190
  br i1 %191, label %192, label %198

192:                                              ; preds = %188
  %193 = load i64, ptr %23, align 8, !tbaa !5
  %194 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %193) #6
  %195 = getelementptr inbounds %struct.obj, ptr %194, i32 0, i32 2
  store i64 1, ptr %195, align 8, !tbaa !12
  %196 = load i64, ptr %14, align 8, !tbaa !5
  %197 = add nsw i64 %196, 1
  store i64 %197, ptr %14, align 8, !tbaa !5
  br label %204

198:                                              ; preds = %188
  %199 = load i64, ptr %23, align 8, !tbaa !5
  %200 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %199) #6
  %201 = getelementptr inbounds %struct.obj, ptr %200, i32 0, i32 2
  store i64 2, ptr %201, align 8, !tbaa !12
  %202 = load i64, ptr %15, align 8, !tbaa !5
  %203 = add nsw i64 %202, 1
  store i64 %203, ptr %15, align 8, !tbaa !5
  br label %204

204:                                              ; preds = %198, %192
  br label %205

205:                                              ; preds = %204, %187
  %206 = load i64, ptr %23, align 8, !tbaa !5
  %207 = add nsw i64 %206, 1
  store i64 %207, ptr %23, align 8, !tbaa !5
  br label %175, !llvm.loop !16

208:                                              ; preds = %180
  %209 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #6
  %210 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  %211 = mul i64 %209, %210
  %212 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %211)
          to label %213 unwind label %229

213:                                              ; preds = %208
  %214 = call ptr @_ZNSt6vectorI3objSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %215 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  store ptr %214, ptr %215, align 8
  %216 = call ptr @_ZNSt6vectorI3objSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %217 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %216, ptr %217, align 8
  %218 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  %219 = load ptr, ptr %218, align 8
  %220 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  %221 = load ptr, ptr %220, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP3objSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr %219, ptr %221, ptr noundef @_Z7compPos3objS_)
          to label %222 unwind label %229

222:                                              ; preds = %213
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store i64 0, ptr %26, align 8, !tbaa !5
  br label %223

223:                                              ; preds = %240, %222
  %224 = load i64, ptr %26, align 8, !tbaa !5
  %225 = load i64, ptr %2, align 8, !tbaa !5
  %226 = mul nsw i64 2, %225
  %227 = icmp slt i64 %224, %226
  br i1 %227, label %233, label %228

228:                                              ; preds = %223
  store i32 11, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %247

229:                                              ; preds = %247, %213, %208
  %230 = landingpad { ptr, i32 }
          cleanup
  %231 = extractvalue { ptr, i32 } %230, 0
  store ptr %231, ptr %5, align 8
  %232 = extractvalue { ptr, i32 } %230, 1
  store i32 %232, ptr %6, align 4
  br label %251

233:                                              ; preds = %223
  %234 = load i64, ptr %26, align 8, !tbaa !5
  %235 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %234) #6
  %236 = getelementptr inbounds %struct.obj, ptr %235, i32 0, i32 2
  %237 = load i64, ptr %236, align 8, !tbaa !12
  %238 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %237)
          to label %239 unwind label %243

239:                                              ; preds = %233
  br label %240

240:                                              ; preds = %239
  %241 = load i64, ptr %26, align 8, !tbaa !5
  %242 = add nsw i64 %241, 1
  store i64 %242, ptr %26, align 8, !tbaa !5
  br label %223, !llvm.loop !17

243:                                              ; preds = %233
  %244 = landingpad { ptr, i32 }
          cleanup
  %245 = extractvalue { ptr, i32 } %244, 0
  store ptr %245, ptr %5, align 8
  %246 = extractvalue { ptr, i32 } %244, 1
  store i32 %246, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  br label %251

247:                                              ; preds = %228
  %248 = invoke i32 @puts(ptr noundef @.str.3)
          to label %249 unwind label %229

249:                                              ; preds = %247
  store i32 0, ptr %1, align 4
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #6
  call void @_ZNSt6vectorI3objSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %250 = load i32, ptr %1, align 4
  ret i32 %250

251:                                              ; preds = %243, %229, %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %13) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #6
  br label %252

252:                                              ; preds = %251, %78, %58
  call void @_ZNSt6vectorI3objSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %253

253:                                              ; preds = %252, %37
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %254

254:                                              ; preds = %253
  %255 = load ptr, ptr %5, align 8
  %256 = load i32, ptr %6, align 4
  %257 = insertvalue { ptr, i32 } poison, ptr %255, 0
  %258 = insertvalue { ptr, i32 } %257, i32 %256, 1
  resume { ptr, i32 } %258

259:                                              ; preds = %168
  unreachable
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI3objSaIS0_EEC2EmRKS1_(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) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP3objSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr, ptr, ptr noundef) #5

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

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

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

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

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

declare i32 @puts(ptr noundef) #3

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

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

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

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


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

%struct.obj = type { i64, i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<obj, std::allocator<obj>>::_Vector_impl" }
%"struct.std::_Vector_base<obj, std::allocator<obj>>::_Vector_impl" = type { %"struct.std::_Vector_base<obj, std::allocator<obj>>::_Vector_impl_data" }
%"struct.std::_Vector_base<obj, std::allocator<obj>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = 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_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7compVal3objS_(ptr noundef byval(%struct.obj) align 8, ptr noundef byval(%struct.obj) align 8) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7compPos3objS_(ptr noundef byval(%struct.obj) align 8, ptr noundef byval(%struct.obj) align 8) #0

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

12:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI3objED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  %13 = load i64, ptr %1, align 8, !tbaa !5
  %14 = icmp sgt i64 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %12
  %15 = call ptr @_ZNSt6vectorI3objSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %16 = call ptr @_ZNSt6vectorI3objSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP3objSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr %15, ptr %16, ptr noundef nonnull @_Z7compVal3objS_)
          to label %30 unwind label %34

17:                                               ; preds = %0
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI3objED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  br label %124

.lr.ph:                                           ; preds = %12, %.lr.ph
  %.04565 = phi i64 [ %26, %.lr.ph ], [ 0, %12 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %4)
  %20 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04565) #6
  store i64 %.04565, ptr %20, align 8, !tbaa !9
  %21 = load i64, ptr %4, align 8, !tbaa !5
  %22 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04565) #6
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  store i64 %21, ptr %23, align 8, !tbaa !11
  %24 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04565) #6
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  store i64 -1, ptr %25, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %26 = add nuw nsw i64 %.04565, 1
  %27 = load i64, ptr %1, align 8, !tbaa !5
  %28 = shl nsw i64 %27, 1
  %29 = icmp slt i64 %26, %28
  br i1 %29, label %.lr.ph, label %._crit_edge, !llvm.loop !13

30:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #6
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  %31 = load i64, ptr %1, align 8, !tbaa !5
  %32 = icmp sgt i64 %31, 0
  br i1 %32, label %.lr.ph70, label %._crit_edge76

.preheader62:                                     ; preds = %81
  %33 = icmp sgt i64 %83, 0
  br i1 %33, label %.lr.ph75, label %._crit_edge76

34:                                               ; preds = %._crit_edge
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %123

.lr.ph70:                                         ; preds = %30, %81
  %.04668 = phi i64 [ %.248, %81 ], [ 0, %30 ]
  %.05466 = phi i64 [ %82, %81 ], [ 0, %30 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05466) #6
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = load i64, ptr %37, align 8, !tbaa !11
  store i64 %38, ptr %8, align 8, !tbaa !5
  %39 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %40 unwind label %44

40:                                               ; preds = %.lr.ph70
  %.not = icmp eq i64 %39, 0
  br i1 %.not, label %46, label %41

41:                                               ; preds = %40
  %42 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %43 unwind label %44

43:                                               ; preds = %41
  %.not55 = icmp eq i64 %42, 0
  br i1 %.not55, label %46, label %81

44:                                               ; preds = %75, %67, %57, %54, %49, %46, %41, %.lr.ph70
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %122

46:                                               ; preds = %43, %40
  %47 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %48 unwind label %44

48:                                               ; preds = %46
  %.not56 = icmp eq i64 %47, 0
  br i1 %.not56, label %54, label %49

49:                                               ; preds = %48
  %50 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %51 unwind label %44

51:                                               ; preds = %49
  %52 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05466) #6
  %53 = getelementptr inbounds i8, ptr %52, i64 16
  store i64 2, ptr %53, align 8, !tbaa !12
  br label %81

54:                                               ; preds = %48
  %55 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %56 unwind label %44

56:                                               ; preds = %54
  %.not57 = icmp eq i64 %55, 0
  br i1 %.not57, label %63, label %57

57:                                               ; preds = %56
  %58 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %59 unwind label %44

59:                                               ; preds = %57
  %60 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05466) #6
  %61 = getelementptr inbounds i8, ptr %60, i64 16
  store i64 1, ptr %61, align 8, !tbaa !12
  %62 = add nsw i64 %.04668, 1
  br label %81

63:                                               ; preds = %56
  %64 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #6
  %65 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  %66 = icmp ugt i64 %64, %65
  br i1 %66, label %67, label %72

67:                                               ; preds = %63
  %68 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %69 unwind label %44

69:                                               ; preds = %67
  %70 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05466) #6
  %71 = getelementptr inbounds i8, ptr %70, i64 16
  store i64 2, ptr %71, align 8, !tbaa !12
  br label %81

72:                                               ; preds = %63
  %73 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  %74 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #6
  %.not58 = icmp ult i64 %73, %74
  br i1 %.not58, label %81, label %75

75:                                               ; preds = %72
  %76 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %77 unwind label %44

77:                                               ; preds = %75
  %78 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.05466) #6
  %79 = getelementptr inbounds i8, ptr %78, i64 16
  store i64 1, ptr %79, align 8, !tbaa !12
  %80 = add nsw i64 %.04668, 1
  br label %81

81:                                               ; preds = %59, %72, %77, %69, %51, %43
  %.248 = phi i64 [ %.04668, %43 ], [ %.04668, %51 ], [ %62, %59 ], [ %.04668, %69 ], [ %80, %77 ], [ %.04668, %72 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  %82 = add nuw nsw i64 %.05466, 1
  %83 = load i64, ptr %1, align 8, !tbaa !5
  %84 = shl nsw i64 %83, 1
  %85 = icmp slt i64 %82, %84
  br i1 %85, label %.lr.ph70, label %.preheader62, !llvm.loop !15

._crit_edge76:                                    ; preds = %106, %30, %.preheader62
  %86 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %6) #6
  %87 = call noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  %88 = mul i64 %87, %86
  %89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %88)
  %90 = call ptr @_ZNSt6vectorI3objSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %91 = call ptr @_ZNSt6vectorI3objSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP3objSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr %90, ptr %91, ptr noundef nonnull @_Z7compPos3objS_)
          to label %.preheader unwind label %112

.preheader:                                       ; preds = %._crit_edge76
  %92 = load i64, ptr %1, align 8, !tbaa !5
  %93 = icmp sgt i64 %92, 0
  br i1 %93, label %.lr.ph78, label %._crit_edge79

.lr.ph75:                                         ; preds = %.preheader62, %106
  %.04174 = phi i64 [ %107, %106 ], [ 0, %.preheader62 ]
  %.373 = phi i64 [ %.4, %106 ], [ %.248, %.preheader62 ]
  %94 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04174) #6
  %95 = getelementptr inbounds i8, ptr %94, i64 16
  %96 = load i64, ptr %95, align 8, !tbaa !12
  %97 = icmp sgt i64 %96, 0
  br i1 %97, label %106, label %98

98:                                               ; preds = %.lr.ph75
  %99 = load i64, ptr %1, align 8, !tbaa !5
  %100 = icmp slt i64 %.373, %99
  %101 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.04174) #6
  %102 = getelementptr inbounds i8, ptr %101, i64 16
  br i1 %100, label %103, label %105

103:                                              ; preds = %98
  store i64 1, ptr %102, align 8, !tbaa !12
  %104 = add nsw i64 %.373, 1
  br label %106

105:                                              ; preds = %98
  store i64 2, ptr %102, align 8, !tbaa !12
  br label %106

106:                                              ; preds = %103, %105, %.lr.ph75
  %.4 = phi i64 [ %.373, %.lr.ph75 ], [ %104, %103 ], [ %.373, %105 ]
  %107 = add nuw nsw i64 %.04174, 1
  %108 = load i64, ptr %1, align 8, !tbaa !5
  %109 = shl nsw i64 %108, 1
  %110 = icmp slt i64 %107, %109
  br i1 %110, label %.lr.ph75, label %._crit_edge76, !llvm.loop !16

._crit_edge79:                                    ; preds = %.lr.ph78, %.preheader
  %111 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  call void @_ZNSt6vectorI3objSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

112:                                              ; preds = %._crit_edge76
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %122

.lr.ph78:                                         ; preds = %.preheader, %.lr.ph78
  %.077 = phi i64 [ %118, %.lr.ph78 ], [ 0, %.preheader ]
  %114 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI3objSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.077) #6
  %115 = getelementptr inbounds i8, ptr %114, i64 16
  %116 = load i64, ptr %115, align 8, !tbaa !12
  %117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %116)
  %118 = add nuw nsw i64 %.077, 1
  %119 = load i64, ptr %1, align 8, !tbaa !5
  %120 = shl nsw i64 %119, 1
  %121 = icmp slt i64 %118, %120
  br i1 %121, label %.lr.ph78, label %._crit_edge79, !llvm.loop !17

122:                                              ; preds = %112, %44
  %.pn = phi { ptr, i32 } [ %45, %44 ], [ %113, %112 ]
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %6) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  br label %123

123:                                              ; preds = %122, %34
  %.pn.pn = phi { ptr, i32 } [ %.pn, %122 ], [ %35, %34 ]
  call void @_ZNSt6vectorI3objSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %124

124:                                              ; preds = %123, %17
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %123 ], [ %18, %17 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI3objSaIS0_EEC2EmRKS1_(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) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP3objSt6vectorIS2_SaIS2_EEEEPFbS2_S2_EEvT_SA_T0_(ptr, ptr, ptr noundef) local_unnamed_addr #5

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

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

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

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

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

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


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