; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/339 Division 1/Problem B (B)

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

%"class.std::basic_ostream" = type { ptr, %"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.0" = type <{ i64, i32, [4 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i64, align 8
@A = external dso_local global i64, align 8
@cf = external dso_local global i64, align 8
@cm = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@u = external dso_local global %"class.std::vector", align 8
@v = external dso_local global %"class.std::vector", align 8
@ans = external dso_local global [100100 x i64], align 16
@sum = external dso_local global [100100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

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

39:                                               ; preds = %48, %0
  %40 = load i32, ptr %2, align 4, !tbaa !8
  %41 = sext i32 %40 to i64
  %42 = load i64, ptr @n, align 8, !tbaa !11
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %45, label %44

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

45:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #8
  %47 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store { i64, i32 } %47, ptr %6, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %6, i64 12, i1 false)
  call void @_ZNSt4pairIxxEC2IxiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(12) %5)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @u, ptr noundef nonnull align 8 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %48

48:                                               ; preds = %45
  %49 = load i32, ptr %2, align 4, !tbaa !8
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %2, align 4, !tbaa !8
  br label %39, !llvm.loop !13

51:                                               ; preds = %44
  %52 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @u) #8
  %53 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %52, ptr %53, align 8
  %54 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @u) #8
  %55 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  %56 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8
  %58 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %57, ptr %59)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !8
  br label %60

60:                                               ; preds = %81, %51
  %61 = load i32, ptr %9, align 4, !tbaa !8
  %62 = sext i32 %61 to i64
  %63 = load i64, ptr @n, align 8, !tbaa !11
  %64 = icmp slt i64 %62, %63
  br i1 %64, label %66, label %65

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

66:                                               ; preds = %60
  %67 = load i32, ptr %9, align 4, !tbaa !8
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !11
  %71 = load i32, ptr %9, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @u, i64 noundef %72) #8
  %74 = getelementptr inbounds %"struct.std::pair", ptr %73, i32 0, i32 0
  %75 = load i64, ptr %74, align 8, !tbaa !15
  %76 = add nsw i64 %70, %75
  %77 = load i32, ptr %9, align 4, !tbaa !8
  %78 = add nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %79
  store i64 %76, ptr %80, align 8, !tbaa !11
  br label %81

81:                                               ; preds = %66
  %82 = load i32, ptr %9, align 4, !tbaa !8
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %9, align 4, !tbaa !8
  br label %60, !llvm.loop !17

84:                                               ; preds = %65
  %85 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) @v, ptr noundef nonnull align 8 dereferenceable(24) @u)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store i64 -1, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store i64 -1, ptr %11, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store i64 -1, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !8
  br label %86

86:                                               ; preds = %184, %84
  %87 = load i32, ptr %13, align 4, !tbaa !8
  %88 = sext i32 %87 to i64
  %89 = load i64, ptr @n, align 8, !tbaa !11
  %90 = icmp sle i64 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %86
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %187

92:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  store i64 0, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store i64 0, ptr %17, align 8, !tbaa !11
  %93 = load i64, ptr @A, align 8, !tbaa !11
  %94 = load i64, ptr @n, align 8, !tbaa !11
  %95 = load i32, ptr %13, align 4, !tbaa !8
  %96 = sext i32 %95 to i64
  %97 = sub nsw i64 %94, %96
  %98 = mul nsw i64 %93, %97
  %99 = load i64, ptr @n, align 8, !tbaa !11
  %100 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %99
  %101 = load i64, ptr %100, align 8, !tbaa !11
  %102 = load i32, ptr %13, align 4, !tbaa !8
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %103
  %105 = load i64, ptr %104, align 8, !tbaa !11
  %106 = sub nsw i64 %101, %105
  %107 = sub nsw i64 %98, %106
  store i64 %107, ptr %16, align 8, !tbaa !11
  %108 = load i64, ptr %16, align 8, !tbaa !11
  %109 = load i64, ptr @m, align 8, !tbaa !11
  %110 = icmp sgt i64 %108, %109
  br i1 %110, label %111, label %112

