; LLVM IR from eyangch/competitive-programming :: USACOcontests/gold/2019.02 (cowland)

; 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::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" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@e = external dso_local global [100000 x i32], align 16
@graph = external dso_local global [100000 x %"class.std::vector"], align 16
@o1 = external dso_local global [100000 x i32], align 16
@o2 = external dso_local global [100000 x i32], align 16
@lg2 = external dso_local global [300000 x i32], align 16
@etour = external dso_local global %"class.std::vector", align 8
@st = external dso_local global [20 x [300000 x i32]], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = 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 noundef i32 @_Z6idminfii(i32 noundef, i32 noundef) #0

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

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

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

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

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

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

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

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

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

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

27:                                               ; preds = %37, %0
  %28 = load i32, ptr %2, align 4, !tbaa !9
  %29 = load i32, ptr @N, align 4, !tbaa !9
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

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

32:                                               ; preds = %27
  %33 = load i32, ptr %2, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %34
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %35)
  br label %37

37:                                               ; preds = %32
  %38 = load i32, ptr %2, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %2, align 4, !tbaa !9
  br label %27, !llvm.loop !11

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %62, %40
  %42 = load i32, ptr %3, align 4, !tbaa !9
  %43 = load i32, ptr @N, align 4, !tbaa !9
  %44 = sub nsw i32 %43, 1
  %45 = icmp slt i32 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %65

47:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %50 = load i32, ptr %4, align 4, !tbaa !9
  %51 = sub nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @graph, i64 0, i64 %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %54 = load i32, ptr %5, align 4, !tbaa !9
  %55 = sub nsw i32 %54, 1
  store i32 %55, ptr %6, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %53, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %56 = load i32, ptr %5, align 4, !tbaa !9
  %57 = sub nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100000 x %"class.std::vector"], ptr @graph, i64 0, i64 %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %60 = load i32, ptr %4, align 4, !tbaa !9
  %61 = sub nsw i32 %60, 1
  store i32 %61, ptr %7, align 4, !tbaa !9
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %62

62:                                               ; preds = %47
  %63 = load i32, ptr %3, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %3, align 4, !tbaa !9
  br label %41, !llvm.loop !13

65:                                               ; preds = %46
  call void @_Z3dfsiii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %88, %65
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = load i32, ptr @N, align 4, !tbaa !9
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %91

71:                                               ; preds = %66
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100000 x i32], ptr @o1, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !9
  call void @_Z3updiii(i32 noundef %75, i32 noundef %79, i32 noundef 0)
  %80 = load i32, ptr %8, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100000 x i32], ptr @o2, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !9
  call void @_Z3updiii(i32 noundef %83, i32 noundef %87, i32 noundef 0)
  br label %88

88:                                               ; preds = %71
  %89 = load i32, ptr %8, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %8, align 4, !tbaa !9
  br label %66, !llvm.loop !14

91:                                               ; preds = %70
  store i32 0, ptr getelementptr inbounds ([300000 x i32], ptr @lg2, i64 0, i64 1), align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 2, ptr %9, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %108, %91
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %95 = trunc i64 %94 to i32
  %96 = icmp sle i32 %93, %95
  br i1 %96, label %98, label %97

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

98:                                               ; preds = %92
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = sdiv i32 %99, 2
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [300000 x i32], ptr @lg2, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  %105 = load i32, ptr %9, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [300000 x i32], ptr @lg2, i64 0, i64 %106
  store i32 %104, ptr %107, align 4, !tbaa !9
  br label %108

108:                                              ; preds = %98
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %9, align 4, !tbaa !9
  br label %92, !llvm.loop !15

111:                                              ; preds = %97
  %112 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %113 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %112, ptr %113, align 8
  %114 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %115 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %114, ptr %115, align 8
  %116 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8
  %118 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8
  %120 = call noundef ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEES2_ET0_T_S8_S7_(ptr %117, ptr %119, ptr noundef @st)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %171, %111
  %122 = load i32, ptr %12, align 4, !tbaa !9
  %123 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %124 = getelementptr inbounds [300000 x i32], ptr @lg2, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = icmp sle i32 %122, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %121
  store i32 14, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %174

128:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %167, %128
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = shl i32 1, %131
  %133 = add nsw i32 %130, %132
  %134 = sub nsw i32 %133, 1
  %135 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %136 = trunc i64 %135 to i32
  %137 = icmp slt i32 %134, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %129
  store i32 17, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %170

