; LLVM IR from VastoLorde95/Competitive-Programming :: HackerEarth/Upgrade/A.ll (Z7reverseiii)

; 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.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.7" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.8" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::vector.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = type { %"struct.std::_Vector_base<Treap::node *, std::allocator<Treap::node *>>::_Vector_impl" }
%"struct.std::_Vector_base<Treap::node *, std::allocator<Treap::node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Treap::node *, std::allocator<Treap::node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Treap::node *, std::allocator<Treap::node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.std::allocator.11" = type { i8 }
%"struct.std::pair" = type { ptr, ptr }
%"struct.std::pair.5" = type { i32, i32 }
%"struct.Treap::node" = type { i32, i32, i32, i32, i32, ptr, ptr }

@pos = external dso_local global [131072 x i32], align 16
@treap = external dso_local global ptr, align 8

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef, i32 noundef) #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef, ptr noundef) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5go_upiib(ptr dead_on_unwind noalias writable sret(%"class.std::vector.0") align 8, i32 noundef, i32 noundef, i1 noundef zeroext) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7reverseiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::vector.0", align 8
  %8 = alloca %"class.std::vector.0", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %15 = alloca %"class.std::vector.0", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.8", align 8
  %17 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %18 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator.8", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %26 = alloca i32, align 4
  %27 = alloca %"class.std::vector", align 8
  %28 = alloca i32, align 4
  %29 = alloca %"class.std::allocator", align 1
  %30 = alloca %"class.std::vector.9", align 8
  %31 = alloca %"class.std::initializer_list", align 8
  %32 = alloca [1 x ptr], align 8
  %33 = alloca %"class.std::allocator.11", align 1
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca ptr, align 8
  %38 = alloca %"struct.std::pair", align 8
  %39 = alloca %"struct.std::pair", align 8
  %40 = alloca ptr, align 8
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca i32, align 4
  %44 = alloca i32, align 4
  %45 = alloca i32, align 4
  %46 = alloca i32, align 4
  %47 = alloca %"struct.std::pair", align 8
  %48 = alloca ptr, align 8
  %49 = alloca ptr, align 8
  %50 = alloca i32, align 4
  %51 = alloca i32, align 4
  %52 = alloca i32, align 4
  %53 = alloca i32, align 4
  %54 = alloca %"struct.std::pair", align 8
  %55 = alloca ptr, align 8
  %56 = alloca ptr, align 8
  %57 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [131072 x i32], ptr @pos, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [131072 x i32], ptr @pos, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp sgt i32 %61, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %3
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #5
  br label %68

68:                                               ; preds = %67, %3
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z5go_upiib(ptr dead_on_unwind writable sret(%"class.std::vector.0") align 8 %7, i32 noundef %69, i32 noundef %70, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = load i32, ptr %6, align 4, !tbaa !5
  invoke void @_Z5go_upiib(ptr dead_on_unwind writable sret(%"class.std::vector.0") align 8 %8, i32 noundef %71, i32 noundef %72, i1 noundef zeroext false)
          to label %73 unwind label %141

73:                                               ; preds = %68
  %74 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %75 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %11, i32 0, i32 0
  store ptr %74, ptr %75, align 8
  %76 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %77 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %12, i32 0, i32 0
  store ptr %76, ptr %77, align 8
  %78 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %11, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %12, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %79, ptr %81)
          to label %82 unwind label %145

82:                                               ; preds = %73
  %83 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  %84 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %13, i32 0, i32 0
  store ptr %83, ptr %84, align 8
  %85 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  %86 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %14, i32 0, i32 0
  store ptr %85, ptr %86, align 8
  %87 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %13, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8
  %89 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %14, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %88, ptr %90)
          to label %91 unwind label %145

91:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %92 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %93 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %17, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKSt4pairIiiESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #5
  %94 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %95 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %18, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  %96 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %97 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %19, i32 0, i32 0
  store ptr %96, ptr %97, align 8
  %98 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.8", ptr %16, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8
  %100 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %18, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8
  %102 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %19, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8
  %104 = invoke ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE6insertIN9__gnu_cxx17__normal_iteratorIPS1_S3_EEvEES8_NS6_IPKS1_S3_EET_SC_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr %99, ptr %101, ptr %103)
          to label %105 unwind label %149

105:                                              ; preds = %91
  %106 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %20, i32 0, i32 0
  store ptr %104, ptr %106, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %107 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %108 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %22, i32 0, i32 0
  store ptr %107, ptr %108, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKSt4pairIiiESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22) #5
  %109 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  %110 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %23, i32 0, i32 0
  store ptr %109, ptr %110, align 8
  %111 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  %112 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %24, i32 0, i32 0
  store ptr %111, ptr %112, align 8
  %113 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.8", ptr %21, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8
  %115 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %23, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8
  %117 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %24, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8
  %119 = invoke ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE6insertIN9__gnu_cxx17__normal_iteratorIPS1_S3_EEvEES8_NS6_IPKS1_S3_EET_SC_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr %114, ptr %116, ptr %118)
          to label %120 unwind label %153

120:                                              ; preds = %105
  %121 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.7", ptr %25, i32 0, i32 0
  store ptr %119, ptr %121, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %122 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  %123 = trunc i64 %122 to i32
  store i32 %123, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #5
  %124 = load i32, ptr %26, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 -1, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %125, ptr noundef nonnull align 4 dereferenceable(4) %28, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %126 unwind label %157

