; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2011-12/Dec/11 Dec G2.ll (Z4testx)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<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" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@ans = external dso_local global i64, align 8
@edge = external dso_local global [1000001 x %"class.std::vector"], align 16
@cur = external dso_local global %"class.std::vector", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6getpari(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5uniteiix(i32 noundef, i32 noundef, i64 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4testx(i64 noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i64 %0, ptr %2, align 8, !tbaa !5
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %14 = load i64, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @edge, i64 0, i64 %14
  store ptr %15, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %16 = load ptr, ptr %3, align 8, !tbaa !9
  %17 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #6
  %18 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %17, ptr %18, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %19 = load ptr, ptr %3, align 8, !tbaa !9
  %20 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %19) #6
  %21 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %20, ptr %21, align 8
  br label %22

22:                                               ; preds = %50, %1
  %23 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  br i1 %23, label %25, label %24

24:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %52

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %26 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %26, i64 8, i1 false)
  %27 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = call noundef i32 @_Z6getpari(i32 noundef %28)
  %30 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !14
  %32 = call noundef i32 @_Z6getpari(i32 noundef %31)
  %33 = icmp ne i32 %29, %32
  br i1 %33, label %34, label %49

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %35 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %36 = load i32, ptr %35, align 4, !tbaa !11
  %37 = call noundef i32 @_Z6getpari(i32 noundef %36)
  store i32 %37, ptr %8, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %38 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %39 = load i32, ptr %38, align 4, !tbaa !14
  %40 = call noundef i32 @_Z6getpari(i32 noundef %39)
  store i32 %40, ptr %9, align 4, !tbaa !15
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %42 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %43 = load i32, ptr %42, align 4, !tbaa !11
  %44 = call noundef i32 @_Z6getpari(i32 noundef %43)
  store i32 %44, ptr %10, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %45 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !14
  %47 = call noundef i32 @_Z6getpari(i32 noundef %46)
  store i32 %47, ptr %11, align 4, !tbaa !15
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS3_S4_EEEbE4typeELb1EEERKiS8_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %48)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @cur, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %49

49:                                               ; preds = %34, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %50

50:                                               ; preds = %49
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  br label %22

52:                                               ; preds = %24
  %53 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #6
  %54 = icmp eq i64 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  br label %181

56:                                               ; preds = %52
  %57 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #6
  %58 = icmp eq i64 %57, 1
  br i1 %58, label %59, label %67

59:                                               ; preds = %56
  %60 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %61 = getelementptr inbounds %"struct.std::pair", ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 4, !tbaa !11
  %63 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %64 = getelementptr inbounds %"struct.std::pair", ptr %63, i32 0, i32 1
  %65 = load i32, ptr %64, align 4, !tbaa !14
  %66 = load i64, ptr %2, align 8, !tbaa !5
  call void @_Z5uniteiix(i32 noundef %62, i32 noundef %65, i64 noundef %66)
  br label %181

67:                                               ; preds = %56
  %68 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #6
  %69 = icmp eq i64 %68, 2
  br i1 %69, label %70, label %93

70:                                               ; preds = %67
  %71 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %72 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %73 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %71, ptr noundef nonnull align 4 dereferenceable(8) %72)
  br i1 %73, label %74, label %78

74:                                               ; preds = %70
  %75 = load i64, ptr @ans, align 8, !tbaa !5
  %76 = mul nsw i64 %75, 2
  %77 = srem i64 %76, 1000000007
  store i64 %77, ptr @ans, align 8, !tbaa !5
  br label %78

78:                                               ; preds = %74, %70
  %79 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %80 = getelementptr inbounds %"struct.std::pair", ptr %79, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !11
  %82 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %83 = getelementptr inbounds %"struct.std::pair", ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 4, !tbaa !14
  %85 = load i64, ptr %2, align 8, !tbaa !5
  call void @_Z5uniteiix(i32 noundef %81, i32 noundef %84, i64 noundef %85)
  %86 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %87 = getelementptr inbounds %"struct.std::pair", ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 4, !tbaa !11
  %89 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %90 = getelementptr inbounds %"struct.std::pair", ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !14
  %92 = load i64, ptr %2, align 8, !tbaa !5
  call void @_Z5uniteiix(i32 noundef %88, i32 noundef %91, i64 noundef %92)
  br label %181

93:                                               ; preds = %67
  %94 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %95 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %96 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %94, ptr noundef nonnull align 4 dereferenceable(8) %95)
  br i1 %96, label %97, label %105