111:                                              ; preds = %92
  store i32 10, ptr %15, align 4
  br label %181

112:                                              ; preds = %92
  %113 = load i64, ptr @n, align 8, !tbaa !11
  %114 = load i32, ptr %13, align 4, !tbaa !8
  %115 = sext i32 %114 to i64
  %116 = sub nsw i64 %113, %115
  %117 = load i64, ptr @cf, align 8, !tbaa !11
  %118 = mul nsw i64 %116, %117
  %119 = load i64, ptr %17, align 8, !tbaa !11
  %120 = add nsw i64 %119, %118
  store i64 %120, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %121 = load i64, ptr @m, align 8, !tbaa !11
  %122 = load i64, ptr %16, align 8, !tbaa !11
  %123 = sub nsw i64 %121, %122
  store i64 %123, ptr %18, align 8, !tbaa !11
  br label %124

124:                                              ; preds = %146, %112
  %125 = load i32, ptr %14, align 4, !tbaa !8
  %126 = load i32, ptr %13, align 4, !tbaa !8
  %127 = icmp slt i32 %125, %126
  br i1 %127, label %128, label %144

128:                                              ; preds = %124
  %129 = load i32, ptr %14, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = load i32, ptr %14, align 4, !tbaa !8
  %132 = sext i32 %131 to i64
  %133 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %132) #8
  %134 = getelementptr inbounds %"struct.std::pair", ptr %133, i32 0, i32 0
  %135 = load i64, ptr %134, align 8, !tbaa !15
  %136 = mul nsw i64 %130, %135
  %137 = load i32, ptr %14, align 4, !tbaa !8
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !11
  %141 = sub nsw i64 %136, %140
  %142 = load i64, ptr %18, align 8, !tbaa !11
  %143 = icmp sle i64 %141, %142
  br label %144

144:                                              ; preds = %128, %124
  %145 = phi i1 [ false, %124 ], [ %143, %128 ]
  br i1 %145, label %146, label %149

146:                                              ; preds = %144
  %147 = load i32, ptr %14, align 4, !tbaa !8
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %14, align 4, !tbaa !8
  br label %124, !llvm.loop !18

149:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %150 = load i32, ptr %14, align 4, !tbaa !8
  %151 = icmp sgt i32 %150, 0
  br i1 %151, label %152, label %164

152:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %153 = load i64, ptr %18, align 8, !tbaa !11
  %154 = load i32, ptr %14, align 4, !tbaa !8
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %155
  %157 = load i64, ptr %156, align 8, !tbaa !11
  %158 = add nsw i64 %153, %157
  %159 = load i32, ptr %14, align 4, !tbaa !8
  %160 = sext i32 %159 to i64
  %161 = sdiv i64 %158, %160
  store i64 %161, ptr %20, align 8, !tbaa !11
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @A, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %163 = load i64, ptr %162, align 8, !tbaa !11
  store i64 %163, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %166

164:                                              ; preds = %149
  %165 = load i64, ptr @A, align 8, !tbaa !11
  store i64 %165, ptr %19, align 8, !tbaa !11
  br label %166

166:                                              ; preds = %164, %152
  %167 = load i64, ptr %19, align 8, !tbaa !11
  %168 = load i64, ptr @cm, align 8, !tbaa !11
  %169 = mul nsw i64 %167, %168
  %170 = load i64, ptr %17, align 8, !tbaa !11
  %171 = add nsw i64 %170, %169
  store i64 %171, ptr %17, align 8, !tbaa !11
  %172 = load i64, ptr %17, align 8, !tbaa !11
  %173 = load i64, ptr %10, align 8, !tbaa !11
  %174 = icmp sgt i64 %172, %173
  br i1 %174, label %175, label %180

175:                                              ; preds = %166
  %176 = load i64, ptr %17, align 8, !tbaa !11
  store i64 %176, ptr %10, align 8, !tbaa !11
  %177 = load i32, ptr %13, align 4, !tbaa !8
  %178 = sext i32 %177 to i64
  store i64 %178, ptr %11, align 8, !tbaa !11
  %179 = load i64, ptr %19, align 8, !tbaa !11
  store i64 %179, ptr %12, align 8, !tbaa !11
  br label %180

