; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2017-18/Jan 2018/Plat (atlarge_nsqrtn)

; 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 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::allocator.0" = type { i8 }

@adj = external dso_local global [70005 x %"class.std::vector"], align 16
@N = external dso_local global i32, align 4
@par = external dso_local global [70005 x i32], align 16
@st = external dso_local global [70005 x i32], align 16
@depth = external dso_local global [70005 x i32], align 16
@distLeaf = external dso_local global [70005 x i32], align 16
@ans = external dso_local global [70005 x i32], align 16
@ord = external dso_local global %"class.std::vector", align 8
@cur = external dso_local global [70005 x i32], align 16
@dumb = external dso_local global [70005 x i32], align 16
@csum = external dso_local global i32, align 4
@inOrd = external dso_local global [701 x %"class.std::vector"], align 16
@val = external dso_local global [701 x %"class.std::vector"], align 16
@dif = external dso_local global [701 x %"class.std::vector"], align 16
@.str.24 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) #2

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

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

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

; 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)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; 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)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildi(i32 noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solvei(i32 noundef) #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 %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector", align 8
  %16 = alloca %"class.std::allocator.0", align 1
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::vector", align 8
  %21 = alloca i32, align 4
  %22 = alloca %"class.std::allocator.0", align 1
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef @.str.24, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %31 unwind label %39

31:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %2)
          to label %32 unwind label %43

32:                                               ; preds = %31
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  call void @_ZN5input2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %55, %32
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = load i32, ptr @N, align 4, !tbaa !5
  %36 = sub nsw i32 %35, 1
  %37 = icmp slt i32 %34, %36
  br i1 %37, label %48, label %38

38:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %58

39:                                               ; preds = %0
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %4, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %5, align 4
  br label %47

43:                                               ; preds = %31
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %4, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br label %47

47:                                               ; preds = %43, %39
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  br label %313

48:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @_ZN5input2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [70005 x %"class.std::vector"], ptr @adj, i64 0, i64 %50
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [70005 x %"class.std::vector"], ptr @adj, i64 0, i64 %53
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %55

55:                                               ; preds = %48
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %6, align 4, !tbaa !5
  br label %33, !llvm.loop !9

58:                                               ; preds = %38
  call void @_Z3dfsi(i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store ptr @ord, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %59 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @ord) #5
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %61 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @ord) #5
  %62 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %61, ptr %62, align 8
  br label %63

63:                                               ; preds = %90, %58
  %64 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br i1 %64, label %66, label %65

65:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %92

66:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  store ptr %67, ptr %12, align 8, !tbaa !11
  %68 = load ptr, ptr %12, align 8, !tbaa !11
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [70005 x i32], ptr @par, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %89

74:                                               ; preds = %66
  %75 = load ptr, ptr %12, align 8, !tbaa !11
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [70005 x i32], ptr @distLeaf, i64 0, i64 %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %79 = load ptr, ptr %12, align 8, !tbaa !11
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [70005 x i32], ptr @par, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [70005 x i32], ptr @distLeaf, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %13, align 4, !tbaa !5
  %88 = call noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %78, ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %89

89:                                               ; preds = %74, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %90

90:                                               ; preds = %89
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  br label %63

92:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %104, %92
  %94 = load i32, ptr %14, align 4, !tbaa !5
  %95 = icmp slt i32 %94, 701
  br i1 %95, label %97, label %96

96:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %107

97:                                               ; preds = %93
  %98 = load i32, ptr %14, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [701 x %"class.std::vector"], ptr @dif, i64 0, i64 %99
  call void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef 100)
  %101 = load i32, ptr %14, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [701 x %"class.std::vector"], ptr @val, i64 0, i64 %102
  call void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %103, i64 noundef 100)
  br label %104

104:                                              ; preds = %97
  %105 = load i32, ptr %14, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %14, align 4, !tbaa !5
  br label %93, !llvm.loop !13

107:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  %108 = load i32, ptr @N, align 4, !tbaa !5
  %109 = mul nsw i32 2, %108
  %110 = add nsw i32 %109, 1
  %111 = sext i32 %110 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %111, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %112 unwind label %119

112:                                              ; preds = %107
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %164, %112
  %114 = load i32, ptr %17, align 4, !tbaa !5
  %115 = load i32, ptr @N, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  %117 = icmp slt i32 %114, %116
  br i1 %117, label %123, label %118

118:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %167

119:                                              ; preds = %107
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %4, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %5, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  br label %312

123:                                              ; preds = %113
  %124 = load i32, ptr %17, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [70005 x %"class.std::vector"], ptr @adj, i64 0, i64 %125
  %127 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %126) #5
  %128 = trunc i64 %127 to i32
  %129 = sub nsw i32 %128, 2
  %130 = load i32, ptr %17, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [70005 x i32], ptr @st, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [70005 x i32], ptr @dumb, i64 0, i64 %134
  store i32 %129, ptr %135, align 4, !tbaa !5
  %136 = load i32, ptr %17, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [70005 x i32], ptr @distLeaf, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = load i32, ptr %17, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [70005 x i32], ptr @depth, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = sub nsw i32 %139, %143
  %145 = load i32, ptr %17, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [70005 x i32], ptr @st, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [70005 x i32], ptr @cur, i64 0, i64 %149
  store i32 %144, ptr %150, align 4, !tbaa !5
  %151 = load i32, ptr %17, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [70005 x i32], ptr @st, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [70005 x i32], ptr @cur, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = load i32, ptr @N, align 4, !tbaa !5
  %159 = add nsw i32 %157, %158
  %160 = sext i32 %159 to i64
  %161 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %160) #5
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %161, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %123
  %165 = load i32, ptr %17, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %17, align 4, !tbaa !5
  br label %113, !llvm.loop !14

167:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %185, %167
  %169 = load i32, ptr %19, align 4, !tbaa !5
  %170 = load i32, ptr @N, align 4, !tbaa !5
  %171 = mul nsw i32 2, %170
  %172 = add nsw i32 %171, 1
  %173 = icmp slt i32 %169, %172
  br i1 %173, label %175, label %174

174:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %188

175:                                              ; preds = %168
  %176 = load i32, ptr %19, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %177) #5
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %178) #5
  %179 = load i32, ptr %19, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %180) #5
  %182 = load i32, ptr %181, align 4, !tbaa !5
  %183 = load i32, ptr %18, align 4, !tbaa !5
  %184 = add nsw i32 %183, %182
  store i32 %184, ptr %18, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %175
  %186 = load i32, ptr %19, align 4, !tbaa !5
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %19, align 4, !tbaa !5
  br label %168, !llvm.loop !15

188:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #5
  %189 = load i32, ptr @N, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 -1, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %190, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 1 dereferenceable(1) %22)
          to label %191 unwind label %197

191:                                              ; preds = %188
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %228, %191
  %193 = load i32, ptr %23, align 4, !tbaa !5
  %194 = load i32, ptr @N, align 4, !tbaa !5
  %195 = icmp slt i32 %193, %194
  br i1 %195, label %201, label %196

196:                                              ; preds = %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %231

197:                                              ; preds = %188
  %198 = landingpad { ptr, i32 }
          cleanup
  %199 = extractvalue { ptr, i32 } %198, 0
  store ptr %199, ptr %4, align 8
  %200 = extractvalue { ptr, i32 } %198, 1
  store i32 %200, ptr %5, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %311

201:                                              ; preds = %192
  %202 = load i32, ptr %23, align 4, !tbaa !5
  %203 = load i32, ptr %23, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [70005 x i32], ptr @cur, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = load i32, ptr @N, align 4, !tbaa !5
  %208 = add nsw i32 %206, %207
  %209 = sext i32 %208 to i64
  %210 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %209) #5
  %211 = load i32, ptr %210, align 4, !tbaa !5
  %212 = add nsw i32 %211, 1
  store i32 %212, ptr %210, align 4, !tbaa !5
  %213 = sext i32 %211 to i64
  %214 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %213) #5
  store i32 %202, ptr %214, align 4, !tbaa !5
  %215 = load i32, ptr %23, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [70005 x i32], ptr @cur, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = icmp sgt i32 %218, 0
  br i1 %219, label %220, label %227

