; LLVM IR from kazunetakahashi/atcoder :: 2017/0415_AGC013 (C2)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@L = external dso_local global i64, align 8
@T = external dso_local global i64, align 8
@X = external dso_local global [100010 x i64], align 16
@W = external dso_local global [100010 x i32], align 16
@ans = external dso_local global [100010 x i32], align 16
@V = external dso_local global [2 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 ptr, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) @L)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) @T)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %28

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

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %59

33:                                               ; preds = %28
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %35
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %36)
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100010 x i32], ptr @W, i64 0, i64 %39
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 4 dereferenceable(4) %40)
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100010 x i32], ptr @W, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr %44, align 4, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [100010 x i32], ptr @W, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [2 x %"class.std::vector"], ptr @V, i64 0, i64 %51
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %54
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %52, ptr noundef nonnull align 8 dereferenceable(8) %55)
  br label %56

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

59:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %116, %59
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = load i32, ptr @N, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %119

65:                                               ; preds = %60
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100010 x i32], ptr @W, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %92

71:                                               ; preds = %65
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !11
  %76 = load i64, ptr @T, align 8, !tbaa !11
  %77 = load i64, ptr @L, align 8, !tbaa !11
  %78 = srem i64 %76, %77
  %79 = add nsw i64 %75, %78
  %80 = trunc i64 %79 to i32
  %81 = load i32, ptr %3, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %82
  store i32 %80, ptr %83, align 4, !tbaa !5
  %84 = load i64, ptr @L, align 8, !tbaa !11
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = srem i64 %89, %84
  %91 = trunc i64 %90 to i32
  store i32 %91, ptr %87, align 4, !tbaa !5
  br label %115

92:                                               ; preds = %65
  %93 = load i32, ptr %3, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !11
  %97 = load i64, ptr @L, align 8, !tbaa !11
  %98 = add nsw i64 %96, %97
  %99 = load i64, ptr @T, align 8, !tbaa !11
  %100 = load i64, ptr @L, align 8, !tbaa !11
  %101 = srem i64 %99, %100
  %102 = sub nsw i64 %98, %101
  %103 = trunc i64 %102 to i32
  %104 = load i32, ptr %3, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %105
  store i32 %103, ptr %106, align 4, !tbaa !5
  %107 = load i64, ptr @L, align 8, !tbaa !11
  %108 = load i32, ptr %3, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = srem i64 %112, %107
  %114 = trunc i64 %113 to i32
  store i32 %114, ptr %110, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %92, %71
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %3, align 4, !tbaa !5
  br label %60, !llvm.loop !13

119:                                              ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  %120 = load i32, ptr @W, align 16, !tbaa !5
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %122, label %187

122:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %123 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([2 x %"class.std::vector"], ptr @V, i64 0, i64 1)) #7
  %124 = trunc i64 %123 to i32
  store i32 %124, ptr %5, align 4, !tbaa !5
  %125 = load i64, ptr @T, align 8, !tbaa !11
  %126 = load i64, ptr @L, align 8, !tbaa !11
  %127 = sdiv i64 %125, %126
  %128 = mul nsw i64 %127, 2
  %129 = load i32, ptr %5, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = mul nsw i64 %128, %130
  %132 = load i32, ptr %4, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = add nsw i64 %133, %131
  %135 = trunc i64 %134 to i32
  store i32 %135, ptr %4, align 4, !tbaa !5
  %136 = load i32, ptr @N, align 4, !tbaa !5
  %137 = load i32, ptr %4, align 4, !tbaa !5
  %138 = srem i32 %137, %136
  store i32 %138, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %139 = load i64, ptr @T, align 8, !tbaa !11
  %140 = load i64, ptr @L, align 8, !tbaa !11
  %141 = srem i64 %139, %140
  %142 = trunc i64 %141 to i32
  store i32 %142, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store ptr getelementptr (i8, ptr @V, i64 24), ptr %7, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %143 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr (i8, ptr @V, i64 24)) #7
  %144 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %143, ptr %144, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %145 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr (i8, ptr @V, i64 24)) #7
  %146 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %145, ptr %146, align 8
  br label %147

