; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/248 Division 2/Problem C (C)

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

%"class.std::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 i64, align 8
@m = external dso_local global i64, align 8
@a = external dso_local global [100100 x i64], align 16
@tot = external dso_local global i64, align 8
@cur = external dso_local global i64, align 8
@s1 = external dso_local global i64, align 8
@s2 = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@v = external dso_local global [100100 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %22 = getelementptr i8, ptr %21, i64 -24
  %23 = load i64, ptr %22, align 8
  %24 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %23
  %25 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %24, ptr noundef null)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %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) @m)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %28

28:                                               ; preds = %37, %0
  %29 = load i64, ptr %2, align 8, !tbaa !8
  %30 = load i64, ptr @m, align 8, !tbaa !8
  %31 = icmp slt i64 %29, %30
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %28
  %34 = load i64, ptr %2, align 8, !tbaa !8
  %35 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %34
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %35)
  br label %37

37:                                               ; preds = %33
  %38 = load i64, ptr %2, align 8, !tbaa !8
  %39 = add nsw i64 %38, 1
  store i64 %39, ptr %2, align 8, !tbaa !8
  br label %28, !llvm.loop !11

40:                                               ; preds = %32
  %41 = load i64, ptr @m, align 8, !tbaa !8
  %42 = icmp eq i64 %41, 1
  br i1 %42, label %43, label %46

43:                                               ; preds = %40
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  br label %254

46:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 1, ptr %3, align 8, !tbaa !8
  br label %47

47:                                               ; preds = %64, %46
  %48 = load i64, ptr %3, align 8, !tbaa !8
  %49 = load i64, ptr @m, align 8, !tbaa !8
  %50 = icmp slt i64 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %67

52:                                               ; preds = %47
  %53 = load i64, ptr %3, align 8, !tbaa !8
  %54 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = load i64, ptr %3, align 8, !tbaa !8
  %57 = sub nsw i64 %56, 1
  %58 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %57
  %59 = load i64, ptr %58, align 8, !tbaa !8
  %60 = sub nsw i64 %55, %59
  %61 = call noundef i64 @_ZSt3absx(i64 noundef %60)
  %62 = load i64, ptr @tot, align 8, !tbaa !8
  %63 = add nsw i64 %62, %61
  store i64 %63, ptr @tot, align 8, !tbaa !8
  br label %64

64:                                               ; preds = %52
  %65 = load i64, ptr %3, align 8, !tbaa !8
  %66 = add nsw i64 %65, 1
  store i64 %66, ptr %3, align 8, !tbaa !8
  br label %47, !llvm.loop !13

67:                                               ; preds = %51
  %68 = load i64, ptr @tot, align 8, !tbaa !8
  store i64 %68, ptr @ans, align 8, !tbaa !8
  %69 = load i64, ptr getelementptr inbounds ([100100 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !8
  %70 = load i64, ptr @a, align 16, !tbaa !8
  %71 = icmp ne i64 %69, %70
  br i1 %71, label %72, label %75

72:                                               ; preds = %67
  %73 = load i64, ptr @a, align 16, !tbaa !8
  %74 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %73
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %74, ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds ([100100 x i64], ptr @a, i64 0, i64 1))
  br label %75

75:                                               ; preds = %72, %67
  %76 = load i64, ptr @m, align 8, !tbaa !8
  %77 = sub nsw i64 %76, 2
  %78 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !8
  %80 = load i64, ptr @m, align 8, !tbaa !8
  %81 = sub nsw i64 %80, 1
  %82 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !8
  %84 = icmp ne i64 %79, %83
  br i1 %84, label %85, label %94

85:                                               ; preds = %75
  %86 = load i64, ptr @m, align 8, !tbaa !8
  %87 = sub nsw i64 %86, 1
  %88 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !8
  %90 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %89
  %91 = load i64, ptr @m, align 8, !tbaa !8
  %92 = sub nsw i64 %91, 2
  %93 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %92
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %90, ptr noundef nonnull align 8 dereferenceable(8) %93)
  br label %94