220:                                              ; preds = %201
  %221 = load i32, ptr %23, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [70005 x i32], ptr @dumb, i64 0, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !5
  %225 = load i32, ptr @csum, align 4, !tbaa !5
  %226 = add nsw i32 %225, %224
  store i32 %226, ptr @csum, align 4, !tbaa !5
  br label %227

227:                                              ; preds = %220, %201
  br label %228

228:                                              ; preds = %227
  %229 = load i32, ptr %23, align 4, !tbaa !5
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %23, align 4, !tbaa !5
  br label %192, !llvm.loop !16

231:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  store ptr %20, ptr %24, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %232 = load ptr, ptr %24, align 8, !tbaa !11
  %233 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %232) #5
  %234 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %233, ptr %234, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %235 = load ptr, ptr %24, align 8, !tbaa !11
  %236 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %235) #5
  %237 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %236, ptr %237, align 8
  br label %238

238:                                              ; preds = %250, %231
  %239 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #5
  br i1 %239, label %241, label %240

240:                                              ; preds = %238
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %256

241:                                              ; preds = %238
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %242 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  store ptr %242, ptr %27, align 8, !tbaa !11
  %243 = load ptr, ptr %27, align 8, !tbaa !11
  %244 = load i32, ptr %243, align 4, !tbaa !5
  %245 = sdiv i32 %244, 100
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [701 x %"class.std::vector"], ptr @inOrd, i64 0, i64 %246
  %248 = load ptr, ptr %27, align 8, !tbaa !11
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %247, ptr noundef nonnull align 4 dereferenceable(4) %248)
          to label %249 unwind label %252

249:                                              ; preds = %241
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  br label %250

250:                                              ; preds = %249
  %251 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  br label %238

252:                                              ; preds = %241
  %253 = landingpad { ptr, i32 }
          cleanup
  %254 = extractvalue { ptr, i32 } %253, 0
  store ptr %254, ptr %4, align 8
  %255 = extractvalue { ptr, i32 } %253, 1
  store i32 %255, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %310

256:                                              ; preds = %240
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %257

257:                                              ; preds = %267, %256
  %258 = load i32, ptr %28, align 4, !tbaa !5
  %259 = load i32, ptr @N, align 4, !tbaa !5
  %260 = icmp slt i32 %258, %259
  br i1 %260, label %262, label %261

261:                                              ; preds = %257
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %274

262:                                              ; preds = %257
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  %263 = load i32, ptr %28, align 4, !tbaa !5
  %264 = sdiv i32 %263, 100
  store i32 %264, ptr %29, align 4, !tbaa !5
  %265 = load i32, ptr %29, align 4, !tbaa !5
  invoke void @_Z5buildi(i32 noundef %265)
          to label %266 unwind label %270

266:                                              ; preds = %262
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %267

267:                                              ; preds = %266
  %268 = load i32, ptr %28, align 4, !tbaa !5
  %269 = add nsw i32 %268, 100
  store i32 %269, ptr %28, align 4, !tbaa !5
  br label %257, !llvm.loop !17

270:                                              ; preds = %262
  %271 = landingpad { ptr, i32 }
          cleanup
  %272 = extractvalue { ptr, i32 } %271, 0
  store ptr %272, ptr %4, align 8
  %273 = extractvalue { ptr, i32 } %271, 1
  store i32 %273, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  br label %310

274:                                              ; preds = %261
  invoke void @_Z5solvei(i32 noundef 1)
          to label %275 unwind label %282

275:                                              ; preds = %274
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  store i32 1, ptr %30, align 4, !tbaa !5
  br label %276

