; LLVM IR from tangjz/acm-icpc :: lydsy (1963)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Gen = type { i32, i32, i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@lft = external dso_local global [17 x %"class.std::vector"], align 16
@rht = external dso_local global [17 x %"class.std::vector"], align 16
@w = external dso_local global [17 x [17 x i64]], align 16
@f = external dso_local global [65537 x i64], align 16
@genX = external dso_local global %struct.Gen, align 4
@genY = external dso_local global %struct.Gen, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE3seq = external hidden global [10001 x i32], align 16
@.str.4 = external hidden unnamed_addr constant [6 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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca i8, align 1
  %31 = alloca i32, align 4
  %32 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m, ptr noundef @n)
  call void @_ZN3Gen4readEv(ptr noundef nonnull align 4 dereferenceable(16) @genX)
  call void @_ZN3Gen4readEv(ptr noundef nonnull align 4 dereferenceable(16) @genY)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %76, %0
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %40 = call noundef i32 @_ZN3Gen3getEv(ptr noundef nonnull align 4 dereferenceable(16) @genX)
  store i32 %40, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %41 = call noundef i32 @_ZN3Gen3getEv(ptr noundef nonnull align 4 dereferenceable(16) @genY)
  store i32 %41, ptr %4, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = and i32 %42, 1
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %64

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = load i32, ptr @m, align 4, !tbaa !5
  %48 = add nsw i32 %46, %47
  %49 = load i32, ptr @m, align 4, !tbaa !5
  %50 = add nsw i32 %48, %49
  %51 = sub nsw i32 %50, 1
  %52 = sdiv i32 %51, 2
  %53 = load i32, ptr @m, align 4, !tbaa !5
  %54 = srem i32 %52, %53
  store i32 %54, ptr %5, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [17 x %"class.std::vector"], ptr @rht, i64 0, i64 %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sub nsw i32 %58, %59
  %61 = load i32, ptr @m, align 4, !tbaa !5
  %62 = sub nsw i32 %60, %61
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %6, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %75

64:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sdiv i32 %65, 2
  %67 = load i32, ptr @m, align 4, !tbaa !5
  %68 = srem i32 %66, %67
  store i32 %68, ptr %7, align 4, !tbaa !5
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [17 x %"class.std::vector"], ptr @lft, i64 0, i64 %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = sub nsw i32 %72, %73
  store i32 %74, ptr %8, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %71, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %75

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

76:                                               ; preds = %75
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %2, align 4, !tbaa !5
  br label %34, !llvm.loop !9

79:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %114, %79
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = load i32, ptr @m, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %117

85:                                               ; preds = %80
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [17 x %"class.std::vector"], ptr @lft, i64 0, i64 %87
  %89 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %88) #7
  %90 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %89, ptr %90, align 8
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [17 x %"class.std::vector"], ptr @lft, i64 0, i64 %92
  %94 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %93) #7
  %95 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  %96 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8
  %98 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %97, ptr %99)
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [17 x %"class.std::vector"], ptr @rht, i64 0, i64 %101
  %103 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %102) #7
  %104 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %103, ptr %104, align 8
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [17 x %"class.std::vector"], ptr @rht, i64 0, i64 %106
  %108 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %107) #7
  %109 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  %110 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8
  %112 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %111, ptr %113)
  br label %114

114:                                              ; preds = %85
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %9, align 4, !tbaa !5
  br label %80, !llvm.loop !11

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

118:                                              ; preds = %371, %117
  %119 = load i32, ptr %14, align 4, !tbaa !5
  %120 = load i32, ptr @m, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %374

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %124

124:                                              ; preds = %367, %123
  %125 = load i32, ptr %16, align 4, !tbaa !5
  %126 = load i32, ptr @m, align 4, !tbaa !5
  %127 = icmp slt i32 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %124
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %370

129:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %130 = load i32, ptr %14, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [17 x %"class.std::vector"], ptr @lft, i64 0, i64 %131
  %133 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %132) #7
  %134 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %133, ptr %134, align 8
  br label %135

135:                                              ; preds = %150, %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %136 = load i32, ptr %14, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [17 x %"class.std::vector"], ptr @lft, i64 0, i64 %137
  %139 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %138) #7
  %140 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %139, ptr %140, align 8
  %141 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br i1 %141, label %143, label %142

142:                                              ; preds = %135
  store i32 14, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %152

143:                                              ; preds = %135
  %144 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = load i32, ptr %17, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %17, align 4, !tbaa !5
  %148 = sext i32 %146 to i64
  %149 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %148
  store i32 %145, ptr %149, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %143
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br label %135, !llvm.loop !12

152:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %153 = load i32, ptr %16, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [17 x %"class.std::vector"], ptr @rht, i64 0, i64 %154
  %156 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %155) #7
  %157 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %156, ptr %157, align 8
  br label %158

158:                                              ; preds = %173, %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %159 = load i32, ptr %16, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [17 x %"class.std::vector"], ptr @rht, i64 0, i64 %160
  %162 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %161) #7
  %163 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %162, ptr %163, align 8
  %164 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br i1 %164, label %166, label %165

165:                                              ; preds = %158
  store i32 17, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %175

166:                                              ; preds = %158
  %167 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = load i32, ptr %17, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %17, align 4, !tbaa !5
  %171 = sext i32 %169 to i64
  %172 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %171
  store i32 %168, ptr %172, align 4, !tbaa !5
  br label %173

173:                                              ; preds = %166
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br label %158, !llvm.loop !13

175:                                              ; preds = %165
  %176 = load i32, ptr %14, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [17 x %"class.std::vector"], ptr @lft, i64 0, i64 %177
  %179 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %178) #7
  %180 = getelementptr inbounds i32, ptr @_ZZ4mainE3seq, i64 %179
  %181 = load i32, ptr %17, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i32, ptr @_ZZ4mainE3seq, i64 %182
  call void @_ZSt13inplace_mergeIPiEvT_S1_S1_(ptr noundef @_ZZ4mainE3seq, ptr noundef %180, ptr noundef %183)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 0, ptr %22, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store i64 0, ptr %23, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %205, %175
  %185 = load i32, ptr %24, align 4, !tbaa !5
  %186 = load i32, ptr %17, align 4, !tbaa !5
  %187 = icmp slt i32 %185, %186
  br i1 %187, label %189, label %188