94:                                               ; preds = %85, %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 1, ptr %4, align 8, !tbaa !8
  br label %95

95:                                               ; preds = %136, %94
  %96 = load i64, ptr %4, align 8, !tbaa !8
  %97 = load i64, ptr @m, align 8, !tbaa !8
  %98 = sub nsw i64 %97, 1
  %99 = icmp slt i64 %96, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  br label %139

101:                                              ; preds = %95
  %102 = load i64, ptr %4, align 8, !tbaa !8
  %103 = sub nsw i64 %102, 1
  %104 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !8
  %106 = load i64, ptr %4, align 8, !tbaa !8
  %107 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %106
  %108 = load i64, ptr %107, align 8, !tbaa !8
  %109 = icmp ne i64 %105, %108
  br i1 %109, label %110, label %118

110:                                              ; preds = %101
  %111 = load i64, ptr %4, align 8, !tbaa !8
  %112 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !8
  %114 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %113
  %115 = load i64, ptr %4, align 8, !tbaa !8
  %116 = sub nsw i64 %115, 1
  %117 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %116
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %114, ptr noundef nonnull align 8 dereferenceable(8) %117)
  br label %118

118:                                              ; preds = %110, %101
  %119 = load i64, ptr %4, align 8, !tbaa !8
  %120 = add nsw i64 %119, 1
  %121 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !8
  %123 = load i64, ptr %4, align 8, !tbaa !8
  %124 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !8
  %126 = icmp ne i64 %122, %125
  br i1 %126, label %127, label %135

127:                                              ; preds = %118
  %128 = load i64, ptr %4, align 8, !tbaa !8
  %129 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !8
  %131 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %130
  %132 = load i64, ptr %4, align 8, !tbaa !8
  %133 = add nsw i64 %132, 1
  %134 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %133
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %131, ptr noundef nonnull align 8 dereferenceable(8) %134)
  br label %135

135:                                              ; preds = %127, %118
  br label %136

136:                                              ; preds = %135
  %137 = load i64, ptr %4, align 8, !tbaa !8
  %138 = add nsw i64 %137, 1
  store i64 %138, ptr %4, align 8, !tbaa !8
  br label %95, !llvm.loop !14

139:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 1, ptr %5, align 8, !tbaa !8
  br label %140

140:                                              ; preds = %247, %139
  %141 = load i64, ptr %5, align 8, !tbaa !8
  %142 = load i64, ptr @n, align 8, !tbaa !8
  %143 = icmp sle i64 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %250

145:                                              ; preds = %140
  %146 = load i64, ptr %5, align 8, !tbaa !8
  %147 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %146
  %148 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %147) #7
  %149 = icmp ugt i64 %148, 0
  br i1 %149, label %150, label %246

150:                                              ; preds = %145
  %151 = load i64, ptr %5, align 8, !tbaa !8
  %152 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %151
  %153 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %152) #7
  %154 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %153, ptr %154, align 8
  %155 = load i64, ptr %5, align 8, !tbaa !8
  %156 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %155
  %157 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %156) #7
  %158 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %157, ptr %158, align 8
  %159 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8
  %161 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %160, ptr %162)
  store i64 0, ptr @cur, align 8, !tbaa !8
  store i64 0, ptr @s1, align 8, !tbaa !8
  store i64 0, ptr @s2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %163 = load i64, ptr %5, align 8, !tbaa !8
  %164 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %163
  %165 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %164) #7
  %166 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %165, ptr %166, align 8
  br label %167

167:                                              ; preds = %186, %150
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %168 = load i64, ptr %5, align 8, !tbaa !8
  %169 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %168
  %170 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %169) #7
  %171 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %170, ptr %171, align 8
  %172 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPxSt6vectorIxSaIxEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br i1 %172, label %174, label %173

173:                                              ; preds = %167
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %189