147:                                              ; preds = %181, %122
  %148 = 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 %148, label %150, label %149

149:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %183

150:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  %152 = load i64, ptr %151, align 8, !tbaa !11
  store i64 %152, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %153 = load i64, ptr %10, align 8, !tbaa !11
  %154 = load i64, ptr @L, align 8, !tbaa !11
  %155 = add nsw i64 %153, %154
  %156 = load i64, ptr @X, align 16, !tbaa !11
  %157 = sub nsw i64 %155, %156
  %158 = load i64, ptr @L, align 8, !tbaa !11
  %159 = srem i64 %157, %158
  %160 = trunc i64 %159 to i32
  store i32 %160, ptr %11, align 4, !tbaa !5
  %161 = load i32, ptr %11, align 4, !tbaa !5
  %162 = load i32, ptr %6, align 4, !tbaa !5
  %163 = mul nsw i32 2, %162
  %164 = icmp sle i32 %161, %163
  br i1 %164, label %165, label %168

165:                                              ; preds = %150
  %166 = load i32, ptr %4, align 4, !tbaa !5
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %4, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %165, %150
  %169 = load i32, ptr %11, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = load i64, ptr @L, align 8, !tbaa !11
  %172 = add nsw i64 %170, %171
  %173 = load i32, ptr %6, align 4, !tbaa !5
  %174 = mul nsw i32 2, %173
  %175 = sext i32 %174 to i64
  %176 = icmp sle i64 %172, %175
  br i1 %176, label %177, label %180

177:                                              ; preds = %168
  %178 = load i32, ptr %4, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %4, align 4, !tbaa !5
  br label %180

180:                                              ; preds = %177, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %181

181:                                              ; preds = %180
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  br label %147

183:                                              ; preds = %149
  %184 = load i32, ptr @N, align 4, !tbaa !5
  %185 = load i32, ptr %4, align 4, !tbaa !5
  %186 = srem i32 %185, %184
  store i32 %186, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %268

187:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %188 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %189 = trunc i64 %188 to i32
  store i32 %189, ptr %12, align 4, !tbaa !5
  %190 = load i32, ptr @N, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = load i64, ptr @T, align 8, !tbaa !11
  %193 = load i64, ptr @L, align 8, !tbaa !11
  %194 = sdiv i64 %192, %193
  %195 = mul nsw i64 %194, 2
  %196 = load i32, ptr %12, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = mul nsw i64 %195, %197
  %199 = load i32, ptr @N, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = srem i64 %198, %200
  %202 = sub nsw i64 %191, %201
  %203 = load i32, ptr %4, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = add nsw i64 %204, %202
  %206 = trunc i64 %205 to i32
  store i32 %206, ptr %4, align 4, !tbaa !5
  %207 = load i32, ptr @N, align 4, !tbaa !5
  %208 = load i32, ptr %4, align 4, !tbaa !5
  %209 = srem i32 %208, %207
  store i32 %209, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %210 = load i64, ptr @T, align 8, !tbaa !11
  %211 = load i64, ptr @L, align 8, !tbaa !11
  %212 = srem i64 %210, %211
  %213 = trunc i64 %212 to i32
  store i32 %213, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store ptr @V, ptr %14, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %214 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %215 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %214, ptr %215, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %216 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %217 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %216, ptr %217, align 8
  br label %218

218:                                              ; preds = %262, %187
  %219 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  br i1 %219, label %221, label %220