180:                                              ; preds = %175, %166
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  store i32 0, ptr %15, align 4
  br label %181

181:                                              ; preds = %180, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  %182 = load i32, ptr %15, align 4
  switch i32 %182, label %254 [
    i32 0, label %183
    i32 10, label %184
  ]

183:                                              ; preds = %181
  br label %184

184:                                              ; preds = %183, %181
  %185 = load i32, ptr %13, align 4, !tbaa !8
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %13, align 4, !tbaa !8
  br label %86, !llvm.loop !19

187:                                              ; preds = %91
  %188 = load i64, ptr %10, align 8, !tbaa !11
  %189 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %188)
  %190 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %189, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !8
  br label %191

191:                                              ; preds = %231, %187
  %192 = load i32, ptr %21, align 4, !tbaa !8
  %193 = sext i32 %192 to i64
  %194 = load i64, ptr @n, align 8, !tbaa !11
  %195 = icmp slt i64 %193, %194
  br i1 %195, label %197, label %196

196:                                              ; preds = %191
  store i32 13, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %234

197:                                              ; preds = %191
  %198 = load i32, ptr %21, align 4, !tbaa !8
  %199 = sext i32 %198 to i64
  %200 = load i64, ptr %11, align 8, !tbaa !11
  %201 = icmp slt i64 %199, %200
  br i1 %201, label %202, label %213

202:                                              ; preds = %197
  %203 = load i32, ptr %21, align 4, !tbaa !8
  %204 = sext i32 %203 to i64
  %205 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %204) #8
  %206 = getelementptr inbounds %"struct.std::pair", ptr %205, i32 0, i32 0
  %207 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %206, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %208 = load i64, ptr %207, align 8, !tbaa !11
  %209 = load i32, ptr %21, align 4, !tbaa !8
  %210 = sext i32 %209 to i64
  %211 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %210) #8
  %212 = getelementptr inbounds %"struct.std::pair", ptr %211, i32 0, i32 0
  store i64 %208, ptr %212, align 8, !tbaa !15
  br label %219

213:                                              ; preds = %197
  %214 = load i64, ptr @A, align 8, !tbaa !11
  %215 = load i32, ptr %21, align 4, !tbaa !8
  %216 = sext i32 %215 to i64
  %217 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %216) #8
  %218 = getelementptr inbounds %"struct.std::pair", ptr %217, i32 0, i32 0
  store i64 %214, ptr %218, align 8, !tbaa !15
  br label %219

219:                                              ; preds = %213, %202
  %220 = load i32, ptr %21, align 4, !tbaa !8
  %221 = sext i32 %220 to i64
  %222 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %221) #8
  %223 = getelementptr inbounds %"struct.std::pair", ptr %222, i32 0, i32 0
  %224 = load i64, ptr %223, align 8, !tbaa !15
  %225 = load i32, ptr %21, align 4, !tbaa !8
  %226 = sext i32 %225 to i64
  %227 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %226) #8
  %228 = getelementptr inbounds %"struct.std::pair", ptr %227, i32 0, i32 1
  %229 = load i64, ptr %228, align 8, !tbaa !20
  %230 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %229
  store i64 %224, ptr %230, align 8, !tbaa !11
  br label %231

231:                                              ; preds = %219
  %232 = load i32, ptr %21, align 4, !tbaa !8
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %21, align 4, !tbaa !8
  br label %191, !llvm.loop !21

234:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !8
  br label %235

235:                                              ; preds = %248, %234
  %236 = load i32, ptr %22, align 4, !tbaa !8
  %237 = sext i32 %236 to i64
  %238 = load i64, ptr @n, align 8, !tbaa !11
  %239 = icmp slt i64 %237, %238
  br i1 %239, label %241, label %240

240:                                              ; preds = %235
  store i32 16, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  br label %251