174:                                              ; preds = %167
  %175 = load i64, ptr %5, align 8, !tbaa !8
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %177 = load i64, ptr %176, align 8, !tbaa !8
  %178 = sub nsw i64 %175, %177
  %179 = call noundef i64 @_ZSt3absx(i64 noundef %178)
  %180 = load i64, ptr @cur, align 8, !tbaa !8
  %181 = add nsw i64 %180, %179
  store i64 %181, ptr @cur, align 8, !tbaa !8
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %183 = load i64, ptr %182, align 8, !tbaa !8
  %184 = load i64, ptr @s2, align 8, !tbaa !8
  %185 = add nsw i64 %184, %183
  store i64 %185, ptr @s2, align 8, !tbaa !8
  br label %186

186:                                              ; preds = %174
  %187 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef 0) #7
  %188 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %187, ptr %188, align 8
  br label %167, !llvm.loop !15

189:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %190 = load i64, ptr %5, align 8, !tbaa !8
  %191 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %190
  %192 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %191) #7
  store i64 %192, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %193

193:                                              ; preds = %242, %189
  %194 = load i64, ptr %13, align 8, !tbaa !8
  %195 = load i64, ptr %12, align 8, !tbaa !8
  %196 = icmp slt i64 %194, %195
  br i1 %196, label %198, label %197

197:                                              ; preds = %193
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %245

198:                                              ; preds = %193
  %199 = load i64, ptr %5, align 8, !tbaa !8
  %200 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %199
  %201 = load i64, ptr %13, align 8, !tbaa !8
  %202 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %200, i64 noundef %201) #7
  %203 = load i64, ptr %202, align 8, !tbaa !8
  %204 = load i64, ptr @s1, align 8, !tbaa !8
  %205 = add nsw i64 %204, %203
  store i64 %205, ptr @s1, align 8, !tbaa !8
  %206 = load i64, ptr %5, align 8, !tbaa !8
  %207 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %206
  %208 = load i64, ptr %13, align 8, !tbaa !8
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %207, i64 noundef %208) #7
  %210 = load i64, ptr %209, align 8, !tbaa !8
  %211 = load i64, ptr @s2, align 8, !tbaa !8
  %212 = sub nsw i64 %211, %210
  store i64 %212, ptr @s2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %213 = load i64, ptr @tot, align 8, !tbaa !8
  %214 = load i64, ptr @cur, align 8, !tbaa !8
  %215 = sub nsw i64 %213, %214
  %216 = load i64, ptr @s2, align 8, !tbaa !8
  %217 = load i64, ptr %12, align 8, !tbaa !8
  %218 = load i64, ptr %13, align 8, !tbaa !8
  %219 = sub nsw i64 %217, %218
  %220 = sub nsw i64 %219, 1
  %221 = load i64, ptr %5, align 8, !tbaa !8
  %222 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %221
  %223 = load i64, ptr %13, align 8, !tbaa !8
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %222, i64 noundef %223) #7
  %225 = load i64, ptr %224, align 8, !tbaa !8
  %226 = mul nsw i64 %220, %225
  %227 = sub nsw i64 %216, %226
  %228 = add nsw i64 %215, %227
  %229 = load i64, ptr %5, align 8, !tbaa !8
  %230 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %229
  %231 = load i64, ptr %13, align 8, !tbaa !8
  %232 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %230, i64 noundef %231) #7
  %233 = load i64, ptr %232, align 8, !tbaa !8
  %234 = load i64, ptr %13, align 8, !tbaa !8
  %235 = add nsw i64 %234, 1
  %236 = mul nsw i64 %233, %235
  %237 = load i64, ptr @s1, align 8, !tbaa !8
  %238 = sub nsw i64 %236, %237
  %239 = add nsw i64 %228, %238
  store i64 %239, ptr %14, align 8, !tbaa !8
  %240 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %241 = load i64, ptr %240, align 8, !tbaa !8
  store i64 %241, ptr @ans, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %242