220:                                              ; preds = %218
  call void @llvm.lifetime.end.p0(i64 8, 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
  br label %264

221:                                              ; preds = %218
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %222 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  %223 = load i64, ptr %222, align 8, !tbaa !11
  store i64 %223, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %224 = load i64, ptr @X, align 16, !tbaa !11
  %225 = load i64, ptr @L, align 8, !tbaa !11
  %226 = add nsw i64 %224, %225
  %227 = load i64, ptr %17, align 8, !tbaa !11
  %228 = sub nsw i64 %226, %227
  %229 = load i64, ptr @L, align 8, !tbaa !11
  %230 = srem i64 %228, %229
  %231 = trunc i64 %230 to i32
  store i32 %231, ptr %18, align 4, !tbaa !5
  %232 = load i32, ptr %18, align 4, !tbaa !5
  %233 = load i32, ptr %13, align 4, !tbaa !5
  %234 = mul nsw i32 2, %233
  %235 = icmp sle i32 %232, %234
  br i1 %235, label %236, label %244

236:                                              ; preds = %221
  %237 = load i32, ptr @N, align 4, !tbaa !5
  %238 = sub nsw i32 %237, 1
  %239 = load i32, ptr %4, align 4, !tbaa !5
  %240 = add nsw i32 %239, %238
  store i32 %240, ptr %4, align 4, !tbaa !5
  %241 = load i32, ptr @N, align 4, !tbaa !5
  %242 = load i32, ptr %4, align 4, !tbaa !5
  %243 = srem i32 %242, %241
  store i32 %243, ptr %4, align 4, !tbaa !5
  br label %244

244:                                              ; preds = %236, %221
  %245 = load i32, ptr %18, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = load i64, ptr @L, align 8, !tbaa !11
  %248 = add nsw i64 %246, %247
  %249 = load i32, ptr %13, align 4, !tbaa !5
  %250 = mul nsw i32 2, %249
  %251 = sext i32 %250 to i64
  %252 = icmp sle i64 %248, %251
  br i1 %252, label %253, label %261

253:                                              ; preds = %244
  %254 = load i32, ptr @N, align 4, !tbaa !5
  %255 = sub nsw i32 %254, 1
  %256 = load i32, ptr %4, align 4, !tbaa !5
  %257 = add nsw i32 %256, %255
  store i32 %257, ptr %4, align 4, !tbaa !5
  %258 = load i32, ptr @N, align 4, !tbaa !5
  %259 = load i32, ptr %4, align 4, !tbaa !5
  %260 = srem i32 %259, %258
  store i32 %260, ptr %4, align 4, !tbaa !5
  br label %261

261:                                              ; preds = %253, %244
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %262

262:                                              ; preds = %261
  %263 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br label %218

264:                                              ; preds = %220
  %265 = load i32, ptr @N, align 4, !tbaa !5
  %266 = load i32, ptr %4, align 4, !tbaa !5
  %267 = srem i32 %266, %265
  store i32 %267, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %268

268:                                              ; preds = %264, %183
  %269 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  %270 = load i32, ptr %4, align 4, !tbaa !5
  %271 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %269, i32 noundef %270)
  %272 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %271, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %273 = load i32, ptr @ans, align 16, !tbaa !5
  store i32 %273, ptr %19, align 4, !tbaa !5
  %274 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.2)
  %275 = load i32, ptr %19, align 4, !tbaa !5
  %276 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %274, i32 noundef %275)
  %277 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %276, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %278 = load i32, ptr @N, align 4, !tbaa !5
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds i32, ptr @ans, i64 %279
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @ans, ptr noundef %280)
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  %281 = load i32, ptr @W, align 16, !tbaa !5
  %282 = icmp eq i32 %281, 0
  br i1 %282, label %283, label %311

283:                                              ; preds = %268
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %284 = load i32, ptr @N, align 4, !tbaa !5
  %285 = sub nsw i32 %284, 1
  store i32 %285, ptr %21, align 4, !tbaa !5
  br label %286

286:                                              ; preds = %306, %283
  %287 = load i32, ptr %21, align 4, !tbaa !5
  %288 = icmp sge i32 %287, 0
  br i1 %288, label %290, label %289

289:                                              ; preds = %286
  store i32 12, ptr %22, align 4
  br label %309

290:                                              ; preds = %286
  %291 = load i32, ptr %19, align 4, !tbaa !5
  %292 = load i32, ptr %21, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %293
  %295 = load i32, ptr %294, align 4, !tbaa !5
  %296 = icmp eq i32 %291, %295
  br i1 %296, label %297, label %305

