; LLVM IR from eyangch/competitive-programming :: Codeforces/1621 (c)

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

%"class.std::basic_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@qc = external dso_local global i64, align 8
@P = external dso_local global [10000 x i64], align 16
@vis = external dso_local global [10000 x i64], align 16
@idx = external dso_local global [10000 x i64], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3qryx(i64 noundef) #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #1

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

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

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

; 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::vector", align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::vector.0", align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"class.std::vector.0", align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %24 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %25 = getelementptr i8, ptr %24, i64 -24
  %26 = load i64, ptr %25, align 8
  %27 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %26
  %28 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %27, ptr noundef null)
  %29 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %31

31:                                               ; preds = %230, %0
  %32 = load i64, ptr @T, align 8, !tbaa !8
  %33 = add nsw i64 %32, -1
  store i64 %33, ptr @T, align 8, !tbaa !8
  %34 = icmp ne i64 %32, 0
  br i1 %34, label %35, label %232

35:                                               ; preds = %31
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  store i64 -2, ptr @qc, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #7
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %37 = load i64, ptr @N, align 8, !tbaa !8
  %38 = getelementptr inbounds i64, ptr @vis, i64 %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 -1, ptr %3, align 4, !tbaa !11
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @vis, ptr noundef %38, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %39 unwind label %48

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  %40 = load i64, ptr @N, align 8, !tbaa !8
  %41 = getelementptr inbounds i64, ptr @idx, i64 %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !11
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @idx, ptr noundef %41, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %42 unwind label %52

42:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %43

43:                                               ; preds = %187, %42
  %44 = load i64, ptr %7, align 8, !tbaa !8
  %45 = load i64, ptr @N, align 8, !tbaa !8
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %56, label %47

47:                                               ; preds = %43
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %198

48:                                               ; preds = %35
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %4, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %231

52:                                               ; preds = %39
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %4, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %231

56:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %57 = load i64, ptr %7, align 8, !tbaa !8
  %58 = invoke noundef i64 @_Z3qryx(i64 noundef %57)
          to label %59 unwind label %90

59:                                               ; preds = %56
  store i64 %58, ptr %9, align 8, !tbaa !8
  %60 = load i64, ptr %9, align 8, !tbaa !8
  %61 = getelementptr inbounds [10000 x i64], ptr @vis, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !8
  %63 = xor i64 %62, -1
  %64 = icmp ne i64 %63, 0
  br i1 %64, label %65, label %94

65:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %66 = load i64, ptr %9, align 8, !tbaa !8
  %67 = getelementptr inbounds [10000 x i64], ptr @vis, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !8
  store i64 %68, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %69 = load i64, ptr %10, align 8, !tbaa !8
  %70 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %69) #7
  %71 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #7
  store i64 %71, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %72 = load i64, ptr %9, align 8, !tbaa !8
  %73 = getelementptr inbounds [10000 x i64], ptr @idx, i64 0, i64 %72
  %74 = load i64, ptr %73, align 8, !tbaa !8
  %75 = load i64, ptr @qc, align 8, !tbaa !8
  %76 = sub nsw i64 %74, %75
  %77 = load i64, ptr %11, align 8, !tbaa !8
  %78 = srem i64 %76, %77
  %79 = load i64, ptr %11, align 8, !tbaa !8
  %80 = add nsw i64 %78, %79
  %81 = load i64, ptr %11, align 8, !tbaa !8
  %82 = srem i64 %80, %81
  store i64 %82, ptr %12, align 8, !tbaa !8
  %83 = load i64, ptr %10, align 8, !tbaa !8
  %84 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %83) #7
  %85 = load i64, ptr %12, align 8, !tbaa !8
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %85) #7
  %87 = load i64, ptr %86, align 8, !tbaa !8
  %88 = load i64, ptr %7, align 8, !tbaa !8
  %89 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %88
  store i64 %87, ptr %89, align 8, !tbaa !8
  store i32 6, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %184

90:                                               ; preds = %56
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %4, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %5, align 4
  br label %197

94:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %95 unwind label %108

95:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %96 = load i64, ptr %7, align 8, !tbaa !8
  %97 = invoke noundef i64 @_Z3qryx(i64 noundef %96)
          to label %98 unwind label %112

98:                                               ; preds = %95
  store i64 %97, ptr %14, align 8, !tbaa !8
  br label %99

99:                                               ; preds = %107, %98
  %100 = load i64, ptr %14, align 8, !tbaa !8
  %101 = load i64, ptr %9, align 8, !tbaa !8
  %102 = icmp ne i64 %100, %101
  br i1 %102, label %103, label %116