242:                                              ; preds = %198
  %243 = load i64, ptr %13, align 8, !tbaa !8
  %244 = add nsw i64 %243, 1
  store i64 %244, ptr %13, align 8, !tbaa !8
  br label %193, !llvm.loop !16

245:                                              ; preds = %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %246

246:                                              ; preds = %245, %145
  br label %247

247:                                              ; preds = %246
  %248 = load i64, ptr %5, align 8, !tbaa !8
  %249 = add nsw i64 %248, 1
  store i64 %249, ptr %5, align 8, !tbaa !8
  br label %140, !llvm.loop !17

250:                                              ; preds = %144
  %251 = load i64, ptr @ans, align 8, !tbaa !8
  %252 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %251)
  %253 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %252, ptr noundef @.str)
  store i32 0, ptr %1, align 4
  br label %254

254:                                              ; preds = %250, %43
  %255 = load i32, ptr %1, align 4
  ret i32 %255
}

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) #6

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

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

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

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

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

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

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

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

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

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

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

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

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


; 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 i64, align 8
@m = external dso_local global i64, align 8
@a = external dso_local global [100100 x i64], align 16
@tot = external dso_local local_unnamed_addr global i64, align 8
@cur = external dso_local local_unnamed_addr global i64, align 8
@s1 = external dso_local local_unnamed_addr global i64, align 8
@s2 = external dso_local local_unnamed_addr global i64, align 8
@ans = external dso_local global i64, align 8
@v = external dso_local global [100100 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca i64, align 8
  %4 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) @m)
  %17 = load i64, ptr @m, align 8, !tbaa !8
  %18 = icmp sgt i64 %17, 0
  br i1 %18, label %.lr.ph, label %.preheader61.._crit_edge65_crit_edge

._crit_edge:                                      ; preds = %.lr.ph
  %19 = icmp eq i64 %25, 1
  br i1 %19, label %27, label %.preheader61

.preheader61:                                     ; preds = %._crit_edge
  %20 = icmp sgt i64 %25, 1
  br i1 %20, label %.lr.ph64, label %.preheader61.._crit_edge65_crit_edge

.preheader61.._crit_edge65_crit_edge:             ; preds = %0, %.preheader61
  %21 = phi i64 [ %25, %.preheader61 ], [ %17, %0 ]
  %.pre = load i64, ptr @tot, align 8, !tbaa !8
  br label %._crit_edge65

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.04462 = phi i64 [ %24, %.lr.ph ], [ 0, %0 ]
  %22 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %.04462
  %23 = 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) %22)
  %24 = add nuw nsw i64 %.04462, 1
  %25 = load i64, ptr @m, align 8, !tbaa !8
  %26 = icmp slt i64 %24, %25
  br i1 %26, label %.lr.ph, label %._crit_edge, !llvm.loop !11

27:                                               ; preds = %._crit_edge
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %131

._crit_edge65:                                    ; preds = %.lr.ph64, %.preheader61.._crit_edge65_crit_edge
  %30 = phi i64 [ %21, %.preheader61.._crit_edge65_crit_edge ], [ %44, %.lr.ph64 ]
  %31 = phi i64 [ %.pre, %.preheader61.._crit_edge65_crit_edge ], [ %42, %.lr.ph64 ]
  store i64 %31, ptr @ans, align 8, !tbaa !8
  %32 = load i64, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !8
  %33 = load i64, ptr @a, align 16, !tbaa !8
  %.not = icmp eq i64 %32, %33
  br i1 %.not, label %48, label %46

