; LLVM IR from tangjz/acm-icpc :: self_training/2017-01-14 (C)

; 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<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Segment = type { i32, i32, i32, i32 }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>, std::allocator<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>, std::allocator<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>, std::allocator<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>, std::allocator<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, %"class.__gnu_cxx::__normal_iterator" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@tot = external dso_local global i32, align 4
@que = external dso_local global [100001 x i32], align 16
@e = external dso_local global [100001 x %"class.std::vector"], align 16
@sz = external dso_local global i32, align 4
@seq = external dso_local global [100001 x i32], align 16
@in = external dso_local global [100001 x i32], align 16
@out = external dso_local global [100001 x i32], align 16
@seg_tot = external dso_local global i32, align 4
@root = external dso_local global [100001 x i32], align 16
@seg = external dso_local global [1800019 x %struct.Segment], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateRiiii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7mod_invi(i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"class.std::stack", align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %struct.Segment, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %35

35:                                               ; preds = %390, %0
  %36 = load i32, ptr @t, align 4, !tbaa !5
  %37 = add nsw i32 %36, -1
  store i32 %37, ptr @t, align 4, !tbaa !5
  %38 = icmp ne i32 %36, 0
  br i1 %38, label %39, label %393

39:                                               ; preds = %35
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %50, %39
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = icmp sle i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %53

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #9
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #9
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %48
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %49) #9
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #9
  br label %50

50:                                               ; preds = %46
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %2, align 4, !tbaa !5
  br label %41, !llvm.loop !9

53:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  store i32 2, ptr %4, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %64, %53
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  br label %67

59:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  %60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %62
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %63, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %64

64:                                               ; preds = %59
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %4, align 4, !tbaa !5
  br label %54, !llvm.loop !11

67:                                               ; preds = %58
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %86, %67
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = icmp sle i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %89

73:                                               ; preds = %68
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i32, ptr @a, i64 %75
  %77 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %76)
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = load i32, ptr @tot, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr @tot, align 4, !tbaa !5
  %84 = sext i32 %82 to i64
  %85 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %84
  store i32 %81, ptr %85, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %73
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %6, align 4, !tbaa !5
  br label %68, !llvm.loop !12

89:                                               ; preds = %72
  %90 = load i32, ptr @tot, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i32, ptr @que, i64 %91
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %92)
  %93 = load i32, ptr @tot, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds i32, ptr @que, i64 %94
  %96 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %95)
  %97 = ptrtoint ptr %96 to i64
  %98 = sub i64 %97, ptrtoint (ptr @que to i64)
  %99 = sdiv exact i64 %98, 4
  %100 = trunc i64 %99 to i32
  store i32 %100, ptr @tot, align 4, !tbaa !5
  store i32 0, ptr @sz, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %7) #9
  call void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEEC2ISB_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  %101 = load i32, ptr @sz, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr @sz, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %103
  store i32 1, ptr %104, align 4, !tbaa !5
  %105 = load i32, ptr @sz, align 4, !tbaa !5
  store i32 %105, ptr getelementptr inbounds ([100001 x i32], ptr @in, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %106 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([100001 x %"class.std::vector"], ptr @e, i64 0, i64 1)) #9
  %107 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %106, ptr %107, align 8
  %108 = invoke { i32, ptr } @_ZSt9make_pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %109 unwind label %161

109:                                              ; preds = %89
  %110 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 0
  %111 = extractvalue { i32, ptr } %108, 0
  store i32 %111, ptr %110, align 8
  %112 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 1
  %113 = extractvalue { i32, ptr } %108, 1
  store ptr %113, ptr %112, align 8
  invoke void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE4pushEOS8_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %114 unwind label %161

114:                                              ; preds = %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #9
  br label %115

115:                                              ; preds = %188, %114
  %116 = invoke noundef zeroext i1 @_ZNKSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %117 unwind label %165

117:                                              ; preds = %115
  %118 = xor i1 %116, true
  br i1 %118, label %119, label %191

119:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %120 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %121 unwind label %169

121:                                              ; preds = %119
  store ptr %120, ptr %13, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %122 = load ptr, ptr %13, align 8, !tbaa !13
  %123 = getelementptr inbounds %"struct.std::pair", ptr %122, i32 0, i32 0
  store ptr %123, ptr %14, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %124 = load ptr, ptr %13, align 8, !tbaa !13
  %125 = getelementptr inbounds %"struct.std::pair", ptr %124, i32 0, i32 1
  store ptr %125, ptr %15, align 8, !tbaa !13
  %126 = load ptr, ptr %15, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %127 = load ptr, ptr %14, align 8, !tbaa !13
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %129
  %131 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %130) #9
  %132 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %131, ptr %132, align 8
  %133 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef nonnull align 8 dereferenceable(8) %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  br i1 %133, label %134, label %177

134:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #9
  %135 = load ptr, ptr %15, align 8, !tbaa !13
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %135) #9
  %137 = load i32, ptr %136, align 4, !tbaa !5
  store i32 %137, ptr %17, align 4, !tbaa !5
  %138 = load ptr, ptr %15, align 8, !tbaa !13
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %138) #9
  %140 = load i32, ptr %17, align 4, !tbaa !5
  %141 = load i32, ptr @sz, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr @sz, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %143
  store i32 %140, ptr %144, align 4, !tbaa !5
  %145 = load i32, ptr @sz, align 4, !tbaa !5
  %146 = load i32, ptr %17, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100001 x i32], ptr @in, i64 0, i64 %147
  store i32 %145, ptr %148, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %149 = load i32, ptr %17, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %150
  %152 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %151) #9
  %153 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %152, ptr %153, align 8
  %154 = invoke { i32, ptr } @_ZSt9make_pairIRiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS9_INSA_IT0_E4typeEE6__typeEEOSB_OSG_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 8 dereferenceable(8) %19)
          to label %155 unwind label %173

155:                                              ; preds = %134
  %156 = getelementptr inbounds { i32, ptr }, ptr %18, i32 0, i32 0
  %157 = extractvalue { i32, ptr } %154, 0
  store i32 %157, ptr %156, align 8
  %158 = getelementptr inbounds { i32, ptr }, ptr %18, i32 0, i32 1
  %159 = extractvalue { i32, ptr } %154, 1
  store ptr %159, ptr %158, align 8
  invoke void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE4pushEOS8_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %160 unwind label %173

160:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  br label %188

161:                                              ; preds = %109, %89
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %11, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #9
  br label %201

165:                                              ; preds = %115
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %11, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %12, align 4
  br label %201

169:                                              ; preds = %119
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %11, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %12, align 4
  br label %190

173:                                              ; preds = %155, %134
  %174 = landingpad { ptr, i32 }
          cleanup
  %175 = extractvalue { ptr, i32 } %174, 0
  store ptr %175, ptr %11, align 8
  %176 = extractvalue { ptr, i32 } %174, 1
  store i32 %176, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #9
  br label %189

177:                                              ; preds = %121
  %178 = load i32, ptr @sz, align 4, !tbaa !5
  %179 = load ptr, ptr %14, align 8, !tbaa !13
  %180 = load i32, ptr %179, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [100001 x i32], ptr @out, i64 0, i64 %181
  store i32 %178, ptr %182, align 4, !tbaa !5
  invoke void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %183 unwind label %184

183:                                              ; preds = %177
  br label %188

184:                                              ; preds = %177
  %185 = landingpad { ptr, i32 }
          cleanup
  %186 = extractvalue { ptr, i32 } %185, 0
  store ptr %186, ptr %11, align 8
  %187 = extractvalue { ptr, i32 } %185, 1
  store i32 %187, ptr %12, align 4
  br label %189

188:                                              ; preds = %183, %160
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  br label %115, !llvm.loop !15

189:                                              ; preds = %184, %173
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  br label %190

190:                                              ; preds = %189, %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  br label %201

191:                                              ; preds = %117
  call void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #9
  store i32 0, ptr @seg_tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #9
  %192 = getelementptr inbounds %struct.Segment, ptr %20, i32 0, i32 0
  store i32 0, ptr %192, align 4, !tbaa !16
  %193 = getelementptr inbounds %struct.Segment, ptr %20, i32 0, i32 1
  store i32 0, ptr %193, align 4, !tbaa !18
  %194 = getelementptr inbounds %struct.Segment, ptr %20, i32 0, i32 2
  store i32 0, ptr %194, align 4, !tbaa !19
  %195 = getelementptr inbounds %struct.Segment, ptr %20, i32 0, i32 3
  store i32 1, ptr %195, align 4, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @seg, ptr align 4 %20, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #9
  store i32 1, ptr %21, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %230, %191
  %197 = load i32, ptr %21, align 4, !tbaa !5
  %198 = load i32, ptr @n, align 4, !tbaa !5
  %199 = icmp sle i32 %197, %198
  br i1 %199, label %202, label %200

200:                                              ; preds = %196
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #9
  br label %233

201:                                              ; preds = %190, %165, %161
  call void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #9
  br label %394