103:                                              ; preds = %99
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %104 unwind label %112

104:                                              ; preds = %103
  %105 = load i64, ptr %7, align 8, !tbaa !8
  %106 = invoke noundef i64 @_Z3qryx(i64 noundef %105)
          to label %107 unwind label %112

107:                                              ; preds = %104
  store i64 %106, ptr %14, align 8, !tbaa !8
  br label %99, !llvm.loop !13

108:                                              ; preds = %94
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %4, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %5, align 4
  br label %196

112:                                              ; preds = %104, %103, %95
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %4, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %5, align 4
  br label %195

116:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %117 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  store i64 %117, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %118 = load i64, ptr @qc, align 8, !tbaa !8
  %119 = sub nsw i64 0, %118
  store i64 %119, ptr %17, align 8, !tbaa !8
  br label %120

120:                                              ; preds = %138, %116
  %121 = load i64, ptr %17, align 8, !tbaa !8
  %122 = load i64, ptr @qc, align 8, !tbaa !8
  %123 = sub nsw i64 0, %122
  %124 = load i64, ptr %15, align 8, !tbaa !8
  %125 = add nsw i64 %123, %124
  %126 = icmp slt i64 %121, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %120
  store i32 9, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %145

128:                                              ; preds = %120
  %129 = load i64, ptr %17, align 8, !tbaa !8
  %130 = load i64, ptr %15, align 8, !tbaa !8
  %131 = srem i64 %129, %130
  %132 = load i64, ptr %15, align 8, !tbaa !8
  %133 = add nsw i64 %131, %132
  %134 = load i64, ptr %15, align 8, !tbaa !8
  %135 = srem i64 %133, %134
  %136 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %13, i64 noundef %135) #7
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(8) %136)
          to label %137 unwind label %141

137:                                              ; preds = %128
  br label %138

138:                                              ; preds = %137
  %139 = load i64, ptr %17, align 8, !tbaa !8
  %140 = add nsw i64 %139, 1
  store i64 %140, ptr %17, align 8, !tbaa !8
  br label %120, !llvm.loop !15

141:                                              ; preds = %128
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %4, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %194

145:                                              ; preds = %127
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0) #7
  %147 = load i64, ptr %146, align 8, !tbaa !8
  %148 = load i64, ptr %7, align 8, !tbaa !8
  %149 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %148
  store i64 %147, ptr %149, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store ptr %16, ptr %18, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %150 = load ptr, ptr %18, align 8, !tbaa !16
  %151 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %150) #7
  %152 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %151, ptr %152, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %153 = load ptr, ptr %18, align 8, !tbaa !16
  %154 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %153) #7
  %155 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %154, ptr %155, align 8
  br label %156

156:                                              ; preds = %165, %145
  %157 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br i1 %157, label %159, label %158

158:                                              ; preds = %156
  store i32 12, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %167

159:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  %161 = load i64, ptr %160, align 8, !tbaa !8
  store i64 %161, ptr %21, align 8, !tbaa !8
  %162 = call noundef i64 @_ZNKSt6vectorIS_IxSaIxEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  %163 = load i64, ptr %21, align 8, !tbaa !8
  %164 = getelementptr inbounds [10000 x i64], ptr @vis, i64 0, i64 %163
  store i64 %162, ptr %164, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %165

165:                                              ; preds = %159
  %166 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br label %156

167:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 0, ptr %22, align 8, !tbaa !8
  br label %168

168:                                              ; preds = %179, %167
  %169 = load i64, ptr %22, align 8, !tbaa !8
  %170 = load i64, ptr %15, align 8, !tbaa !8
  %171 = icmp slt i64 %169, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %168
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %182

173:                                              ; preds = %168
  %174 = load i64, ptr %22, align 8, !tbaa !8
  %175 = load i64, ptr %22, align 8, !tbaa !8
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %175) #7
  %177 = load i64, ptr %176, align 8, !tbaa !8
  %178 = getelementptr inbounds [10000 x i64], ptr @idx, i64 0, i64 %177
  store i64 %174, ptr %178, align 8, !tbaa !8
  br label %179

179:                                              ; preds = %173
  %180 = load i64, ptr %22, align 8, !tbaa !8
  %181 = add nsw i64 %180, 1
  store i64 %181, ptr %22, align 8, !tbaa !8
  br label %168, !llvm.loop !18

182:                                              ; preds = %172
  invoke void @_ZNSt6vectorIS_IxSaIxEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %16)
          to label %183 unwind label %190