297:                                              ; preds = %290
  %298 = load i32, ptr %21, align 4, !tbaa !5
  %299 = load i32, ptr @N, align 4, !tbaa !5
  %300 = add nsw i32 %298, %299
  %301 = load i32, ptr %4, align 4, !tbaa !5
  %302 = sub nsw i32 %300, %301
  %303 = load i32, ptr @N, align 4, !tbaa !5
  %304 = srem i32 %302, %303
  store i32 %304, ptr %20, align 4, !tbaa !5
  store i32 12, ptr %22, align 4
  br label %309

305:                                              ; preds = %290
  br label %306

306:                                              ; preds = %305
  %307 = load i32, ptr %21, align 4, !tbaa !5
  %308 = add nsw i32 %307, -1
  store i32 %308, ptr %21, align 4, !tbaa !5
  br label %286, !llvm.loop !16

309:                                              ; preds = %297, %289
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %310

310:                                              ; preds = %309
  br label %338

311:                                              ; preds = %268
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %312

312:                                              ; preds = %333, %311
  %313 = load i32, ptr %23, align 4, !tbaa !5
  %314 = load i32, ptr @N, align 4, !tbaa !5
  %315 = icmp slt i32 %313, %314
  br i1 %315, label %317, label %316

316:                                              ; preds = %312
  store i32 15, ptr %22, align 4
  br label %336

317:                                              ; preds = %312
  %318 = load i32, ptr %19, align 4, !tbaa !5
  %319 = load i32, ptr %23, align 4, !tbaa !5
  %320 = sext i32 %319 to i64
  %321 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %320
  %322 = load i32, ptr %321, align 4, !tbaa !5
  %323 = icmp eq i32 %318, %322
  br i1 %323, label %324, label %332

324:                                              ; preds = %317
  %325 = load i32, ptr %23, align 4, !tbaa !5
  %326 = load i32, ptr @N, align 4, !tbaa !5
  %327 = add nsw i32 %325, %326
  %328 = load i32, ptr %4, align 4, !tbaa !5
  %329 = sub nsw i32 %327, %328
  %330 = load i32, ptr @N, align 4, !tbaa !5
  %331 = srem i32 %329, %330
  store i32 %331, ptr %20, align 4, !tbaa !5
  store i32 15, ptr %22, align 4
  br label %336

332:                                              ; preds = %317
  br label %333

333:                                              ; preds = %332
  %334 = load i32, ptr %23, align 4, !tbaa !5
  %335 = add nsw i32 %334, 1
  store i32 %335, ptr %23, align 4, !tbaa !5
  br label %312, !llvm.loop !17

336:                                              ; preds = %324, %316
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %337

337:                                              ; preds = %336
  br label %338

338:                                              ; preds = %337, %310
  %339 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.3)
  %340 = load i32, ptr %20, align 4, !tbaa !5
  %341 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %339, i32 noundef %340)
  %342 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %341, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %343

343:                                              ; preds = %359, %338
  %344 = load i32, ptr %24, align 4, !tbaa !5
  %345 = load i32, ptr @N, align 4, !tbaa !5
  %346 = icmp slt i32 %344, %345
  br i1 %346, label %348, label %347

347:                                              ; preds = %343
  store i32 18, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %362

348:                                              ; preds = %343
  %349 = load i32, ptr %20, align 4, !tbaa !5
  %350 = load i32, ptr %24, align 4, !tbaa !5
  %351 = add nsw i32 %349, %350
  %352 = load i32, ptr @N, align 4, !tbaa !5
  %353 = srem i32 %351, %352
  %354 = sext i32 %353 to i64
  %355 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %354
  %356 = load i32, ptr %355, align 4, !tbaa !5
  %357 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %356)
  %358 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %357, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %359

359:                                              ; preds = %348
  %360 = load i32, ptr %24, align 4, !tbaa !5
  %361 = add nsw i32 %360, 1
  store i32 %361, ptr %24, align 4, !tbaa !5
  br label %343, !llvm.loop !18

