; LLVM IR from eyangch/competitive-programming :: USACOcontests/silver/2020.12 (2)

; 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"

%"struct.std::pair" = type { i64, i64 }
%"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
@c = external dso_local global [2500 x %"struct.std::pair"], align 16
@ans = external dso_local global i64, align 8
@pfxl = external dso_local global [2500 x %"class.std::vector"], align 16
@pfxr = external dso_local global [2500 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

35:                                               ; preds = %49, %0
  %36 = load i64, ptr %2, align 8, !tbaa !8
  %37 = load i64, ptr @N, align 8, !tbaa !8
  %38 = icmp slt i64 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  %41 = load i64, ptr %2, align 8, !tbaa !8
  %42 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %41
  %43 = getelementptr inbounds %"struct.std::pair", ptr %42, i32 0, i32 0
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %43)
  %45 = load i64, ptr %2, align 8, !tbaa !8
  %46 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %45
  %47 = getelementptr inbounds %"struct.std::pair", ptr %46, i32 0, i32 1
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 8 dereferenceable(8) %47)
  br label %49

49:                                               ; preds = %40
  %50 = load i64, ptr %2, align 8, !tbaa !8
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %2, align 8, !tbaa !8
  br label %35, !llvm.loop !11

52:                                               ; preds = %39
  %53 = load i64, ptr @N, align 8, !tbaa !8
  %54 = getelementptr inbounds %"struct.std::pair", ptr @c, i64 %53
  call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef @c, ptr noundef %54)
  %55 = load i64, ptr @N, align 8, !tbaa !8
  %56 = add nsw i64 1, %55
  %57 = load i64, ptr @N, align 8, !tbaa !8
  %58 = load i64, ptr @N, align 8, !tbaa !8
  %59 = sub nsw i64 %58, 1
  %60 = mul nsw i64 %57, %59
  %61 = sdiv i64 %60, 2
  %62 = add nsw i64 %56, %61
  store i64 %62, ptr @ans, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %63

63:                                               ; preds = %96, %52
  %64 = load i64, ptr %3, align 8, !tbaa !8
  %65 = load i64, ptr @N, align 8, !tbaa !8
  %66 = sub nsw i64 %65, 1
  %67 = icmp slt i64 %64, %66
  br i1 %67, label %69, label %68

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

69:                                               ; preds = %63
  %70 = load i64, ptr %3, align 8, !tbaa !8
  %71 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %70
  %72 = load i64, ptr %3, align 8, !tbaa !8
  %73 = add nsw i64 %72, 1
  %74 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %73
  %75 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %74, ptr noundef nonnull align 8 dereferenceable(24) %71)
  %76 = load i64, ptr %3, align 8, !tbaa !8
  %77 = add nsw i64 %76, 1
  %78 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %77
  %79 = load i64, ptr %3, align 8, !tbaa !8
  %80 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %79
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 1
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %78, ptr noundef nonnull align 8 dereferenceable(8) %81)
  %82 = load i64, ptr %3, align 8, !tbaa !8
  %83 = add nsw i64 %82, 1
  %84 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %83
  %85 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %84) #7
  %86 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  store ptr %85, ptr %86, align 8
  %87 = load i64, ptr %3, align 8, !tbaa !8
  %88 = add nsw i64 %87, 1
  %89 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %88
  %90 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %89) #7
  %91 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  store ptr %90, ptr %91, align 8
  %92 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %4, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8
  %94 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %5, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %93, ptr %95)
  br label %96

96:                                               ; preds = %69
  %97 = load i64, ptr %3, align 8, !tbaa !8
  %98 = add nsw i64 %97, 1
  store i64 %98, ptr %3, align 8, !tbaa !8
  br label %63, !llvm.loop !13

99:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %100 = load i64, ptr @N, align 8, !tbaa !8
  %101 = sub nsw i64 %100, 1
  store i64 %101, ptr %6, align 8, !tbaa !8
  br label %102

102:                                              ; preds = %133, %99
  %103 = load i64, ptr %6, align 8, !tbaa !8
  %104 = icmp sgt i64 %103, 0
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %136

106:                                              ; preds = %102
  %107 = load i64, ptr %6, align 8, !tbaa !8
  %108 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %107
  %109 = load i64, ptr %6, align 8, !tbaa !8
  %110 = sub nsw i64 %109, 1
  %111 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %110
  %112 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %111, ptr noundef nonnull align 8 dereferenceable(24) %108)
  %113 = load i64, ptr %6, align 8, !tbaa !8
  %114 = sub nsw i64 %113, 1
  %115 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %114
  %116 = load i64, ptr %6, align 8, !tbaa !8
  %117 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %116
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 1
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %115, ptr noundef nonnull align 8 dereferenceable(8) %118)
  %119 = load i64, ptr %6, align 8, !tbaa !8
  %120 = sub nsw i64 %119, 1
  %121 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %120
  %122 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %121) #7
  %123 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %122, ptr %123, align 8
  %124 = load i64, ptr %6, align 8, !tbaa !8
  %125 = sub nsw i64 %124, 1
  %126 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %125
  %127 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %126) #7
  %128 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %127, ptr %128, align 8
  %129 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8
  %131 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %130, ptr %132)
  br label %133

