; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2013-14/Open 2014 (14 Open G2)

; 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.LazySegTree = type { [262144 x i64], [262144 x i64] }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { i32, %"struct.std::pair.13" }
%"struct.std::pair.13" = type { i32, i32 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %class.LazySegTree, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::vector.8", align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca %"struct.std::pair.13", align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair", align 4
  %18 = alloca i32, align 4
  %19 = alloca %"struct.std::pair.13", align 4
  %20 = alloca i32, align 4
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4194304, ptr %5) #6
  call void @_ZN11LazySegTreeILi131072EEC2Ev(ptr noundef nonnull align 8 dereferenceable(4194304) %5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #6
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store ptr %0, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #6
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %29, ptr %30, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #6
  %33 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %32, ptr %33, align 8
  br label %34

34:                                               ; preds = %53, %2
  %35 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  br i1 %35, label %37, label %36

36:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %64

37:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #6
  %38 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %38, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #6
  %39 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 1
  %40 = getelementptr inbounds %"struct.std::pair.13", ptr %39, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 -1, ptr %14, align 4, !tbaa !11
  %41 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 0
  invoke void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %41)
          to label %42 unwind label %55

42:                                               ; preds = %37
  invoke void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(4) %40, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %43 unwind label %55

43:                                               ; preds = %42
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(12) %12)
          to label %44 unwind label %55

44:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %45 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 1
  %46 = getelementptr inbounds %"struct.std::pair.13", ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !13
  %48 = sub nsw i32 %47, 1
  store i32 %48, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 1, ptr %20, align 4, !tbaa !11
  %49 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 0
  invoke void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %49)
          to label %50 unwind label %59

50:                                               ; preds = %44
  invoke void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(8) %19)
          to label %51 unwind label %59

51:                                               ; preds = %50
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 4 dereferenceable(12) %17)
          to label %52 unwind label %59

52:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #6
  br label %53

53:                                               ; preds = %52
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br label %34

55:                                               ; preds = %43, %42, %37
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %15, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #6
  br label %63

59:                                               ; preds = %51, %50, %44
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %15, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #6
  br label %63

63:                                               ; preds = %59, %55
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %178

64:                                               ; preds = %36
  %65 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %66 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %65, ptr %66, align 8
  %67 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %68 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %67, ptr %68, align 8
  %69 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8
  %71 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %70, ptr %72)
          to label %73 unwind label %87

73:                                               ; preds = %64
  %74 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %75 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %74, ptr %75, align 8
  %76 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %77 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  store ptr %76, ptr %77, align 8
  %78 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %79, ptr %81)
          to label %82 unwind label %87

82:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 0, ptr %25, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  store i32 0, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  store i32 0, ptr %27, align 4, !tbaa !11
  br label %83

83:                                               ; preds = %173, %82
  %84 = load i32, ptr %27, align 4, !tbaa !11
  %85 = icmp slt i32 %84, 131072
  br i1 %85, label %91, label %86

86:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  br label %176

87:                                               ; preds = %73, %64
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %15, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %16, align 4
  br label %178

91:                                               ; preds = %83
  br label %92

92:                                               ; preds = %122, %91
  %93 = load i32, ptr %26, align 4, !tbaa !11
  %94 = sext i32 %93 to i64
  %95 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %96 = icmp ult i64 %94, %95
  br i1 %96, label %97, label %105

97:                                               ; preds = %92
  %98 = load i32, ptr %26, align 4, !tbaa !11
  %99 = sext i32 %98 to i64
  %100 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %99) #6
  %101 = getelementptr inbounds %"struct.std::pair", ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 4, !tbaa !16
  %103 = load i32, ptr %27, align 4, !tbaa !11
  %104 = icmp eq i32 %102, %103
  br label %105

105:                                              ; preds = %97, %92
  %106 = phi i1 [ false, %92 ], [ %104, %97 ]
  br i1 %106, label %107, label %129