139:                                              ; preds = %129
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = sub nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [20 x [300000 x i32]], ptr @st, i64 0, i64 %142
  %144 = load i32, ptr %14, align 4, !tbaa !9
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [300000 x i32], ptr %143, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !9
  %148 = load i32, ptr %12, align 4, !tbaa !9
  %149 = sub nsw i32 %148, 1
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [20 x [300000 x i32]], ptr @st, i64 0, i64 %150
  %152 = load i32, ptr %14, align 4, !tbaa !9
  %153 = load i32, ptr %12, align 4, !tbaa !9
  %154 = sub nsw i32 %153, 1
  %155 = shl i32 1, %154
  %156 = add nsw i32 %152, %155
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [300000 x i32], ptr %151, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !9
  %160 = call noundef i32 @_Z6idminfii(i32 noundef %147, i32 noundef %159)
  %161 = load i32, ptr %12, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [20 x [300000 x i32]], ptr @st, i64 0, i64 %162
  %164 = load i32, ptr %14, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [300000 x i32], ptr %163, i64 0, i64 %165
  store i32 %160, ptr %166, align 4, !tbaa !9
  br label %167

167:                                              ; preds = %139
  %168 = load i32, ptr %14, align 4, !tbaa !9
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %14, align 4, !tbaa !9
  br label %129, !llvm.loop !16

170:                                              ; preds = %138
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %12, align 4, !tbaa !9
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %12, align 4, !tbaa !9
  br label %121, !llvm.loop !17

174:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %175

175:                                              ; preds = %239, %174
  %176 = load i32, ptr %15, align 4, !tbaa !9
  %177 = load i32, ptr @Q, align 4, !tbaa !9
  %178 = icmp slt i32 %176, %177
  br i1 %178, label %180, label %179

179:                                              ; preds = %175
  store i32 20, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %242

180:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %181 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %182 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %181, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %183 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %182, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %184 = load i32, ptr %17, align 4, !tbaa !9
  %185 = add nsw i32 %184, -1
  store i32 %185, ptr %17, align 4, !tbaa !9
  %186 = load i32, ptr %16, align 4, !tbaa !9
  %187 = icmp eq i32 %186, 1
  br i1 %187, label %188, label %211

188:                                              ; preds = %180
  %189 = load i32, ptr %17, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [100000 x i32], ptr @o1, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !9
  %193 = load i32, ptr %18, align 4, !tbaa !9
  %194 = load i32, ptr %17, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %195
  %197 = load i32, ptr %196, align 4, !tbaa !9
  call void @_Z3updiii(i32 noundef %192, i32 noundef %193, i32 noundef %197)
  %198 = load i32, ptr %17, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [100000 x i32], ptr @o2, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !9
  %202 = load i32, ptr %18, align 4, !tbaa !9
  %203 = load i32, ptr %17, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !9
  call void @_Z3updiii(i32 noundef %201, i32 noundef %202, i32 noundef %206)
  %207 = load i32, ptr %18, align 4, !tbaa !9
  %208 = load i32, ptr %17, align 4, !tbaa !9
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %209
  store i32 %207, ptr %210, align 4, !tbaa !9
  br label %238

211:                                              ; preds = %180
  %212 = load i32, ptr %18, align 4, !tbaa !9
  %213 = add nsw i32 %212, -1
  store i32 %213, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %214 = load i32, ptr %17, align 4, !tbaa !9
  %215 = load i32, ptr %18, align 4, !tbaa !9
  %216 = call noundef i32 @_Z3lcaii(i32 noundef %214, i32 noundef %215)
  store i32 %216, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !9
  %217 = load i32, ptr %17, align 4, !tbaa !9
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100000 x i32], ptr @o1, i64 0, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !9
  %221 = call noundef i32 @_Z3qryi(i32 noundef %220)
  %222 = load i32, ptr %18, align 4, !tbaa !9
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [100000 x i32], ptr @o1, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !9
  %226 = call noundef i32 @_Z3qryi(i32 noundef %225)
  %227 = xor i32 %221, %226
  %228 = load i32, ptr %19, align 4, !tbaa !9
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !9
  %232 = xor i32 %227, %231
  %233 = load i32, ptr %20, align 4, !tbaa !9
  %234 = xor i32 %233, %232
  store i32 %234, ptr %20, align 4, !tbaa !9
  %235 = load i32, ptr %20, align 4, !tbaa !9
  %236 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %235)
  %237 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %236, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %238

238:                                              ; preds = %211, %188
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %239

239:                                              ; preds = %238
  %240 = load i32, ptr %15, align 4, !tbaa !9
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr %15, align 4, !tbaa !9
  br label %175, !llvm.loop !18

242:                                              ; preds = %179
  %243 = load i32, ptr %1, align 4
  ret i32 %243
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 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)) #5

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

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

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