126:                                              ; preds = %120
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %127 = load ptr, ptr @treap, align 8, !tbaa !9
  store ptr %127, ptr %32, align 8, !tbaa !9
  %128 = getelementptr inbounds %"class.std::initializer_list", ptr %31, i32 0, i32 0
  store ptr %32, ptr %128, align 8, !tbaa !11
  %129 = getelementptr inbounds %"class.std::initializer_list", ptr %31, i32 0, i32 1
  store i64 1, ptr %129, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr %33) #5
  call void @_ZNSaIPN5Treap4nodeEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #5
  %130 = getelementptr inbounds { ptr, i64 }, ptr %31, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8
  %132 = getelementptr inbounds { ptr, i64 }, ptr %31, i32 0, i32 1
  %133 = load i64, ptr %132, align 8
  invoke void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEC2ESt16initializer_listIS2_ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr %131, i64 %133, ptr noundef nonnull align 1 dereferenceable(1) %33)
          to label %134 unwind label %161

134:                                              ; preds = %126
  call void @_ZNSt15__new_allocatorIPN5Treap4nodeEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  %135 = load i32, ptr %26, align 4, !tbaa !5
  %136 = sub nsw i32 %135, 1
  store i32 %136, ptr %34, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %211, %134
  %138 = load i32, ptr %34, align 4, !tbaa !5
  %139 = icmp sge i32 %138, 0
  br i1 %139, label %165, label %140

140:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  br label %223

141:                                              ; preds = %68
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %9, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %10, align 4
  br label %440

145:                                              ; preds = %82, %73
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %9, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %10, align 4
  br label %439

149:                                              ; preds = %91
  %150 = landingpad { ptr, i32 }
          cleanup
  %151 = extractvalue { ptr, i32 } %150, 0
  store ptr %151, ptr %9, align 8
  %152 = extractvalue { ptr, i32 } %150, 1
  store i32 %152, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %438

153:                                              ; preds = %105
  %154 = landingpad { ptr, i32 }
          cleanup
  %155 = extractvalue { ptr, i32 } %154, 0
  store ptr %155, ptr %9, align 8
  %156 = extractvalue { ptr, i32 } %154, 1
  store i32 %156, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %438

157:                                              ; preds = %120
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %9, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %10, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %29) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %437

161:                                              ; preds = %126
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %9, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %10, align 4
  call void @_ZNSt15__new_allocatorIPN5Treap4nodeEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %33) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %436

165:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  %166 = load i32, ptr %34, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %167) #5
  %169 = getelementptr inbounds %"struct.std::pair.5", ptr %168, i32 0, i32 0
  %170 = load i32, ptr %169, align 4, !tbaa !15
  store i32 %170, ptr %35, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #5
  %171 = load i32, ptr %34, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %172) #5
  %174 = getelementptr inbounds %"struct.std::pair.5", ptr %173, i32 0, i32 1
  %175 = load i32, ptr %174, align 4, !tbaa !17
  store i32 %175, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #5
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  %177 = load ptr, ptr %176, align 8, !tbaa !9
  store ptr %177, ptr %37, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %38) #5
  %178 = load ptr, ptr %37, align 8, !tbaa !9
  %179 = load i32, ptr %36, align 4, !tbaa !5
  %180 = invoke { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %178, i32 noundef %179)
          to label %181 unwind label %214

181:                                              ; preds = %165
  %182 = getelementptr inbounds { ptr, ptr }, ptr %38, i32 0, i32 0
  %183 = extractvalue { ptr, ptr } %180, 0
  store ptr %183, ptr %182, align 8
  %184 = getelementptr inbounds { ptr, ptr }, ptr %38, i32 0, i32 1
  %185 = extractvalue { ptr, ptr } %180, 1
  store ptr %185, ptr %184, align 8
  %186 = getelementptr inbounds %"struct.std::pair", ptr %38, i32 0, i32 1
  %187 = load ptr, ptr %186, align 8, !tbaa !18
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  store ptr %187, ptr %188, align 8, !tbaa !9
  %189 = getelementptr inbounds %"struct.std::pair", ptr %38, i32 0, i32 0
  %190 = load ptr, ptr %189, align 8, !tbaa !20
  store ptr %190, ptr %37, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %39) #5
  %191 = load ptr, ptr %37, align 8, !tbaa !9
  %192 = load i32, ptr %35, align 4, !tbaa !5
  %193 = sub nsw i32 %192, 1
  %194 = invoke { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %191, i32 noundef %193)
          to label %195 unwind label %218

195:                                              ; preds = %181
  %196 = getelementptr inbounds { ptr, ptr }, ptr %39, i32 0, i32 0
  %197 = extractvalue { ptr, ptr } %194, 0
  store ptr %197, ptr %196, align 8
  %198 = getelementptr inbounds { ptr, ptr }, ptr %39, i32 0, i32 1
  %199 = extractvalue { ptr, ptr } %194, 1
  store ptr %199, ptr %198, align 8
  %200 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIPN5Treap4nodeES2_EaSEOS3_(ptr noundef nonnull align 8 dereferenceable(16) %38, ptr noundef nonnull align 8 dereferenceable(16) %39) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #5
  %201 = getelementptr inbounds %"struct.std::pair", ptr %38, i32 0, i32 1
  invoke void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(8) %201)
          to label %202 unwind label %214

202:                                              ; preds = %195
  %203 = call noundef i64 @_ZNKSt6vectorIPN5Treap4nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  %204 = sub i64 %203, 1
  %205 = trunc i64 %204 to i32
  %206 = load i32, ptr %34, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %207) #5
  store i32 %205, ptr %208, align 4, !tbaa !5
  %209 = getelementptr inbounds %"struct.std::pair", ptr %38, i32 0, i32 0
  invoke void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 8 dereferenceable(8) %209)
          to label %210 unwind label %214