107:                                              ; preds = %105
  %108 = load i32, ptr %26, align 4, !tbaa !11
  %109 = sext i32 %108 to i64
  %110 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %109) #6
  %111 = getelementptr inbounds %"struct.std::pair", ptr %110, i32 0, i32 1
  %112 = getelementptr inbounds %"struct.std::pair.13", ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 4, !tbaa !17
  %114 = add nsw i32 %113, 1
  %115 = load i32, ptr %26, align 4, !tbaa !11
  %116 = sext i32 %115 to i64
  %117 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %116) #6
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 1
  %119 = getelementptr inbounds %"struct.std::pair.13", ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !13
  %121 = sub nsw i32 %120, 1
  invoke void @_ZN11LazySegTreeILi131072EE3updEiiiiii(ptr noundef nonnull align 8 dereferenceable(4194304) %5, i32 noundef %114, i32 noundef %121, i32 noundef 1, i32 noundef 1, i32 noundef 0, i32 noundef 131071)
          to label %122 unwind label %125

122:                                              ; preds = %107
  %123 = load i32, ptr %26, align 4, !tbaa !11
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %26, align 4, !tbaa !11
  br label %92, !llvm.loop !18

125:                                              ; preds = %145, %107
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %15, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %178

129:                                              ; preds = %105
  br label %130

130:                                              ; preds = %166, %129
  %131 = load i32, ptr %25, align 4, !tbaa !11
  %132 = sext i32 %131 to i64
  %133 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %134 = icmp ult i64 %132, %133
  br i1 %134, label %135, label %143

135:                                              ; preds = %130
  %136 = load i32, ptr %25, align 4, !tbaa !11
  %137 = sext i32 %136 to i64
  %138 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %137) #6
  %139 = getelementptr inbounds %"struct.std::pair", ptr %138, i32 0, i32 0
  %140 = load i32, ptr %139, align 4, !tbaa !16
  %141 = load i32, ptr %27, align 4, !tbaa !11
  %142 = icmp eq i32 %140, %141
  br label %143

143:                                              ; preds = %135, %130
  %144 = phi i1 [ false, %130 ], [ %142, %135 ]
  br i1 %144, label %145, label %172

145:                                              ; preds = %143
  %146 = load i32, ptr %25, align 4, !tbaa !11
  %147 = sext i32 %146 to i64
  %148 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %147) #6
  %149 = getelementptr inbounds %"struct.std::pair", ptr %148, i32 0, i32 1
  %150 = getelementptr inbounds %"struct.std::pair.13", ptr %149, i32 0, i32 0
  %151 = load i32, ptr %150, align 4, !tbaa !17
  %152 = sext i32 %151 to i64
  %153 = load i32, ptr %25, align 4, !tbaa !11
  %154 = sext i32 %153 to i64
  %155 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %154) #6
  %156 = getelementptr inbounds %"struct.std::pair", ptr %155, i32 0, i32 1
  %157 = getelementptr inbounds %"struct.std::pair.13", ptr %156, i32 0, i32 1
  %158 = load i32, ptr %157, align 4, !tbaa !13
  %159 = load i32, ptr %25, align 4, !tbaa !11
  %160 = sext i32 %159 to i64
  %161 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %160) #6
  %162 = getelementptr inbounds %"struct.std::pair", ptr %161, i32 0, i32 1
  %163 = getelementptr inbounds %"struct.std::pair.13", ptr %162, i32 0, i32 1
  %164 = load i32, ptr %163, align 4, !tbaa !13
  %165 = invoke noundef i64 @_ZN11LazySegTreeILi131072EE4qsumEiiiii(ptr noundef nonnull align 8 dereferenceable(4194304) %5, i32 noundef %158, i32 noundef %164, i32 noundef 1, i32 noundef 0, i32 noundef 131071)
          to label %166 unwind label %125

166:                                              ; preds = %145
  %167 = mul nsw i64 %152, %165
  %168 = load i64, ptr %6, align 8, !tbaa !9
  %169 = add nsw i64 %168, %167
  store i64 %169, ptr %6, align 8, !tbaa !9
  %170 = load i32, ptr %25, align 4, !tbaa !11
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %25, align 4, !tbaa !11
  br label %130, !llvm.loop !20

172:                                              ; preds = %143
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %27, align 4, !tbaa !11
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %27, align 4, !tbaa !11
  br label %83, !llvm.loop !21

176:                                              ; preds = %86
  %177 = load i64, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4194304, ptr %5) #6
  ret i64 %177

178:                                              ; preds = %125, %87, %63
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4194304, ptr %5) #6
  br label %179