202:                                              ; preds = %196
  %203 = load i32, ptr %21, align 4, !tbaa !5
  %204 = sub nsw i32 %203, 1
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [100001 x i32], ptr @root, i64 0, i64 %205
  %207 = load i32, ptr %206, align 4, !tbaa !5
  %208 = load i32, ptr %21, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [100001 x i32], ptr @root, i64 0, i64 %209
  store i32 %207, ptr %210, align 4, !tbaa !5
  %211 = load i32, ptr %21, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [100001 x i32], ptr @root, i64 0, i64 %212
  %214 = load i32, ptr @tot, align 4, !tbaa !5
  %215 = sub nsw i32 %214, 1
  %216 = load i32, ptr @tot, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds i32, ptr @que, i64 %217
  %219 = load i32, ptr %21, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %223
  %225 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %218, ptr noundef nonnull align 4 dereferenceable(4) %224)
  %226 = ptrtoint ptr %225 to i64
  %227 = sub i64 %226, ptrtoint (ptr @que to i64)
  %228 = sdiv exact i64 %227, 4
  %229 = trunc i64 %228 to i32
  call void @_Z6updateRiiii(ptr noundef nonnull align 4 dereferenceable(4) %213, i32 noundef 0, i32 noundef %215, i32 noundef %229)
  br label %230

230:                                              ; preds = %202
  %231 = load i32, ptr %21, align 4, !tbaa !5
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %21, align 4, !tbaa !5
  br label %196, !llvm.loop !22

233:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #9
  store i32 0, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #9
  store i32 1, ptr %23, align 4, !tbaa !5
  br label %234

234:                                              ; preds = %387, %233
  %235 = load i32, ptr %23, align 4, !tbaa !5
  %236 = load i32, ptr @n, align 4, !tbaa !5
  %237 = icmp sle i32 %235, %236
  br i1 %237, label %239, label %238

238:                                              ; preds = %234
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #9
  br label %390

239:                                              ; preds = %234
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #9
  %240 = load i32, ptr %23, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [100001 x i32], ptr @in, i64 0, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !5
  %244 = sub nsw i32 %243, 1
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [100001 x i32], ptr @root, i64 0, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !5
  store i32 %247, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #9
  %248 = load i32, ptr %23, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [100001 x i32], ptr @out, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [100001 x i32], ptr @root, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  store i32 %254, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #9
  store i32 0, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #9
  %255 = load i32, ptr @tot, align 4, !tbaa !5
  %256 = sub nsw i32 %255, 1
  store i32 %256, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #9
  %257 = load i32, ptr %23, align 4, !tbaa !5
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [100001 x i32], ptr @out, i64 0, i64 %258
  %260 = load i32, ptr %259, align 4, !tbaa !5
  %261 = load i32, ptr %23, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [100001 x i32], ptr @in, i64 0, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !5
  %265 = sub nsw i32 %260, %264
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %29, align 4, !tbaa !5
  %267 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @m, ptr noundef nonnull align 4 dereferenceable(4) %29)
  %268 = load i32, ptr %267, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #9
  store i32 %268, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #9
  store i32 1, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #9
  store i32 1, ptr %31, align 4, !tbaa !5
  br label %269

269:                                              ; preds = %358, %239
  %270 = load i32, ptr %26, align 4, !tbaa !5
  %271 = load i32, ptr %27, align 4, !tbaa !5
  %272 = icmp slt i32 %270, %271
  br i1 %272, label %273, label %359

273:                                              ; preds = %269
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #9
  %274 = load i32, ptr %26, align 4, !tbaa !5
  %275 = load i32, ptr %27, align 4, !tbaa !5
  %276 = add nsw i32 %274, %275
  %277 = ashr i32 %276, 1
  store i32 %277, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #9
  %278 = load i32, ptr %25, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %279
  %281 = getelementptr inbounds %struct.Segment, ptr %280, i32 0, i32 1
  %282 = load i32, ptr %281, align 4, !tbaa !18
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %283
  %285 = getelementptr inbounds %struct.Segment, ptr %284, i32 0, i32 2
  %286 = load i32, ptr %285, align 8, !tbaa !19
  %287 = load i32, ptr %24, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %288
  %290 = getelementptr inbounds %struct.Segment, ptr %289, i32 0, i32 1
  %291 = load i32, ptr %290, align 4, !tbaa !18
  %292 = sext i32 %291 to i64
  %293 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %292
  %294 = getelementptr inbounds %struct.Segment, ptr %293, i32 0, i32 2
  %295 = load i32, ptr %294, align 8, !tbaa !19
  %296 = sub nsw i32 %286, %295
  store i32 %296, ptr %33, align 4, !tbaa !5
  %297 = load i32, ptr %33, align 4, !tbaa !5
  %298 = load i32, ptr %28, align 4, !tbaa !5
  %299 = icmp slt i32 %297, %298
  br i1 %299, label %300, label %345