.lr.ph64:                                         ; preds = %.preheader61, %.lr.ph64
  %.04563 = phi i64 [ %43, %.lr.ph64 ], [ 1, %.preheader61 ]
  %34 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %.04563
  %35 = load i64, ptr %34, align 8, !tbaa !8
  %36 = add nsw i64 %.04563, -1
  %37 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %36
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %39 = sub nsw i64 %35, %38
  %40 = tail call noundef i64 @_ZSt3absx(i64 noundef %39)
  %41 = load i64, ptr @tot, align 8, !tbaa !8
  %42 = add nsw i64 %41, %40
  store i64 %42, ptr @tot, align 8, !tbaa !8
  %43 = add nuw nsw i64 %.04563, 1
  %44 = load i64, ptr @m, align 8, !tbaa !8
  %45 = icmp slt i64 %43, %44
  br i1 %45, label %.lr.ph64, label %._crit_edge65, !llvm.loop !13

46:                                               ; preds = %._crit_edge65
  %47 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %33
  tail call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %47, ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @a, i64 8))
  %.pre84 = load i64, ptr @m, align 8, !tbaa !8
  br label %48

48:                                               ; preds = %46, %._crit_edge65
  %49 = phi i64 [ %.pre84, %46 ], [ %30, %._crit_edge65 ]
  %50 = add nsw i64 %49, -2
  %51 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !8
  %53 = add nsw i64 %49, -1
  %54 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %.not54 = icmp eq i64 %52, %55
  br i1 %.not54, label %58, label %56

56:                                               ; preds = %48
  %57 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %55
  tail call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(8) %51)
  %.pre85 = load i64, ptr @m, align 8, !tbaa !8
  br label %58

58:                                               ; preds = %56, %48
  %59 = phi i64 [ %.pre85, %56 ], [ %49, %48 ]
  %60 = icmp sgt i64 %59, 2
  br i1 %60, label %.lr.ph68, label %.preheader

.preheader:                                       ; preds = %76, %58
  %61 = load i64, ptr @n, align 8, !tbaa !8
  %.not5575 = icmp slt i64 %61, 1
  br i1 %.not5575, label %._crit_edge79, label %.lr.ph78

.lr.ph68:                                         ; preds = %58, %76
  %.04666 = phi i64 [ %71, %76 ], [ 1, %58 ]
  %62 = add nsw i64 %.04666, -1
  %63 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %.04666
  %66 = load i64, ptr %65, align 8, !tbaa !8
  %.not57 = icmp eq i64 %64, %66
  br i1 %.not57, label %69, label %67

67:                                               ; preds = %.lr.ph68
  %68 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %66
  tail call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %68, ptr noundef nonnull align 8 dereferenceable(8) %63)
  %.pre86 = load i64, ptr %65, align 8, !tbaa !8
  br label %69

69:                                               ; preds = %67, %.lr.ph68
  %70 = phi i64 [ %.pre86, %67 ], [ %64, %.lr.ph68 ]
  %71 = add nuw nsw i64 %.04666, 1
  %72 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !8
  %.not58 = icmp eq i64 %73, %70
  br i1 %.not58, label %76, label %74

74:                                               ; preds = %69
  %75 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %70
  tail call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %75, ptr noundef nonnull align 8 dereferenceable(8) %72)
  br label %76

76:                                               ; preds = %69, %74
  %77 = load i64, ptr @m, align 8, !tbaa !8
  %78 = add nsw i64 %77, -1
  %79 = icmp slt i64 %71, %78
  br i1 %79, label %.lr.ph68, label %.preheader, !llvm.loop !14

._crit_edge79:                                    ; preds = %.loopexit, %.preheader
  %80 = load i64, ptr @ans, align 8, !tbaa !8
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %80)
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %81, ptr noundef nonnull @.str)
  br label %131

.lr.ph78:                                         ; preds = %.preheader, %.loopexit
  %.04776 = phi i64 [ %129, %.loopexit ], [ 1, %.preheader ]
  %83 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @v, i64 0, i64 %.04776
  %84 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #7
  %.not56 = icmp eq i64 %84, 0
  br i1 %.not56, label %.loopexit, label %85