133:                                              ; preds = %106
  %134 = load i64, ptr %6, align 8, !tbaa !8
  %135 = add nsw i64 %134, -1
  store i64 %135, ptr %6, align 8, !tbaa !8
  br label %102, !llvm.loop !14

136:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  br label %137

137:                                              ; preds = %239, %136
  %138 = load i64, ptr %9, align 8, !tbaa !8
  %139 = load i64, ptr @N, align 8, !tbaa !8
  %140 = icmp slt i64 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %242

142:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %143 = load i64, ptr %9, align 8, !tbaa !8
  %144 = add nsw i64 %143, 1
  store i64 %144, ptr %11, align 8, !tbaa !8
  br label %145

145:                                              ; preds = %235, %142
  %146 = load i64, ptr %11, align 8, !tbaa !8
  %147 = load i64, ptr @N, align 8, !tbaa !8
  %148 = icmp slt i64 %146, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %145
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %238

150:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %151 = load i64, ptr %9, align 8, !tbaa !8
  %152 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %151
  %153 = getelementptr inbounds %"struct.std::pair", ptr %152, i32 0, i32 1
  %154 = load i64, ptr %11, align 8, !tbaa !8
  %155 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %154
  %156 = getelementptr inbounds %"struct.std::pair", ptr %155, i32 0, i32 1
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef nonnull align 8 dereferenceable(8) %156)
  %158 = load i64, ptr %157, align 8, !tbaa !8
  store i64 %158, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %159 = load i64, ptr %9, align 8, !tbaa !8
  %160 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %159
  %161 = getelementptr inbounds %"struct.std::pair", ptr %160, i32 0, i32 1
  %162 = load i64, ptr %11, align 8, !tbaa !8
  %163 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %162
  %164 = getelementptr inbounds %"struct.std::pair", ptr %163, i32 0, i32 1
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %161, ptr noundef nonnull align 8 dereferenceable(8) %164)
  %166 = load i64, ptr %165, align 8, !tbaa !8
  store i64 %166, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %167 = load i64, ptr %9, align 8, !tbaa !8
  %168 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %167
  %169 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %168) #7
  %170 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %169, ptr %170, align 8
  %171 = load i64, ptr %9, align 8, !tbaa !8
  %172 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %171
  %173 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %172) #7
  %174 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  store ptr %173, ptr %174, align 8
  %175 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %176 = load ptr, ptr %175, align 8
  %177 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %17, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8
  %179 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr %176, ptr %178, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %180 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %179, ptr %180, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %181 = load i64, ptr %9, align 8, !tbaa !8
  %182 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %181
  %183 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %182) #7
  %184 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %183, ptr %184, align 8
  %185 = load i64, ptr %9, align 8, !tbaa !8
  %186 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %185
  %187 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %186) #7
  %188 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %187, ptr %188, align 8
  %189 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  %190 = load ptr, ptr %189, align 8
  %191 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %192 = load ptr, ptr %191, align 8
  %193 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr %190, ptr %192, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %194 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %18, i32 0, i32 0
  store ptr %193, ptr %194, align 8
  %195 = call noundef i64 @_ZN9__gnu_cxxmiIPxSt6vectorIxSaIxEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  store i64 %195, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %196 = load i64, ptr %11, align 8, !tbaa !8
  %197 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %196
  %198 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %197) #7
  %199 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %198, ptr %199, align 8
  %200 = load i64, ptr %11, align 8, !tbaa !8
  %201 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %200
  %202 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %201) #7
  %203 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  store ptr %202, ptr %203, align 8
  %204 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  %205 = load ptr, ptr %204, align 8
  %206 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  %207 = load ptr, ptr %206, align 8
  %208 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr %205, ptr %207, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %209 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %208, ptr %209, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %210 = load i64, ptr %11, align 8, !tbaa !8
  %211 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %210
  %212 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %211) #7
  %213 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %212, ptr %213, align 8
  %214 = load i64, ptr %11, align 8, !tbaa !8
  %215 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %214
  %216 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %215) #7
  %217 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  store ptr %216, ptr %217, align 8
  %218 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  %219 = load ptr, ptr %218, align 8
  %220 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %27, i32 0, i32 0
  %221 = load ptr, ptr %220, align 8
  %222 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr %219, ptr %221, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %223 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %222, ptr %223, align 8
  %224 = call noundef i64 @_ZN9__gnu_cxxmiIPxSt6vectorIxSaIxEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  store i64 %224, ptr %21, align 8, !tbaa !8
  %225 = load i64, ptr %14, align 8, !tbaa !8
  %226 = load i64, ptr %21, align 8, !tbaa !8
  %227 = add nsw i64 %225, %226
  %228 = load i64, ptr @ans, align 8, !tbaa !8
  %229 = add nsw i64 %228, %227
  store i64 %229, ptr @ans, align 8, !tbaa !8
  %230 = load i64, ptr %14, align 8, !tbaa !8
  %231 = load i64, ptr %21, align 8, !tbaa !8
  %232 = mul nsw i64 %230, %231
  %233 = load i64, ptr @ans, align 8, !tbaa !8
  %234 = add nsw i64 %233, %232
  store i64 %234, ptr @ans, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %235