300:                                              ; preds = %273
  %301 = load i32, ptr %30, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = load i32, ptr %25, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %304
  %306 = getelementptr inbounds %struct.Segment, ptr %305, i32 0, i32 1
  %307 = load i32, ptr %306, align 4, !tbaa !18
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %308
  %310 = getelementptr inbounds %struct.Segment, ptr %309, i32 0, i32 3
  %311 = load i32, ptr %310, align 4, !tbaa !20
  %312 = sext i32 %311 to i64
  %313 = mul nsw i64 %302, %312
  %314 = srem i64 %313, 1000000007
  %315 = trunc i64 %314 to i32
  store i32 %315, ptr %30, align 4, !tbaa !5
  %316 = load i32, ptr %31, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = load i32, ptr %24, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %319
  %321 = getelementptr inbounds %struct.Segment, ptr %320, i32 0, i32 1
  %322 = load i32, ptr %321, align 4, !tbaa !18
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %323
  %325 = getelementptr inbounds %struct.Segment, ptr %324, i32 0, i32 3
  %326 = load i32, ptr %325, align 4, !tbaa !20
  %327 = sext i32 %326 to i64
  %328 = mul nsw i64 %317, %327
  %329 = srem i64 %328, 1000000007
  %330 = trunc i64 %329 to i32
  store i32 %330, ptr %31, align 4, !tbaa !5
  %331 = load i32, ptr %33, align 4, !tbaa !5
  %332 = load i32, ptr %28, align 4, !tbaa !5
  %333 = sub nsw i32 %332, %331
  store i32 %333, ptr %28, align 4, !tbaa !5
  %334 = load i32, ptr %24, align 4, !tbaa !5
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %335
  %337 = getelementptr inbounds %struct.Segment, ptr %336, i32 0, i32 0
  %338 = load i32, ptr %337, align 16, !tbaa !16
  store i32 %338, ptr %24, align 4, !tbaa !5
  %339 = load i32, ptr %25, align 4, !tbaa !5
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %340
  %342 = getelementptr inbounds %struct.Segment, ptr %341, i32 0, i32 0
  %343 = load i32, ptr %342, align 16, !tbaa !16
  store i32 %343, ptr %25, align 4, !tbaa !5
  %344 = load i32, ptr %32, align 4, !tbaa !5
  store i32 %344, ptr %27, align 4, !tbaa !5
  br label %358

345:                                              ; preds = %273
  %346 = load i32, ptr %24, align 4, !tbaa !5
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %347
  %349 = getelementptr inbounds %struct.Segment, ptr %348, i32 0, i32 1
  %350 = load i32, ptr %349, align 4, !tbaa !18
  store i32 %350, ptr %24, align 4, !tbaa !5
  %351 = load i32, ptr %25, align 4, !tbaa !5
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %352
  %354 = getelementptr inbounds %struct.Segment, ptr %353, i32 0, i32 1
  %355 = load i32, ptr %354, align 4, !tbaa !18
  store i32 %355, ptr %25, align 4, !tbaa !5
  %356 = load i32, ptr %32, align 4, !tbaa !5
  %357 = add nsw i32 %356, 1
  store i32 %357, ptr %26, align 4, !tbaa !5
  br label %358

358:                                              ; preds = %345, %300
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #9
  br label %269, !llvm.loop !23

359:                                              ; preds = %269
  %360 = load i32, ptr %28, align 4, !tbaa !5
  %361 = icmp ne i32 %360, 0
  br i1 %361, label %362, label %375

362:                                              ; preds = %359
  %363 = load i32, ptr %30, align 4, !tbaa !5
  %364 = sext i32 %363 to i64
  %365 = load i32, ptr %26, align 4, !tbaa !5
  %366 = sext i32 %365 to i64
  %367 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %366
  %368 = load i32, ptr %367, align 4, !tbaa !5
  %369 = load i32, ptr %28, align 4, !tbaa !5
  %370 = call noundef i32 @_Z7mod_powii(i32 noundef %368, i32 noundef %369)
  %371 = sext i32 %370 to i64
  %372 = mul nsw i64 %364, %371
  %373 = srem i64 %372, 1000000007
  %374 = trunc i64 %373 to i32
  store i32 %374, ptr %30, align 4, !tbaa !5
  br label %375

375:                                              ; preds = %362, %359
  %376 = load i32, ptr %22, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = load i32, ptr %30, align 4, !tbaa !5
  %379 = sext i32 %378 to i64
  %380 = load i32, ptr %31, align 4, !tbaa !5
  %381 = call noundef i32 @_Z7mod_invi(i32 noundef %380)
  %382 = sext i32 %381 to i64
  %383 = mul nsw i64 %379, %382
  %384 = add nsw i64 %377, %383
  %385 = srem i64 %384, 1000000007
  %386 = trunc i64 %385 to i32
  store i32 %386, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #9
  br label %387

