; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2013-14/Dec 2013 (13 Dec G3)

; 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_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"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 }

@cin = external dso_local global %"class.std::basic_ifstream", align 8
@cout = external dso_local global %"class.std::basic_ofstream", align 8
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@nex = external dso_local global [100001 x i32], align 16
@pre = external dso_local global [100001 x i32], align 16
@pos = external dso_local global [100001 x %"struct.std::pair"], align 16
@cyc = external dso_local global [100001 x %"class.std::vector"], align 16
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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 %"struct.std::pair", align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %42, %0
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr @M, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  %23 = icmp slt i32 %20, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %19
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100001 x i32], ptr @nex, i64 0, i64 %27
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100001 x i32], ptr @nex, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %32, align 4, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100001 x i32], ptr @nex, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100001 x i32], ptr @pre, i64 0, i64 %40
  store i32 %35, ptr %41, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %25
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !9

45:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %58, %45
  br label %47

47:                                               ; preds = %46
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @cyc, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %4, align 4, !tbaa !5
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %51
  %53 = getelementptr inbounds %"struct.std::pair", ptr %52, i32 0, i32 1
  store i32 %48, ptr %53, align 4, !tbaa !11
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = load i32, ptr @M, align 4, !tbaa !5
  %56 = icmp eq i32 %54, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %47
  br label %63

58:                                               ; preds = %47
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100001 x i32], ptr @pre, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  store i32 %62, ptr %3, align 4, !tbaa !5
  br label %46, !llvm.loop !13

63:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %108, %63
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = load i32, ptr @M, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  %68 = icmp slt i32 %65, %67
  br i1 %68, label %70, label %69

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

70:                                               ; preds = %64
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %72
  %74 = getelementptr inbounds %"struct.std::pair", ptr %73, i32 0, i32 0
  %75 = load i32, ptr %74, align 8, !tbaa !14
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %107

77:                                               ; preds = %70
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %79
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !11
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %107

84:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %85 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %85, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %105, %84
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @cyc, i64 0, i64 %89
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %90, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %7, align 4, !tbaa !5
  store i32 %91, ptr %9, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %94
  %96 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %95, ptr noundef nonnull align 4 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100001 x i32], ptr @nex, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  store i32 %100, ptr %6, align 4, !tbaa !5
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = icmp eq i32 %101, %102
  br i1 %103, label %104, label %105

104:                                              ; preds = %87
  br label %106

105:                                              ; preds = %87
  br label %86, !llvm.loop !15

106:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %107

107:                                              ; preds = %106, %77, %70
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %5, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %5, align 4, !tbaa !5
  br label %64, !llvm.loop !16

111:                                              ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %246, %111
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = load i32, ptr @Q, align 4, !tbaa !5
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %249

117:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %118 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %119 = load i32, ptr @N, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  %121 = load i32, ptr %11, align 4, !tbaa !5
  %122 = sub nsw i32 %120, %121
  store i32 %122, ptr %11, align 4, !tbaa !5
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = load i32, ptr @N, align 4, !tbaa !5
  %125 = load i32, ptr @M, align 4, !tbaa !5
  %126 = sub nsw i32 %124, %125
  %127 = add nsw i32 %126, 1
  %128 = icmp sle i32 %123, %127
  br i1 %128, label %129, label %153

129:                                              ; preds = %117
  %130 = load i32, ptr %11, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %133 = icmp uge i64 %131, %132
  br i1 %133, label %134, label %146

134:                                              ; preds = %129
  %135 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %136 = sub i64 %135, 1
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cyc, i64 noundef %136) #6
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr %11, align 4, !tbaa !5
  %140 = add nsw i32 %138, %139
  %141 = sext i32 %140 to i64
  %142 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %143 = sub i64 %142, 1
  %144 = sub i64 %141, %143
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @cout, i64 noundef %144)
  br label %152

146:                                              ; preds = %129
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cyc, i64 noundef %148) #6
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @cout, i32 noundef %150)
  br label %152

152:                                              ; preds = %146, %134
  br label %244

153:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %154 = load i32, ptr %11, align 4, !tbaa !5
  %155 = load i32, ptr @N, align 4, !tbaa !5
  %156 = load i32, ptr @M, align 4, !tbaa !5
  %157 = sub nsw i32 %155, %156
  %158 = add nsw i32 %157, 1
  %159 = sub nsw i32 %154, %158
  store i32 %159, ptr %12, align 4, !tbaa !5
  %160 = load i32, ptr %12, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %161
  %163 = getelementptr inbounds %"struct.std::pair", ptr %162, i32 0, i32 0
  %164 = load i32, ptr %163, align 8, !tbaa !14
  %165 = icmp eq i32 %164, 0
  br i1 %165, label %166, label %200

166:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %167 = load i32, ptr %12, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %168
  %170 = getelementptr inbounds %"struct.std::pair", ptr %169, i32 0, i32 1
  %171 = load i32, ptr %170, align 4, !tbaa !11
  %172 = load i32, ptr @N, align 4, !tbaa !5
  %173 = add nsw i32 %171, %172
  %174 = load i32, ptr @M, align 4, !tbaa !5
  %175 = sub nsw i32 %173, %174
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %13, align 4, !tbaa !5
  %177 = load i32, ptr %13, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %180 = icmp ult i64 %178, %179
  br i1 %180, label %181, label %187

181:                                              ; preds = %166
  %182 = load i32, ptr %13, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cyc, i64 noundef %183) #6
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @cout, i32 noundef %185)
  br label %199

187:                                              ; preds = %166
  %188 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %189 = sub i64 %188, 1
  %190 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cyc, i64 noundef %189) #6
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = load i32, ptr %13, align 4, !tbaa !5
  %193 = add nsw i32 %191, %192
  %194 = sext i32 %193 to i64
  %195 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %196 = sub i64 %195, 1
  %197 = sub i64 %194, %196
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @cout, i64 noundef %197)
  br label %199

199:                                              ; preds = %187, %181
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %243

200:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %201 = load i32, ptr %12, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %202
  %204 = getelementptr inbounds %"struct.std::pair", ptr %203, i32 0, i32 0
  %205 = load i32, ptr %204, align 8, !tbaa !14
  store i32 %205, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %206 = load i32, ptr %12, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %207
  %209 = getelementptr inbounds %"struct.std::pair", ptr %208, i32 0, i32 1
  %210 = load i32, ptr %209, align 4, !tbaa !11
  %211 = load i32, ptr @N, align 4, !tbaa !5
  %212 = load i32, ptr @M, align 4, !tbaa !5
  %213 = sub nsw i32 %211, %212
  %214 = add nsw i32 %213, 1
  %215 = sub nsw i32 %210, %214
  %216 = load i32, ptr %14, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @cyc, i64 0, i64 %217
  %219 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %218) #6
  %220 = trunc i64 %219 to i32
  %221 = srem i32 %215, %220
  store i32 %221, ptr %15, align 4, !tbaa !5
  br label %222

222:                                              ; preds = %225, %200
  %223 = load i32, ptr %15, align 4, !tbaa !5
  %224 = icmp slt i32 %223, 0
  br i1 %224, label %225, label %234

225:                                              ; preds = %222
  %226 = load i32, ptr %14, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @cyc, i64 0, i64 %227
  %229 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %228) #6
  %230 = load i32, ptr %15, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = add i64 %231, %229
  %233 = trunc i64 %232 to i32
  store i32 %233, ptr %15, align 4, !tbaa !5
  br label %222, !llvm.loop !17

234:                                              ; preds = %222
  %235 = load i32, ptr %14, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @cyc, i64 0, i64 %236
  %238 = load i32, ptr %15, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %237, i64 noundef %239) #6
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @cout, i32 noundef %241)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %243

243:                                              ; preds = %234, %199
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %244

244:                                              ; preds = %243, %152
  %245 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @cout, ptr noundef @.str.4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %246

246:                                              ; preds = %244
  %247 = load i32, ptr %10, align 4, !tbaa !5
  %248 = add nsw i32 %247, 1
  store i32 %248, ptr %10, align 4, !tbaa !5
  br label %112, !llvm.loop !18

249:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  %250 = load i32, ptr %1, align 4
  ret i32 %250
}

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

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

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

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

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

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

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

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

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

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

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

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


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

%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"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 }