362:                                              ; preds = %347
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %363 = load i32, ptr %1, align 4
  ret i32 %363
}

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: 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)) #2 align 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 dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #2 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

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

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

; 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) #6

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #6

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@N = external dso_local global i32, align 4
@L = external dso_local global i64, align 8
@T = external dso_local global i64, align 8
@X = external dso_local global [100010 x i64], align 16
@W = external dso_local global [100010 x i32], align 16
@ans = external dso_local global [100010 x i32], align 16
@V = external dso_local global [2 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) @L)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %8 = load i32, ptr @N, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

.preheader81:                                     ; preds = %.lr.ph
  %10 = icmp sgt i32 %21, 0
  br i1 %10, label %.lr.ph87, label %._crit_edge

.lr.ph87:                                         ; preds = %.preheader81
  %11 = load i64, ptr @L, align 8
  %12 = load i64, ptr @T, align 8
  %wide.trip.count = zext nneg i32 %21 to i64
  br label %26

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %13 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %indvars.iv
  %14 = 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) %13)
  %15 = getelementptr inbounds [100010 x i32], ptr @W, i64 0, i64 %indvars.iv
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %17 = load i32, ptr %15, align 4, !tbaa !5
  %18 = add nsw i32 %17, -1
  store i32 %18, ptr %15, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [2 x %"class.std::vector"], ptr @V, i64 0, i64 %19
  tail call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr @N, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next, %22
  br i1 %23, label %.lr.ph, label %.preheader81, !llvm.loop !9

._crit_edge:                                      ; preds = %39, %0, %.preheader81
  %24 = load i32, ptr @W, align 16, !tbaa !5
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %41, label %73

26:                                               ; preds = %.lr.ph87, %39
  %indvars.iv108 = phi i64 [ 0, %.lr.ph87 ], [ %indvars.iv.next109, %39 ]
  %27 = getelementptr inbounds [100010 x i32], ptr @W, i64 0, i64 %indvars.iv108
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = icmp eq i32 %28, 0
  %30 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %indvars.iv108
  %31 = load i64, ptr %30, align 8, !tbaa !11
  br i1 %29, label %32, label %35

32:                                               ; preds = %26
  %33 = srem i64 %12, %11
  %34 = add nsw i64 %33, %31
  br label %39

35:                                               ; preds = %26
  %36 = add nsw i64 %11, %31
  %37 = srem i64 %12, %11
  %38 = sub i64 %36, %37
  br label %39

39:                                               ; preds = %32, %35
  %.pn.in.in = phi i64 [ %34, %32 ], [ %38, %35 ]
  %.pn.in = shl i64 %.pn.in.in, 32
  %.pn = ashr exact i64 %.pn.in, 32
  %.sink.in = srem i64 %.pn, %11
  %.sink = trunc nsw i64 %.sink.in to i32
  %40 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %indvars.iv108
  store i32 %.sink, ptr %40, align 4
  %indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %26, !llvm.loop !13

41:                                               ; preds = %._crit_edge
  %42 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @V, i64 24)) #7
  %43 = load i64, ptr @T, align 8, !tbaa !11
  %44 = load i64, ptr @L, align 8, !tbaa !11
  %45 = sdiv i64 %43, %44
  %46 = srem i64 %43, %44
  %47 = shl i64 %42, 1
  %48 = mul i64 %47, %45
  %49 = trunc i64 %48 to i32
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %51 = srem i32 %49, %50
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %52 = tail call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @V, i64 24)) #7
  store ptr %52, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %53 = tail call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @V, i64 24)) #7
  store ptr %53, ptr %2, align 8
  %54 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  br i1 %54, label %.lr.ph95, label %._crit_edge96

.lr.ph95:                                         ; preds = %41
  %55 = trunc i64 %46 to i32
  %56 = shl nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  br label %58