387:                                              ; preds = %375
  %388 = load i32, ptr %23, align 4, !tbaa !5
  %389 = add nsw i32 %388, 1
  store i32 %389, ptr %23, align 4, !tbaa !5
  br label %234, !llvm.loop !24

390:                                              ; preds = %238
  %391 = load i32, ptr %22, align 4, !tbaa !5
  %392 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %391)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #9
  br label %35, !llvm.loop !25

393:                                              ; preds = %35
  ret i32 0

394:                                              ; preds = %201
  %395 = load ptr, ptr %11, align 8
  %396 = load i32, ptr %12, align 4
  %397 = insertvalue { ptr, i32 } poison, ptr %395, 0
  %398 = insertvalue { ptr, i32 } %397, i32 %396, 1
  resume { ptr, i32 } %398
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) #7

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE4pushEOS8_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i32, ptr } @_ZSt9make_pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i32, ptr } @_ZSt9make_pairIRiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS9_INSA_IT0_E4typeEE6__typeEEOSB_OSG_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

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

; 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)) #8

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 #8 = { 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 #9 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTS7Segment", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!18 = !{!17, !6, i64 4}
!19 = !{!17, !6, i64 8}
!20 = !{!17, !6, i64 12}
!21 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Segment = type { i32, i32, i32, i32 }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>, std::allocator<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>, std::allocator<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>, std::allocator<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>, std::allocator<std::pair<int, __gnu_cxx::__normal_iterator<int *, std::vector<int>>>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, %"class.__gnu_cxx::__normal_iterator" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100001 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [100001 x i32], align 16
@e = external dso_local global [100001 x %"class.std::vector"], align 16
@sz = external dso_local local_unnamed_addr global i32, align 4
@seq = external dso_local local_unnamed_addr global [100001 x i32], align 16
@in = external dso_local local_unnamed_addr global [100001 x i32], align 16
@out = external dso_local local_unnamed_addr global [100001 x i32], align 16
@seg_tot = external dso_local local_unnamed_addr global i32, align 4
@root = external dso_local global [100001 x i32], align 16
@seg = external dso_local local_unnamed_addr global [1800019 x %struct.Segment], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateRiiii(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7mod_invi(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::stack", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i32, align 4
  %13 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %14 = load i32, ptr @t, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr @t, align 4, !tbaa !5
  %.not119 = icmp eq i32 %14, 0
  br i1 %.not119, label %._crit_edge122, label %.lr.ph121

.lr.ph121:                                        ; preds = %0
  %16 = getelementptr inbounds i8, ptr %5, i64 8
  %17 = getelementptr inbounds i8, ptr %10, i64 8
  br label %18

18:                                               ; preds = %.lr.ph121, %._crit_edge117
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %.not7582 = icmp slt i32 %20, 1
  br i1 %.not7582, label %._crit_edge87.thread, label %.lr.ph

._crit_edge87.thread:                             ; preds = %18
  store i32 0, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge92

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  store i32 2, ptr %2, align 4, !tbaa !5
  %.not7684 = icmp slt i32 %22, 2
  br i1 %.not7684, label %._crit_edge87, label %.lr.ph86

.lr.ph:                                           ; preds = %18, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %18 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  %21 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %21) #8
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %.not75.not = icmp slt i64 %indvars.iv, %23
  br i1 %.not75.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge87:                                    ; preds = %.lr.ph86, %._crit_edge
  %24 = phi i32 [ %22, %._crit_edge ], [ %31, %.lr.ph86 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  store i32 0, ptr @tot, align 4, !tbaa !5
  %.not7788 = icmp slt i32 %24, 1
  br i1 %.not7788, label %._crit_edge92, label %.lr.ph91

.lr.ph86:                                         ; preds = %._crit_edge, %.lr.ph86
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %27
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %2, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %.not76.not = icmp slt i32 %29, %31
  br i1 %.not76.not, label %.lr.ph86, label %._crit_edge87, !llvm.loop !11

._crit_edge92:                                    ; preds = %.lr.ph91, %._crit_edge87.thread, %._crit_edge87
  %32 = phi i32 [ 0, %._crit_edge87 ], [ 0, %._crit_edge87.thread ], [ %53, %.lr.ph91 ]
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i32, ptr @que, i64 %33
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %34)
  %35 = load i32, ptr @tot, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds i32, ptr @que, i64 %36
  %38 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %37)
  %39 = ptrtoint ptr %38 to i64
  %40 = sub i64 %39, ptrtoint (ptr @que to i64)
  %41 = lshr exact i64 %40, 2
  %42 = trunc i64 %41 to i32
  store i32 %42, ptr @tot, align 4, !tbaa !5
  store i32 0, ptr @sz, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #8
  call void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEEC2ISB_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %43 = load i32, ptr @sz, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr @sz, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %45
  store i32 1, ptr %46, align 4, !tbaa !5
  store i32 %44, ptr getelementptr inbounds (i8, ptr @in, i64 4), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %47 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @e, i64 24)) #8
  store ptr %47, ptr %7, align 8
  %48 = invoke { i32, ptr } @_ZSt9make_pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %58 unwind label %88

