; LLVM IR from eyangch/competitive-programming :: USACOcontests/platinum/2019.12 (snowcow)

; 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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>

@N = external dso_local global i64, align 8
@Q = external dso_local global i64, align 8
@graph = external dso_local global [100000 x %"class.std::vector"], align 16
@ord = external dso_local global %"class.std::vector", align 8
@fo = external dso_local global [100000 x i64], align 16
@lo = external dso_local global [100000 x i64], align 16
@t = external dso_local global ptr, align 8
@cl = external dso_local global [100000 x %"class.std::set"], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsxx(i64 noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #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 @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(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 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 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_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %17 = alloca %"class.std::vector", align 8
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca ptr, align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca i64, align 8
  %25 = alloca %"struct.std::pair", align 8
  %26 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %27 = load ptr, ptr @stdin, align 8, !tbaa !5
  %28 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.5, ptr noundef %27)
  %29 = load ptr, ptr @stdout, align 8, !tbaa !5
  %30 = call ptr @freopen(ptr noundef @.str.6, ptr noundef @.str.7, ptr noundef %29)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #9
  store i64 0, ptr %2, align 8, !tbaa !9
  br label %33

33:                                               ; preds = %52, %0
  %34 = load i64, ptr %2, align 8, !tbaa !9
  %35 = load i64, ptr @N, align 8, !tbaa !9
  %36 = sub nsw i64 %35, 1
  %37 = icmp slt i64 %34, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #9
  br label %55

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #9
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %42 = load i64, ptr %3, align 8, !tbaa !9
  %43 = sub nsw i64 %42, 1
  %44 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @graph, i64 0, i64 %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  %45 = load i64, ptr %4, align 8, !tbaa !9
  %46 = sub nsw i64 %45, 1
  store i64 %46, ptr %5, align 8, !tbaa !9
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %44, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  %47 = load i64, ptr %4, align 8, !tbaa !9
  %48 = sub nsw i64 %47, 1
  %49 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @graph, i64 0, i64 %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %50 = load i64, ptr %3, align 8, !tbaa !9
  %51 = sub nsw i64 %50, 1
  store i64 %51, ptr %6, align 8, !tbaa !9
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %49, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #9
  br label %52

52:                                               ; preds = %39
  %53 = load i64, ptr %2, align 8, !tbaa !9
  %54 = add nsw i64 %53, 1
  store i64 %54, ptr %2, align 8, !tbaa !9
  br label %33, !llvm.loop !11

55:                                               ; preds = %38
  call void @_Z3dfsxx(i64 noundef 0, i64 noundef 0)
  %56 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #10
  %57 = load i64, ptr @N, align 8, !tbaa !9
  %58 = sub nsw i64 %57, 1
  invoke void @_ZN4segtC2Exx(ptr noundef nonnull align 8 dereferenceable(48) %56, i64 noundef 0, i64 noundef %58)
          to label %59 unwind label %65

59:                                               ; preds = %55
  store ptr %56, ptr @t, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %60

60:                                               ; preds = %213, %59
  %61 = load i64, ptr %9, align 8, !tbaa !9
  %62 = load i64, ptr @Q, align 8, !tbaa !9
  %63 = icmp slt i64 %61, %62
  br i1 %63, label %69, label %64

64:                                               ; preds = %60
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %216

65:                                               ; preds = %55
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %7, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %8, align 4
  call void @_ZdlPvm(ptr noundef %56, i64 noundef 48) #11
  br label %222

69:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %71 = load i64, ptr %11, align 8, !tbaa !9
  %72 = icmp eq i64 %71, 1
  br i1 %72, label %73, label %195

73:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #9
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %74, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %76 = load i64, ptr %12, align 8, !tbaa !9
  %77 = add nsw i64 %76, -1
  store i64 %77, ptr %12, align 8, !tbaa !9
  %78 = load i64, ptr %13, align 8, !tbaa !9
  %79 = add nsw i64 %78, -1
  store i64 %79, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %80 = load i64, ptr %13, align 8, !tbaa !9
  %81 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %80
  %82 = load i64, ptr %12, align 8, !tbaa !9
  %83 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %82
  %84 = call ptr @_ZNSt3setIxSt4lessIxESaIxEE11upper_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) %81, ptr noundef nonnull align 8 dereferenceable(8) %83)
  %85 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %14, i32 0, i32 0
  store ptr %84, ptr %85, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %86 = load i64, ptr %13, align 8, !tbaa !9
  %87 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %86
  %88 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %87) #9
  %89 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %15, i32 0, i32 0
  store ptr %88, ptr %89, align 8
  %90 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br i1 %90, label %91, label %106

91:                                               ; preds = %73
  %92 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef 0) #9
  %93 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %16, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #9
  %95 = load i64, ptr %94, align 8, !tbaa !9
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ord, i64 noundef %95) #9
  %97 = load i64, ptr %96, align 8, !tbaa !9
  %98 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !9
  %100 = load i64, ptr %12, align 8, !tbaa !9
  %101 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !9
  %103 = icmp sge i64 %99, %102
  br i1 %103, label %104, label %105

104:                                              ; preds = %91
  store i32 7, ptr %10, align 4
  br label %191

105:                                              ; preds = %91
  br label %106

106:                                              ; preds = %105, %73
  %107 = load ptr, ptr @t, align 8, !tbaa !5
  %108 = load i64, ptr %12, align 8, !tbaa !9
  %109 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !9
  %111 = load i64, ptr %12, align 8, !tbaa !9
  %112 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !9
  call void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(48) %107, i64 noundef %110, i64 noundef %113, i64 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #9
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %114 = load i64, ptr %13, align 8, !tbaa !9
  %115 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %114
  %116 = load i64, ptr %12, align 8, !tbaa !9
  %117 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %116
  %118 = invoke ptr @_ZNSt3setIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) %115, ptr noundef nonnull align 8 dereferenceable(8) %117)
          to label %119 unwind label %135

119:                                              ; preds = %106
  %120 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %18, i32 0, i32 0
  store ptr %118, ptr %120, align 8
  br label %121

121:                                              ; preds = %144, %119
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %122 = load i64, ptr %13, align 8, !tbaa !9
  %123 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %122
  %124 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %123) #9
  %125 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %19, i32 0, i32 0
  store ptr %124, ptr %125, align 8
  %126 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  br i1 %126, label %127, label %147

127:                                              ; preds = %121
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #9
  %129 = load i64, ptr %128, align 8, !tbaa !9
  %130 = load i64, ptr %12, align 8, !tbaa !9
  %131 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !9
  %133 = icmp sgt i64 %129, %132
  br i1 %133, label %134, label %139

134:                                              ; preds = %127
  br label %147

135:                                              ; preds = %180, %139, %106
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %7, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %8, align 4
  br label %194

139:                                              ; preds = %127
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #9
  %141 = load i64, ptr %140, align 8, !tbaa !9
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ord, i64 noundef %141) #9
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %17, ptr noundef nonnull align 8 dereferenceable(8) %142)
          to label %143 unwind label %135

143:                                              ; preds = %139
  br label %144

144:                                              ; preds = %143
  %145 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEi(ptr noundef nonnull align 8 dereferenceable(8) %18, i32 noundef 0) #9
  %146 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %145, ptr %146, align 8
  br label %121, !llvm.loop !13

147:                                              ; preds = %134, %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  store ptr %17, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #9
  %148 = load ptr, ptr %21, align 8, !tbaa !5
  %149 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %148) #9
  %150 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %149, ptr %150, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #9
  %151 = load ptr, ptr %21, align 8, !tbaa !5
  %152 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %151) #9
  %153 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %152, ptr %153, align 8
  br label %154

154:                                              ; preds = %174, %147
  %155 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #9
  br i1 %155, label %157, label %156

156:                                              ; preds = %154
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %180

157:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #9
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #9
  %159 = load i64, ptr %158, align 8, !tbaa !9
  store i64 %159, ptr %24, align 8, !tbaa !9
  %160 = load ptr, ptr @t, align 8, !tbaa !5
  %161 = load i64, ptr %24, align 8, !tbaa !9
  %162 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %161
  %163 = load i64, ptr %162, align 8, !tbaa !9
  %164 = load i64, ptr %24, align 8, !tbaa !9
  %165 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %164
  %166 = load i64, ptr %165, align 8, !tbaa !9
  invoke void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(48) %160, i64 noundef %163, i64 noundef %166, i64 noundef -1)
          to label %167 unwind label %176

167:                                              ; preds = %157
  %168 = load i64, ptr %13, align 8, !tbaa !9
  %169 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %168
  %170 = load i64, ptr %24, align 8, !tbaa !9
  %171 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %170
  %172 = invoke noundef i64 @_ZNSt3setIxSt4lessIxESaIxEE5eraseERKx(ptr noundef nonnull align 8 dereferenceable(48) %169, ptr noundef nonnull align 8 dereferenceable(8) %171)
          to label %173 unwind label %176

173:                                              ; preds = %167
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  br label %174

174:                                              ; preds = %173
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #9
  br label %154

176:                                              ; preds = %167, %157
  %177 = landingpad { ptr, i32 }
          cleanup
  %178 = extractvalue { ptr, i32 } %177, 0
  store ptr %178, ptr %7, align 8
  %179 = extractvalue { ptr, i32 } %177, 1
  store i32 %179, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  br label %194

180:                                              ; preds = %156
  %181 = load i64, ptr %13, align 8, !tbaa !9
  %182 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %181
  %183 = load i64, ptr %12, align 8, !tbaa !9
  %184 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %183
  %185 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %182, ptr noundef nonnull align 8 dereferenceable(8) %184)
          to label %186 unwind label %135

186:                                              ; preds = %180
  %187 = getelementptr inbounds { ptr, i8 }, ptr %25, i32 0, i32 0
  %188 = extractvalue { ptr, i8 } %185, 0
  store ptr %188, ptr %187, align 8
  %189 = getelementptr inbounds { ptr, i8 }, ptr %25, i32 0, i32 1
  %190 = extractvalue { ptr, i8 } %185, 1
  store i8 %190, ptr %189, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #9
  store i32 0, ptr %10, align 4
  br label %191

191:                                              ; preds = %186, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  %192 = load i32, ptr %10, align 4
  switch i32 %192, label %210 [
    i32 0, label %193
  ]

193:                                              ; preds = %191
  br label %209

194:                                              ; preds = %176, %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %222

195:                                              ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #9
  %196 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %197 = load i64, ptr %26, align 8, !tbaa !9
  %198 = add nsw i64 %197, -1
  store i64 %198, ptr %26, align 8, !tbaa !9
  %199 = load ptr, ptr @t, align 8, !tbaa !5
  %200 = load i64, ptr %26, align 8, !tbaa !9
  %201 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %200
  %202 = load i64, ptr %201, align 8, !tbaa !9
  %203 = load i64, ptr %26, align 8, !tbaa !9
  %204 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %203
  %205 = load i64, ptr %204, align 8, !tbaa !9
  %206 = call noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(48) %199, i64 noundef %202, i64 noundef %205)
  %207 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %206)
  %208 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %207, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #9
  br label %209

209:                                              ; preds = %195, %193
  store i32 0, ptr %10, align 4
  br label %210

210:                                              ; preds = %209, %191
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  %211 = load i32, ptr %10, align 4
  switch i32 %211, label %227 [
    i32 0, label %212
    i32 7, label %213
  ]

212:                                              ; preds = %210
  br label %213

213:                                              ; preds = %212, %210
  %214 = load i64, ptr %9, align 8, !tbaa !9
  %215 = add nsw i64 %214, 1
  store i64 %215, ptr %9, align 8, !tbaa !9
  br label %60, !llvm.loop !14

216:                                              ; preds = %64
  %217 = load ptr, ptr @t, align 8, !tbaa !5
  %218 = icmp eq ptr %217, null
  br i1 %218, label %220, label %219

219:                                              ; preds = %216
  call void @_ZN4segtD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %217) #9
  call void @_ZdlPvm(ptr noundef %217, i64 noundef 48) #11
  br label %220