179:                                              ; preds = %178
  %180 = load ptr, ptr %15, align 8
  %181 = load i32, ptr %16, align 4
  %182 = insertvalue { ptr, i32 } poison, ptr %180, 0
  %183 = insertvalue { ptr, i32 } %182, i32 %181, 1
  resume { ptr, i32 } %183
}

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

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

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; 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(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN11LazySegTreeILi131072EE4qsumEiiiii(ptr noundef nonnull align 8 dereferenceable(4194304), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


; 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.LazySegTree = type { [262144 x i64], [262144 x i64] }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, std::pair<int, int>>, std::allocator<std::pair<int, std::pair<int, int>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { i32, %"struct.std::pair.13" }
%"struct.std::pair.13" = type { i32, i32 }

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z15numintersectionSt6vectorISt4pairIiS0_IiiEESaIS2_EES4_(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.LazySegTree, align 8
  %4 = alloca %"class.std::vector.8", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca %"struct.std::pair", align 4
  %9 = alloca %"struct.std::pair.13", align 4
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair.13", align 4
  %14 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4194304, ptr nonnull %3) #6
  call void @_ZN11LazySegTreeILi131072EEC2Ev(ptr noundef nonnull align 8 dereferenceable(4194304) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %15 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  store ptr %15, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %16 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  store ptr %16, ptr %6, align 8
  %17 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %18 = getelementptr inbounds i8, ptr %7, i64 4
  %19 = getelementptr inbounds i8, ptr %7, i64 8
  br label %22

._crit_edge:                                      ; preds = %27, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %20 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %21 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %20, ptr %21)
          to label %35 unwind label %42

22:                                               ; preds = %.lr.ph, %27
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #6
  %23 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %23, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  store i32 -1, ptr %10, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(8) %9)
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %24 unwind label %30

24:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %25 = load i32, ptr %19, align 4, !tbaa !9
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #6
  store i32 1, ptr %14, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IiRiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @_ZNSt4pairIiS_IiiEEC2IiS0_TnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS4_S5_EEEbE4typeELb1EEERKiRKS0_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(8) %13)
  invoke void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 4 dereferenceable(12) %11)
          to label %27 unwind label %32

27:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %29 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  br i1 %29, label %22, label %._crit_edge

30:                                               ; preds = %22
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  br label %34

32:                                               ; preds = %24
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #6
  br label %34

34:                                               ; preds = %32, %30
  %.pn = phi { ptr, i32 } [ %33, %32 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %83

35:                                               ; preds = %._crit_edge
  %36 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %37 = call ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiS2_IiiEESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %36, ptr %37)
          to label %.preheader unwind label %42

.preheader:                                       ; preds = %35, %.critedge2
  %.059 = phi i32 [ %82, %.critedge2 ], [ 0, %35 ]
  %.02558 = phi i32 [ %.1.lcssa, %.critedge2 ], [ 0, %35 ]
  %.02657 = phi i32 [ %.127.lcssa, %.critedge2 ], [ 0, %35 ]
  %.02856 = phi i64 [ %.129.lcssa, %.critedge2 ], [ 0, %35 ]
  %38 = sext i32 %.02558 to i64
  %39 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %40 = icmp ugt i64 %39, %38
  br i1 %40, label %.lr.ph45, label %.critedge

41:                                               ; preds = %.critedge2
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %3) #6
  ret i64 %.129.lcssa

42:                                               ; preds = %35, %._crit_edge
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %83

.lr.ph45:                                         ; preds = %.preheader, %56
  %indvars.iv = phi i64 [ %indvars.iv.next, %56 ], [ %38, %.preheader ]
  %44 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #6
  %45 = load i32, ptr %44, align 4, !tbaa !12
  %46 = icmp eq i32 %45, %.059
  br i1 %46, label %47, label %.critedge.loopexit

47:                                               ; preds = %.lr.ph45
  %48 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #6
  %49 = getelementptr inbounds i8, ptr %48, i64 4
  %50 = load i32, ptr %49, align 4, !tbaa !13
  %51 = add nsw i32 %50, 1
  %52 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %indvars.iv) #6
  %53 = getelementptr inbounds i8, ptr %52, i64 8
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = add nsw i32 %54, -1
  invoke void @_ZN11LazySegTreeILi131072EE3updEiiiiii(ptr noundef nonnull align 8 dereferenceable(4194304) %3, i32 noundef %51, i32 noundef %55, i32 noundef 1, i32 noundef 1, i32 noundef 0, i32 noundef 131071)
          to label %56 unwind label %.loopexit.split-lp