188:                                              ; preds = %184
  store i32 20, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %208

189:                                              ; preds = %184
  %190 = load i32, ptr %16, align 4, !tbaa !5
  %191 = load i32, ptr %14, align 4, !tbaa !5
  %192 = sub nsw i32 %190, %191
  %193 = load i32, ptr %24, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = add nsw i32 %196, %192
  store i32 %197, ptr %195, align 4, !tbaa !5
  %198 = load i32, ptr %24, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = load i64, ptr %23, align 8, !tbaa !14
  %204 = add nsw i64 %203, %202
  store i64 %204, ptr %23, align 8, !tbaa !14
  br label %205

205:                                              ; preds = %189
  %206 = load i32, ptr %24, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %24, align 4, !tbaa !5
  br label %184, !llvm.loop !16

208:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %209 = load i32, ptr @_ZZ4mainE3seq, align 16, !tbaa !5
  %210 = load i32, ptr @m, align 4, !tbaa !5
  %211 = sdiv i32 %209, %210
  %212 = load i32, ptr @m, align 4, !tbaa !5
  %213 = mul nsw i32 %211, %212
  store i32 %213, ptr %25, align 4, !tbaa !5
  %214 = load i32, ptr %25, align 4, !tbaa !5
  %215 = load i32, ptr @_ZZ4mainE3seq, align 16, !tbaa !5
  %216 = icmp sgt i32 %214, %215
  br i1 %216, label %217, label %221

217:                                              ; preds = %208
  %218 = load i32, ptr @m, align 4, !tbaa !5
  %219 = load i32, ptr %25, align 4, !tbaa !5
  %220 = sub nsw i32 %219, %218
  store i32 %220, ptr %25, align 4, !tbaa !5
  br label %221

221:                                              ; preds = %217, %208
  %222 = load i64, ptr %23, align 8, !tbaa !14
  %223 = load i32, ptr %17, align 4, !tbaa !5
  %224 = sext i32 %223 to i64
  %225 = load i32, ptr %25, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = mul nsw i64 %224, %226
  %228 = sub nsw i64 %222, %227
  %229 = load i32, ptr %14, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [17 x [17 x i64]], ptr @w, i64 0, i64 %230
  %232 = load i32, ptr %16, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [17 x i64], ptr %231, i64 0, i64 %233
  store i64 %228, ptr %234, align 8, !tbaa !14
  %235 = load i32, ptr %17, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %236
  store i32 1061109567, ptr %237, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 1, ptr %26, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %363, %221
  %239 = load i32, ptr %26, align 4, !tbaa !5
  %240 = load i32, ptr %17, align 4, !tbaa !5
  %241 = icmp sle i32 %239, %240
  br i1 %241, label %243, label %242

242:                                              ; preds = %238
  store i32 23, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %366

243:                                              ; preds = %238
  %244 = load i32, ptr %26, align 4, !tbaa !5
  %245 = sub nsw i32 %244, 1
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !5
  %249 = sext i32 %248 to i64
  %250 = load i64, ptr %22, align 8, !tbaa !14
  %251 = add nsw i64 %250, %249
  store i64 %251, ptr %22, align 8, !tbaa !14
  %252 = load i32, ptr %26, align 4, !tbaa !5
  %253 = sub nsw i32 %252, 1
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %254
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = load i64, ptr %23, align 8, !tbaa !14
  %259 = sub nsw i64 %258, %257
  store i64 %259, ptr %23, align 8, !tbaa !14
  %260 = load i32, ptr %26, align 4, !tbaa !5
  %261 = load i32, ptr %17, align 4, !tbaa !5
  %262 = load i32, ptr %26, align 4, !tbaa !5
  %263 = sub nsw i32 %261, %262
  %264 = icmp slt i32 %260, %263
  br i1 %264, label %265, label %313

265:                                              ; preds = %243
  %266 = load i32, ptr %26, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %267
  %269 = load i32, ptr %268, align 4, !tbaa !5
  %270 = load i32, ptr @m, align 4, !tbaa !5
  %271 = sdiv i32 %269, %270
  %272 = load i32, ptr @m, align 4, !tbaa !5
  %273 = mul nsw i32 %271, %272
  store i32 %273, ptr %25, align 4, !tbaa !5
  %274 = load i32, ptr %25, align 4, !tbaa !5
  %275 = load i32, ptr %26, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = icmp sgt i32 %274, %278
  br i1 %279, label %280, label %284

280:                                              ; preds = %265
  %281 = load i32, ptr @m, align 4, !tbaa !5
  %282 = load i32, ptr %25, align 4, !tbaa !5
  %283 = sub nsw i32 %282, %281
  store i32 %283, ptr %25, align 4, !tbaa !5
  br label %284

284:                                              ; preds = %280, %265
  %285 = load i32, ptr %25, align 4, !tbaa !5
  %286 = load i32, ptr %26, align 4, !tbaa !5
  %287 = sub nsw i32 %286, 1
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %288
  %290 = load i32, ptr %289, align 4, !tbaa !5
  %291 = icmp sge i32 %285, %290
  br i1 %291, label %292, label %312