183:                                              ; preds = %182
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  store i32 0, ptr %8, align 4
  br label %184

184:                                              ; preds = %183, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  %185 = load i32, ptr %8, align 4
  switch i32 %185, label %239 [
    i32 0, label %186
    i32 6, label %187
  ]

186:                                              ; preds = %184
  br label %187

187:                                              ; preds = %186, %184
  %188 = load i64, ptr %7, align 8, !tbaa !8
  %189 = add nsw i64 %188, 1
  store i64 %189, ptr %7, align 8, !tbaa !8
  br label %43, !llvm.loop !19

190:                                              ; preds = %182
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %4, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %5, align 4
  br label %194

194:                                              ; preds = %190, %141
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %195

195:                                              ; preds = %194, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %196

196:                                              ; preds = %195, %108
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  br label %197

197:                                              ; preds = %196, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %231

198:                                              ; preds = %47
  %199 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 33)
          to label %200 unwind label %206

200:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store i64 0, ptr %23, align 8, !tbaa !8
  br label %201

201:                                              ; preds = %219, %200
  %202 = load i64, ptr %23, align 8, !tbaa !8
  %203 = load i64, ptr @N, align 8, !tbaa !8
  %204 = icmp slt i64 %202, %203
  br i1 %204, label %210, label %205

205:                                              ; preds = %201
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %226

206:                                              ; preds = %228, %226, %198
  %207 = landingpad { ptr, i32 }
          cleanup
  %208 = extractvalue { ptr, i32 } %207, 0
  store ptr %208, ptr %4, align 8
  %209 = extractvalue { ptr, i32 } %207, 1
  store i32 %209, ptr %5, align 4
  br label %231

210:                                              ; preds = %201
  %211 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 32)
          to label %212 unwind label %222

212:                                              ; preds = %210
  %213 = load i64, ptr %23, align 8, !tbaa !8
  %214 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %213
  %215 = load i64, ptr %214, align 8, !tbaa !8
  %216 = add nsw i64 %215, 1
  %217 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %211, i64 noundef %216)
          to label %218 unwind label %222

218:                                              ; preds = %212
  br label %219

219:                                              ; preds = %218
  %220 = load i64, ptr %23, align 8, !tbaa !8
  %221 = add nsw i64 %220, 1
  store i64 %221, ptr %23, align 8, !tbaa !8
  br label %201, !llvm.loop !20

222:                                              ; preds = %212, %210
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %4, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %231

226:                                              ; preds = %205
  %227 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
          to label %228 unwind label %206

228:                                              ; preds = %226
  %229 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout)
          to label %230 unwind label %206

230:                                              ; preds = %228
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #7
  br label %31, !llvm.loop !21

231:                                              ; preds = %222, %206, %197, %52, %48
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #7
  br label %234

232:                                              ; preds = %31
  %233 = load i32, ptr %1, align 4
  ret i32 %233

234:                                              ; preds = %231
  %235 = load ptr, ptr %4, align 8
  %236 = load i32, ptr %5, align 4
  %237 = insertvalue { ptr, i32 } poison, ptr %235, 0
  %238 = insertvalue { ptr, i32 } %237, i32 %236, 1
  resume { ptr, i32 } %238

239:                                              ; preds = %184
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #5 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


; 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::basic_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<long long>, std::allocator<std::vector<long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@qc = external dso_local local_unnamed_addr global i64, align 8
@P = external dso_local local_unnamed_addr global [10000 x i64], align 16
@vis = external dso_local global [10000 x i64], align 16
@idx = external dso_local global [10000 x i64], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3qryx(i64 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #1

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::vector.0", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::vector.0", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %17 = load i64, ptr @T, align 8, !tbaa !8
  %18 = add nsw i64 %17, -1
  store i64 %18, ptr @T, align 8, !tbaa !8
  %.not66 = icmp eq i64 %17, 0
  br i1 %.not66, label %._crit_edge69, label %.lr.ph68

.lr.ph68:                                         ; preds = %0, %127
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  store i64 -2, ptr @qc, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #7
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %20 = load i64, ptr @N, align 8, !tbaa !8
  %21 = getelementptr inbounds i64, ptr @vis, i64 %20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 -1, ptr %2, align 4, !tbaa !11
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @vis, ptr noundef nonnull %21, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %22 unwind label %31

22:                                               ; preds = %.lr.ph68
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %23 = load i64, ptr @N, align 8, !tbaa !8
  %24 = getelementptr inbounds i64, ptr @idx, i64 %23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !11
  invoke void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @idx, ptr noundef nonnull %24, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %25 unwind label %33

25:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = icmp sgt i64 %26, 0
  br i1 %27, label %.lr.ph61, label %._crit_edge62

._crit_edge62:                                    ; preds = %100, %25
  %28 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 33)
          to label %.preheader50 unwind label %111