85:                                               ; preds = %.lr.ph78
  %86 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #7
  %87 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %86, ptr %87)
  store i64 0, ptr @cur, align 8, !tbaa !8
  store i64 0, ptr @s1, align 8, !tbaa !8
  store i64 0, ptr @s2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %88 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #7
  store ptr %88, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %89 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #7
  store ptr %89, ptr %2, align 8
  %90 = 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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br i1 %90, label %.lr.ph70, label %._crit_edge71

._crit_edge71:                                    ; preds = %.lr.ph70, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %91 = call noundef i64 @_ZNKSt6vectorIxSaIxEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #7
  %92 = icmp sgt i64 %91, 0
  br i1 %92, label %.lr.ph74, label %.loopexit

.lr.ph70:                                         ; preds = %85, %.lr.ph70
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %94 = load i64, ptr %93, align 8, !tbaa !8
  %95 = sub nsw i64 %.04776, %94
  %96 = call noundef i64 @_ZSt3absx(i64 noundef %95)
  %97 = load i64, ptr @cur, align 8, !tbaa !8
  %98 = add nsw i64 %97, %96
  store i64 %98, ptr @cur, align 8, !tbaa !8
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %1) #7
  %100 = load i64, ptr %99, align 8, !tbaa !8
  %101 = load i64, ptr @s2, align 8, !tbaa !8
  %102 = add nsw i64 %101, %100
  store i64 %102, ptr @s2, align 8, !tbaa !8
  %103 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef 0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %104 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %83) #7
  store ptr %104, ptr %2, align 8
  %105 = 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
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br i1 %105, label %.lr.ph70, label %._crit_edge71, !llvm.loop !15

.lr.ph74:                                         ; preds = %._crit_edge71, %.lr.ph74
  %.072 = phi i64 [ %.neg80, %.lr.ph74 ], [ 0, %._crit_edge71 ]
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %.072) #7
  %107 = load i64, ptr %106, align 8, !tbaa !8
  %108 = load i64, ptr @s1, align 8, !tbaa !8
  %109 = add nsw i64 %108, %107
  store i64 %109, ptr @s1, align 8, !tbaa !8
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %.072) #7
  %111 = load i64, ptr %110, align 8, !tbaa !8
  %112 = load i64, ptr @s2, align 8, !tbaa !8
  %113 = sub nsw i64 %112, %111
  store i64 %113, ptr @s2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %114 = load i64, ptr @tot, align 8, !tbaa !8
  %115 = load i64, ptr @cur, align 8, !tbaa !8
  %.neg80 = add nuw nsw i64 %.072, 1
  %.neg81 = sub nsw i64 %.neg80, %91
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %.072) #7
  %117 = load i64, ptr %116, align 8, !tbaa !8
  %.neg82 = mul i64 %.neg81, %117
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIxSaIxEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %.072) #7
  %119 = load i64, ptr %118, align 8, !tbaa !8
  %120 = mul nsw i64 %119, %.neg80
  %121 = load i64, ptr @s1, align 8, !tbaa !8
  %122 = add i64 %114, %113
  %123 = add i64 %122, %.neg82
  %124 = add i64 %115, %121
  %125 = sub i64 %123, %124
  %126 = add i64 %125, %120
  store i64 %126, ptr %3, align 8, !tbaa !8
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @ans, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %128 = load i64, ptr %127, align 8, !tbaa !8
  store i64 %128, ptr @ans, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %exitcond.not = icmp eq i64 %.neg80, %91
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph74, !llvm.loop !16

.loopexit:                                        ; preds = %.lr.ph74, %._crit_edge71, %.lr.ph78
  %129 = add nuw nsw i64 %.04776, 1
  %130 = load i64, ptr @n, align 8, !tbaa !8
  %.not55.not = icmp slt i64 %.04776, %130
  br i1 %.not55.not, label %.lr.ph78, label %._crit_edge79, !llvm.loop !17

131:                                              ; preds = %._crit_edge79, %27
  ret i32 0
}

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

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

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

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

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

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 #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) local_unnamed_addr #6

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

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

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

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

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

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

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

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

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

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

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

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

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


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