210:                                              ; preds = %202
  call void @llvm.lifetime.end.p0(i64 16, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  br label %211

211:                                              ; preds = %210
  %212 = load i32, ptr %34, align 4, !tbaa !5
  %213 = add nsw i32 %212, -1
  store i32 %213, ptr %34, align 4, !tbaa !5
  br label %137, !llvm.loop !21

214:                                              ; preds = %202, %195, %165
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %9, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %10, align 4
  br label %222

218:                                              ; preds = %181
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %9, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %39) #5
  br label %222

222:                                              ; preds = %218, %214
  call void @llvm.lifetime.end.p0(i64 16, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  br label %435

223:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #5
  %224 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %225 = sub i64 %224, 1
  %226 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %225) #5
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %228) #5
  %230 = load ptr, ptr %229, align 8, !tbaa !9
  store ptr %230, ptr %40, align 8, !tbaa !9
  %231 = load ptr, ptr %40, align 8, !tbaa !9
  %232 = getelementptr inbounds %"struct.Treap::node", ptr %231, i32 0, i32 4
  %233 = load i32, ptr %232, align 8, !tbaa !23
  %234 = xor i32 %233, 1
  store i32 %234, ptr %232, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #5
  %235 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %236 = trunc i64 %235 to i32
  %237 = sub nsw i32 %236, 2
  store i32 %237, ptr %41, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %263, %223
  %239 = load i32, ptr %41, align 4, !tbaa !5
  %240 = icmp sge i32 %239, 0
  br i1 %240, label %242, label %241

241:                                              ; preds = %238
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #5
  br label %270

242:                                              ; preds = %238
  %243 = load i32, ptr %41, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %244) #5
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %247) #5
  %249 = load ptr, ptr %248, align 8, !tbaa !9
  %250 = getelementptr inbounds %"struct.Treap::node", ptr %249, i32 0, i32 4
  %251 = load i32, ptr %250, align 8, !tbaa !23
  %252 = xor i32 %251, 1
  store i32 %252, ptr %250, align 8, !tbaa !23
  %253 = load ptr, ptr %40, align 8, !tbaa !9
  %254 = load i32, ptr %41, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %255) #5
  %257 = load i32, ptr %256, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %258) #5
  %260 = load ptr, ptr %259, align 8, !tbaa !9
  %261 = invoke noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef %253, ptr noundef %260)
          to label %262 unwind label %266

262:                                              ; preds = %242
  store ptr %261, ptr %40, align 8, !tbaa !9
  br label %263

263:                                              ; preds = %262
  %264 = load i32, ptr %41, align 4, !tbaa !5
  %265 = add nsw i32 %264, -1
  store i32 %265, ptr %41, align 4, !tbaa !5
  br label %238, !llvm.loop !25

266:                                              ; preds = %242
  %267 = landingpad { ptr, i32 }
          cleanup
  %268 = extractvalue { ptr, i32 } %267, 0
  store ptr %268, ptr %9, align 8
  %269 = extractvalue { ptr, i32 } %267, 1
  store i32 %269, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #5
  br label %434

270:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #5
  %271 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %272 = trunc i64 %271 to i32
  store i32 %272, ptr %42, align 4, !tbaa !5
  br label %273

273:                                              ; preds = %289, %270
  %274 = load i32, ptr %42, align 4, !tbaa !5
  %275 = load i32, ptr %26, align 4, !tbaa !5
  %276 = icmp slt i32 %274, %275
  br i1 %276, label %278, label %277

277:                                              ; preds = %273
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #5
  br label %296

278:                                              ; preds = %273
  %279 = load ptr, ptr %40, align 8, !tbaa !9
  %280 = load i32, ptr %42, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %281) #5
  %283 = load i32, ptr %282, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %284) #5
  %286 = load ptr, ptr %285, align 8, !tbaa !9
  %287 = invoke noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef %279, ptr noundef %286)
          to label %288 unwind label %292

288:                                              ; preds = %278
  store ptr %287, ptr %40, align 8, !tbaa !9
  br label %289

289:                                              ; preds = %288
  %290 = load i32, ptr %42, align 4, !tbaa !5
  %291 = add nsw i32 %290, 1
  store i32 %291, ptr %42, align 4, !tbaa !5
  br label %273, !llvm.loop !26

292:                                              ; preds = %278
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %9, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #5
  br label %434

296:                                              ; preds = %277
  %297 = load ptr, ptr %40, align 8, !tbaa !9
  %298 = getelementptr inbounds %"struct.Treap::node", ptr %297, i32 0, i32 4
  %299 = load i32, ptr %298, align 8, !tbaa !23
  %300 = xor i32 %299, 1
  store i32 %300, ptr %298, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %43) #5
  %301 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %302 = sub i64 %301, 1
  %303 = trunc i64 %302 to i32
  store i32 %303, ptr %43, align 4, !tbaa !5
  br label %304

304:                                              ; preds = %347, %296
  %305 = load i32, ptr %43, align 4, !tbaa !5
  %306 = icmp sge i32 %305, 0
  br i1 %306, label %308, label %307

307:                                              ; preds = %304
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #5
  br label %354