.lr.ph91:                                         ; preds = %._crit_edge87, %.lr.ph91
  %indvars.iv124 = phi i64 [ %indvars.iv.next125, %.lr.ph91 ], [ 1, %._crit_edge87 ]
  %49 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv124
  %50 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %49)
  %51 = load i32, ptr %49, align 4, !tbaa !5
  %52 = load i32, ptr @tot, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr @tot, align 4, !tbaa !5
  %54 = sext i32 %52 to i64
  %55 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %54
  store i32 %51, ptr %55, align 4, !tbaa !5
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %.not77.not = icmp slt i64 %indvars.iv124, %57
  br i1 %.not77.not, label %.lr.ph91, label %._crit_edge92, !llvm.loop !12

58:                                               ; preds = %._crit_edge92
  %59 = extractvalue { i32, ptr } %48, 0
  store i32 %59, ptr %5, align 8
  %60 = extractvalue { i32, ptr } %48, 1
  store ptr %60, ptr %16, align 8
  invoke void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE4pushEOS8_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %61 unwind label %88

61:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  %62 = call noundef zeroext i1 @_ZNKSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %62, label %._crit_edge95, label %.lr.ph94

.lr.ph94:                                         ; preds = %61, %97
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %65 = load i32, ptr %63, align 8, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %66
  %68 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %67) #8
  store ptr %68, ptr %8, align 8
  %69 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  br i1 %69, label %70, label %92

70:                                               ; preds = %.lr.ph94
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %64) #8
  %72 = load i32, ptr %71, align 4, !tbaa !5
  store i32 %72, ptr %9, align 4, !tbaa !5
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %64) #8
  %74 = load i32, ptr %9, align 4, !tbaa !5
  %75 = load i32, ptr @sz, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr @sz, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %77
  store i32 %74, ptr %78, align 4, !tbaa !5
  %79 = sext i32 %74 to i64
  %80 = getelementptr inbounds [100001 x i32], ptr @in, i64 0, i64 %79
  store i32 %76, ptr %80, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  %81 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @e, i64 0, i64 %79
  %82 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %81) #8
  store ptr %82, ptr %11, align 8
  %83 = invoke { i32, ptr } @_ZSt9make_pairIRiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS9_INSA_IT0_E4typeEE6__typeEEOSB_OSG_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %84 unwind label %90

84:                                               ; preds = %70
  %85 = extractvalue { i32, ptr } %83, 0
  store i32 %85, ptr %10, align 8
  %86 = extractvalue { i32, ptr } %83, 1
  store ptr %86, ptr %17, align 8
  invoke void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE4pushEOS8_(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %87 unwind label %90

87:                                               ; preds = %84
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  br label %97

88:                                               ; preds = %58, %._crit_edge92
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #8
  br label %100

90:                                               ; preds = %84, %70
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  br label %100

92:                                               ; preds = %.lr.ph94
  %93 = load i32, ptr @sz, align 4, !tbaa !5
  %94 = load i32, ptr %63, align 8, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100001 x i32], ptr @out, i64 0, i64 %95
  store i32 %93, ptr %96, align 4, !tbaa !5
  call void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br label %97

97:                                               ; preds = %92, %87
  %98 = call noundef zeroext i1 @_ZNKSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
  br i1 %98, label %._crit_edge95, label %.lr.ph94, !llvm.loop !13

._crit_edge95:                                    ; preds = %97, %61
  call void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #8
  store i32 0, ptr @seg_tot, align 4, !tbaa !5
  store <4 x i32> <i32 0, i32 0, i32 0, i32 1>, ptr @seg, align 16, !tbaa !5
  %99 = load i32, ptr @n, align 4, !tbaa !5
  %.not7896 = icmp slt i32 %99, 1
  br i1 %.not7896, label %._crit_edge117, label %.lr.ph99

.preheader:                                       ; preds = %.lr.ph99
  %.not79113 = icmp slt i32 %118, 1
  br i1 %.not79113, label %._crit_edge117, label %.lr.ph116

100:                                              ; preds = %90, %88
  %.pn = phi { ptr, i32 } [ %91, %90 ], [ %89, %88 ]
  call void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #8
  resume { ptr, i32 } %.pn