276:                                              ; preds = %301, %275
  %277 = load i32, ptr %30, align 4, !tbaa !5
  %278 = load i32, ptr @N, align 4, !tbaa !5
  %279 = add nsw i32 %278, 1
  %280 = icmp slt i32 %277, %279
  br i1 %280, label %286, label %281

281:                                              ; preds = %276
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %308

282:                                              ; preds = %274
  %283 = landingpad { ptr, i32 }
          cleanup
  %284 = extractvalue { ptr, i32 } %283, 0
  store ptr %284, ptr %4, align 8
  %285 = extractvalue { ptr, i32 } %283, 1
  store i32 %285, ptr %5, align 4
  br label %310

286:                                              ; preds = %276
  %287 = load i32, ptr %30, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [70005 x i32], ptr @ans, i64 0, i64 %288
  %290 = load i32, ptr %289, align 4, !tbaa !5
  %291 = icmp ne i32 %290, 0
  br i1 %291, label %296, label %292

292:                                              ; preds = %286
  %293 = load i32, ptr %30, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [70005 x i32], ptr @ans, i64 0, i64 %294
  store i32 1, ptr %295, align 4, !tbaa !5
  br label %296

296:                                              ; preds = %292, %286
  %297 = load i32, ptr %30, align 4, !tbaa !5
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [70005 x i32], ptr @ans, i64 0, i64 %298
  invoke void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %299)
          to label %300 unwind label %304

300:                                              ; preds = %296
  br label %301

301:                                              ; preds = %300
  %302 = load i32, ptr %30, align 4, !tbaa !5
  %303 = add nsw i32 %302, 1
  store i32 %303, ptr %30, align 4, !tbaa !5
  br label %276, !llvm.loop !18

304:                                              ; preds = %296
  %305 = landingpad { ptr, i32 }
          cleanup
  %306 = extractvalue { ptr, i32 } %305, 0
  store ptr %306, ptr %4, align 8
  %307 = extractvalue { ptr, i32 } %305, 1
  store i32 %307, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %310

308:                                              ; preds = %281
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  %309 = load i32, ptr %1, align 4
  ret i32 %309

310:                                              ; preds = %304, %282, %270, %252
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #5
  br label %311

311:                                              ; preds = %310, %197
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  br label %312

312:                                              ; preds = %311, %119
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  br label %313

313:                                              ; preds = %312, %47
  %314 = load ptr, ptr %4, align 8
  %315 = load i32, ptr %5, align 4
  %316 = insertvalue { ptr, i32 } poison, ptr %314, 0
  %317 = insertvalue { ptr, i32 } %316, i32 %315, 1
  resume { ptr, i32 } %317
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5input2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::allocator.0" = type { i8 }

@adj = external dso_local global [70005 x %"class.std::vector"], align 16
@N = external dso_local global i32, align 4
@par = external dso_local local_unnamed_addr global [70005 x i32], align 16
@st = external dso_local local_unnamed_addr global [70005 x i32], align 16
@depth = external dso_local local_unnamed_addr global [70005 x i32], align 16
@distLeaf = external dso_local global [70005 x i32], align 16
@ans = external dso_local global [70005 x i32], align 16
@ord = external dso_local global %"class.std::vector", align 8
@cur = external dso_local local_unnamed_addr global [70005 x i32], align 16
@dumb = external dso_local local_unnamed_addr global [70005 x i32], align 16
@csum = external dso_local local_unnamed_addr global i32, align 4
@inOrd = external dso_local global [701 x %"class.std::vector"], align 16
@val = external dso_local global [701 x %"class.std::vector"], align 16
@dif = external dso_local global [701 x %"class.std::vector"], align 16
@.str.24 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; 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 #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildi(i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solvei(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::__cxx11::basic_string", align 8
  %2 = alloca %"class.std::allocator", align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::allocator.0", align 1
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::allocator.0", align 1
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull @.str.24, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %16 unwind label %23