308:                                              ; preds = %304
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #5
  %309 = load i32, ptr %43, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %310) #5
  %312 = getelementptr inbounds %"struct.std::pair.5", ptr %311, i32 0, i32 0
  %313 = load i32, ptr %312, align 4, !tbaa !15
  store i32 %313, ptr %44, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %45) #5
  %314 = load i32, ptr %43, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %315) #5
  %317 = getelementptr inbounds %"struct.std::pair.5", ptr %316, i32 0, i32 1
  %318 = load i32, ptr %317, align 4, !tbaa !17
  store i32 %318, ptr %45, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %46) #5
  %319 = load i32, ptr %45, align 4, !tbaa !5
  %320 = load i32, ptr %44, align 4, !tbaa !5
  %321 = sub nsw i32 %319, %320
  %322 = add nsw i32 %321, 1
  store i32 %322, ptr %46, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %47) #5
  %323 = load ptr, ptr %40, align 8, !tbaa !9
  %324 = load i32, ptr %46, align 4, !tbaa !5
  %325 = invoke { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %323, i32 noundef %324)
          to label %326 unwind label %350

326:                                              ; preds = %308
  %327 = getelementptr inbounds { ptr, ptr }, ptr %47, i32 0, i32 0
  %328 = extractvalue { ptr, ptr } %325, 0
  store ptr %328, ptr %327, align 8
  %329 = getelementptr inbounds { ptr, ptr }, ptr %47, i32 0, i32 1
  %330 = extractvalue { ptr, ptr } %325, 1
  store ptr %330, ptr %329, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #5
  %331 = getelementptr inbounds %"struct.std::pair", ptr %47, i32 0, i32 0
  %332 = load ptr, ptr %331, align 8, !tbaa !20
  store ptr %332, ptr %48, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %49) #5
  %333 = getelementptr inbounds %"struct.std::pair", ptr %47, i32 0, i32 1
  %334 = load ptr, ptr %333, align 8, !tbaa !18
  store ptr %334, ptr %49, align 8, !tbaa !9
  %335 = load ptr, ptr %48, align 8, !tbaa !9
  %336 = getelementptr inbounds %"struct.Treap::node", ptr %335, i32 0, i32 4
  %337 = load i32, ptr %336, align 8, !tbaa !23
  %338 = xor i32 %337, 1
  store i32 %338, ptr %336, align 8, !tbaa !23
  %339 = load ptr, ptr %48, align 8, !tbaa !9
  %340 = load i32, ptr %43, align 4, !tbaa !5
  %341 = sext i32 %340 to i64
  %342 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %341) #5
  %343 = load i32, ptr %342, align 4, !tbaa !5
  %344 = sext i32 %343 to i64
  %345 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %344) #5
  store ptr %339, ptr %345, align 8, !tbaa !9
  %346 = load ptr, ptr %49, align 8, !tbaa !9
  store ptr %346, ptr %40, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %49) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %47) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #5
  br label %347

347:                                              ; preds = %326
  %348 = load i32, ptr %43, align 4, !tbaa !5
  %349 = add nsw i32 %348, -1
  store i32 %349, ptr %43, align 4, !tbaa !5
  br label %304, !llvm.loop !27

350:                                              ; preds = %308
  %351 = landingpad { ptr, i32 }
          cleanup
  %352 = extractvalue { ptr, i32 } %351, 0
  store ptr %352, ptr %9, align 8
  %353 = extractvalue { ptr, i32 } %351, 1
  store i32 %353, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %47) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %46) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %45) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %43) #5
  br label %434

354:                                              ; preds = %307
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #5
  %355 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %356 = trunc i64 %355 to i32
  store i32 %356, ptr %50, align 4, !tbaa !5
  br label %357

357:                                              ; preds = %397, %354
  %358 = load i32, ptr %50, align 4, !tbaa !5
  %359 = load i32, ptr %26, align 4, !tbaa !5
  %360 = icmp slt i32 %358, %359
  br i1 %360, label %362, label %361

361:                                              ; preds = %357
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #5
  br label %404

362:                                              ; preds = %357
  call void @llvm.lifetime.start.p0(i64 4, ptr %51) #5
  %363 = load i32, ptr %50, align 4, !tbaa !5
  %364 = sext i32 %363 to i64
  %365 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %364) #5
  %366 = getelementptr inbounds %"struct.std::pair.5", ptr %365, i32 0, i32 0
  %367 = load i32, ptr %366, align 4, !tbaa !15
  store i32 %367, ptr %51, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %52) #5
  %368 = load i32, ptr %50, align 4, !tbaa !5
  %369 = sext i32 %368 to i64
  %370 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %369) #5
  %371 = getelementptr inbounds %"struct.std::pair.5", ptr %370, i32 0, i32 1
  %372 = load i32, ptr %371, align 4, !tbaa !17
  store i32 %372, ptr %52, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %53) #5
  %373 = load i32, ptr %52, align 4, !tbaa !5
  %374 = load i32, ptr %51, align 4, !tbaa !5
  %375 = sub nsw i32 %373, %374
  %376 = add nsw i32 %375, 1
  store i32 %376, ptr %53, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %54) #5
  %377 = load ptr, ptr %40, align 8, !tbaa !9
  %378 = load i32, ptr %53, align 4, !tbaa !5
  %379 = invoke { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %377, i32 noundef %378)
          to label %380 unwind label %400