.lr.ph99:                                         ; preds = %._crit_edge95, %.lr.ph99
  %indvars.iv127 = phi i64 [ %indvars.iv.next128, %.lr.ph99 ], [ 1, %._crit_edge95 ]
  %101 = add nsw i64 %indvars.iv127, -1
  %102 = getelementptr inbounds [100001 x i32], ptr @root, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = getelementptr inbounds [100001 x i32], ptr @root, i64 0, i64 %indvars.iv127
  store i32 %103, ptr %104, align 4, !tbaa !5
  %105 = load i32, ptr @tot, align 4, !tbaa !5
  %106 = add nsw i32 %105, -1
  %107 = sext i32 %105 to i64
  %108 = getelementptr inbounds i32, ptr @que, i64 %107
  %109 = getelementptr inbounds [100001 x i32], ptr @seq, i64 0, i64 %indvars.iv127
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %111
  %113 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %108, ptr noundef nonnull align 4 dereferenceable(4) %112)
  %114 = ptrtoint ptr %113 to i64
  %115 = sub i64 %114, ptrtoint (ptr @que to i64)
  %116 = lshr exact i64 %115, 2
  %117 = trunc i64 %116 to i32
  call void @_Z6updateRiiii(ptr noundef nonnull align 4 dereferenceable(4) %104, i32 noundef 0, i32 noundef %106, i32 noundef %117)
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %118 = load i32, ptr @n, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %.not78.not = icmp slt i64 %indvars.iv127, %119
  br i1 %.not78.not, label %.lr.ph99, label %.preheader, !llvm.loop !14

._crit_edge117.loopexit:                          ; preds = %193
  %120 = trunc nsw i64 %199 to i32
  br label %._crit_edge117

._crit_edge117:                                   ; preds = %._crit_edge95, %._crit_edge117.loopexit, %.preheader
  %.070.lcssa = phi i32 [ 0, %.preheader ], [ %120, %._crit_edge117.loopexit ], [ 0, %._crit_edge95 ]
  %121 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.070.lcssa)
  %122 = load i32, ptr @t, align 4, !tbaa !5
  %123 = add nsw i32 %122, -1
  store i32 %123, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %122, 0
  br i1 %.not, label %._crit_edge122, label %18, !llvm.loop !15

.lr.ph116:                                        ; preds = %.preheader, %193
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %193 ], [ 1, %.preheader ]
  %.070114 = phi i64 [ %199, %193 ], [ 0, %.preheader ]
  %124 = getelementptr inbounds [100001 x i32], ptr @in, i64 0, i64 %indvars.iv130
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = add nsw i32 %125, -1
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100001 x i32], ptr @root, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = getelementptr inbounds [100001 x i32], ptr @out, i64 0, i64 %indvars.iv130
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100001 x i32], ptr @root, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = load i32, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #8
  %reass.sub = sub i32 %131, %125
  %136 = add i32 %reass.sub, 1
  store i32 %136, ptr %12, align 4, !tbaa !5
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @m, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %138 = load i32, ptr %137, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #8
  %139 = icmp sgt i32 %135, 1
  br i1 %139, label %.lr.ph108.preheader, label %._crit_edge109

.lr.ph108.preheader:                              ; preds = %.lr.ph116
  %140 = add nsw i32 %135, -1
  br label %.lr.ph108

.lr.ph108:                                        ; preds = %.lr.ph108.preheader, %181
  %.056106 = phi i32 [ %.1, %181 ], [ 1, %.lr.ph108.preheader ]
  %.057105 = phi i32 [ %.158, %181 ], [ 1, %.lr.ph108.preheader ]
  %.059104 = phi i32 [ %.160, %181 ], [ %138, %.lr.ph108.preheader ]
  %.061103 = phi i32 [ %.162, %181 ], [ %140, %.lr.ph108.preheader ]
  %.063102 = phi i32 [ %.164, %181 ], [ 0, %.lr.ph108.preheader ]
  %.065101 = phi i32 [ %.166, %181 ], [ %134, %.lr.ph108.preheader ]
  %.067100 = phi i32 [ %.168, %181 ], [ %129, %.lr.ph108.preheader ]
  %141 = add nuw nsw i32 %.061103, %.063102
  %142 = lshr i32 %141, 1
  %143 = sext i32 %.065101 to i64
  %144 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %143
  %145 = getelementptr inbounds i8, ptr %144, i64 4
  %146 = load i32, ptr %145, align 4, !tbaa !16
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %147
  %149 = getelementptr inbounds i8, ptr %148, i64 8
  %150 = load i32, ptr %149, align 8, !tbaa !18
  %151 = sext i32 %.067100 to i64
  %152 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %151
  %153 = getelementptr inbounds i8, ptr %152, i64 4
  %154 = load i32, ptr %153, align 4, !tbaa !16
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [1800019 x %struct.Segment], ptr @seg, i64 0, i64 %155
  %157 = getelementptr inbounds i8, ptr %156, i64 8
  %158 = load i32, ptr %157, align 8, !tbaa !18
  %159 = sub nsw i32 %150, %158
  %160 = icmp slt i32 %159, %.059104
  br i1 %160, label %161, label %179

161:                                              ; preds = %.lr.ph108
  %162 = sext i32 %.057105 to i64
  %163 = getelementptr inbounds i8, ptr %148, i64 12
  %164 = load i32, ptr %163, align 4, !tbaa !19
  %165 = sext i32 %164 to i64
  %166 = mul nsw i64 %165, %162
  %167 = srem i64 %166, 1000000007
  %168 = trunc nsw i64 %167 to i32
  %169 = sext i32 %.056106 to i64
  %170 = getelementptr inbounds i8, ptr %156, i64 12
  %171 = load i32, ptr %170, align 4, !tbaa !19
  %172 = sext i32 %171 to i64
  %173 = mul nsw i64 %172, %169
  %174 = srem i64 %173, 1000000007
  %175 = trunc nsw i64 %174 to i32
  %176 = sub nsw i32 %.059104, %159
  %177 = load i32, ptr %152, align 16, !tbaa !20
  %178 = load i32, ptr %144, align 16, !tbaa !20
  br label %181

179:                                              ; preds = %.lr.ph108
  %180 = add nuw nsw i32 %142, 1
  br label %181

181:                                              ; preds = %179, %161
  %.168 = phi i32 [ %177, %161 ], [ %154, %179 ]
  %.166 = phi i32 [ %178, %161 ], [ %146, %179 ]
  %.164 = phi i32 [ %.063102, %161 ], [ %180, %179 ]
  %.162 = phi i32 [ %142, %161 ], [ %.061103, %179 ]
  %.160 = phi i32 [ %176, %161 ], [ %.059104, %179 ]
  %.158 = phi i32 [ %168, %161 ], [ %.057105, %179 ]
  %.1 = phi i32 [ %175, %161 ], [ %.056106, %179 ]
  %182 = icmp slt i32 %.164, %.162
  br i1 %182, label %.lr.ph108, label %._crit_edge109, !llvm.loop !21

._crit_edge109:                                   ; preds = %181, %.lr.ph116
  %.063.lcssa = phi i32 [ 0, %.lr.ph116 ], [ %.164, %181 ]
  %.059.lcssa = phi i32 [ %138, %.lr.ph116 ], [ %.160, %181 ]
  %.057.lcssa = phi i32 [ 1, %.lr.ph116 ], [ %.158, %181 ]
  %.056.lcssa = phi i32 [ 1, %.lr.ph116 ], [ %.1, %181 ]
  %.not80 = icmp eq i32 %.059.lcssa, 0
  br i1 %.not80, label %193, label %183

183:                                              ; preds = %._crit_edge109
  %184 = sext i32 %.057.lcssa to i64
  %185 = zext nneg i32 %.063.lcssa to i64
  %186 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %185
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = call noundef i32 @_Z7mod_powii(i32 noundef %187, i32 noundef %.059.lcssa)
  %189 = sext i32 %188 to i64
  %190 = mul nsw i64 %189, %184
  %191 = srem i64 %190, 1000000007
  %192 = trunc nsw i64 %191 to i32
  br label %193

193:                                              ; preds = %183, %._crit_edge109
  %.2 = phi i32 [ %192, %183 ], [ %.057.lcssa, %._crit_edge109 ]
  %194 = sext i32 %.2 to i64
  %195 = call noundef i32 @_Z7mod_invi(i32 noundef %.056.lcssa)
  %196 = sext i32 %195 to i64
  %197 = mul nsw i64 %196, %194
  %198 = add nsw i64 %197, %.070114
  %199 = srem i64 %198, 1000000007
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %200 = load i32, ptr @n, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %.not79.not = icmp slt i64 %indvars.iv130, %201
  br i1 %.not79.not, label %.lr.ph116, label %._crit_edge117.loopexit, !llvm.loop !22

._crit_edge122:                                   ; preds = %._crit_edge117, %0
  ret i32 0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE4pushEOS8_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { i32, ptr } @_ZSt9make_pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS8_INS9_IT0_E4typeEE6__typeEEOSA_OSF_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i32, ptr } @_ZSt9make_pairIRiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS9_INSA_IT0_E4typeEE6__typeEEOSB_OSG_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackISt4pairIiN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEESt5dequeIS8_SaIS8_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #7 align 2

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

; 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 #7

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

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


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