292:                                              ; preds = %284
  %293 = load i32, ptr %14, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [17 x [17 x i64]], ptr @w, i64 0, i64 %294
  %296 = load i32, ptr %16, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [17 x i64], ptr %295, i64 0, i64 %297
  %299 = load i64, ptr %23, align 8, !tbaa !14
  %300 = load i64, ptr %22, align 8, !tbaa !14
  %301 = sub nsw i64 %299, %300
  %302 = load i32, ptr %26, align 4, !tbaa !5
  %303 = load i32, ptr %26, align 4, !tbaa !5
  %304 = add nsw i32 %302, %303
  %305 = load i32, ptr %17, align 4, !tbaa !5
  %306 = sub nsw i32 %304, %305
  %307 = sext i32 %306 to i64
  %308 = load i32, ptr %25, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = mul nsw i64 %307, %309
  %311 = add nsw i64 %301, %310
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %298, i64 noundef %311)
  br label %312

312:                                              ; preds = %292, %284
  br label %362

313:                                              ; preds = %243
  %314 = load i32, ptr %26, align 4, !tbaa !5
  %315 = sub nsw i32 %314, 1
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = load i32, ptr @m, align 4, !tbaa !5
  %320 = sdiv i32 %318, %319
  %321 = load i32, ptr @m, align 4, !tbaa !5
  %322 = mul nsw i32 %320, %321
  store i32 %322, ptr %25, align 4, !tbaa !5
  %323 = load i32, ptr %25, align 4, !tbaa !5
  %324 = load i32, ptr %26, align 4, !tbaa !5
  %325 = sub nsw i32 %324, 1
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %326
  %328 = load i32, ptr %327, align 4, !tbaa !5
  %329 = icmp slt i32 %323, %328
  br i1 %329, label %330, label %334

330:                                              ; preds = %313
  %331 = load i32, ptr @m, align 4, !tbaa !5
  %332 = load i32, ptr %25, align 4, !tbaa !5
  %333 = add nsw i32 %332, %331
  store i32 %333, ptr %25, align 4, !tbaa !5
  br label %334

334:                                              ; preds = %330, %313
  %335 = load i32, ptr %25, align 4, !tbaa !5
  %336 = load i32, ptr %26, align 4, !tbaa !5
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %337
  %339 = load i32, ptr %338, align 4, !tbaa !5
  %340 = icmp sle i32 %335, %339
  br i1 %340, label %341, label %361

341:                                              ; preds = %334
  %342 = load i32, ptr %14, align 4, !tbaa !5
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [17 x [17 x i64]], ptr @w, i64 0, i64 %343
  %345 = load i32, ptr %16, align 4, !tbaa !5
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds [17 x i64], ptr %344, i64 0, i64 %346
  %348 = load i64, ptr %23, align 8, !tbaa !14
  %349 = load i64, ptr %22, align 8, !tbaa !14
  %350 = sub nsw i64 %348, %349
  %351 = load i32, ptr %26, align 4, !tbaa !5
  %352 = load i32, ptr %26, align 4, !tbaa !5
  %353 = add nsw i32 %351, %352
  %354 = load i32, ptr %17, align 4, !tbaa !5
  %355 = sub nsw i32 %353, %354
  %356 = sext i32 %355 to i64
  %357 = load i32, ptr %25, align 4, !tbaa !5
  %358 = sext i32 %357 to i64
  %359 = mul nsw i64 %356, %358
  %360 = add nsw i64 %350, %359
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %347, i64 noundef %360)
  br label %361

361:                                              ; preds = %341, %334
  br label %362

362:                                              ; preds = %361, %312
  br label %363

363:                                              ; preds = %362
  %364 = load i32, ptr %26, align 4, !tbaa !5
  %365 = add nsw i32 %364, 1
  store i32 %365, ptr %26, align 4, !tbaa !5
  br label %238, !llvm.loop !17

366:                                              ; preds = %242
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %367

367:                                              ; preds = %366
  %368 = load i32, ptr %16, align 4, !tbaa !5
  %369 = add nsw i32 %368, 1
  store i32 %369, ptr %16, align 4, !tbaa !5
  br label %124, !llvm.loop !18

370:                                              ; preds = %128
  br label %371

371:                                              ; preds = %370
  %372 = load i32, ptr %14, align 4, !tbaa !5
  %373 = add nsw i32 %372, 1
  store i32 %373, ptr %14, align 4, !tbaa !5
  br label %118, !llvm.loop !19

374:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %375

375:                                              ; preds = %454, %374
  %376 = load i32, ptr %27, align 4, !tbaa !5
  %377 = load i32, ptr @m, align 4, !tbaa !5
  %378 = shl i32 1, %377
  %379 = icmp slt i32 %376, %378
  br i1 %379, label %381, label %380

380:                                              ; preds = %375
  store i32 26, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  br label %457

381:                                              ; preds = %375
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  store i32 0, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %382

382:                                              ; preds = %394, %381
  %383 = load i32, ptr %29, align 4, !tbaa !5
  %384 = load i32, ptr @m, align 4, !tbaa !5
  %385 = icmp slt i32 %383, %384
  br i1 %385, label %387, label %386

386:                                              ; preds = %382
  store i32 29, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %397

387:                                              ; preds = %382
  %388 = load i32, ptr %27, align 4, !tbaa !5
  %389 = load i32, ptr %29, align 4, !tbaa !5
  %390 = ashr i32 %388, %389
  %391 = and i32 %390, 1
  %392 = load i32, ptr %28, align 4, !tbaa !5
  %393 = add nsw i32 %392, %391
  store i32 %393, ptr %28, align 4, !tbaa !5
  br label %394

394:                                              ; preds = %387
  %395 = load i32, ptr %29, align 4, !tbaa !5
  %396 = add nsw i32 %395, 1
  store i32 %396, ptr %29, align 4, !tbaa !5
  br label %382, !llvm.loop !20

397:                                              ; preds = %386
  %398 = load i32, ptr %28, align 4, !tbaa !5
  %399 = icmp ne i32 %398, 0
  br i1 %399, label %404, label %400

400:                                              ; preds = %397
  %401 = load i32, ptr %27, align 4, !tbaa !5
  %402 = sext i32 %401 to i64
  %403 = getelementptr inbounds [65537 x i64], ptr @f, i64 0, i64 %402
  store i64 0, ptr %403, align 8, !tbaa !14
  store i32 28, ptr %15, align 4
  br label %451