380:                                              ; preds = %362
  %381 = getelementptr inbounds { ptr, ptr }, ptr %54, i32 0, i32 0
  %382 = extractvalue { ptr, ptr } %379, 0
  store ptr %382, ptr %381, align 8
  %383 = getelementptr inbounds { ptr, ptr }, ptr %54, i32 0, i32 1
  %384 = extractvalue { ptr, ptr } %379, 1
  store ptr %384, ptr %383, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %55) #5
  %385 = getelementptr inbounds %"struct.std::pair", ptr %54, i32 0, i32 0
  %386 = load ptr, ptr %385, align 8, !tbaa !20
  store ptr %386, ptr %55, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #5
  %387 = getelementptr inbounds %"struct.std::pair", ptr %54, i32 0, i32 1
  %388 = load ptr, ptr %387, align 8, !tbaa !18
  store ptr %388, ptr %56, align 8, !tbaa !9
  %389 = load ptr, ptr %55, align 8, !tbaa !9
  %390 = load i32, ptr %50, align 4, !tbaa !5
  %391 = sext i32 %390 to i64
  %392 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %27, i64 noundef %391) #5
  %393 = load i32, ptr %392, align 4, !tbaa !5
  %394 = sext i32 %393 to i64
  %395 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %394) #5
  store ptr %389, ptr %395, align 8, !tbaa !9
  %396 = load ptr, ptr %56, align 8, !tbaa !9
  store ptr %396, ptr %40, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %55) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %54) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #5
  br label %397

397:                                              ; preds = %380
  %398 = load i32, ptr %50, align 4, !tbaa !5
  %399 = add nsw i32 %398, 1
  store i32 %399, ptr %50, align 4, !tbaa !5
  br label %357, !llvm.loop !28

400:                                              ; preds = %362
  %401 = landingpad { ptr, i32 }
          cleanup
  %402 = extractvalue { ptr, i32 } %401, 0
  store ptr %402, ptr %9, align 8
  %403 = extractvalue { ptr, i32 } %401, 1
  store i32 %403, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %54) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %53) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %52) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %51) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #5
  br label %434

404:                                              ; preds = %361
  br label %405

405:                                              ; preds = %422, %404
  %406 = call noundef i64 @_ZNKSt6vectorIPN5Treap4nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  %407 = icmp ugt i64 %406, 1
  br i1 %407, label %408, label %431

408:                                              ; preds = %405
  call void @llvm.lifetime.start.p0(i64 4, ptr %57) #5
  %409 = call noundef i64 @_ZNKSt6vectorIPN5Treap4nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  %410 = trunc i64 %409 to i32
  store i32 %410, ptr %57, align 4, !tbaa !5
  %411 = load i32, ptr %57, align 4, !tbaa !5
  %412 = sub nsw i32 %411, 1
  %413 = sext i32 %412 to i64
  %414 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %413) #5
  %415 = load ptr, ptr %414, align 8, !tbaa !9
  %416 = load i32, ptr %57, align 4, !tbaa !5
  %417 = sub nsw i32 %416, 2
  %418 = sext i32 %417 to i64
  %419 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %418) #5
  %420 = load ptr, ptr %419, align 8, !tbaa !9
  %421 = invoke noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef %415, ptr noundef %420)
          to label %422 unwind label %427

422:                                              ; preds = %408
  %423 = load i32, ptr %57, align 4, !tbaa !5
  %424 = sub nsw i32 %423, 2
  %425 = sext i32 %424 to i64
  %426 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %425) #5
  store ptr %421, ptr %426, align 8, !tbaa !9
  call void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #5
  br label %405, !llvm.loop !29

427:                                              ; preds = %408
  %428 = landingpad { ptr, i32 }
          cleanup
  %429 = extractvalue { ptr, i32 } %428, 0
  store ptr %429, ptr %9, align 8
  %430 = extractvalue { ptr, i32 } %428, 1
  store i32 %430, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %57) #5
  br label %434

431:                                              ; preds = %405
  %432 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef 0) #5
  %433 = load ptr, ptr %432, align 8, !tbaa !9
  store ptr %433, ptr @treap, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #5
  call void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  ret void

434:                                              ; preds = %427, %400, %350, %292, %266
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #5
  br label %435

435:                                              ; preds = %434, %222
  call void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %30) #5
  br label %436

436:                                              ; preds = %435, %161
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %27) #5
  br label %437

437:                                              ; preds = %436, %157
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %438

438:                                              ; preds = %437, %153, %149
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  br label %439

439:                                              ; preds = %438, %145
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  br label %440

440:                                              ; preds = %439, %141
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br label %441

441:                                              ; preds = %440
  %442 = load ptr, ptr %9, align 8
  %443 = load i32, ptr %10, align 4
  %444 = insertvalue { ptr, i32 } poison, ptr %442, 0
  %445 = insertvalue { ptr, i32 } %444, i32 %443, 1
  resume { ptr, i32 } %445
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


; 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.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.8" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.7" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::vector.9" = type { %"struct.std::_Vector_base.10" }
%"struct.std::_Vector_base.10" = type { %"struct.std::_Vector_base<Treap::node *, std::allocator<Treap::node *>>::_Vector_impl" }
%"struct.std::_Vector_base<Treap::node *, std::allocator<Treap::node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Treap::node *, std::allocator<Treap::node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Treap::node *, std::allocator<Treap::node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.11" = type { i8 }
%"struct.std::pair" = type { ptr, ptr }