235:                                              ; preds = %150
  %236 = load i64, ptr %11, align 8, !tbaa !8
  %237 = add nsw i64 %236, 1
  store i64 %237, ptr %11, align 8, !tbaa !8
  br label %145, !llvm.loop !15

238:                                              ; preds = %149
  br label %239

239:                                              ; preds = %238
  %240 = load i64, ptr %9, align 8, !tbaa !8
  %241 = add nsw i64 %240, 1
  store i64 %241, ptr %9, align 8, !tbaa !8
  br label %137, !llvm.loop !16

242:                                              ; preds = %141
  %243 = load i64, ptr @ans, align 8, !tbaa !8
  %244 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %243)
  %245 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %244, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %246 = load i32, ptr %1, align 4
  ret i32 %246
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #3 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 nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

; 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 nounwind uwtable
declare dso_local noundef i64 @_ZN9__gnu_cxxmiIPxSt6vectorIxSaIxEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(8)) #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

; 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

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}


; 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"

%"struct.std::pair" = type { i64, i64 }
%"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
@c = external dso_local global [2500 x %"struct.std::pair"], align 16
@ans = external dso_local local_unnamed_addr global i64, align 8
@pfxl = external dso_local global [2500 x %"class.std::vector"], align 16
@pfxr = external dso_local global [2500 x %"class.std::vector"], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %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 noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = 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)
  %14 = load i64, ptr @N, align 8, !tbaa !8
  %15 = icmp sgt i64 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa60 = phi i64 [ %14, %0 ], [ %29, %.lr.ph ]
  %16 = getelementptr inbounds %"struct.std::pair", ptr @c, i64 %.lcssa60
  tail call void @_ZSt4sortIPSt4pairIxxEEvT_S3_(ptr noundef nonnull @c, ptr noundef nonnull %16)
  %17 = load i64, ptr @N, align 8, !tbaa !8
  %18 = add nsw i64 %17, 1
  %19 = add nsw i64 %17, -1
  %20 = mul nsw i64 %19, %17
  %21 = sdiv i64 %20, 2
  %22 = add nsw i64 %18, %21
  store i64 %22, ptr @ans, align 8, !tbaa !8
  %23 = icmp sgt i64 %17, 1
  br i1 %23, label %.lr.ph64, label %.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.061 = phi i64 [ %28, %.lr.ph ], [ 0, %0 ]
  %24 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %.061
  %25 = 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) %24)
  %26 = getelementptr inbounds i8, ptr %24, i64 8
  %27 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %28 = add nuw nsw i64 %.061, 1
  %29 = load i64, ptr @N, align 8, !tbaa !8
  %30 = icmp slt i64 %28, %29
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader59:                                     ; preds = %.lr.ph64
  %31 = icmp sgt i64 %39, 1
  br i1 %31, label %.lr.ph67, label %.preheader

.lr.ph64:                                         ; preds = %._crit_edge, %.lr.ph64
  %.05362 = phi i64 [ %33, %.lr.ph64 ], [ 0, %._crit_edge ]
  %32 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %.05362
  %33 = add nuw nsw i64 %.05362, 1
  %34 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %33
  %35 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(24) %32)
  %36 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %.05362, i32 1
  tail call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef nonnull align 8 dereferenceable(8) %36)
  %37 = tail call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #7
  %38 = tail call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #7
  tail call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %37, ptr %38)
  %39 = load i64, ptr @N, align 8, !tbaa !8
  %40 = add nsw i64 %39, -1
  %41 = icmp slt i64 %33, %40
  br i1 %41, label %.lr.ph64, label %.preheader59, !llvm.loop !13