404:                                              ; preds = %397
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #7
  store i8 0, ptr %30, align 1, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  store i32 0, ptr %31, align 4, !tbaa !5
  br label %405

405:                                              ; preds = %447, %404
  %406 = load i32, ptr %31, align 4, !tbaa !5
  %407 = load i32, ptr @m, align 4, !tbaa !5
  %408 = icmp slt i32 %406, %407
  br i1 %408, label %410, label %409

409:                                              ; preds = %405
  store i32 32, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  br label %450

410:                                              ; preds = %405
  %411 = load i32, ptr %27, align 4, !tbaa !5
  %412 = load i32, ptr %31, align 4, !tbaa !5
  %413 = ashr i32 %411, %412
  %414 = and i32 %413, 1
  %415 = icmp ne i32 %414, 0
  br i1 %415, label %417, label %416

416:                                              ; preds = %410
  br label %447

417:                                              ; preds = %410
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %418 = load i32, ptr %27, align 4, !tbaa !5
  %419 = load i32, ptr %31, align 4, !tbaa !5
  %420 = shl i32 1, %419
  %421 = xor i32 %418, %420
  %422 = sext i32 %421 to i64
  %423 = getelementptr inbounds [65537 x i64], ptr @f, i64 0, i64 %422
  %424 = load i64, ptr %423, align 8, !tbaa !14
  %425 = load i32, ptr %28, align 4, !tbaa !5
  %426 = sub nsw i32 %425, 1
  %427 = sext i32 %426 to i64
  %428 = getelementptr inbounds [17 x [17 x i64]], ptr @w, i64 0, i64 %427
  %429 = load i32, ptr %31, align 4, !tbaa !5
  %430 = sext i32 %429 to i64
  %431 = getelementptr inbounds [17 x i64], ptr %428, i64 0, i64 %430
  %432 = load i64, ptr %431, align 8, !tbaa !14
  %433 = add nsw i64 %424, %432
  store i64 %433, ptr %32, align 8, !tbaa !14
  %434 = load i8, ptr %30, align 1, !tbaa !21, !range !23, !noundef !24
  %435 = trunc i8 %434 to i1
  br i1 %435, label %436, label %441

436:                                              ; preds = %417
  %437 = load i32, ptr %27, align 4, !tbaa !5
  %438 = sext i32 %437 to i64
  %439 = getelementptr inbounds [65537 x i64], ptr @f, i64 0, i64 %438
  %440 = load i64, ptr %32, align 8, !tbaa !14
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %439, i64 noundef %440)
  br label %446

441:                                              ; preds = %417
  %442 = load i64, ptr %32, align 8, !tbaa !14
  %443 = load i32, ptr %27, align 4, !tbaa !5
  %444 = sext i32 %443 to i64
  %445 = getelementptr inbounds [65537 x i64], ptr @f, i64 0, i64 %444
  store i64 %442, ptr %445, align 8, !tbaa !14
  store i8 1, ptr %30, align 1, !tbaa !21
  br label %446

446:                                              ; preds = %441, %436
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %447

447:                                              ; preds = %446, %416
  %448 = load i32, ptr %31, align 4, !tbaa !5
  %449 = add nsw i32 %448, 1
  store i32 %449, ptr %31, align 4, !tbaa !5
  br label %405, !llvm.loop !25

450:                                              ; preds = %409
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #7
  store i32 0, ptr %15, align 4
  br label %451

451:                                              ; preds = %450, %400
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  %452 = load i32, ptr %15, align 4
  switch i32 %452, label %465 [
    i32 0, label %453
    i32 28, label %454
  ]

453:                                              ; preds = %451
  br label %454

454:                                              ; preds = %453, %451
  %455 = load i32, ptr %27, align 4, !tbaa !5
  %456 = add nsw i32 %455, 1
  store i32 %456, ptr %27, align 4, !tbaa !5
  br label %375, !llvm.loop !26

457:                                              ; preds = %380
  %458 = load i32, ptr @m, align 4, !tbaa !5
  %459 = shl i32 1, %458
  %460 = sub nsw i32 %459, 1
  %461 = sext i32 %460 to i64
  %462 = getelementptr inbounds [65537 x i64], ptr @f, i64 0, i64 %461
  %463 = load i64, ptr %462, align 8, !tbaa !14
  %464 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %463)
  ret i32 0

465:                                              ; preds = %451
  unreachable
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3Gen4readEv(ptr noundef nonnull align 4 dereferenceable(16)) #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 nounwind uwtable
declare dso_local noundef i32 @_ZN3Gen3getEv(ptr noundef nonnull align 4 dereferenceable(16)) #4 align 2

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #6