56:                                               ; preds = %47
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %57 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %58 = icmp ugt i64 %57, %indvars.iv.next
  br i1 %58, label %.lr.ph45, label %.critedge.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %65
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %83

.loopexit.split-lp:                               ; preds = %47
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %83

.critedge.loopexit:                               ; preds = %56, %.lr.ph45
  %.1.lcssa.ph.in = phi i64 [ %indvars.iv, %.lr.ph45 ], [ %indvars.iv.next, %56 ]
  %.1.lcssa.ph = trunc i64 %.1.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader
  %.1.lcssa = phi i32 [ %.02558, %.preheader ], [ %.1.lcssa.ph, %.critedge.loopexit ]
  %59 = sext i32 %.02657 to i64
  %60 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %61 = icmp ugt i64 %60, %59
  br i1 %61, label %.lr.ph50, label %.critedge2

.lr.ph50:                                         ; preds = %.critedge, %76
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %76 ], [ %59, %.critedge ]
  %.12948 = phi i64 [ %79, %76 ], [ %.02856, %.critedge ]
  %62 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv61) #6
  %63 = load i32, ptr %62, align 4, !tbaa !12
  %64 = icmp eq i32 %63, %.059
  br i1 %64, label %65, label %.critedge2.loopexit

65:                                               ; preds = %.lr.ph50
  %66 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv61) #6
  %67 = getelementptr inbounds i8, ptr %66, i64 4
  %68 = load i32, ptr %67, align 4, !tbaa !13
  %69 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv61) #6
  %70 = getelementptr inbounds i8, ptr %69, i64 8
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %72 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv61) #6
  %73 = getelementptr inbounds i8, ptr %72, i64 8
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = invoke noundef i64 @_ZN11LazySegTreeILi131072EE4qsumEiiiii(ptr noundef nonnull align 8 dereferenceable(4194304) %3, i32 noundef %71, i32 noundef %74, i32 noundef 1, i32 noundef 0, i32 noundef 131071)
          to label %76 unwind label %.loopexit

76:                                               ; preds = %65
  %77 = sext i32 %68 to i64
  %78 = mul nsw i64 %75, %77
  %79 = add nsw i64 %78, %.12948
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %80 = call noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  %81 = icmp ugt i64 %80, %indvars.iv.next62
  br i1 %81, label %.lr.ph50, label %.critedge2.loopexit, !llvm.loop !16

.critedge2.loopexit:                              ; preds = %.lr.ph50, %76
  %.129.lcssa.ph = phi i64 [ %79, %76 ], [ %.12948, %.lr.ph50 ]
  %.127.lcssa.ph.in = phi i64 [ %indvars.iv.next62, %76 ], [ %indvars.iv61, %.lr.ph50 ]
  %.127.lcssa.ph = trunc i64 %.127.lcssa.ph.in to i32
  br label %.critedge2

.critedge2:                                       ; preds = %.critedge2.loopexit, %.critedge
  %.129.lcssa = phi i64 [ %.02856, %.critedge ], [ %.129.lcssa.ph, %.critedge2.loopexit ]
  %.127.lcssa = phi i32 [ %.02657, %.critedge ], [ %.127.lcssa.ph, %.critedge2.loopexit ]
  %82 = add nuw nsw i32 %.059, 1
  %exitcond.not = icmp eq i32 %82, 131072
  br i1 %exitcond.not, label %41, label %.preheader, !llvm.loop !17

83:                                               ; preds = %.loopexit, %.loopexit.split-lp, %42, %34
  %.pn.pn = phi { ptr, i32 } [ %.pn, %34 ], [ %43, %42 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn.pn
}

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

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

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

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

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

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; 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(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiS1_IiiEESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt4pairIiS0_IiiEESaIS2_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(12) ptr @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN11LazySegTreeILi131072EE4qsumEiiiii(ptr noundef nonnull align 8 dereferenceable(4194304), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiS0_IiiEESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


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