16:                                               ; preds = %0
  invoke void @_ZN2io5setIOENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull %1)
          to label %17 unwind label %25

17:                                               ; preds = %16
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  call void @_ZN5input2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4) @N)
  %18 = load i32, ptr @N, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 1
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %17
  call void @_Z3dfsi(i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %20 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @ord) #5
  store ptr %20, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %21 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @ord) #5
  store ptr %21, ptr %6, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br i1 %22, label %.lr.ph67, label %._crit_edge68

23:                                               ; preds = %0
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %27

25:                                               ; preds = %16
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #5
  br label %27

27:                                               ; preds = %25, %23
  %.pn = phi { ptr, i32 } [ %26, %25 ], [ %24, %23 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  br label %161

.lr.ph:                                           ; preds = %17, %.lr.ph
  %.04965 = phi i32 [ %34, %.lr.ph ], [ 0, %17 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @_ZN5input2reIiJiEEEvRT_DpRT0_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [70005 x %"class.std::vector"], ptr @adj, i64 0, i64 %29
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %30, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [70005 x %"class.std::vector"], ptr @adj, i64 0, i64 %32
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  %34 = add nuw nsw i32 %.04965, 1
  %35 = load i32, ptr @N, align 4, !tbaa !5
  %36 = add nsw i32 %35, -1
  %37 = icmp slt i32 %34, %36
  br i1 %37, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge68:                                    ; preds = %50, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %58

.lr.ph67:                                         ; preds = %._crit_edge, %50
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [70005 x i32], ptr @par, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %.not64 = icmp eq i32 %42, 0
  br i1 %.not64, label %50, label %43

43:                                               ; preds = %.lr.ph67
  %44 = getelementptr inbounds [70005 x i32], ptr @distLeaf, i64 0, i64 %40
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %45 = sext i32 %42 to i64
  %46 = getelementptr inbounds [70005 x i32], ptr @distLeaf, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %7, align 4, !tbaa !5
  %49 = call noundef zeroext i1 @_Z5ckminIiEbRT_RKS0_(ptr noundef nonnull align 4 dereferenceable(4) %44, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  br label %50

50:                                               ; preds = %43, %.lr.ph67
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  %52 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  br i1 %52, label %.lr.ph67, label %._crit_edge68

53:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  %54 = load i32, ptr @N, align 4, !tbaa !5
  %55 = shl nsw i32 %54, 1
  %56 = or disjoint i32 %55, 1
  %57 = sext i32 %56 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %57, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %61 unwind label %64

58:                                               ; preds = %._crit_edge68, %58
  %indvars.iv = phi i64 [ 0, %._crit_edge68 ], [ %indvars.iv.next, %58 ]
  %59 = getelementptr inbounds [701 x %"class.std::vector"], ptr @dif, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %59, i64 noundef 100)
  %60 = getelementptr inbounds [701 x %"class.std::vector"], ptr @val, i64 0, i64 %indvars.iv
  call void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef 100)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 701
  br i1 %exitcond.not, label %53, label %58, !llvm.loop !11

61:                                               ; preds = %53
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  %62 = load i32, ptr @N, align 4, !tbaa !5
  %.not70 = icmp slt i32 %62, 1
  br i1 %.not70, label %._crit_edge74, label %.lr.ph73

._crit_edge74:                                    ; preds = %.lr.ph73, %61
  %63 = phi i32 [ %62, %61 ], [ %86, %.lr.ph73 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  %.not5675 = icmp slt i32 %63, 0
  br i1 %.not5675, label %._crit_edge79, label %.lr.ph78

64:                                               ; preds = %53
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  br label %160

.lr.ph73:                                         ; preds = %61, %.lr.ph73
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %.lr.ph73 ], [ 1, %61 ]
  %66 = getelementptr inbounds [70005 x %"class.std::vector"], ptr @adj, i64 0, i64 %indvars.iv97
  %67 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %66) #5
  %68 = trunc i64 %67 to i32
  %69 = add nsw i32 %68, -2
  %70 = getelementptr inbounds [70005 x i32], ptr @st, i64 0, i64 %indvars.iv97
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [70005 x i32], ptr @dumb, i64 0, i64 %72
  store i32 %69, ptr %73, align 4, !tbaa !5
  %74 = getelementptr inbounds [70005 x i32], ptr @distLeaf, i64 0, i64 %indvars.iv97
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = getelementptr inbounds [70005 x i32], ptr @depth, i64 0, i64 %indvars.iv97
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sub nsw i32 %75, %77
  %79 = getelementptr inbounds [70005 x i32], ptr @cur, i64 0, i64 %72
  store i32 %78, ptr %79, align 4, !tbaa !5
  %80 = load i32, ptr @N, align 4, !tbaa !5
  %81 = add nsw i32 %80, %78
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %82) #5
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %83, align 4, !tbaa !5
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %86 = load i32, ptr @N, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %.not.not = icmp slt i64 %indvars.iv97, %87
  br i1 %.not.not, label %.lr.ph73, label %._crit_edge74, !llvm.loop !12