97:                                               ; preds = %93
  %98 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %99 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #6
  %100 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %98, ptr noundef nonnull align 4 dereferenceable(8) %99)
  br i1 %100, label %101, label %105

101:                                              ; preds = %97
  %102 = load i64, ptr @ans, align 8, !tbaa !5
  %103 = mul nsw i64 %102, 3
  %104 = srem i64 %103, 1000000007
  store i64 %104, ptr @ans, align 8, !tbaa !5
  br label %159

105:                                              ; preds = %97, %93
  %106 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %107 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %108 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %106, ptr noundef nonnull align 4 dereferenceable(8) %107)
  br i1 %108, label %117, label %109

109:                                              ; preds = %105
  %110 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %111 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #6
  %112 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %110, ptr noundef nonnull align 4 dereferenceable(8) %111)
  br i1 %112, label %117, label %113

113:                                              ; preds = %109
  %114 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %115 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #6
  %116 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %114, ptr noundef nonnull align 4 dereferenceable(8) %115)
  br i1 %116, label %117, label %121

117:                                              ; preds = %113, %109, %105
  %118 = load i64, ptr @ans, align 8, !tbaa !5
  %119 = mul nsw i64 %118, 2
  %120 = srem i64 %119, 1000000007
  store i64 %120, ptr @ans, align 8, !tbaa !5
  br label %158

121:                                              ; preds = %113
  %122 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #6
  %123 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %122, ptr %123, align 8
  %124 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #6
  %125 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %124, ptr %125, align 8
  %126 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8
  %128 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %127, ptr %129)
  %130 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %131 = getelementptr inbounds %"struct.std::pair", ptr %130, i32 0, i32 0
  %132 = load i32, ptr %131, align 4, !tbaa !11
  %133 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %134 = getelementptr inbounds %"struct.std::pair", ptr %133, i32 0, i32 0
  %135 = load i32, ptr %134, align 4, !tbaa !11
  %136 = icmp eq i32 %132, %135
  br i1 %136, label %137, label %157

137:                                              ; preds = %121
  %138 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %139 = getelementptr inbounds %"struct.std::pair", ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !14
  %141 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #6
  %142 = getelementptr inbounds %"struct.std::pair", ptr %141, i32 0, i32 1
  %143 = load i32, ptr %142, align 4, !tbaa !14
  %144 = icmp eq i32 %140, %143
  br i1 %144, label %145, label %157

145:                                              ; preds = %137
  %146 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %147 = getelementptr inbounds %"struct.std::pair", ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 4, !tbaa !14
  %149 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #6
  %150 = getelementptr inbounds %"struct.std::pair", ptr %149, i32 0, i32 0
  %151 = load i32, ptr %150, align 4, !tbaa !11
  %152 = icmp eq i32 %148, %151
  br i1 %152, label %153, label %157

153:                                              ; preds = %145
  %154 = load i64, ptr @ans, align 8, !tbaa !5
  %155 = mul nsw i64 %154, 3
  %156 = srem i64 %155, 1000000007
  store i64 %156, ptr @ans, align 8, !tbaa !5
  br label %157

157:                                              ; preds = %153, %145, %137, %121
  br label %158

158:                                              ; preds = %157, %117
  br label %159

159:                                              ; preds = %158, %101
  %160 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %161 = getelementptr inbounds %"struct.std::pair", ptr %160, i32 0, i32 0
  %162 = load i32, ptr %161, align 4, !tbaa !11
  %163 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #6
  %164 = getelementptr inbounds %"struct.std::pair", ptr %163, i32 0, i32 1
  %165 = load i32, ptr %164, align 4, !tbaa !14
  %166 = load i64, ptr %2, align 8, !tbaa !5
  call void @_Z5uniteiix(i32 noundef %162, i32 noundef %165, i64 noundef %166)
  %167 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %168 = getelementptr inbounds %"struct.std::pair", ptr %167, i32 0, i32 0
  %169 = load i32, ptr %168, align 4, !tbaa !11
  %170 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #6
  %171 = getelementptr inbounds %"struct.std::pair", ptr %170, i32 0, i32 1
  %172 = load i32, ptr %171, align 4, !tbaa !14
  %173 = load i64, ptr %2, align 8, !tbaa !5
  call void @_Z5uniteiix(i32 noundef %169, i32 noundef %172, i64 noundef %173)
  %174 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #6
  %175 = getelementptr inbounds %"struct.std::pair", ptr %174, i32 0, i32 0
  %176 = load i32, ptr %175, align 4, !tbaa !11
  %177 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #6
  %178 = getelementptr inbounds %"struct.std::pair", ptr %177, i32 0, i32 1
  %179 = load i32, ptr %178, align 4, !tbaa !14
  %180 = load i64, ptr %2, align 8, !tbaa !5
  call void @_Z5uniteiix(i32 noundef %176, i32 noundef %179, i64 noundef %180)
  br label %181