._crit_edge96:                                    ; preds = %58, %41
  %.065.lcssa = phi i32 [ %51, %41 ], [ %.267, %58 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  br label %118

58:                                               ; preds = %.lr.ph95, %58
  %.06593 = phi i32 [ %51, %.lr.ph95 ], [ %.267, %58 ]
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %60 = load i64, ptr %59, align 8, !tbaa !11
  %61 = load i64, ptr @L, align 8, !tbaa !11
  %62 = add nsw i64 %61, %60
  %63 = load i64, ptr @X, align 16, !tbaa !11
  %64 = sub i64 %62, %63
  %65 = srem i64 %64, %61
  %66 = trunc i64 %65 to i32
  %.not73 = icmp sge i32 %56, %66
  %67 = zext i1 %.not73 to i32
  %spec.select = add nsw i32 %.06593, %67
  %sext74 = shl i64 %65, 32
  %68 = ashr exact i64 %sext74, 32
  %69 = add nsw i64 %68, %61
  %.not75 = icmp sle i64 %69, %57
  %70 = zext i1 %.not75 to i32
  %.267 = add nsw i32 %spec.select, %70
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %72 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  br i1 %72, label %58, label %._crit_edge96

73:                                               ; preds = %._crit_edge
  %74 = tail call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  %75 = load i32, ptr @N, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = load i64, ptr @T, align 8, !tbaa !11
  %78 = load i64, ptr @L, align 8, !tbaa !11
  %79 = sdiv i64 %77, %78
  %80 = srem i64 %77, %78
  %sext = shl i64 %74, 32
  %81 = ashr exact i64 %sext, 31
  %82 = mul i64 %81, %79
  %83 = srem i64 %82, %76
  %84 = trunc nsw i64 %83 to i32
  %85 = sub i32 %75, %84
  %86 = srem i32 %85, %75
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %87 = tail call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  store ptr %87, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %88 = tail call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @V) #7
  store ptr %88, ptr %4, align 8
  %89 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %89, label %.lr.ph90, label %._crit_edge91

.lr.ph90:                                         ; preds = %73
  %90 = trunc i64 %80 to i32
  %91 = shl nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  br label %93

._crit_edge91:                                    ; preds = %115, %73
  %.3.lcssa = phi i32 [ %86, %73 ], [ %.5, %115 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  br label %118

93:                                               ; preds = %.lr.ph90, %115
  %.388 = phi i32 [ %86, %.lr.ph90 ], [ %.5, %115 ]
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %95 = load i64, ptr %94, align 8, !tbaa !11
  %96 = load i64, ptr @X, align 16, !tbaa !11
  %97 = load i64, ptr @L, align 8, !tbaa !11
  %98 = sub i64 %96, %95
  %99 = add i64 %98, %97
  %100 = srem i64 %99, %97
  %101 = trunc i64 %100 to i32
  %.not = icmp slt i32 %91, %101
  br i1 %.not, label %107, label %102

102:                                              ; preds = %93
  %103 = load i32, ptr @N, align 4, !tbaa !5
  %104 = add i32 %.388, -1
  %105 = add i32 %104, %103
  %106 = srem i32 %105, %103
  br label %107

107:                                              ; preds = %102, %93
  %.4 = phi i32 [ %106, %102 ], [ %.388, %93 ]
  %sext70 = shl i64 %100, 32
  %108 = ashr exact i64 %sext70, 32
  %109 = add nsw i64 %108, %97
  %.not71 = icmp sgt i64 %109, %92
  br i1 %.not71, label %115, label %110

110:                                              ; preds = %107
  %111 = load i32, ptr @N, align 4, !tbaa !5
  %112 = add i32 %.4, -1
  %113 = add i32 %112, %111
  %114 = srem i32 %113, %111
  br label %115

115:                                              ; preds = %110, %107
  %.5 = phi i32 [ %114, %110 ], [ %.4, %107 ]
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  %117 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  br i1 %117, label %93, label %._crit_edge91

118:                                              ; preds = %._crit_edge91, %._crit_edge96
  %.3.lcssa.sink = phi i32 [ %.3.lcssa, %._crit_edge91 ], [ %.065.lcssa, %._crit_edge96 ]
  %119 = load i32, ptr @N, align 4, !tbaa !5
  %120 = srem i32 %.3.lcssa.sink, %119
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %121, i32 noundef %120)
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %124 = load i32, ptr @ans, align 16, !tbaa !5
  %125 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.2)
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %125, i32 noundef %124)
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %128 = load i32, ptr @N, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr @ans, i64 %129
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @ans, ptr noundef nonnull %130)
  %131 = load i32, ptr @W, align 16, !tbaa !5
  %132 = icmp eq i32 %131, 0
  %133 = load i32, ptr @N, align 4, !tbaa !5
  br i1 %132, label %135, label %.preheader