220:                                              ; preds = %219, %216
  %221 = load i32, ptr %1, align 4
  ret i32 %221

222:                                              ; preds = %194, %65
  %223 = load ptr, ptr %7, align 8
  %224 = load i32, ptr %8, align 4
  %225 = insertvalue { ptr, i32 } poison, ptr %223, 0
  %226 = insertvalue { ptr, i32 } %225, i32 %224, 1
  resume { ptr, i32 } %226

227:                                              ; preds = %210
  unreachable
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #5

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #6

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #7

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef, i64 noundef) #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setIxSt4lessIxESaIxEE5eraseERKx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #8

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { 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 = { nobuiltin allocsize(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 = { nobuiltin 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin nounwind }

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

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


; 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<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i64, align 8
@Q = external dso_local global i64, align 8
@graph = external dso_local global [100000 x %"class.std::vector"], align 16
@ord = external dso_local global %"class.std::vector", align 8
@fo = external dso_local global [100000 x i64], align 16
@lo = external dso_local local_unnamed_addr global [100000 x i64], align 16
@t = external dso_local local_unnamed_addr global ptr, align 8
@cl = external dso_local global [100000 x %"class.std::set"], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsxx(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) 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 @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca i64, align 8
  %16 = load ptr, ptr @stdin, align 8, !tbaa !5
  %17 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.5, ptr noundef %16)
  %18 = load ptr, ptr @stdout, align 8, !tbaa !5
  %19 = tail call ptr @freopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, ptr noundef %18)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  %22 = load i64, ptr @N, align 8, !tbaa !9
  %23 = icmp sgt i64 %22, 1
  br i1 %23, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @_Z3dfsxx(i64 noundef 0, i64 noundef 0)
  %24 = call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #9
  %25 = load i64, ptr @N, align 8, !tbaa !9
  %26 = add nsw i64 %25, -1
  invoke void @_ZN4segtC2Exx(ptr noundef nonnull align 8 dereferenceable(48) %24, i64 noundef 0, i64 noundef %26)
          to label %43 unwind label %47

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.022 = phi i64 [ %39, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #10
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %29 = load i64, ptr %1, align 8, !tbaa !9
  %30 = add nsw i64 %29, -1
  %31 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @graph, i64 0, i64 %30
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #10
  %32 = load i64, ptr %2, align 8, !tbaa !9
  %33 = add nsw i64 %32, -1
  store i64 %33, ptr %3, align 8, !tbaa !9
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  %34 = load i64, ptr %2, align 8, !tbaa !9
  %35 = add nsw i64 %34, -1
  %36 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @graph, i64 0, i64 %35
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #10
  %37 = load i64, ptr %1, align 8, !tbaa !9
  %38 = add nsw i64 %37, -1
  store i64 %38, ptr %4, align 8, !tbaa !9
  call void @_ZNSt6vectorIxSaIxEE9push_backEOx(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #10
  %39 = add nuw nsw i64 %.022, 1
  %40 = load i64, ptr @N, align 8, !tbaa !9
  %41 = add nsw i64 %40, -1
  %42 = icmp slt i64 %39, %41
  br i1 %42, label %.lr.ph, label %._crit_edge, !llvm.loop !11

43:                                               ; preds = %._crit_edge
  store ptr %24, ptr @t, align 8, !tbaa !5
  %44 = load i64, ptr @Q, align 8, !tbaa !9
  %45 = icmp sgt i64 %44, 0
  br i1 %45, label %.lr.ph32, label %._crit_edge33.thread

._crit_edge33:                                    ; preds = %147
  %.pre36 = load ptr, ptr @t, align 8, !tbaa !5
  %46 = icmp eq ptr %.pre36, null
  br i1 %46, label %152, label %._crit_edge33.thread

47:                                               ; preds = %._crit_edge
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %24, i64 noundef 48) #11
  br label %153

.lr.ph32:                                         ; preds = %43, %147
  %.01730 = phi i64 [ %148, %147 ], [ 0, %43 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #10
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %50 = load i64, ptr %5, align 8, !tbaa !9
  %51 = icmp eq i64 %50, 1
  br i1 %51, label %52, label %135

52:                                               ; preds = %.lr.ph32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #10
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %53, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %55 = load i64, ptr %6, align 8, !tbaa !9
  %56 = add nsw i64 %55, -1
  store i64 %56, ptr %6, align 8, !tbaa !9
  %57 = load i64, ptr %7, align 8, !tbaa !9
  %58 = add nsw i64 %57, -1
  store i64 %58, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #10
  %59 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %58
  %60 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %56
  %61 = call ptr @_ZNSt3setIxSt4lessIxESaIxEE11upper_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) %59, ptr noundef nonnull align 8 dereferenceable(8) %60)
  store ptr %61, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #10
  %62 = load i64, ptr %7, align 8, !tbaa !9
  %63 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %62
  %64 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %63) #10
  store ptr %64, ptr %9, align 8
  %65 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #10
  br i1 %65, label %66, label %._crit_edge34