declare i32 @printf(ptr noundef, ...) #1

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Gen = type { i32, i32, i32, i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@lft = external dso_local global [17 x %"class.std::vector"], align 16
@rht = external dso_local global [17 x %"class.std::vector"], align 16
@w = external dso_local global [17 x [17 x i64]], align 16
@f = external dso_local global [65537 x i64], align 16
@genX = external dso_local global %struct.Gen, align 4
@genY = external dso_local global %struct.Gen, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ4mainE3seq = external hidden global [10001 x i32], align 16
@.str.4 = external hidden unnamed_addr constant [6 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 %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m, ptr noundef nonnull @n)
  tail call void @_ZN3Gen4readEv(ptr noundef nonnull align 4 dereferenceable(16) @genX)
  tail call void @_ZN3Gen4readEv(ptr noundef nonnull align 4 dereferenceable(16) @genY)
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %.preheader155

.preheader155:                                    ; preds = %33, %0
  %10 = load i32, ptr @m, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph158, label %.preheader151.preheader

.lr.ph:                                           ; preds = %0, %33
  %.0156 = phi i32 [ %34, %33 ], [ 0, %0 ]
  %12 = call noundef i32 @_ZN3Gen3getEv(ptr noundef nonnull align 4 dereferenceable(16) @genX)
  %13 = call noundef i32 @_ZN3Gen3getEv(ptr noundef nonnull align 4 dereferenceable(16) @genY)
  %14 = and i32 %12, 1
  %.not139 = icmp eq i32 %14, 0
  br i1 %.not139, label %26, label %15

15:                                               ; preds = %.lr.ph
  %16 = load i32, ptr @m, align 4, !tbaa !5
  %reass.add = shl i32 %16, 1
  %17 = add nsw i32 %12, -1
  %18 = add i32 %17, %reass.add
  %19 = ashr exact i32 %18, 1
  %20 = srem i32 %19, %16
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [17 x %"class.std::vector"], ptr @rht, i64 0, i64 %21
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %23 = add i32 %13, 1
  %24 = add i32 %12, %16
  %25 = sub i32 %23, %24
  store i32 %25, ptr %1, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  br label %33

26:                                               ; preds = %.lr.ph
  %27 = ashr exact i32 %12, 1
  %28 = load i32, ptr @m, align 4, !tbaa !5
  %29 = srem i32 %27, %28
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [17 x %"class.std::vector"], ptr @lft, i64 0, i64 %30
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %32 = sub nsw i32 %12, %13
  store i32 %32, ptr %2, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  br label %33

33:                                               ; preds = %26, %15
  %34 = add nuw nsw i32 %.0156, 1
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %.lr.ph, label %.preheader155, !llvm.loop !9

.preheader154:                                    ; preds = %.lr.ph158
  %37 = icmp sgt i32 %44, 0
  br i1 %37, label %.preheader153, label %.preheader151.preheader

.lr.ph158:                                        ; preds = %.preheader155, %.lr.ph158
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph158 ], [ 0, %.preheader155 ]
  %38 = getelementptr inbounds [17 x %"class.std::vector"], ptr @lft, i64 0, i64 %indvars.iv
  %39 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #8
  %40 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %38) #8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %39, ptr %40)
  %41 = getelementptr inbounds [17 x %"class.std::vector"], ptr @rht, i64 0, i64 %indvars.iv
  %42 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #8
  %43 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEEEvT_S7_(ptr %42, ptr %43)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = load i32, ptr @m, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next, %45
  br i1 %46, label %.lr.ph158, label %.preheader154, !llvm.loop !11

.preheader153:                                    ; preds = %.preheader154, %._crit_edge181
  %47 = phi i32 [ %50, %._crit_edge181 ], [ %44, %.preheader154 ]
  %indvars.iv221 = phi i64 [ %indvars.iv.next222, %._crit_edge181 ], [ 0, %.preheader154 ]
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %.lr.ph180, label %.preheader153.._crit_edge181_crit_edge

.preheader153.._crit_edge181_crit_edge:           ; preds = %.preheader153
  %.pre231 = sext i32 %47 to i64
  br label %._crit_edge181

.lr.ph180:                                        ; preds = %.preheader153
  %49 = getelementptr inbounds [17 x %"class.std::vector"], ptr @lft, i64 0, i64 %indvars.iv221
  br label %52

.preheader152:                                    ; preds = %._crit_edge181
  %.not196 = icmp eq i32 %50, 31
  br i1 %.not196, label %._crit_edge193, label %.preheader151.preheader

.preheader151.preheader:                          ; preds = %.preheader155, %.preheader154, %.preheader152
  %.ph = phi i32 [ %10, %.preheader155 ], [ %44, %.preheader154 ], [ %50, %.preheader152 ]
  br label %.preheader151

._crit_edge181:                                   ; preds = %._crit_edge178, %.preheader153.._crit_edge181_crit_edge
  %.pre-phi = phi i64 [ %.pre231, %.preheader153.._crit_edge181_crit_edge ], [ %109, %._crit_edge178 ]
  %50 = phi i32 [ %47, %.preheader153.._crit_edge181_crit_edge ], [ %108, %._crit_edge178 ]
  %indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1
  %51 = icmp slt i64 %indvars.iv.next222, %.pre-phi
  br i1 %51, label %.preheader153, label %.preheader152, !llvm.loop !12