.preheader50:                                     ; preds = %._crit_edge62
  %29 = load i64, ptr @N, align 8, !tbaa !8
  %30 = icmp sgt i64 %29, 0
  br i1 %30, label %.lr.ph64, label %._crit_edge65

31:                                               ; preds = %.lr.ph68
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  br label %130

33:                                               ; preds = %22
  %34 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %130

.lr.ph61:                                         ; preds = %25, %100
  %.04159 = phi i64 [ %101, %100 ], [ 0, %25 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %35 = invoke noundef i64 @_Z3qryx(i64 noundef %.04159)
          to label %36 unwind label %54

36:                                               ; preds = %.lr.ph61
  store i64 %35, ptr %4, align 8, !tbaa !8
  %37 = getelementptr inbounds [10000 x i64], ptr @vis, i64 0, i64 %35
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %.not42 = icmp eq i64 %38, -1
  br i1 %.not42, label %56, label %39

39:                                               ; preds = %36
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %38) #7
  %41 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #7
  %42 = load i64, ptr %4, align 8, !tbaa !8
  %43 = getelementptr inbounds [10000 x i64], ptr @idx, i64 0, i64 %42
  %44 = load i64, ptr %43, align 8, !tbaa !8
  %45 = load i64, ptr @qc, align 8, !tbaa !8
  %46 = sub nsw i64 %44, %45
  %47 = srem i64 %46, %41
  %48 = add nsw i64 %47, %41
  %49 = srem i64 %48, %41
  %50 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IxSaIxEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %38) #7
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %49) #7
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %.04159
  store i64 %52, ptr %53, align 8, !tbaa !8
  br label %100

54:                                               ; preds = %.lr.ph61
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %109

56:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %57 unwind label %63

57:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %58 = invoke noundef i64 @_Z3qryx(i64 noundef %.04159)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %57, %61
  %storemerge = phi i64 [ %62, %61 ], [ %58, %57 ]
  store i64 %storemerge, ptr %6, align 8, !tbaa !8
  %59 = load i64, ptr %4, align 8, !tbaa !8
  %.not43 = icmp eq i64 %storemerge, %59
  br i1 %.not43, label %65, label %60

60:                                               ; preds = %.preheader
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %61 unwind label %.loopexit

61:                                               ; preds = %60
  %62 = invoke noundef i64 @_Z3qryx(i64 noundef %.04159)
          to label %.preheader unwind label %.loopexit, !llvm.loop !13

63:                                               ; preds = %56
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %108

.loopexit:                                        ; preds = %60, %61
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %107

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

65:                                               ; preds = %.preheader
  %66 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  %67 = load i64, ptr @qc, align 8, !tbaa !8
  %68 = sub nsw i64 0, %67
  %69 = sub i64 %66, %67
  %70 = icmp sgt i64 %69, %68
  br i1 %70, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %81, %65
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 0) #7
  %72 = load i64, ptr %71, align 8, !tbaa !8
  %73 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %.04159
  store i64 %72, ptr %73, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %74 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  store ptr %74, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %75 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  store ptr %75, ptr %9, align 8
  %76 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %76, label %.lr.ph53, label %._crit_edge54

.lr.ph:                                           ; preds = %65, %81
  %.04051 = phi i64 [ %82, %81 ], [ %68, %65 ]
  %77 = srem i64 %.04051, %66
  %78 = add nsw i64 %77, %66
  %79 = srem i64 %78, %66
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %79) #7
  invoke void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(8) %80)
          to label %81 unwind label %86

81:                                               ; preds = %.lr.ph
  %82 = add nsw i64 %.04051, 1
  %83 = load i64, ptr @qc, align 8, !tbaa !8
  %84 = sub i64 %66, %83
  %85 = icmp slt i64 %82, %84
  br i1 %85, label %.lr.ph, label %._crit_edge, !llvm.loop !15

86:                                               ; preds = %.lr.ph
  %87 = landingpad { ptr, i32 }
          cleanup
  br label %106

._crit_edge54:                                    ; preds = %.lr.ph53, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %88 = icmp sgt i64 %66, 0
  br i1 %88, label %.lr.ph57, label %._crit_edge58