._crit_edge79:                                    ; preds = %.lr.ph78, %._crit_edge74
  %.lcssa = phi i32 [ %63, %._crit_edge74 ], [ %94, %.lr.ph78 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  %88 = sext i32 %.lcssa to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  store i32 -1, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %13) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %88, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %97 unwind label %103

.lr.ph78:                                         ; preds = %._crit_edge74, %.lr.ph78
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %.lr.ph78 ], [ 0, %._crit_edge74 ]
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv100) #5
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %89) #5
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %indvars.iv100) #5
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = load i32, ptr %10, align 4, !tbaa !5
  %93 = add nsw i32 %92, %91
  store i32 %93, ptr %10, align 4, !tbaa !5
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %94 = load i32, ptr @N, align 4, !tbaa !5
  %95 = shl nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %.not56.not = icmp slt i64 %indvars.iv100, %96
  br i1 %.not56.not, label %.lr.ph78, label %._crit_edge79, !llvm.loop !13

97:                                               ; preds = %._crit_edge79
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  %98 = load i32, ptr @N, align 4, !tbaa !5
  %99 = icmp sgt i32 %98, 0
  br i1 %99, label %.lr.ph82, label %._crit_edge83

._crit_edge83:                                    ; preds = %123, %97
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %100 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store ptr %100, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %101 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  store ptr %101, ptr %15, align 8
  %102 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br i1 %102, label %.lr.ph85, label %._crit_edge86

103:                                              ; preds = %._crit_edge79
  %104 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  br label %159

.lr.ph82:                                         ; preds = %97, %123
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %123 ], [ 0, %97 ]
  %105 = phi i32 [ %124, %123 ], [ %98, %97 ]
  %106 = getelementptr inbounds [70005 x i32], ptr @cur, i64 0, i64 %indvars.iv103
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = add nsw i32 %107, %105
  %109 = sext i32 %108 to i64
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %109) #5
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %110, align 4, !tbaa !5
  %113 = sext i32 %111 to i64
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %113) #5
  %115 = trunc nuw nsw i64 %indvars.iv103 to i32
  store i32 %115, ptr %114, align 4, !tbaa !5
  %116 = load i32, ptr %106, align 4, !tbaa !5
  %117 = icmp sgt i32 %116, 0
  br i1 %117, label %118, label %123

118:                                              ; preds = %.lr.ph82
  %119 = getelementptr inbounds [70005 x i32], ptr @dumb, i64 0, i64 %indvars.iv103
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = load i32, ptr @csum, align 4, !tbaa !5
  %122 = add nsw i32 %121, %120
  store i32 %122, ptr @csum, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %.lr.ph82, %118
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %124 = load i32, ptr @N, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = icmp slt i64 %indvars.iv.next104, %125
  br i1 %126, label %.lr.ph82, label %._crit_edge83, !llvm.loop !14