@N = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@e = external dso_local global [100000 x i32], align 16
@graph = external dso_local global [100000 x %"class.std::vector"], align 16
@o1 = external dso_local local_unnamed_addr global [100000 x i32], align 16
@o2 = external dso_local local_unnamed_addr global [100000 x i32], align 16
@lg2 = external dso_local local_unnamed_addr global [300000 x i32], align 16
@etour = external dso_local global %"class.std::vector", align 8
@st = external dso_local global [20 x [300000 x i32]], align 16
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = 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 noundef i32 @_Z6idminfii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiii(i32 noundef, i32 noundef, 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 #0 align 2

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = load ptr, ptr @stdin, align 8, !tbaa !5
  %9 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.3, ptr noundef %8)
  %10 = load ptr, ptr @stdout, align 8, !tbaa !5
  %11 = tail call ptr @freopen(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, ptr noundef %10)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  %14 = load i32, ptr @N, align 4, !tbaa !9
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

.preheader43:                                     ; preds = %.lr.ph
  %16 = icmp sgt i32 %19, 1
  br i1 %16, label %.lr.ph46, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %17 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %indvars.iv
  %18 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = load i32, ptr @N, align 4, !tbaa !9
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next, %20
  br i1 %21, label %.lr.ph, label %.preheader43, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph46, %0, %.preheader43
  call void @_Z3dfsiii(i32 noundef 0, i32 noundef 0, i32 noundef 0)
  %22 = load i32, ptr @N, align 4, !tbaa !9
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph49, label %._crit_edge50

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

._crit_edge50:                                    ; preds = %.lr.ph49, %._crit_edge
  store i32 0, ptr getelementptr inbounds (i8, ptr @lg2, i64 4), align 4, !tbaa !9
  %42 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %43 = trunc i64 %42 to i32
  %.not51 = icmp slt i32 %43, 2
  br i1 %.not51, label %._crit_edge55, label %.lr.ph54

.lr.ph49:                                         ; preds = %._crit_edge, %.lr.ph49
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph49 ], [ 0, %._crit_edge ]
  %44 = getelementptr inbounds [100000 x i32], ptr @o1, i64 0, i64 %indvars.iv66
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %indvars.iv66
  %47 = load i32, ptr %46, align 4, !tbaa !9
  call void @_Z3updiii(i32 noundef %45, i32 noundef %47, i32 noundef 0)
  %48 = getelementptr inbounds [100000 x i32], ptr @o2, i64 0, i64 %indvars.iv66
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = load i32, ptr %46, align 4, !tbaa !9
  call void @_Z3updiii(i32 noundef %49, i32 noundef %50, i32 noundef 0)
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %51 = load i32, ptr @N, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = icmp slt i64 %indvars.iv.next67, %52
  br i1 %53, label %.lr.ph49, label %._crit_edge50, !llvm.loop !14

._crit_edge55:                                    ; preds = %.lr.ph54, %._crit_edge50
  %54 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %55 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %56 = call noundef ptr @_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEES2_ET0_T_S8_S7_(ptr %54, ptr %55, ptr noundef nonnull @st)
  %57 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %58 = getelementptr inbounds [300000 x i32], ptr @lg2, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %.not4060 = icmp slt i32 %59, 1
  br i1 %.not4060, label %.preheader, label %.preheader42

.lr.ph54:                                         ; preds = %._crit_edge50, %.lr.ph54
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.lr.ph54 ], [ 2, %._crit_edge50 ]
  %60 = lshr i64 %indvars.iv69, 1
  %61 = and i64 %60, 2147483647
  %62 = getelementptr inbounds [300000 x i32], ptr @lg2, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  %65 = getelementptr inbounds [300000 x i32], ptr @lg2, i64 0, i64 %indvars.iv69
  store i32 %64, ptr %65, align 4, !tbaa !9
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %66 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %sext = shl i64 %66, 32
  %67 = ashr exact i64 %sext, 32
  %.not.not = icmp slt i64 %indvars.iv69, %67
  br i1 %.not.not, label %.lr.ph54, label %._crit_edge55, !llvm.loop !15

.preheader42:                                     ; preds = %._crit_edge55, %._crit_edge59
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %._crit_edge59 ], [ 1, %._crit_edge55 ]
  %68 = trunc nuw nsw i64 %indvars.iv75 to i32
  %69 = shl nuw i32 1, %68
  %70 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %71 = trunc i64 %70 to i32
  %.not4156 = icmp sgt i32 %69, %71
  br i1 %.not4156, label %._crit_edge59, label %.lr.ph58