52:                                               ; preds = %.lr.ph180, %._crit_edge178
  %indvars.iv218 = phi i64 [ 0, %.lr.ph180 ], [ %indvars.iv.next219, %._crit_edge178 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %53 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #8
  store ptr %53, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %54 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #8
  store ptr %54, ptr %4, align 8
  %55 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br i1 %55, label %.lr.ph160, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %.lr.ph160
  %56 = trunc nuw i64 %indvars.iv.next205 to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %52
  %.0121.lcssa = phi i32 [ 0, %52 ], [ %56, %._crit_edge.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %57 = getelementptr inbounds [17 x %"class.std::vector"], ptr @rht, i64 0, i64 %indvars.iv218
  %58 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #8
  store ptr %58, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %59 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #8
  store ptr %59, ptr %6, align 8
  %60 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br i1 %60, label %.lr.ph163.preheader, label %._crit_edge164

.lr.ph163.preheader:                              ; preds = %._crit_edge
  %61 = zext i32 %.0121.lcssa to i64
  br label %.lr.ph163

.lr.ph160:                                        ; preds = %52, %.lr.ph160
  %indvars.iv204 = phi i64 [ %indvars.iv.next205, %.lr.ph160 ], [ 0, %52 ]
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1
  %64 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %indvars.iv204
  store i32 %63, ptr %64, align 4, !tbaa !5
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  %66 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #8
  store ptr %66, ptr %4, align 8
  %67 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  br i1 %67, label %.lr.ph160, label %._crit_edge.loopexit, !llvm.loop !14

._crit_edge164.loopexit:                          ; preds = %.lr.ph163
  %68 = trunc nuw i64 %indvars.iv.next208 to i32
  br label %._crit_edge164

._crit_edge164:                                   ; preds = %._crit_edge164.loopexit, %._crit_edge
  %.1122.lcssa = phi i32 [ %.0121.lcssa, %._crit_edge ], [ %68, %._crit_edge164.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  %69 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %49) #8
  %70 = getelementptr inbounds i32, ptr @_ZZ4mainE3seq, i64 %69
  %71 = zext i32 %.1122.lcssa to i64
  %72 = getelementptr inbounds i32, ptr @_ZZ4mainE3seq, i64 %71
  call void @_ZSt13inplace_mergeIPiEvT_S1_S1_(ptr noundef nonnull @_ZZ4mainE3seq, ptr noundef nonnull %70, ptr noundef nonnull %72)
  %.not195 = icmp eq i32 %.1122.lcssa, 0
  br i1 %.not195, label %._crit_edge170, label %.lr.ph169

.lr.ph169:                                        ; preds = %._crit_edge164
  %73 = sub nsw i64 %indvars.iv218, %indvars.iv221
  %74 = trunc nsw i64 %73 to i32
  %min.iters.check = icmp ult i32 %.1122.lcssa, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph169
  %indvars.iv210.ph = phi i64 [ 0, %.lr.ph169 ], [ %n.vec, %middle.block ]
  %.0118166.ph = phi i64 [ 0, %.lr.ph169 ], [ %84, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph169
  %n.vec = and i64 %71, 4294967292
  %broadcast.splatinsert = insertelement <2 x i32> poison, i32 %74, i64 0
  %broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %81, %vector.body ]
  %vec.phi255 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %82, %vector.body ]
  %75 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %index
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %wide.load = load <2 x i32>, ptr %75, align 16, !tbaa !5
  %wide.load256 = load <2 x i32>, ptr %76, align 8, !tbaa !5
  %77 = add nsw <2 x i32> %wide.load, %broadcast.splat
  %78 = add nsw <2 x i32> %wide.load256, %broadcast.splat
  store <2 x i32> %77, ptr %75, align 16, !tbaa !5
  store <2 x i32> %78, ptr %76, align 8, !tbaa !5
  %79 = sext <2 x i32> %77 to <2 x i64>
  %80 = sext <2 x i32> %78 to <2 x i64>
  %81 = add <2 x i64> %vec.phi, %79
  %82 = add <2 x i64> %vec.phi255, %80
  %index.next = add nuw i64 %index, 4
  %83 = icmp eq i64 %index.next, %n.vec
  br i1 %83, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %82, %81
  %84 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %71
  br i1 %cmp.n, label %._crit_edge170, label %scalar.ph.preheader

.lr.ph163:                                        ; preds = %.lr.ph163.preheader, %.lr.ph163
  %indvars.iv207 = phi i64 [ %61, %.lr.ph163.preheader ], [ %indvars.iv.next208, %.lr.ph163 ]
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %indvars.iv.next208 = add nuw nsw i64 %indvars.iv207, 1
  %87 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %indvars.iv207
  store i32 %86, ptr %87, align 4, !tbaa !5
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %89 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #8
  store ptr %89, ptr %6, align 8
  %90 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br i1 %90, label %.lr.ph163, label %._crit_edge164.loopexit, !llvm.loop !18

._crit_edge170:                                   ; preds = %scalar.ph, %middle.block, %._crit_edge164
  %.0118.lcssa = phi i64 [ 0, %._crit_edge164 ], [ %84, %middle.block ], [ %107, %scalar.ph ]
  %91 = load i32, ptr @_ZZ4mainE3seq, align 16, !tbaa !5
  %.fr = freeze i32 %91
  %92 = load i32, ptr @m, align 4, !tbaa !5
  %93 = srem i32 %.fr, %92
  %94 = icmp slt i32 %93, 0
  %95 = select i1 %94, i32 %92, i32 0
  %96 = add i32 %93, %95
  %spec.select = sub i32 %.fr, %96
  %97 = sext i32 %spec.select to i64
  %98 = mul nsw i64 %97, %71
  %99 = sub nsw i64 %.0118.lcssa, %98
  %100 = getelementptr inbounds [17 x [17 x i64]], ptr @w, i64 0, i64 %indvars.iv221, i64 %indvars.iv218
  store i64 %99, ptr %100, align 8, !tbaa !19
  store i32 1061109567, ptr %72, align 4, !tbaa !5
  br i1 %.not195, label %._crit_edge178, label %.lr.ph177.preheader

.lr.ph177.preheader:                              ; preds = %._crit_edge170
  %101 = sext i32 %.1122.lcssa to i64
  %102 = add i32 %.1122.lcssa, 1
  %wide.trip.count216 = zext i32 %102 to i64
  br label %.lr.ph177

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv210 = phi i64 [ %indvars.iv.next211, %scalar.ph ], [ %indvars.iv210.ph, %scalar.ph.preheader ]
  %.0118166 = phi i64 [ %107, %scalar.ph ], [ %.0118166.ph, %scalar.ph.preheader ]
  %103 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %indvars.iv210
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = add nsw i32 %104, %74
  store i32 %105, ptr %103, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = add nsw i64 %.0118166, %106
  %indvars.iv.next211 = add nuw nsw i64 %indvars.iv210, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next211, %71
  br i1 %exitcond.not, label %._crit_edge170, label %scalar.ph, !llvm.loop !21

._crit_edge178.loopexit:                          ; preds = %142
  %.pre = load i32, ptr @m, align 4, !tbaa !5
  br label %._crit_edge178

._crit_edge178:                                   ; preds = %._crit_edge178.loopexit, %._crit_edge170
  %108 = phi i32 [ %.pre, %._crit_edge178.loopexit ], [ %92, %._crit_edge170 ]
  %indvars.iv.next219 = add nuw nsw i64 %indvars.iv218, 1
  %109 = sext i32 %108 to i64
  %110 = icmp slt i64 %indvars.iv.next219, %109
  br i1 %110, label %52, label %._crit_edge181, !llvm.loop !22

.lr.ph177:                                        ; preds = %.lr.ph177.preheader, %142
  %indvars.iv213 = phi i64 [ 1, %.lr.ph177.preheader ], [ %indvars.iv.next214, %142 ]
  %.1119174 = phi i64 [ %.0118.lcssa, %.lr.ph177.preheader ], [ %116, %142 ]
  %.0120173 = phi i64 [ 0, %.lr.ph177.preheader ], [ %115, %142 ]
  %indvars215 = trunc i64 %indvars.iv213 to i32
  %111 = add nsw i64 %indvars.iv213, -1
  %112 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %.fr135 = freeze i32 %113
  %114 = sext i32 %.fr135 to i64
  %115 = add nsw i64 %.0120173, %114
  %116 = sub nsw i64 %.1119174, %114
  %117 = sub nsw i32 %.1122.lcssa, %indvars215
  %118 = sext i32 %117 to i64
  %119 = icmp slt i64 %indvars.iv213, %118
  br i1 %119, label %120, label %128

120:                                              ; preds = %.lr.ph177
  %121 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %indvars.iv213
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %.fr137 = freeze i32 %122
  %123 = load i32, ptr @m, align 4, !tbaa !5
  %124 = srem i32 %.fr137, %123
  %125 = icmp slt i32 %124, 0
  %126 = select i1 %125, i32 %123, i32 0
  %127 = add i32 %124, %126
  %spec.select140 = sub i32 %.fr137, %127
  %.not138 = icmp slt i32 %spec.select140, %.fr135
  br i1 %.not138, label %142, label %.sink.split

128:                                              ; preds = %.lr.ph177
  %129 = load i32, ptr @m, align 4, !tbaa !5
  %130 = srem i32 %.fr135, %129
  %131 = sub nsw i32 %.fr135, %130
  %132 = icmp sgt i32 %130, 0
  %133 = select i1 %132, i32 %129, i32 0
  %spec.select141 = add nsw i32 %133, %131
  %134 = getelementptr inbounds [10001 x i32], ptr @_ZZ4mainE3seq, i64 0, i64 %indvars.iv213
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %.not136 = icmp sgt i32 %spec.select141, %135
  br i1 %.not136, label %142, label %.sink.split

.sink.split:                                      ; preds = %128, %120
  %spec.select140.sink = phi i32 [ %spec.select140, %120 ], [ %spec.select141, %128 ]
  %136 = sub i64 %116, %115
  %137 = shl nuw nsw i64 %indvars.iv213, 1
  %138 = sub nsw i64 %137, %101
  %139 = sext i32 %spec.select140.sink to i64
  %140 = mul nsw i64 %138, %139
  %141 = add nsw i64 %136, %140
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %100, i64 noundef %141)
  br label %142