._crit_edge86:                                    ; preds = %134, %._crit_edge83
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  %127 = load i32, ptr @N, align 4, !tbaa !5
  %128 = icmp sgt i32 %127, 0
  br i1 %128, label %.lr.ph89, label %._crit_edge90

.lr.ph85:                                         ; preds = %._crit_edge83, %134
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = sdiv i32 %130, 100
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [701 x %"class.std::vector"], ptr @inOrd, i64 0, i64 %132
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %133, ptr noundef nonnull align 4 dereferenceable(4) %129)
          to label %134 unwind label %137

134:                                              ; preds = %.lr.ph85
  %135 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %136 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br i1 %136, label %.lr.ph85, label %._crit_edge86

137:                                              ; preds = %.lr.ph85
  %138 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  br label %158

._crit_edge90:                                    ; preds = %141, %._crit_edge86
  invoke void @_Z5solvei(i32 noundef 1)
          to label %.preheader unwind label %147

.preheader:                                       ; preds = %._crit_edge90
  %139 = load i32, ptr @N, align 4, !tbaa !5
  %.not5791 = icmp slt i32 %139, 1
  br i1 %.not5791, label %._crit_edge94, label %.lr.ph93

.lr.ph89:                                         ; preds = %._crit_edge86, %141
  %.04387 = phi i32 [ %142, %141 ], [ 0, %._crit_edge86 ]
  %140 = udiv i32 %.04387, 100
  invoke void @_Z5buildi(i32 noundef %140)
          to label %141 unwind label %145

141:                                              ; preds = %.lr.ph89
  %142 = add nuw nsw i32 %.04387, 100
  %143 = load i32, ptr @N, align 4, !tbaa !5
  %144 = icmp slt i32 %142, %143
  br i1 %144, label %.lr.ph89, label %._crit_edge90, !llvm.loop !15

145:                                              ; preds = %.lr.ph89
  %146 = landingpad { ptr, i32 }
          cleanup
  br label %158

._crit_edge94:                                    ; preds = %153, %.preheader
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  ret i32 0

147:                                              ; preds = %._crit_edge90
  %148 = landingpad { ptr, i32 }
          cleanup
  br label %158

.lr.ph93:                                         ; preds = %.preheader, %153
  %indvars.iv106 = phi i64 [ %indvars.iv.next107, %153 ], [ 1, %.preheader ]
  %149 = getelementptr inbounds [70005 x i32], ptr @ans, i64 0, i64 %indvars.iv106
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %.not58 = icmp eq i32 %150, 0
  br i1 %.not58, label %151, label %152

151:                                              ; preds = %.lr.ph93
  store i32 1, ptr %149, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %151, %.lr.ph93
  invoke void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4) %149)
          to label %153 unwind label %156

153:                                              ; preds = %152
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %154 = load i32, ptr @N, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %.not57.not = icmp slt i64 %indvars.iv106, %155
  br i1 %.not57.not, label %.lr.ph93, label %._crit_edge94, !llvm.loop !16

156:                                              ; preds = %152
  %157 = landingpad { ptr, i32 }
          cleanup
  br label %158

158:                                              ; preds = %156, %147, %145, %137
  %.pn59 = phi { ptr, i32 } [ %138, %137 ], [ %146, %145 ], [ %157, %156 ], [ %148, %147 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  br label %159

159:                                              ; preds = %158, %103
  %.pn59.pn = phi { ptr, i32 } [ %.pn59, %158 ], [ %104, %103 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  br label %160

160:                                              ; preds = %159, %64
  %.pn59.pn.pn = phi { ptr, i32 } [ %.pn59.pn, %159 ], [ %65, %64 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  br label %161

161:                                              ; preds = %160, %27
  %.pn59.pn.pn.pn = phi { ptr, i32 } [ %.pn59.pn.pn, %160 ], [ %.pn, %27 ]
  resume { ptr, i32 } %.pn59.pn.pn.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5input2reIiEEvRT_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6output2psIiJEEEvRKT_DpRKT0_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

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


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