241:                                              ; preds = %235
  %242 = load i32, ptr %22, align 4, !tbaa !8
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %243
  %245 = load i64, ptr %244, align 8, !tbaa !11
  %246 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %245)
  %247 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %246, i8 noundef signext 32)
  br label %248

248:                                              ; preds = %241
  %249 = load i32, ptr %22, align 4, !tbaa !8
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %22, align 4, !tbaa !8
  br label %235, !llvm.loop !22

251:                                              ; preds = %240
  %252 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  %253 = load i32, ptr %1, align 4
  ret i32 %253

254:                                              ; preds = %181
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #4 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)) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #1

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

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

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


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

%"class.std::basic_ostream" = type { ptr, %"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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"struct.std::pair" = type { i64, i64 }
%"struct.std::pair.0" = type <{ i64, i32, [4 x i8] }>

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i64, align 8
@A = external dso_local global i64, align 8
@cf = external dso_local global i64, align 8
@cm = external dso_local global i64, align 8
@m = external dso_local global i64, align 8
@u = external dso_local global %"class.std::vector", align 8
@v = external dso_local global %"class.std::vector", align 8
@ans = external dso_local local_unnamed_addr global [100100 x i64], align 16
@sum = external dso_local local_unnamed_addr global [100100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; 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 #0 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)) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"struct.std::pair", align 8
  %4 = alloca %"struct.std::pair.0", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, 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 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %14 = getelementptr i8, ptr %13, i64 -24
  %15 = load i64, ptr %14, align 8
  %16 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %15
  %17 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %16, ptr noundef null)
  %18 = 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)
  %19 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(8) @A)
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(8) @cf)
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) @cm)
  %22 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !8
  %23 = load i64, ptr @n, align 8, !tbaa !11
  %24 = icmp sgt i64 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  br label %29

._crit_edge:                                      ; preds = %29, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %25 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @u) #7
  %26 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @u) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %25, ptr %26)
  %27 = load i64, ptr @n, align 8, !tbaa !11
  %28 = icmp sgt i64 %27, 0
  br i1 %28, label %.lr.ph69.preheader, label %._crit_edge70

.lr.ph69.preheader:                               ; preds = %._crit_edge
  %.pre = load i64, ptr @sum, align 16, !tbaa !11
  br label %.lr.ph69

29:                                               ; preds = %.lr.ph, %29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %31 = call { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %.fca.0.extract = extractvalue { i64, i32 } %31, 0
  %.fca.1.extract = extractvalue { i64, i32 } %31, 1
  store i64 %.fca.0.extract, ptr %4, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  call void @_ZNSt4pairIxxEC2IxiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(12) %4)
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @u, ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %32 = load i32, ptr %1, align 4, !tbaa !8
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %1, align 4, !tbaa !8
  %34 = sext i32 %33 to i64
  %35 = load i64, ptr @n, align 8, !tbaa !11
  %36 = icmp sgt i64 %35, %34
  br i1 %36, label %29, label %._crit_edge, !llvm.loop !13

._crit_edge70:                                    ; preds = %.lr.ph69, %._crit_edge
  %37 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24) @v, ptr noundef nonnull align 8 dereferenceable(24) @u)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  store i64 -1, ptr %5, align 8, !tbaa !11
  %38 = load i64, ptr @n, align 8, !tbaa !11
  %.not76 = icmp slt i64 %38, 0
  br i1 %.not76, label %._crit_edge84, label %.lr.ph83.preheader

.lr.ph83.preheader:                               ; preds = %._crit_edge70
  %.pre107 = load i64, ptr @A, align 8, !tbaa !11
  br label %.lr.ph83

.lr.ph69:                                         ; preds = %.lr.ph69.preheader, %.lr.ph69
  %39 = phi i64 [ %.pre, %.lr.ph69.preheader ], [ %42, %.lr.ph69 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph69.preheader ], [ %indvars.iv.next, %.lr.ph69 ]
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @u, i64 noundef %indvars.iv) #7
  %41 = load i64, ptr %40, align 8, !tbaa !15
  %42 = add nsw i64 %41, %39
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %43 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %indvars.iv.next
  store i64 %42, ptr %43, align 8, !tbaa !11
  %44 = load i64, ptr @n, align 8, !tbaa !11
  %45 = icmp sgt i64 %44, %indvars.iv.next
  br i1 %45, label %.lr.ph69, label %._crit_edge70, !llvm.loop !17