@pos = external dso_local local_unnamed_addr global [131072 x i32], align 16
@treap = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef, i32 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5go_upiib(ptr dead_on_unwind noalias writable sret(%"class.std::vector.0") align 8, i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z7reverseiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector.0", align 8
  %7 = alloca %"class.std::vector.0", align 8
  %8 = alloca %"class.std::vector.0", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.8", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.8", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.7", align 8
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::allocator", align 1
  %16 = alloca %"class.std::vector.9", align 8
  %17 = alloca [1 x ptr], align 8
  %18 = alloca %"class.std::allocator.11", align 1
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca %"struct.std::pair", align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  %21 = sext i32 %0 to i64
  %22 = getelementptr inbounds [131072 x i32], ptr @pos, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = sext i32 %1 to i64
  %25 = getelementptr inbounds [131072 x i32], ptr @pos, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = icmp sgt i32 %23, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %3
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #5
  %.pre = load i32, ptr %4, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %28, %3
  %30 = phi i32 [ %.pre, %28 ], [ %0, %3 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_Z5go_upiib(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.0") align 8 %6, i32 noundef %30, i32 noundef %2, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %31 = load i32, ptr %5, align 4, !tbaa !5
  invoke void @_Z5go_upiib(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.0") align 8 %7, i32 noundef %31, i32 noundef %2, i1 noundef zeroext false)
          to label %32 unwind label %76

32:                                               ; preds = %29
  %33 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %34 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %33, ptr %34)
          to label %35 unwind label %78

35:                                               ; preds = %32
  %36 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %37 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  invoke void @_ZSt7reverseIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %36, ptr %37)
          to label %38 unwind label %78

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %39 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  store ptr %39, ptr %10, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKSt4pairIiiESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %40 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %41 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %42 = load ptr, ptr %9, align 8
  %43 = invoke ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE6insertIN9__gnu_cxx17__normal_iteratorIPS1_S3_EEvEES8_NS6_IPKS1_S3_EET_SC_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr %42, ptr %40, ptr %41)
          to label %44 unwind label %80

44:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %45 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  store ptr %45, ptr %12, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKSt4pairIiiESt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %46 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %47 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  %48 = load ptr, ptr %11, align 8
  %49 = invoke ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE6insertIN9__gnu_cxx17__normal_iteratorIPS1_S3_EEvEES8_NS6_IPKS1_S3_EET_SC_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr %48, ptr %46, ptr %47)
          to label %50 unwind label %82

50:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  %51 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  %52 = trunc i64 %51 to i32
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #5
  %sext = shl i64 %51, 32
  %53 = ashr exact i64 %sext, 32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #5
  store i32 -1, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %15) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %53, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 1 dereferenceable(1) %15)
          to label %54 unwind label %84

54:                                               ; preds = %50
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #5
  %55 = load ptr, ptr @treap, align 8, !tbaa !9
  store ptr %55, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %18) #5
  call void @_ZNSaIPN5Treap4nodeEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  invoke void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEC2ESt16initializer_listIS2_ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr nonnull %17, i64 1, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %56 unwind label %86

56:                                               ; preds = %54
  call void @_ZNSt15__new_allocatorIPN5Treap4nodeEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  %57 = icmp sgt i32 %52, 0
  br i1 %57, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %56
  %58 = getelementptr inbounds i8, ptr %19, i64 8
  %59 = getelementptr inbounds i8, ptr %20, i64 8
  %60 = and i64 %51, 2147483647
  br label %88

._crit_edge:                                      ; preds = %113, %56
  %61 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %62 = add i64 %61, -1
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %62) #5
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %65) #5
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  %69 = load i32, ptr %68, align 8, !tbaa !11
  %70 = xor i32 %69, 1
  store i32 %70, ptr %68, align 8, !tbaa !11
  %71 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %72 = trunc i64 %71 to i32
  %73 = icmp sgt i32 %72, 1
  br i1 %73, label %.lr.ph104.preheader, label %._crit_edge105

.lr.ph104.preheader:                              ; preds = %._crit_edge
  %74 = add i64 %71, 4294967294
  %75 = and i64 %74, 4294967295
  br label %.lr.ph104

76:                                               ; preds = %29
  %77 = landingpad { ptr, i32 }
          cleanup
  br label %222

78:                                               ; preds = %35, %32
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %221

80:                                               ; preds = %38
  %81 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %220

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

84:                                               ; preds = %50
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %15) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #5
  br label %219

86:                                               ; preds = %54
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIPN5Treap4nodeEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %18) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #5
  br label %218

88:                                               ; preds = %.lr.ph, %113
  %indvars.iv = phi i64 [ %60, %.lr.ph ], [ %indvars.iv.next, %113 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %89 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv.next) #5
  %90 = load i32, ptr %89, align 4, !tbaa !13
  %91 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv.next) #5
  %92 = getelementptr inbounds i8, ptr %91, i64 4
  %93 = load i32, ptr %92, align 4, !tbaa !15
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %19) #5
  %96 = invoke { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %95, i32 noundef %93)
          to label %97 unwind label %115

97:                                               ; preds = %88
  %98 = extractvalue { ptr, ptr } %96, 0
  store ptr %98, ptr %19, align 8
  %99 = extractvalue { ptr, ptr } %96, 1
  store ptr %99, ptr %58, align 8
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  store ptr %99, ptr %100, align 8, !tbaa !9
  %101 = load ptr, ptr %19, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %20) #5
  %102 = add nsw i32 %90, -1
  %103 = invoke { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %101, i32 noundef %102)
          to label %104 unwind label %117

104:                                              ; preds = %97
  %105 = extractvalue { ptr, ptr } %103, 0
  store ptr %105, ptr %20, align 8
  %106 = extractvalue { ptr, ptr } %103, 1
  store ptr %106, ptr %59, align 8
  %107 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIPN5Treap4nodeES2_EaSEOS3_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %20) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %20) #5
  invoke void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(8) %58)
          to label %108 unwind label %115