.preheader.loopexit:                              ; preds = %.lr.ph67
  %.pre = load i64, ptr @N, align 8, !tbaa !8
  br label %.preheader

.preheader:                                       ; preds = %._crit_edge, %.preheader.loopexit, %.preheader59
  %42 = phi i64 [ %.pre, %.preheader.loopexit ], [ %39, %.preheader59 ], [ %17, %._crit_edge ]
  %43 = icmp sgt i64 %42, 0
  br i1 %43, label %.lr.ph72, label %._crit_edge73

.lr.ph67:                                         ; preds = %.preheader59, %.lr.ph67
  %.05466 = phi i64 [ %45, %.lr.ph67 ], [ %40, %.preheader59 ]
  %44 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %.05466
  %45 = add nsw i64 %.05466, -1
  %46 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %45
  %47 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIxSaIxEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 8 dereferenceable(24) %44)
  %48 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %.05466, i32 1
  tail call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 8 dereferenceable(8) %48)
  %49 = tail call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #7
  %50 = tail call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #7
  tail call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEEEvT_S7_(ptr %49, ptr %50)
  %51 = icmp ugt i64 %.05466, 1
  br i1 %51, label %.lr.ph67, label %.preheader.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %62, %.lr.ph72
  %52 = phi i64 [ %57, %.lr.ph72 ], [ %89, %62 ]
  %53 = icmp slt i64 %58, %52
  br i1 %53, label %.lr.ph72, label %._crit_edge73, !llvm.loop !15

._crit_edge73:                                    ; preds = %.loopexit, %.preheader
  %54 = load i64, ptr @ans, align 8, !tbaa !8
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %54)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph72:                                         ; preds = %.preheader, %.loopexit
  %57 = phi i64 [ %52, %.loopexit ], [ %42, %.preheader ]
  %.05571 = phi i64 [ %58, %.loopexit ], [ 0, %.preheader ]
  %58 = add nuw nsw i64 %.05571, 1
  %59 = icmp slt i64 %58, %57
  br i1 %59, label %.lr.ph70, label %.loopexit

.lr.ph70:                                         ; preds = %.lr.ph72
  %60 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %.05571, i32 1
  %61 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxl, i64 0, i64 %.05571
  br label %62

62:                                               ; preds = %.lr.ph70, %62
  %.05668 = phi i64 [ %58, %.lr.ph70 ], [ %88, %62 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %63 = getelementptr inbounds [2500 x %"struct.std::pair"], ptr @c, i64 0, i64 %.05668, i32 1
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 8 dereferenceable(8) %63)
  %65 = load i64, ptr %64, align 8, !tbaa !8
  store i64 %65, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull align 8 dereferenceable(8) %63)
  %67 = load i64, ptr %66, align 8, !tbaa !8
  store i64 %67, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %68 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #7
  %69 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #7
  %70 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr %68, ptr %69, ptr noundef nonnull align 8 dereferenceable(8) %1)
  store ptr %70, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %71 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #7
  %72 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %61) #7
  %73 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr %71, ptr %72, ptr noundef nonnull align 8 dereferenceable(8) %2)
  store ptr %73, ptr %4, align 8
  %74 = call noundef i64 @_ZN9__gnu_cxxmiIPxSt6vectorIxSaIxEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %75 = getelementptr inbounds [2500 x %"class.std::vector"], ptr @pfxr, i64 0, i64 %.05668
  %76 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #7
  %77 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #7
  %78 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr %76, ptr %77, ptr noundef nonnull align 8 dereferenceable(8) %1)
  store ptr %78, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %79 = call ptr @_ZNSt6vectorIxSaIxEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #7
  %80 = call ptr @_ZNSt6vectorIxSaIxEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %75) #7
  %81 = call ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr %79, ptr %80, ptr noundef nonnull align 8 dereferenceable(8) %2)
  store ptr %81, ptr %6, align 8
  %82 = call noundef i64 @_ZN9__gnu_cxxmiIPxSt6vectorIxSaIxEEEENS_17__normal_iteratorIT_T0_E15difference_typeERKS8_SB_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %83 = add nsw i64 %82, %74
  %84 = load i64, ptr @ans, align 8, !tbaa !8
  %85 = mul nsw i64 %82, %74
  %86 = add i64 %83, %85
  %87 = add i64 %86, %84
  store i64 %87, ptr @ans, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %88 = add nuw nsw i64 %.05668, 1
  %89 = load i64, ptr @N, align 8, !tbaa !8
  %90 = icmp slt i64 %88, %89
  br i1 %90, label %62, label %.loopexit, !llvm.loop !16
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 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 nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIPxSt6vectorIxSaIxEEEExET_S7_S7_RKT0_(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(8)) 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

; 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

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}


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