._crit_edge84:                                    ; preds = %93, %._crit_edge70
  %.054.lcssa = phi i64 [ -1, %._crit_edge70 ], [ %.256, %93 ]
  %.051.lcssa = phi i64 [ -1, %._crit_edge70 ], [ %.253, %93 ]
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.054.lcssa)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %48 = load i64, ptr @n, align 8, !tbaa !11
  %49 = icmp sgt i64 %48, 0
  br i1 %49, label %.lr.ph89, label %._crit_edge92

.lr.ph83:                                         ; preds = %.lr.ph83.preheader, %93
  %50 = phi i64 [ %.pre107, %.lr.ph83.preheader ], [ %94, %93 ]
  %indvars.iv97 = phi i64 [ 0, %.lr.ph83.preheader ], [ %indvars.iv.next98, %93 ]
  %51 = phi i64 [ %38, %.lr.ph83.preheader ], [ %95, %93 ]
  %.04981 = phi i32 [ 0, %.lr.ph83.preheader ], [ %.2, %93 ]
  %.05178 = phi i64 [ -1, %.lr.ph83.preheader ], [ %.253, %93 ]
  %.05477 = phi i64 [ -1, %.lr.ph83.preheader ], [ %.256, %93 ]
  %52 = sub nsw i64 %51, %indvars.iv97
  %53 = mul nsw i64 %50, %52
  %54 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %51
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %indvars.iv97
  %57 = load i64, ptr %56, align 8, !tbaa !11
  %.neg = sub i64 %57, %55
  %58 = add i64 %.neg, %53
  %59 = load i64, ptr @m, align 8, !tbaa !11
  %60 = icmp sgt i64 %58, %59
  br i1 %60, label %93, label %61

61:                                               ; preds = %.lr.ph83
  %62 = load i64, ptr @cf, align 8, !tbaa !11
  %63 = mul nsw i64 %62, %52
  %64 = sub nsw i64 %59, %58
  %65 = sext i32 %.04981 to i64
  %66 = icmp sgt i64 %indvars.iv97, %65
  br i1 %66, label %.lr.ph73, label %.critedge

.lr.ph73:                                         ; preds = %61, %73
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %73 ], [ %65, %61 ]
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv94) #7
  %68 = load i64, ptr %67, align 8, !tbaa !15
  %69 = mul nsw i64 %68, %indvars.iv94
  %70 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %indvars.iv94
  %71 = load i64, ptr %70, align 8, !tbaa !11
  %72 = sub nsw i64 %69, %71
  %.not66 = icmp sgt i64 %72, %64
  br i1 %.not66, label %.critedge.loopexit, label %73

73:                                               ; preds = %.lr.ph73
  %indvars.iv.next95 = add nsw i64 %indvars.iv94, 1
  %74 = icmp slt i64 %indvars.iv.next95, %indvars.iv97
  br i1 %74, label %.lr.ph73, label %.critedge.loopexit, !llvm.loop !18

.critedge.loopexit:                               ; preds = %73, %.lr.ph73
  %.1.lcssa.ph.in = phi i64 [ %indvars.iv94, %.lr.ph73 ], [ %indvars.iv97, %73 ]
  %.1.lcssa.ph = trunc i64 %.1.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %61
  %.1.lcssa = phi i32 [ %.04981, %61 ], [ %.1.lcssa.ph, %.critedge.loopexit ]
  %75 = icmp sgt i32 %.1.lcssa, 0
  br i1 %75, label %76, label %84

76:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %77 = zext nneg i32 %.1.lcssa to i64
  %78 = getelementptr inbounds [100100 x i64], ptr @sum, i64 0, i64 %77
  %79 = load i64, ptr %78, align 8, !tbaa !11
  %80 = add nsw i64 %79, %64
  %81 = sdiv i64 %80, %77
  store i64 %81, ptr %6, align 8, !tbaa !11
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) @A, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %83 = load i64, ptr %82, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %.pre106 = load i64, ptr @A, align 8, !tbaa !11
  br label %86