108:                                              ; preds = %104
  %109 = call noundef i64 @_ZNKSt6vectorIPN5Treap4nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %110 = trunc i64 %109 to i32
  %111 = add i32 %110, -1
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv.next) #5
  store i32 %111, ptr %112, align 4, !tbaa !5
  invoke void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EE9push_backERKS2_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %113 unwind label %115

113:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %19) #5
  %114 = icmp ugt i64 %indvars.iv, 1
  br i1 %114, label %88, label %._crit_edge, !llvm.loop !18

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

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

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

._crit_edge105:                                   ; preds = %138, %._crit_edge
  %.075.lcssa = phi ptr [ %67, %._crit_edge ], [ %137, %138 ]
  %120 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %121 = trunc i64 %120 to i32
  %122 = icmp slt i32 %121, %52
  br i1 %122, label %.lr.ph109.preheader, label %._crit_edge110

.lr.ph109.preheader:                              ; preds = %._crit_edge105
  %sext143 = shl i64 %120, 32
  %123 = ashr exact i64 %sext143, 32
  br label %.lr.ph109

.lr.ph104:                                        ; preds = %.lr.ph104.preheader, %138
  %indvars.iv129 = phi i64 [ %75, %.lr.ph104.preheader ], [ %indvars.iv.next130, %138 ]
  %.075102 = phi ptr [ %67, %.lr.ph104.preheader ], [ %137, %138 ]
  %124 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv129) #5
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %126) #5
  %128 = load ptr, ptr %127, align 8, !tbaa !9
  %129 = getelementptr inbounds i8, ptr %128, i64 16
  %130 = load i32, ptr %129, align 8, !tbaa !11
  %131 = xor i32 %130, 1
  store i32 %131, ptr %129, align 8, !tbaa !11
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv129) #5
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %134) #5
  %136 = load ptr, ptr %135, align 8, !tbaa !9
  %137 = invoke noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef %.075102, ptr noundef %136)
          to label %138 unwind label %140

138:                                              ; preds = %.lr.ph104
  %indvars.iv.next130 = add nsw i64 %indvars.iv129, -1
  %139 = icmp sgt i64 %indvars.iv129, 0
  br i1 %139, label %.lr.ph104, label %._crit_edge105, !llvm.loop !20

140:                                              ; preds = %.lr.ph104
  %141 = landingpad { ptr, i32 }
          cleanup
  br label %217

._crit_edge110:                                   ; preds = %155, %._crit_edge105
  %.176.lcssa = phi ptr [ %.075.lcssa, %._crit_edge105 ], [ %154, %155 ]
  %142 = getelementptr inbounds i8, ptr %.176.lcssa, i64 16
  %143 = load i32, ptr %142, align 8, !tbaa !11
  %144 = xor i32 %143, 1
  store i32 %144, ptr %142, align 8, !tbaa !11
  %145 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %146 = trunc i64 %145 to i32
  %.081112 = add i32 %146, -1
  %147 = icmp sgt i32 %.081112, -1
  br i1 %147, label %.lr.ph116.preheader, label %._crit_edge117

.lr.ph116.preheader:                              ; preds = %._crit_edge110
  %148 = zext nneg i32 %.081112 to i64
  br label %.lr.ph116

.lr.ph109:                                        ; preds = %.lr.ph109.preheader, %155
  %indvars.iv132 = phi i64 [ %123, %.lr.ph109.preheader ], [ %indvars.iv.next133, %155 ]
  %.176107 = phi ptr [ %.075.lcssa, %.lr.ph109.preheader ], [ %154, %155 ]
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv132) #5
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %151) #5
  %153 = load ptr, ptr %152, align 8, !tbaa !9
  %154 = invoke noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef %.176107, ptr noundef %153)
          to label %155 unwind label %156

155:                                              ; preds = %.lr.ph109
  %indvars.iv.next133 = add nsw i64 %indvars.iv132, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next133 to i32
  %exitcond.not = icmp eq i32 %lftr.wideiv, %52
  br i1 %exitcond.not, label %._crit_edge110, label %.lr.ph109, !llvm.loop !21

156:                                              ; preds = %.lr.ph109
  %157 = landingpad { ptr, i32 }
          cleanup
  br label %217

._crit_edge117:                                   ; preds = %169, %._crit_edge110
  %.277.lcssa = phi ptr [ %.176.lcssa, %._crit_edge110 ], [ %171, %169 ]
  %158 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %159 = trunc i64 %158 to i32
  %160 = icmp slt i32 %159, %52
  br i1 %160, label %.lr.ph122.preheader, label %.preheader

.lr.ph122.preheader:                              ; preds = %._crit_edge117
  %sext144 = shl i64 %158, 32
  %161 = ashr exact i64 %sext144, 32
  br label %.lr.ph122

.lr.ph116:                                        ; preds = %.lr.ph116.preheader, %169
  %indvars.iv135 = phi i64 [ %148, %.lr.ph116.preheader ], [ %indvars.iv.next136, %169 ]
  %.277113 = phi ptr [ %.176.lcssa, %.lr.ph116.preheader ], [ %171, %169 ]
  %162 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv135) #5
  %163 = load i32, ptr %162, align 4, !tbaa !13
  %164 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv135) #5
  %165 = getelementptr inbounds i8, ptr %164, i64 4
  %166 = load i32, ptr %165, align 4, !tbaa !15
  %reass.sub = sub i32 %166, %163
  %167 = add i32 %reass.sub, 1
  %168 = invoke { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %.277113, i32 noundef %167)
          to label %169 unwind label %180