181:                                              ; preds = %159, %78, %59, %55
  ret void
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(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(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 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 @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

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

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

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

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

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

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

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

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

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 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long long", !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, !13, i64 0}
!12 = !{!"_ZTSSt4pairIiiE", !13, i64 0, !13, i64 4}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = !{!13, !13, i64 0}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<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" = type { ptr }
%"struct.std::pair" = type { i32, i32 }

@ans = external dso_local local_unnamed_addr global i64, align 8
@edge = external dso_local global [1000001 x %"class.std::vector"], align 16
@cur = external dso_local global %"class.std::vector", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6getpari(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5uniteiix(i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4testx(i64 noundef %0) local_unnamed_addr #0 {
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  tail call void @_ZNSt6vectorISt4pairIiiESaIS1_EE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #5
  %9 = getelementptr inbounds [1000001 x %"class.std::vector"], ptr @edge, i64 0, i64 %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %10 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  store ptr %10, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %11 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  store ptr %11, ptr %3, align 8
  %12 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %12, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %25, %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %13 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #5
  %14 = icmp eq i64 %13, 0
  br i1 %14, label %108, label %28

.lr.ph:                                           ; preds = %1, %25
  %15 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %.sroa.02.0.copyload = load i32, ptr %15, align 4
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 4
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4
  %16 = call noundef i32 @_Z6getpari(i32 noundef %.sroa.02.0.copyload)
  %17 = call noundef i32 @_Z6getpari(i32 noundef %.sroa.6.0.copyload)
  %.not = icmp eq i32 %16, %17
  br i1 %.not, label %25, label %18

18:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %19 = call noundef i32 @_Z6getpari(i32 noundef %.sroa.02.0.copyload)
  store i32 %19, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %20 = call noundef i32 @_Z6getpari(i32 noundef %.sroa.6.0.copyload)
  store i32 %20, ptr %6, align 4, !tbaa !5
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %22 = call noundef i32 @_Z6getpari(i32 noundef %.sroa.02.0.copyload)
  store i32 %22, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %23 = call noundef i32 @_Z6getpari(i32 noundef %.sroa.6.0.copyload)
  store i32 %23, ptr %8, align 4, !tbaa !5
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXaaclsr5_PCCPE18_ConstructiblePairIT_T0_EEclsr5_PCCPE26_ImplicitlyConvertiblePairIS3_S4_EEEbE4typeELb1EEERKiS8_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %24)
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @cur, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %25

25:                                               ; preds = %18, %.lr.ph
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #5
  %27 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #5
  br i1 %27, label %.lr.ph, label %._crit_edge

28:                                               ; preds = %._crit_edge
  %29 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #5
  %30 = icmp eq i64 %29, 1
  br i1 %30, label %.sink.split15, label %31

31:                                               ; preds = %28
  %32 = call noundef i64 @_ZNKSt6vectorISt4pairIiiESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #5
  %33 = icmp eq i64 %32, 2
  %34 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #5
  %35 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #5
  %36 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %34, ptr noundef nonnull align 4 dereferenceable(8) %35)
  br i1 %33, label %37, label %42

37:                                               ; preds = %31
  br i1 %36, label %38, label %.sink.split15.sink.split

38:                                               ; preds = %37
  %39 = load i64, ptr @ans, align 8, !tbaa !9
  %40 = shl nsw i64 %39, 1
  %41 = srem i64 %40, 1000000007
  store i64 %41, ptr @ans, align 8, !tbaa !9
  br label %.sink.split15.sink.split

42:                                               ; preds = %31
  br i1 %36, label %43, label %50

43:                                               ; preds = %42
  %44 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #5
  %45 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #5
  %46 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %44, ptr noundef nonnull align 4 dereferenceable(8) %45)
  br i1 %46, label %47, label %50

47:                                               ; preds = %43
  %48 = load i64, ptr @ans, align 8, !tbaa !9
  %49 = mul nsw i64 %48, 3
  br label %.sink.split

50:                                               ; preds = %43, %42
  %51 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #5
  %52 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #5
  %53 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %51, ptr noundef nonnull align 4 dereferenceable(8) %52)
  br i1 %53, label %62, label %54