84:                                               ; preds = %.critedge
  %85 = load i64, ptr @A, align 8, !tbaa !11
  br label %86

86:                                               ; preds = %84, %76
  %87 = phi i64 [ %.pre106, %76 ], [ %85, %84 ]
  %.048 = phi i64 [ %83, %76 ], [ %85, %84 ]
  %88 = load i64, ptr @cm, align 8, !tbaa !11
  %89 = mul nsw i64 %88, %.048
  %90 = add nsw i64 %89, %63
  %91 = icmp sgt i64 %90, %.05477
  br i1 %91, label %92, label %93

92:                                               ; preds = %86
  store i64 %.048, ptr %5, align 8, !tbaa !11
  br label %93

93:                                               ; preds = %86, %92, %.lr.ph83
  %94 = phi i64 [ %50, %.lr.ph83 ], [ %87, %92 ], [ %87, %86 ]
  %.256 = phi i64 [ %.05477, %.lr.ph83 ], [ %90, %92 ], [ %.05477, %86 ]
  %.253 = phi i64 [ %.05178, %.lr.ph83 ], [ %indvars.iv97, %92 ], [ %.05178, %86 ]
  %.2 = phi i32 [ %.04981, %.lr.ph83 ], [ %.1.lcssa, %92 ], [ %.1.lcssa, %86 ]
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %95 = load i64, ptr @n, align 8, !tbaa !11
  %.not.not = icmp sgt i64 %95, %indvars.iv97
  br i1 %.not.not, label %.lr.ph83, label %._crit_edge84, !llvm.loop !19

.preheader:                                       ; preds = %101
  %96 = icmp sgt i64 %110, 0
  br i1 %96, label %.lr.ph91, label %._crit_edge92

.lr.ph89:                                         ; preds = %._crit_edge84, %101
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %101 ], [ 0, %._crit_edge84 ]
  %97 = icmp sgt i64 %.051.lcssa, %indvars.iv100
  br i1 %97, label %98, label %101

98:                                               ; preds = %.lr.ph89
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv100) #7
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %101

101:                                              ; preds = %.lr.ph89, %98
  %A.sink = phi ptr [ %100, %98 ], [ @A, %.lr.ph89 ]
  %102 = load i64, ptr %A.sink, align 8, !tbaa !11
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv100) #7
  store i64 %102, ptr %103, align 8, !tbaa !15
  %104 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv100) #7
  %105 = load i64, ptr %104, align 8, !tbaa !15
  %106 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv100) #7
  %107 = getelementptr inbounds i8, ptr %106, i64 8
  %108 = load i64, ptr %107, align 8, !tbaa !20
  %109 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %108
  store i64 %105, ptr %109, align 8, !tbaa !11
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %110 = load i64, ptr @n, align 8, !tbaa !11
  %111 = icmp sgt i64 %110, %indvars.iv.next101
  br i1 %111, label %.lr.ph89, label %.preheader, !llvm.loop !21

._crit_edge92:                                    ; preds = %.lr.ph91, %._crit_edge84, %.preheader
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  ret i32 0

.lr.ph91:                                         ; preds = %.preheader, %.lr.ph91
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %.lr.ph91 ], [ 0, %.preheader ]
  %113 = getelementptr inbounds [100100 x i64], ptr @ans, i64 0, i64 %indvars.iv103
  %114 = load i64, ptr %113, align 8, !tbaa !11
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %114)
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %115, i8 noundef signext 32)
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %117 = load i64, ptr @n, align 8, !tbaa !11
  %118 = icmp sgt i64 %117, %indvars.iv.next104
  br i1 %118, label %.lr.ph91, label %._crit_edge92, !llvm.loop !22
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { i64, i32 } @_ZSt9make_pairIRxRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEaSERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 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: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 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 uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #1

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


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