._crit_edge34:                                    ; preds = %52
  %.pre = load i64, ptr %6, align 8, !tbaa !9
  %.phi.trans.insert = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %.pre
  %.pre35 = load i64, ptr %.phi.trans.insert, align 8, !tbaa !9
  br label %77

66:                                               ; preds = %52
  %67 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef 0) #10
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #10
  %69 = load i64, ptr %68, align 8, !tbaa !9
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ord, i64 noundef %69) #10
  %71 = load i64, ptr %70, align 8, !tbaa !9
  %72 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !9
  %74 = load i64, ptr %6, align 8, !tbaa !9
  %75 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !9
  %.not = icmp slt i64 %73, %76
  br i1 %.not, label %77, label %133

77:                                               ; preds = %._crit_edge34, %66
  %78 = phi i64 [ %.pre35, %._crit_edge34 ], [ %76, %66 ]
  %79 = phi i64 [ %.pre, %._crit_edge34 ], [ %74, %66 ]
  %80 = load ptr, ptr @t, align 8, !tbaa !5
  %81 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %79
  %82 = load i64, ptr %81, align 8, !tbaa !9
  call void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(48) %80, i64 noundef %82, i64 noundef %78, i64 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #10
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #10
  %83 = load i64, ptr %7, align 8, !tbaa !9
  %84 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %83
  %85 = load i64, ptr %6, align 8, !tbaa !9
  %86 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %85
  %87 = invoke ptr @_ZNSt3setIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) %84, ptr noundef nonnull align 8 dereferenceable(8) %86)
          to label %88 unwind label %.loopexit.split-lp

88:                                               ; preds = %77
  store ptr %87, ptr %11, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #10
  %89 = load i64, ptr %7, align 8, !tbaa !9
  %90 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %89
  %91 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %90) #10
  store ptr %91, ptr %12, align 8
  %92 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #10
  br i1 %92, label %.lr.ph24, label %._crit_edge25

.lr.ph24:                                         ; preds = %88, %103
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #10
  %94 = load i64, ptr %93, align 8, !tbaa !9
  %95 = load i64, ptr %6, align 8, !tbaa !9
  %96 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !9
  %98 = icmp sgt i64 %94, %97
  br i1 %98, label %._crit_edge25, label %99

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

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

99:                                               ; preds = %.lr.ph24
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #10
  %101 = load i64, ptr %100, align 8, !tbaa !9
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @ord, i64 noundef %101) #10
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(8) %102)
          to label %103 unwind label %.loopexit

103:                                              ; preds = %99
  %104 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEppEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 0) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #10
  %105 = load i64, ptr %7, align 8, !tbaa !9
  %106 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %105
  %107 = call ptr @_ZNKSt3setIxSt4lessIxESaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %106) #10
  store ptr %107, ptr %12, align 8
  %108 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIxES2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #10
  br i1 %108, label %.lr.ph24, label %._crit_edge25, !llvm.loop !13

._crit_edge25:                                    ; preds = %103, %.lr.ph24, %88
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #10
  %109 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #10
  store ptr %109, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #10
  %110 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #10
  store ptr %110, ptr %14, align 8
  %111 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #10
  br i1 %111, label %.lr.ph28, label %._crit_edge29