.preheader:                                       ; preds = %118
  %134 = icmp sgt i32 %133, 0
  br i1 %134, label %.lr.ph99.preheader, label %.loopexit

.lr.ph99.preheader:                               ; preds = %.preheader
  %wide.trip.count114 = zext nneg i32 %133 to i64
  br label %.lr.ph99

135:                                              ; preds = %118
  %136 = zext i32 %133 to i64
  br label %137

137:                                              ; preds = %140, %135
  %indvars.iv116 = phi i64 [ %141, %140 ], [ %136, %135 ]
  %138 = trunc nuw i64 %indvars.iv116 to i32
  %139 = icmp sgt i32 %138, 0
  br i1 %139, label %140, label %.loopexit

140:                                              ; preds = %137
  %141 = add nsw i64 %indvars.iv116, -1
  %142 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = icmp eq i32 %124, %143
  br i1 %144, label %145, label %137, !llvm.loop !14

145:                                              ; preds = %140
  %146 = trunc i64 %141 to i32
  br label %.loopexit.sink.split

.lr.ph99:                                         ; preds = %.lr.ph99.preheader, %152
  %indvars.iv111 = phi i64 [ 0, %.lr.ph99.preheader ], [ %indvars.iv.next112, %152 ]
  %147 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %indvars.iv111
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = icmp eq i32 %124, %148
  br i1 %149, label %150, label %152

150:                                              ; preds = %.lr.ph99
  %151 = trunc nuw nsw i64 %indvars.iv111 to i32
  br label %.loopexit.sink.split

152:                                              ; preds = %.lr.ph99
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count114
  br i1 %exitcond115.not, label %.loopexit, label %.lr.ph99, !llvm.loop !15

.loopexit.sink.split:                             ; preds = %145, %150
  %.sink129 = phi i32 [ %151, %150 ], [ %133, %145 ]
  %.sink128 = phi i32 [ %133, %150 ], [ %146, %145 ]
  %153 = sub i32 %.sink129, %120
  %154 = add i32 %153, %.sink128
  %155 = srem i32 %154, %133
  br label %.loopexit

.loopexit:                                        ; preds = %152, %137, %.loopexit.sink.split, %.preheader
  %.2 = phi i32 [ 0, %.preheader ], [ %155, %.loopexit.sink.split ], [ 0, %137 ], [ 0, %152 ]
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.3)
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %156, i32 noundef %.2)
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %157, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %159 = load i32, ptr @N, align 4, !tbaa !5
  %160 = icmp sgt i32 %159, 0
  br i1 %160, label %.lr.ph102, label %._crit_edge103

._crit_edge103:                                   ; preds = %.lr.ph102, %.loopexit
  ret i32 0

.lr.ph102:                                        ; preds = %.loopexit, %.lr.ph102
  %161 = phi i32 [ %170, %.lr.ph102 ], [ %159, %.loopexit ]
  %.0100 = phi i32 [ %169, %.lr.ph102 ], [ 0, %.loopexit ]
  %162 = add nsw i32 %.0100, %.2
  %163 = srem i32 %162, %161
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %166)
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %167, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %169 = add nuw nsw i32 %.0100, 1
  %170 = load i32, ptr @N, align 4, !tbaa !5
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %.lr.ph102, label %._crit_edge103, !llvm.loop !16
}

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 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 #2 align 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 dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 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 nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

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

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

; 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 #6

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #6

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


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