142:                                              ; preds = %.sink.split, %120, %128
  %indvars.iv.next214 = add nuw nsw i64 %indvars.iv213, 1
  %exitcond217.not = icmp eq i64 %indvars.iv.next214, %wide.trip.count216
  br i1 %exitcond217.not, label %._crit_edge178.loopexit, label %.lr.ph177, !llvm.loop !23

.preheader151:                                    ; preds = %.preheader151.preheader, %.loopexit
  %143 = phi i32 [ %189, %.loopexit ], [ %.ph, %.preheader151.preheader ]
  %indvars.iv227 = phi i64 [ %indvars.iv.next228, %.loopexit ], [ 0, %.preheader151.preheader ]
  %144 = icmp sgt i32 %143, 0
  br i1 %144, label %.lr.ph185.preheader, label %._crit_edge186.thread

.lr.ph185.preheader:                              ; preds = %.preheader151
  %145 = trunc nuw nsw i64 %indvars.iv227 to i32
  %min.iters.check259 = icmp ult i32 %143, 8
  br i1 %min.iters.check259, label %.lr.ph185.preheader275, label %vector.ph260

.lr.ph185.preheader275:                           ; preds = %middle.block257, %.lr.ph185.preheader
  %.0110184.ph = phi i32 [ 0, %.lr.ph185.preheader ], [ %n.vec262, %middle.block257 ]
  %.0111183.ph = phi i32 [ 0, %.lr.ph185.preheader ], [ %153, %middle.block257 ]
  br label %.lr.ph185

vector.ph260:                                     ; preds = %.lr.ph185.preheader
  %n.vec262 = and i32 %143, 2147483640
  %broadcast.splatinsert269 = insertelement <4 x i32> poison, i32 %145, i64 0
  %broadcast.splat270 = shufflevector <4 x i32> %broadcast.splatinsert269, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body264

vector.body264:                                   ; preds = %vector.body264, %vector.ph260
  %index265 = phi i32 [ 0, %vector.ph260 ], [ %index.next271, %vector.body264 ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph260 ], [ %vec.ind.next, %vector.body264 ]
  %vec.phi267 = phi <4 x i32> [ zeroinitializer, %vector.ph260 ], [ %150, %vector.body264 ]
  %vec.phi268 = phi <4 x i32> [ zeroinitializer, %vector.ph260 ], [ %151, %vector.body264 ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %146 = lshr <4 x i32> %broadcast.splat270, %vec.ind
  %147 = lshr <4 x i32> %broadcast.splat270, %step.add
  %148 = and <4 x i32> %146, <i32 1, i32 1, i32 1, i32 1>
  %149 = and <4 x i32> %147, <i32 1, i32 1, i32 1, i32 1>
  %150 = add <4 x i32> %148, %vec.phi267
  %151 = add <4 x i32> %149, %vec.phi268
  %index.next271 = add nuw i32 %index265, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %152 = icmp eq i32 %index.next271, %n.vec262
  br i1 %152, label %middle.block257, label %vector.body264, !llvm.loop !24

middle.block257:                                  ; preds = %vector.body264
  %bin.rdx272 = add <4 x i32> %151, %150
  %153 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx272)
  %cmp.n273 = icmp eq i32 %143, %n.vec262
  br i1 %cmp.n273, label %._crit_edge186, label %.lr.ph185.preheader275