.lr.ph58:                                         ; preds = %.preheader42
  %72 = add nsw i64 %indvars.iv75, -1
  %73 = trunc nuw nsw i64 %72 to i32
  %74 = shl nuw i32 1, %73
  %75 = sext i32 %69 to i64
  %76 = sext i32 %74 to i64
  br label %83

.preheader:                                       ; preds = %._crit_edge59, %._crit_edge55
  %77 = load i32, ptr @Q, align 4, !tbaa !9
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %.lr.ph63, label %._crit_edge64

._crit_edge59:                                    ; preds = %83, %.preheader42
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %79 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %80 = getelementptr inbounds [300000 x i32], ptr @lg2, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %.not40.not = icmp slt i64 %indvars.iv75, %82
  br i1 %.not40.not, label %.preheader42, label %.preheader, !llvm.loop !16

83:                                               ; preds = %.lr.ph58, %83
  %indvars.iv72 = phi i64 [ 0, %.lr.ph58 ], [ %indvars.iv.next73, %83 ]
  %84 = getelementptr inbounds [20 x [300000 x i32]], ptr @st, i64 0, i64 %72, i64 %indvars.iv72
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = add nuw nsw i64 %indvars.iv72, %76
  %87 = getelementptr inbounds [20 x [300000 x i32]], ptr @st, i64 0, i64 %72, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = call noundef i32 @_Z6idminfii(i32 noundef %85, i32 noundef %88)
  %90 = getelementptr inbounds [20 x [300000 x i32]], ptr @st, i64 0, i64 %indvars.iv75, i64 %indvars.iv72
  store i32 %89, ptr %90, align 4, !tbaa !9
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %91 = add nuw nsw i64 %indvars.iv.next73, %75
  %92 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @etour) #6
  %sext78 = shl i64 %92, 32
  %93 = ashr exact i64 %sext78, 32
  %.not41 = icmp sgt i64 %91, %93
  br i1 %.not41, label %._crit_edge59, label %83, !llvm.loop !17

._crit_edge64:                                    ; preds = %140, %.preheader
  ret i32 0

.lr.ph63:                                         ; preds = %.preheader, %140
  %.03562 = phi i32 [ %141, %140 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %94 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %95 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %94, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %96 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %95, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = add nsw i32 %97, -1
  store i32 %98, ptr %6, align 4, !tbaa !9
  %99 = load i32, ptr %5, align 4, !tbaa !9
  %100 = icmp eq i32 %99, 1
  br i1 %100, label %101, label %119

101:                                              ; preds = %.lr.ph63
  %102 = sext i32 %98 to i64
  %103 = getelementptr inbounds [100000 x i32], ptr @o1, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = load i32, ptr %7, align 4, !tbaa !9
  %106 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %102
  %107 = load i32, ptr %106, align 4, !tbaa !9
  call void @_Z3updiii(i32 noundef %104, i32 noundef %105, i32 noundef %107)
  %108 = load i32, ptr %6, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100000 x i32], ptr @o2, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !9
  %112 = load i32, ptr %7, align 4, !tbaa !9
  %113 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %109
  %114 = load i32, ptr %113, align 4, !tbaa !9
  call void @_Z3updiii(i32 noundef %111, i32 noundef %112, i32 noundef %114)
  %115 = load i32, ptr %7, align 4, !tbaa !9
  %116 = load i32, ptr %6, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %117
  store i32 %115, ptr %118, align 4, !tbaa !9
  br label %140

119:                                              ; preds = %.lr.ph63
  %120 = load i32, ptr %7, align 4, !tbaa !9
  %121 = add nsw i32 %120, -1
  store i32 %121, ptr %7, align 4, !tbaa !9
  %122 = call noundef i32 @_Z3lcaii(i32 noundef %98, i32 noundef %121)
  %123 = load i32, ptr %6, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100000 x i32], ptr @o1, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !9
  %127 = call noundef i32 @_Z3qryi(i32 noundef %126)
  %128 = load i32, ptr %7, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100000 x i32], ptr @o1, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = call noundef i32 @_Z3qryi(i32 noundef %131)
  %133 = xor i32 %132, %127
  %134 = sext i32 %122 to i64
  %135 = getelementptr inbounds [100000 x i32], ptr @e, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !9
  %137 = xor i32 %133, %136
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %137)
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %138, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %140

140:                                              ; preds = %119, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %141 = add nuw nsw i32 %.03562, 1
  %142 = load i32, ptr @Q, align 4, !tbaa !9
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %.lr.ph63, label %._crit_edge64, !llvm.loop !18
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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

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

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

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


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