._crit_edge29:                                    ; preds = %128, %._crit_edge25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #10
  %112 = load i64, ptr %7, align 8, !tbaa !9
  %113 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %112
  %114 = load i64, ptr %6, align 8, !tbaa !9
  %115 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %114
  %116 = invoke { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %113, ptr noundef nonnull align 8 dereferenceable(8) %115)
          to label %.critedge unwind label %.loopexit.split-lp

.lr.ph28:                                         ; preds = %._crit_edge25, %128
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #10
  %118 = load i64, ptr %117, align 8, !tbaa !9
  %119 = load ptr, ptr @t, align 8, !tbaa !5
  %120 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %118
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %118
  %123 = load i64, ptr %122, align 8, !tbaa !9
  invoke void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(48) %119, i64 noundef %121, i64 noundef %123, i64 noundef -1)
          to label %124 unwind label %131

124:                                              ; preds = %.lr.ph28
  %125 = load i64, ptr %7, align 8, !tbaa !9
  %126 = getelementptr inbounds [100000 x %"class.std::set"], ptr @cl, i64 0, i64 %125
  %127 = invoke noundef i64 @_ZNSt3setIxSt4lessIxESaIxEE5eraseERKx(ptr noundef nonnull align 8 dereferenceable(48) %126, ptr noundef nonnull align 8 dereferenceable(8) %120)
          to label %128 unwind label %131

128:                                              ; preds = %124
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #10
  %130 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #10
  br i1 %130, label %.lr.ph28, label %._crit_edge29

131:                                              ; preds = %124, %.lr.ph28
  %132 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #10
  br label %134

.critedge:                                        ; preds = %._crit_edge29
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #10
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #10
  br label %147

133:                                              ; preds = %66
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #10
  br label %147

134:                                              ; preds = %.loopexit, %.loopexit.split-lp, %131
  %.pn = phi { ptr, i32 } [ %132, %131 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #10
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #10
  br label %153

135:                                              ; preds = %.lr.ph32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #10
  %136 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %137 = load i64, ptr %15, align 8, !tbaa !9
  %138 = add nsw i64 %137, -1
  store i64 %138, ptr %15, align 8, !tbaa !9
  %139 = load ptr, ptr @t, align 8, !tbaa !5
  %140 = getelementptr inbounds [100000 x i64], ptr @fo, i64 0, i64 %138
  %141 = load i64, ptr %140, align 8, !tbaa !9
  %142 = getelementptr inbounds [100000 x i64], ptr @lo, i64 0, i64 %138
  %143 = load i64, ptr %142, align 8, !tbaa !9
  %144 = call noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(48) %139, i64 noundef %141, i64 noundef %143)
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %144)
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %145, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #10
  br label %147

147:                                              ; preds = %135, %.critedge, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #10
  %148 = add nuw nsw i64 %.01730, 1
  %149 = load i64, ptr @Q, align 8, !tbaa !9
  %150 = icmp slt i64 %148, %149
  br i1 %150, label %.lr.ph32, label %._crit_edge33, !llvm.loop !14

._crit_edge33.thread:                             ; preds = %43, %._crit_edge33
  %151 = phi ptr [ %.pre36, %._crit_edge33 ], [ %24, %43 ]
  call void @_ZN4segtD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %151) #10
  call void @_ZdlPvm(ptr noundef nonnull %151, i64 noundef 48) #11
  br label %152

152:                                              ; preds = %._crit_edge33.thread, %._crit_edge33
  ret i32 0

153:                                              ; preds = %134, %47
  %.pn.pn = phi { ptr, i32 } [ %.pn, %134 ], [ %48, %47 ]
  resume { ptr, i32 } %.pn.pn
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #6

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #7

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4segt3updExxx(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNSt3setIxSt4lessIxESaIxEE5eraseERKx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN4segt3qryExx(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef, i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #8

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { 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 = { nobuiltin allocsize(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 = { nobuiltin 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 #8 = { 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 #9 = { builtin allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { builtin nounwind }

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

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


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