@cin = external dso_local global %"class.std::basic_ifstream", align 8
@cout = external dso_local global %"class.std::basic_ofstream", align 8
@N = external dso_local global i32, align 4
@M = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@nex = external dso_local global [100001 x i32], align 16
@pre = external dso_local local_unnamed_addr global [100001 x i32], align 16
@pos = external dso_local global [100001 x %"struct.std::pair"], align 16
@cyc = external dso_local global [100001 x %"class.std::vector"], align 16
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  %10 = load i32, ptr @M, align 4, !tbaa !5
  %.not43 = icmp slt i32 %10, 1
  br i1 %.not43, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @cyc, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %12, i32 1
  store i32 0, ptr %13, align 4, !tbaa !9
  %14 = load i32, ptr @M, align 4, !tbaa !5
  %15 = icmp eq i32 %11, %14
  br i1 %15, label %._crit_edge48, label %.lr.ph47

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %16 = getelementptr inbounds [100001 x i32], ptr @nex, i64 0, i64 %indvars.iv
  %17 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %18 = load i32, ptr %16, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr %16, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [100001 x i32], ptr @pre, i64 0, i64 %20
  %22 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %22, ptr %21, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i32, ptr @M, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %.not.not = icmp slt i64 %indvars.iv, %24
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph47:                                         ; preds = %._crit_edge, %.lr.ph47
  %25 = phi i64 [ %30, %.lr.ph47 ], [ %12, %._crit_edge ]
  %.02545 = phi i32 [ %26, %.lr.ph47 ], [ 0, %._crit_edge ]
  %26 = add nuw nsw i32 %.02545, 1
  %27 = getelementptr inbounds [100001 x i32], ptr @pre, i64 0, i64 %25
  %28 = load i32, ptr %27, align 4, !tbaa !5
  store i32 %28, ptr %1, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) @cyc, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %30, i32 1
  store i32 %26, ptr %31, align 4, !tbaa !9
  %32 = load i32, ptr @M, align 4, !tbaa !5
  %33 = icmp eq i32 %29, %32
  br i1 %33, label %._crit_edge48, label %.lr.ph47, !llvm.loop !13

._crit_edge48:                                    ; preds = %.lr.ph47, %._crit_edge
  %34 = phi i32 [ %11, %._crit_edge ], [ %29, %.lr.ph47 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  %.not3549 = icmp slt i32 %34, 1
  br i1 %.not3549, label %._crit_edge53, label %.lr.ph52

._crit_edge53:                                    ; preds = %63, %._crit_edge48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %35 = load i32, ptr @Q, align 4, !tbaa !5
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %.lr.ph60, label %._crit_edge61

.lr.ph52:                                         ; preds = %._crit_edge48, %63
  %37 = phi i32 [ %64, %63 ], [ %34, %._crit_edge48 ]
  %storemerge3450 = phi i32 [ %66, %63 ], [ 1, %._crit_edge48 ]
  %38 = sext i32 %storemerge3450 to i64
  %39 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %38
  %40 = load i32, ptr %39, align 8, !tbaa !14
  %41 = icmp eq i32 %40, 0
  br i1 %41, label %42, label %63

42:                                               ; preds = %.lr.ph52
  %43 = getelementptr inbounds i8, ptr %39, i64 4
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %63

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 %storemerge3450, ptr %3, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %47, %46
  %48 = phi i32 [ %storemerge3450, %46 ], [ %60, %47 ]
  %.026 = phi i32 [ 0, %46 ], [ %51, %47 ]
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @cyc, i64 0, i64 %49
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %50, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %51 = add nuw nsw i32 %.026, 1
  store i32 %.026, ptr %5, align 4, !tbaa !5
  call void @_ZNSt4pairIiiEC2IRiiTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %53
  %55 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %54, ptr noundef nonnull align 4 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [100001 x i32], ptr @nex, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  store i32 %59, ptr %3, align 4, !tbaa !5
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = icmp eq i32 %59, %60
  br i1 %61, label %62, label %47, !llvm.loop !15

62:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %.pre = load i32, ptr @M, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %.lr.ph52, %42, %62
  %64 = phi i32 [ %37, %.lr.ph52 ], [ %37, %42 ], [ %.pre, %62 ]
  %65 = phi i32 [ %storemerge3450, %.lr.ph52 ], [ %storemerge3450, %42 ], [ %59, %62 ]
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %2, align 4, !tbaa !5
  %.not35.not = icmp slt i32 %65, %64
  br i1 %.not35.not, label %.lr.ph52, label %._crit_edge53, !llvm.loop !16

._crit_edge61:                                    ; preds = %139, %._crit_edge53
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph60:                                         ; preds = %._crit_edge53, %139
  %.02758 = phi i32 [ %141, %139 ], [ 0, %._crit_edge53 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %68 = load i32, ptr @N, align 4, !tbaa !5
  %69 = add i32 %68, 1
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = sub i32 %69, %70
  store i32 %71, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr @M, align 4, !tbaa !5
  %73 = sub nsw i32 %68, %72
  %74 = add nsw i32 %73, 1
  %.not36 = icmp sgt i32 %71, %74
  br i1 %.not36, label %95, label %75

75:                                               ; preds = %.lr.ph60
  %76 = sext i32 %71 to i64
  %77 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %.not37 = icmp ugt i64 %77, %76
  br i1 %.not37, label %89, label %78

78:                                               ; preds = %75
  %79 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %80 = add i64 %79, -1
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cyc, i64 noundef %80) #6
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = add nsw i32 %83, %82
  %85 = sext i32 %84 to i64
  %86 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %reass.sub = sub i64 %85, %86
  %87 = add i64 %reass.sub, 1
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @cout, i64 noundef %87)
  br label %139