54:                                               ; preds = %50
  %55 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #5
  %56 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #5
  %57 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %55, ptr noundef nonnull align 4 dereferenceable(8) %56)
  br i1 %57, label %62, label %58

58:                                               ; preds = %54
  %59 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #5
  %60 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #5
  %61 = call noundef zeroext i1 @_ZSteqIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %59, ptr noundef nonnull align 4 dereferenceable(8) %60)
  br i1 %61, label %62, label %65

62:                                               ; preds = %58, %54, %50
  %63 = load i64, ptr @ans, align 8, !tbaa !9
  %64 = shl nsw i64 %63, 1
  br label %.sink.split

65:                                               ; preds = %58
  %66 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #5
  %67 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #5
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %66, ptr %67)
  %68 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #5
  %69 = load i32, ptr %68, align 4, !tbaa !11
  %70 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #5
  %71 = load i32, ptr %70, align 4, !tbaa !11
  %72 = icmp eq i32 %69, %71
  br i1 %72, label %73, label %92

73:                                               ; preds = %65
  %74 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 1) #5
  %75 = getelementptr inbounds i8, ptr %74, i64 4
  %76 = load i32, ptr %75, align 4, !tbaa !13
  %77 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #5
  %78 = getelementptr inbounds i8, ptr %77, i64 4
  %79 = load i32, ptr %78, align 4, !tbaa !13
  %80 = icmp eq i32 %76, %79
  br i1 %80, label %81, label %92

81:                                               ; preds = %73
  %82 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #5
  %83 = getelementptr inbounds i8, ptr %82, i64 4
  %84 = load i32, ptr %83, align 4, !tbaa !13
  %85 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 2) #5
  %86 = load i32, ptr %85, align 4, !tbaa !11
  %87 = icmp eq i32 %84, %86
  br i1 %87, label %88, label %92

88:                                               ; preds = %81
  %89 = load i64, ptr @ans, align 8, !tbaa !9
  %90 = mul nsw i64 %89, 3
  br label %.sink.split

.sink.split:                                      ; preds = %47, %88, %62
  %.sink14 = phi i64 [ %64, %62 ], [ %90, %88 ], [ %49, %47 ]
  %91 = srem i64 %.sink14, 1000000007
  store i64 %91, ptr @ans, align 8, !tbaa !9
  br label %92

92:                                               ; preds = %.sink.split, %81, %73, %65
  %93 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #5
  %94 = load i32, ptr %93, align 4, !tbaa !11
  %95 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef 0) #5
  %96 = getelementptr inbounds i8, ptr %95, i64 4
  %97 = load i32, ptr %96, align 4, !tbaa !13
  call void @_Z5uniteiix(i32 noundef %94, i32 noundef %97, i64 noundef %0)
  br label %.sink.split15.sink.split

.sink.split15.sink.split:                         ; preds = %37, %38, %92
  %.sink27 = phi i64 [ 1, %92 ], [ 0, %38 ], [ 0, %37 ]
  %.sink.ph = phi i64 [ 2, %92 ], [ 1, %38 ], [ 1, %37 ]
  %98 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef %.sink27) #5
  %99 = load i32, ptr %98, align 4, !tbaa !11
  %100 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef %.sink27) #5
  %101 = getelementptr inbounds i8, ptr %100, i64 4
  %102 = load i32, ptr %101, align 4, !tbaa !13
  call void @_Z5uniteiix(i32 noundef %99, i32 noundef %102, i64 noundef %0)
  br label %.sink.split15

.sink.split15:                                    ; preds = %.sink.split15.sink.split, %28
  %.sink = phi i64 [ 0, %28 ], [ %.sink.ph, %.sink.split15.sink.split ]
  %103 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef %.sink) #5
  %104 = load i32, ptr %103, align 4, !tbaa !11
  %105 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cur, i64 noundef %.sink) #5
  %106 = getelementptr inbounds i8, ptr %105, i64 4
  %107 = load i32, ptr %106, align 4, !tbaa !13
  call void @_Z5uniteiix(i32 noundef %104, i32 noundef %107, i64 noundef %0)
  br label %108

108:                                              ; preds = %.sink.split15, %._crit_edge
  ret void
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(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(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

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

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

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

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

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

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

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

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 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}


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