.lr.ph53:                                         ; preds = %._crit_edge, %.lr.ph53
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %90 = load i64, ptr %89, align 8, !tbaa !8
  %91 = call noundef i64 @_ZNKSt6vectorIS_IxSaIxEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  %92 = getelementptr inbounds [10000 x i64], ptr @vis, i64 0, i64 %90
  store i64 %91, ptr %92, align 8, !tbaa !8
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %94 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br i1 %94, label %.lr.ph53, label %._crit_edge54

._crit_edge58:                                    ; preds = %.lr.ph57, %._crit_edge54
  invoke void @_ZNSt6vectorIS_IxSaIxEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %99 unwind label %104

.lr.ph57:                                         ; preds = %._crit_edge54, %.lr.ph57
  %.03355 = phi i64 [ %98, %.lr.ph57 ], [ 0, %._crit_edge54 ]
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %.03355) #7
  %96 = load i64, ptr %95, align 8, !tbaa !8
  %97 = getelementptr inbounds [10000 x i64], ptr @idx, i64 0, i64 %96
  store i64 %.03355, ptr %97, align 8, !tbaa !8
  %98 = add nuw nsw i64 %.03355, 1
  %exitcond.not = icmp eq i64 %98, %66
  br i1 %exitcond.not, label %._crit_edge58, label %.lr.ph57, !llvm.loop !16

99:                                               ; preds = %._crit_edge58
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  br label %100

100:                                              ; preds = %99, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  %101 = add nuw nsw i64 %.04159, 1
  %102 = load i64, ptr @N, align 8, !tbaa !8
  %103 = icmp slt i64 %101, %102
  br i1 %103, label %.lr.ph61, label %._crit_edge62, !llvm.loop !17

104:                                              ; preds = %._crit_edge58
  %105 = landingpad { ptr, i32 }
          cleanup
  br label %106

106:                                              ; preds = %104, %86
  %.pn = phi { ptr, i32 } [ %87, %86 ], [ %105, %104 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  br label %107

107:                                              ; preds = %.loopexit, %.loopexit.split-lp, %106
  %.pn45 = phi { ptr, i32 } [ %.pn, %106 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %108

108:                                              ; preds = %107, %63
  %.pn45.pn = phi { ptr, i32 } [ %.pn45, %107 ], [ %64, %63 ]
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #7
  br label %109

109:                                              ; preds = %108, %54
  %.pn45.pn.pn = phi { ptr, i32 } [ %.pn45.pn, %108 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %130

._crit_edge65:                                    ; preds = %119, %.preheader50
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
          to label %125 unwind label %111

111:                                              ; preds = %125, %._crit_edge65, %._crit_edge62
  %112 = landingpad { ptr, i32 }
          cleanup
  br label %130

.lr.ph64:                                         ; preds = %.preheader50, %119
  %.063 = phi i64 [ %120, %119 ], [ 0, %.preheader50 ]
  %113 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 32)
          to label %114 unwind label %123

114:                                              ; preds = %.lr.ph64
  %115 = getelementptr inbounds [10000 x i64], ptr @P, i64 0, i64 %.063
  %116 = load i64, ptr %115, align 8, !tbaa !8
  %117 = add nsw i64 %116, 1
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %113, i64 noundef %117)
          to label %119 unwind label %123

119:                                              ; preds = %114
  %120 = add nuw nsw i64 %.063, 1
  %121 = load i64, ptr @N, align 8, !tbaa !8
  %122 = icmp slt i64 %120, %121
  br i1 %122, label %.lr.ph64, label %._crit_edge65, !llvm.loop !18

123:                                              ; preds = %114, %.lr.ph64
  %124 = landingpad { ptr, i32 }
          cleanup
  br label %130

125:                                              ; preds = %._crit_edge65
  %126 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout)
          to label %127 unwind label %111

127:                                              ; preds = %125
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  %128 = load i64, ptr @T, align 8, !tbaa !8
  %129 = add nsw i64 %128, -1
  store i64 %129, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %128, 0
  br i1 %.not, label %._crit_edge69, label %.lr.ph68, !llvm.loop !19

130:                                              ; preds = %123, %111, %109, %33, %31
  %.pn45.pn.pn.pn = phi { ptr, i32 } [ %.pn45.pn.pn, %109 ], [ %124, %123 ], [ %112, %111 ], [ %34, %33 ], [ %32, %31 ]
  call void @_ZNSt6vectorIS_IxSaIxEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn45.pn.pn.pn

._crit_edge69:                                    ; preds = %127, %0
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #5 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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