89:                                               ; preds = %75
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cyc, i64 noundef %91) #6
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @cout, i32 noundef %93)
  br label %139

95:                                               ; preds = %.lr.ph60
  %96 = sub nsw i32 %71, %74
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100001 x %"struct.std::pair"], ptr @pos, i64 0, i64 %97
  %99 = load i32, ptr %98, align 8, !tbaa !14
  %100 = icmp eq i32 %99, 0
  %101 = getelementptr inbounds i8, ptr %98, i64 4
  %102 = load i32, ptr %101, align 4, !tbaa !9
  br i1 %100, label %103, label %123

103:                                              ; preds = %95
  %104 = sub i32 %69, %72
  %105 = add i32 %104, %102
  %106 = sext i32 %105 to i64
  %107 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %108 = icmp ugt i64 %107, %106
  br i1 %108, label %109, label %113

109:                                              ; preds = %103
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cyc, i64 noundef %106) #6
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @cout, i32 noundef %111)
  br label %139

113:                                              ; preds = %103
  %114 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %115 = add i64 %114, -1
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cyc, i64 noundef %115) #6
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = add nsw i32 %117, %105
  %119 = sext i32 %118 to i64
  %120 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cyc) #6
  %reass.sub62 = sub i64 %119, %120
  %121 = add i64 %reass.sub62, 1
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) @cout, i64 noundef %121)
  br label %139

123:                                              ; preds = %95
  %124 = sub nsw i32 %102, %74
  %125 = sext i32 %99 to i64
  %126 = getelementptr inbounds [100001 x %"class.std::vector"], ptr @cyc, i64 0, i64 %125
  %127 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %126) #6
  %128 = trunc i64 %127 to i32
  %129 = srem i32 %124, %128
  %130 = icmp slt i32 %129, 0
  br i1 %130, label %.lr.ph56, label %._crit_edge57

.lr.ph56:                                         ; preds = %123, %.lr.ph56
  %.054 = phi i32 [ %133, %.lr.ph56 ], [ %129, %123 ]
  %131 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %126) #6
  %132 = trunc i64 %131 to i32
  %133 = add i32 %.054, %132
  %134 = icmp slt i32 %133, 0
  br i1 %134, label %.lr.ph56, label %._crit_edge57, !llvm.loop !17

._crit_edge57:                                    ; preds = %.lr.ph56, %123
  %.0.lcssa = phi i32 [ %129, %123 ], [ %133, %.lr.ph56 ]
  %135 = zext nneg i32 %.0.lcssa to i64
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %126, i64 noundef %135) #6
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @cout, i32 noundef %137)
  br label %139

139:                                              ; preds = %._crit_edge57, %113, %109, %78, %89
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @cout, ptr noundef nonnull @.str.4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %141 = add nuw nsw i32 %.02758, 1
  %142 = load i32, ptr @Q, align 4, !tbaa !5
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %.lr.ph60, label %._crit_edge61, !llvm.loop !18
}

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

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