169:                                              ; preds = %.lr.ph116
  %170 = extractvalue { ptr, ptr } %168, 0
  %171 = extractvalue { ptr, ptr } %168, 1
  %172 = getelementptr inbounds i8, ptr %170, i64 16
  %173 = load i32, ptr %172, align 8, !tbaa !11
  %174 = xor i32 %173, 1
  store i32 %174, ptr %172, align 8, !tbaa !11
  %175 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv135) #5
  %176 = load i32, ptr %175, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %177) #5
  store ptr %170, ptr %178, align 8, !tbaa !9
  %indvars.iv.next136 = add nsw i64 %indvars.iv135, -1
  %179 = icmp sgt i64 %indvars.iv135, 0
  br i1 %179, label %.lr.ph116, label %._crit_edge117, !llvm.loop !22

180:                                              ; preds = %.lr.ph116
  %181 = landingpad { ptr, i32 }
          cleanup
  br label %217

.preheader:                                       ; preds = %191, %._crit_edge117
  %182 = call noundef i64 @_ZNKSt6vectorIPN5Treap4nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %183 = icmp ugt i64 %182, 1
  br i1 %183, label %.lr.ph123, label %._crit_edge124

.lr.ph122:                                        ; preds = %.lr.ph122.preheader, %191
  %indvars.iv138 = phi i64 [ %161, %.lr.ph122.preheader ], [ %indvars.iv.next139, %191 ]
  %.378120 = phi ptr [ %.277.lcssa, %.lr.ph122.preheader ], [ %193, %191 ]
  %184 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv138) #5
  %185 = load i32, ptr %184, align 4, !tbaa !13
  %186 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv138) #5
  %187 = getelementptr inbounds i8, ptr %186, i64 4
  %188 = load i32, ptr %187, align 4, !tbaa !15
  %reass.sub125 = sub i32 %188, %185
  %189 = add i32 %reass.sub125, 1
  %190 = invoke { ptr, ptr } @_ZN5Treap5splitEPNS_4nodeEi(ptr noundef %.378120, i32 noundef %189)
          to label %191 unwind label %198

191:                                              ; preds = %.lr.ph122
  %192 = extractvalue { ptr, ptr } %190, 0
  %193 = extractvalue { ptr, ptr } %190, 1
  %194 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %indvars.iv138) #5
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %196) #5
  store ptr %192, ptr %197, align 8, !tbaa !9
  %indvars.iv.next139 = add nsw i64 %indvars.iv138, 1
  %lftr.wideiv141 = trunc i64 %indvars.iv.next139 to i32
  %exitcond142.not = icmp eq i32 %lftr.wideiv141, %52
  br i1 %exitcond142.not, label %.preheader, label %.lr.ph122, !llvm.loop !23

198:                                              ; preds = %.lr.ph122
  %199 = landingpad { ptr, i32 }
          cleanup
  br label %217

.lr.ph123:                                        ; preds = %.preheader, %209
  %200 = call noundef i64 @_ZNKSt6vectorIPN5Treap4nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %201 = shl i64 %200, 32
  %sext84 = add i64 %201, -4294967296
  %202 = ashr exact i64 %sext84, 32
  %203 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %202) #5
  %204 = load ptr, ptr %203, align 8, !tbaa !9
  %sext85 = add i64 %201, -8589934592
  %205 = ashr exact i64 %sext85, 32
  %206 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %205) #5
  %207 = load ptr, ptr %206, align 8, !tbaa !9
  %208 = invoke noundef ptr @_ZN5Treap5mergeEPNS_4nodeES1_(ptr noundef %204, ptr noundef %207)
          to label %209 unwind label %213

209:                                              ; preds = %.lr.ph123
  %210 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %205) #5
  store ptr %208, ptr %210, align 8, !tbaa !9
  call void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %211 = call noundef i64 @_ZNKSt6vectorIPN5Treap4nodeESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %212 = icmp ugt i64 %211, 1
  br i1 %212, label %.lr.ph123, label %._crit_edge124, !llvm.loop !24

213:                                              ; preds = %.lr.ph123
  %214 = landingpad { ptr, i32 }
          cleanup
  br label %217

._crit_edge124:                                   ; preds = %209, %.preheader
  %215 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIPN5Treap4nodeESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0) #5
  %216 = load ptr, ptr %215, align 8, !tbaa !9
  store ptr %216, ptr @treap, align 8, !tbaa !9
  call void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  ret void

217:                                              ; preds = %140, %156, %180, %198, %213, %119
  %.pn87.pn = phi { ptr, i32 } [ %.pn87, %119 ], [ %141, %140 ], [ %157, %156 ], [ %181, %180 ], [ %199, %198 ], [ %214, %213 ]
  call void @_ZNSt6vectorIPN5Treap4nodeESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  br label %218

218:                                              ; preds = %217, %86
  %.pn87.pn.pn = phi { ptr, i32 } [ %.pn87.pn, %217 ], [ %87, %86 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %16) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  br label %219

219:                                              ; preds = %218, %84
  %.pn87.pn.pn.pn = phi { ptr, i32 } [ %.pn87.pn.pn, %218 ], [ %85, %84 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #5
  br label %220

220:                                              ; preds = %219, %82, %80
  %.pn87.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn87.pn.pn.pn, %219 ], [ %83, %82 ], [ %81, %80 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  br label %221

221:                                              ; preds = %220, %78
  %.pn87.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn87.pn.pn.pn.pn, %220 ], [ %79, %78 ]
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  br label %222

222:                                              ; preds = %221, %76
  %.pn87.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn87.pn.pn.pn.pn.pn, %221 ], [ %77, %76 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  resume { ptr, i32 } %.pn87.pn.pn.pn.pn.pn.pn
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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