._crit_edge193.loopexit:                          ; preds = %.loopexit
  %154 = add nsw i32 %190, -1
  %155 = sext i32 %154 to i64
  br label %._crit_edge193

._crit_edge193:                                   ; preds = %._crit_edge193.loopexit, %.preheader152
  %.lcssa = phi i64 [ 2147483647, %.preheader152 ], [ %155, %._crit_edge193.loopexit ]
  %156 = getelementptr inbounds [65537 x i64], ptr @f, i64 0, i64 %.lcssa
  %157 = load i64, ptr %156, align 8, !tbaa !19
  %158 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %157)
  ret i32 0

._crit_edge186:                                   ; preds = %.lr.ph185, %middle.block257
  %.lcssa247 = phi i32 [ %153, %middle.block257 ], [ %165, %.lr.ph185 ]
  %.not = icmp eq i32 %.lcssa247, 0
  br i1 %.not, label %._crit_edge186.thread, label %.preheader

.preheader:                                       ; preds = %._crit_edge186
  br i1 %144, label %.lr.ph190, label %.loopexit

.lr.ph190:                                        ; preds = %.preheader
  %159 = add nsw i32 %.lcssa247, -1
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [65537 x i64], ptr @f, i64 0, i64 %indvars.iv227
  %162 = trunc nuw nsw i64 %indvars.iv227 to i32
  br label %168

.lr.ph185:                                        ; preds = %.lr.ph185.preheader275, %.lr.ph185
  %.0110184 = phi i32 [ %166, %.lr.ph185 ], [ %.0110184.ph, %.lr.ph185.preheader275 ]
  %.0111183 = phi i32 [ %165, %.lr.ph185 ], [ %.0111183.ph, %.lr.ph185.preheader275 ]
  %163 = lshr i32 %145, %.0110184
  %164 = and i32 %163, 1
  %165 = add nuw nsw i32 %164, %.0111183
  %166 = add nuw nsw i32 %.0110184, 1
  %exitcond224.not = icmp eq i32 %166, %143
  br i1 %exitcond224.not, label %._crit_edge186, label %.lr.ph185, !llvm.loop !25

._crit_edge186.thread:                            ; preds = %.preheader151, %._crit_edge186
  %167 = getelementptr inbounds [65537 x i64], ptr @f, i64 0, i64 %indvars.iv227
  store i64 0, ptr %167, align 8, !tbaa !19
  br label %.loopexit

168:                                              ; preds = %.lr.ph190, %184
  %169 = phi i32 [ %143, %.lr.ph190 ], [ %185, %184 ]
  %170 = phi i32 [ %143, %.lr.ph190 ], [ %186, %184 ]
  %indvars.iv225 = phi i64 [ 0, %.lr.ph190 ], [ %indvars.iv.next226, %184 ]
  %.0109188 = phi i1 [ false, %.lr.ph190 ], [ %.2, %184 ]
  %171 = trunc nuw nsw i64 %indvars.iv225 to i32
  %172 = shl nuw i32 1, %171
  %173 = and i32 %172, %162
  %.not133 = icmp eq i32 %173, 0
  br i1 %.not133, label %184, label %174

174:                                              ; preds = %168
  %175 = xor i32 %172, %162
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [65537 x i64], ptr @f, i64 0, i64 %176
  %178 = load i64, ptr %177, align 8, !tbaa !19
  %179 = getelementptr inbounds [17 x [17 x i64]], ptr @w, i64 0, i64 %160, i64 %indvars.iv225
  %180 = load i64, ptr %179, align 8, !tbaa !19
  %181 = add nsw i64 %180, %178
  br i1 %.0109188, label %182, label %183

182:                                              ; preds = %174
  call void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8) %161, i64 noundef %181)
  %.pre230 = load i32, ptr @m, align 4, !tbaa !5
  br label %184

183:                                              ; preds = %174
  store i64 %181, ptr %161, align 8, !tbaa !19
  br label %184

184:                                              ; preds = %182, %183, %168
  %185 = phi i32 [ %169, %168 ], [ %.pre230, %182 ], [ %169, %183 ]
  %186 = phi i32 [ %170, %168 ], [ %.pre230, %182 ], [ %170, %183 ]
  %.2 = phi i1 [ %.0109188, %168 ], [ true, %182 ], [ true, %183 ]
  %indvars.iv.next226 = add nuw nsw i64 %indvars.iv225, 1
  %187 = sext i32 %186 to i64
  %188 = icmp slt i64 %indvars.iv.next226, %187
  br i1 %188, label %168, label %.loopexit, !llvm.loop !26

.loopexit:                                        ; preds = %184, %.preheader, %._crit_edge186.thread
  %189 = phi i32 [ %143, %.preheader ], [ %143, %._crit_edge186.thread ], [ %185, %184 ]
  %indvars.iv.next228 = add nuw nsw i64 %indvars.iv227, 1
  %190 = shl nuw i32 1, %189
  %191 = sext i32 %190 to i64
  %192 = icmp slt i64 %indvars.iv.next228, %191
  br i1 %192, label %.preheader151, label %._crit_edge193.loopexit, !llvm.loop !27
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3Gen4readEv(ptr noundef nonnull align 4 dereferenceable(16)) 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 nounwind uwtable
declare dso_local noundef i32 @_ZN3Gen3getEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4 align 2

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

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

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

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

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

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

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

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_Z3updRxx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #7

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10}
!19 = !{!20, !20, i64 0}
!20 = !{!"long long", !7, i64 0}
!21 = distinct !{!21, !10, !17, !16}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10, !16, !17}
!25 = distinct !{!25, !10, !17, !16}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}


; Effective O3 passes: ADCEPass,AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass