; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/WunderFund 2016/Problem C (C)

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

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

@n = external dso_local global i32, align 4
@v = external dso_local global %"class.std::vector", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"struct.std::pair", align 4
  %6 = alloca %"struct.std::pair.0", align 4
  %7 = alloca { i64, i32 }, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %38, %0
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %41

34:                                               ; preds = %29
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %36 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %36, ptr %6, align 4
  %37 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store { i64, i32 } %37, ptr %7, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 8 %7, i64 12, i1 false)
  call void @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @v, ptr noundef nonnull align 4 dereferenceable(12) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #8
  br label %38

38:                                               ; preds = %34
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %4, align 4, !tbaa !5
  br label %29, !llvm.loop !9

41:                                               ; preds = %33
  %42 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #8
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  %44 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #8
  %45 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %44, ptr %45, align 8
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8
  %48 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIS2_IiiEiESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %47, ptr %49)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 2, ptr %10, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %150, %41
  %51 = load i32, ptr %10, align 4, !tbaa !5
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i32 5, ptr %11, align 4
  br label %153

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %56 = load i32, ptr %10, align 4, !tbaa !5
  %57 = sub nsw i32 %56, 2
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %58) #8
  %60 = getelementptr inbounds %"struct.std::pair", ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds %"struct.std::pair.0", ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 4, !tbaa !11
  store i32 %62, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = sub nsw i32 %63, 2
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %65) #8
  %67 = getelementptr inbounds %"struct.std::pair", ptr %66, i32 0, i32 0
  %68 = getelementptr inbounds %"struct.std::pair.0", ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !14
  store i32 %69, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %70 = load i32, ptr %10, align 4, !tbaa !5
  %71 = sub nsw i32 %70, 1
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %72) #8
  %74 = getelementptr inbounds %"struct.std::pair", ptr %73, i32 0, i32 0
  %75 = getelementptr inbounds %"struct.std::pair.0", ptr %74, i32 0, i32 0
  %76 = load i32, ptr %75, align 4, !tbaa !11
  store i32 %76, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = sub nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %79) #8
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 0
  %82 = getelementptr inbounds %"struct.std::pair.0", ptr %81, i32 0, i32 1
  %83 = load i32, ptr %82, align 4, !tbaa !14
  store i32 %83, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %85) #8
  %87 = getelementptr inbounds %"struct.std::pair", ptr %86, i32 0, i32 0
  %88 = getelementptr inbounds %"struct.std::pair.0", ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 4, !tbaa !11
  store i32 %89, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %91) #8
  %93 = getelementptr inbounds %"struct.std::pair", ptr %92, i32 0, i32 0
  %94 = getelementptr inbounds %"struct.std::pair.0", ptr %93, i32 0, i32 1
  %95 = load i32, ptr %94, align 4, !tbaa !14
  store i32 %95, ptr %17, align 4, !tbaa !5
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = load i32, ptr %14, align 4, !tbaa !5
  %98 = icmp ne i32 %96, %97
  br i1 %98, label %107, label %99

99:                                               ; preds = %55
  %100 = load i32, ptr %14, align 4, !tbaa !5
  %101 = load i32, ptr %16, align 4, !tbaa !5
  %102 = icmp ne i32 %100, %101
  br i1 %102, label %107, label %103

103:                                              ; preds = %99
  %104 = load i32, ptr %16, align 4, !tbaa !5
  %105 = load i32, ptr %12, align 4, !tbaa !5
  %106 = icmp ne i32 %104, %105
  br i1 %106, label %107, label %146

107:                                              ; preds = %103, %99, %55
  %108 = load i32, ptr %15, align 4, !tbaa !5
  %109 = load i32, ptr %13, align 4, !tbaa !5
  %110 = sub nsw i32 %108, %109
  %111 = load i32, ptr %16, align 4, !tbaa !5
  %112 = load i32, ptr %12, align 4, !tbaa !5
  %113 = sub nsw i32 %111, %112
  %114 = mul nsw i32 %110, %113
  %115 = load i32, ptr %17, align 4, !tbaa !5
  %116 = load i32, ptr %13, align 4, !tbaa !5
  %117 = sub nsw i32 %115, %116
  %118 = load i32, ptr %14, align 4, !tbaa !5
  %119 = load i32, ptr %12, align 4, !tbaa !5
  %120 = sub nsw i32 %118, %119
  %121 = mul nsw i32 %117, %120
  %122 = icmp ne i32 %114, %121
  br i1 %122, label %123, label %145

123:                                              ; preds = %107
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = sub nsw i32 %124, 2
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %126) #8
  %128 = getelementptr inbounds %"struct.std::pair", ptr %127, i32 0, i32 1
  %129 = load i32, ptr %128, align 4, !tbaa !15
  %130 = add nsw i32 %129, 1
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = sub nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %133) #8
  %135 = getelementptr inbounds %"struct.std::pair", ptr %134, i32 0, i32 1
  %136 = load i32, ptr %135, align 4, !tbaa !15
  %137 = add nsw i32 %136, 1
  %138 = load i32, ptr %10, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %139) #8
  %141 = getelementptr inbounds %"struct.std::pair", ptr %140, i32 0, i32 1
  %142 = load i32, ptr %141, align 4, !tbaa !15
  %143 = add nsw i32 %142, 1
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %130, i32 noundef %137, i32 noundef %143)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  br label %147

145:                                              ; preds = %107
  br label %146

146:                                              ; preds = %145, %103
  store i32 0, ptr %11, align 4
  br label %147

147:                                              ; preds = %146, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %148 = load i32, ptr %11, align 4
  switch i32 %148, label %153 [
    i32 0, label %149
  ]

149:                                              ; preds = %147
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %10, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %10, align 4, !tbaa !5
  br label %50, !llvm.loop !16

153:                                              ; preds = %147, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  %154 = load i32, ptr %11, align 4
  switch i32 %154, label %290 [
    i32 5, label %155
  ]

155:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %172, %155
  %157 = load i32, ptr %18, align 4, !tbaa !5
  %158 = load i32, ptr @n, align 4, !tbaa !5
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %156
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %175

161:                                              ; preds = %156
  %162 = load i32, ptr %18, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %163) #8
  %165 = getelementptr inbounds %"struct.std::pair", ptr %164, i32 0, i32 0
  %166 = getelementptr inbounds %"struct.std::pair.0", ptr %165, i32 0, i32 0
  %167 = load i32, ptr %18, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %168) #8
  %170 = getelementptr inbounds %"struct.std::pair", ptr %169, i32 0, i32 0
  %171 = getelementptr inbounds %"struct.std::pair.0", ptr %170, i32 0, i32 1
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %166, ptr noundef nonnull align 4 dereferenceable(4) %171) #8
  br label %172

172:                                              ; preds = %161
  %173 = load i32, ptr %18, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %18, align 4, !tbaa !5
  br label %156, !llvm.loop !17

175:                                              ; preds = %160
  %176 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #8
  %177 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %176, ptr %177, align 8
  %178 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #8
  %179 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %178, ptr %179, align 8
  %180 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8
  %182 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %183 = load ptr, ptr %182, align 8
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIS2_IiiEiESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %181, ptr %183)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 2, ptr %21, align 4, !tbaa !5
  br label %184

184:                                              ; preds = %284, %175
  %185 = load i32, ptr %21, align 4, !tbaa !5
  %186 = load i32, ptr @n, align 4, !tbaa !5
  %187 = icmp slt i32 %185, %186
  br i1 %187, label %189, label %188

188:                                              ; preds = %184
  store i32 11, ptr %11, align 4
  br label %287

189:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %190 = load i32, ptr %21, align 4, !tbaa !5
  %191 = sub nsw i32 %190, 2
  %192 = sext i32 %191 to i64
  %193 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %192) #8
  %194 = getelementptr inbounds %"struct.std::pair", ptr %193, i32 0, i32 0
  %195 = getelementptr inbounds %"struct.std::pair.0", ptr %194, i32 0, i32 0
  %196 = load i32, ptr %195, align 4, !tbaa !11
  store i32 %196, ptr %22, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %197 = load i32, ptr %21, align 4, !tbaa !5
  %198 = sub nsw i32 %197, 2
  %199 = sext i32 %198 to i64
  %200 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %199) #8
  %201 = getelementptr inbounds %"struct.std::pair", ptr %200, i32 0, i32 0
  %202 = getelementptr inbounds %"struct.std::pair.0", ptr %201, i32 0, i32 1
  %203 = load i32, ptr %202, align 4, !tbaa !14
  store i32 %203, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %204 = load i32, ptr %21, align 4, !tbaa !5
  %205 = sub nsw i32 %204, 1
  %206 = sext i32 %205 to i64
  %207 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %206) #8
  %208 = getelementptr inbounds %"struct.std::pair", ptr %207, i32 0, i32 0
  %209 = getelementptr inbounds %"struct.std::pair.0", ptr %208, i32 0, i32 0
  %210 = load i32, ptr %209, align 4, !tbaa !11
  store i32 %210, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  %211 = load i32, ptr %21, align 4, !tbaa !5
  %212 = sub nsw i32 %211, 1
  %213 = sext i32 %212 to i64
  %214 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %213) #8
  %215 = getelementptr inbounds %"struct.std::pair", ptr %214, i32 0, i32 0
  %216 = getelementptr inbounds %"struct.std::pair.0", ptr %215, i32 0, i32 1
  %217 = load i32, ptr %216, align 4, !tbaa !14
  store i32 %217, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %218 = load i32, ptr %21, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %219) #8
  %221 = getelementptr inbounds %"struct.std::pair", ptr %220, i32 0, i32 0
  %222 = getelementptr inbounds %"struct.std::pair.0", ptr %221, i32 0, i32 0
  %223 = load i32, ptr %222, align 4, !tbaa !11
  store i32 %223, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %224 = load i32, ptr %21, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %225) #8
  %227 = getelementptr inbounds %"struct.std::pair", ptr %226, i32 0, i32 0
  %228 = getelementptr inbounds %"struct.std::pair.0", ptr %227, i32 0, i32 1
  %229 = load i32, ptr %228, align 4, !tbaa !14
  store i32 %229, ptr %27, align 4, !tbaa !5
  %230 = load i32, ptr %22, align 4, !tbaa !5
  %231 = load i32, ptr %24, align 4, !tbaa !5
  %232 = icmp ne i32 %230, %231
  br i1 %232, label %241, label %233

233:                                              ; preds = %189
  %234 = load i32, ptr %24, align 4, !tbaa !5
  %235 = load i32, ptr %26, align 4, !tbaa !5
  %236 = icmp ne i32 %234, %235
  br i1 %236, label %241, label %237

237:                                              ; preds = %233
  %238 = load i32, ptr %26, align 4, !tbaa !5
  %239 = load i32, ptr %22, align 4, !tbaa !5
  %240 = icmp ne i32 %238, %239
  br i1 %240, label %241, label %280

241:                                              ; preds = %237, %233, %189
  %242 = load i32, ptr %25, align 4, !tbaa !5
  %243 = load i32, ptr %23, align 4, !tbaa !5
  %244 = sub nsw i32 %242, %243
  %245 = load i32, ptr %26, align 4, !tbaa !5
  %246 = load i32, ptr %22, align 4, !tbaa !5
  %247 = sub nsw i32 %245, %246
  %248 = mul nsw i32 %244, %247
  %249 = load i32, ptr %27, align 4, !tbaa !5
  %250 = load i32, ptr %23, align 4, !tbaa !5
  %251 = sub nsw i32 %249, %250
  %252 = load i32, ptr %24, align 4, !tbaa !5
  %253 = load i32, ptr %22, align 4, !tbaa !5
  %254 = sub nsw i32 %252, %253
  %255 = mul nsw i32 %251, %254
  %256 = icmp ne i32 %248, %255
  br i1 %256, label %257, label %279

257:                                              ; preds = %241
  %258 = load i32, ptr %21, align 4, !tbaa !5
  %259 = sub nsw i32 %258, 2
  %260 = sext i32 %259 to i64
  %261 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %260) #8
  %262 = getelementptr inbounds %"struct.std::pair", ptr %261, i32 0, i32 1
  %263 = load i32, ptr %262, align 4, !tbaa !15
  %264 = add nsw i32 %263, 1
  %265 = load i32, ptr %21, align 4, !tbaa !5
  %266 = sub nsw i32 %265, 1
  %267 = sext i32 %266 to i64
  %268 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %267) #8
  %269 = getelementptr inbounds %"struct.std::pair", ptr %268, i32 0, i32 1
  %270 = load i32, ptr %269, align 4, !tbaa !15
  %271 = add nsw i32 %270, 1
  %272 = load i32, ptr %21, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %273) #8
  %275 = getelementptr inbounds %"struct.std::pair", ptr %274, i32 0, i32 1
  %276 = load i32, ptr %275, align 4, !tbaa !15
  %277 = add nsw i32 %276, 1
  %278 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %264, i32 noundef %271, i32 noundef %277)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  br label %281

279:                                              ; preds = %241
  br label %280

280:                                              ; preds = %279, %237
  store i32 0, ptr %11, align 4
  br label %281

281:                                              ; preds = %280, %257
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  %282 = load i32, ptr %11, align 4
  switch i32 %282, label %287 [
    i32 0, label %283
  ]

283:                                              ; preds = %281
  br label %284

284:                                              ; preds = %283
  %285 = load i32, ptr %21, align 4, !tbaa !5
  %286 = add nsw i32 %285, 1
  store i32 %286, ptr %21, align 4, !tbaa !5
  br label %184, !llvm.loop !18

287:                                              ; preds = %281, %188
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  %288 = load i32, ptr %11, align 4
  switch i32 %288, label %290 [
    i32 11, label %289
  ]

289:                                              ; preds = %287
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  br label %290

290:                                              ; preds = %289, %287, %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %291 = load i32, ptr %1, align 4
  ret i32 %291
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #7

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


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

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

@n = external dso_local global i32, align 4
@v = external dso_local global %"class.std::vector", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair.0", align 8
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

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

._crit_edge:                                      ; preds = %12, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %9 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %10 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIS2_IiiEiESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %9, ptr %10)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %.not82102 = icmp sgt i32 %11, 2
  br i1 %.not82102, label %.lr.ph105, label %.critedge90.preheader

12:                                               ; preds = %.lr.ph, %12
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %14 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %14, ptr %5, align 8
  %15 = call { i64, i32 } @_ZSt9make_pairISt4pairIiiERiES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %.fca.0.extract = extractvalue { i64, i32 } %15, 0
  %.fca.1.extract = extractvalue { i64, i32 } %15, 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 @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) @v, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #7
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %12, label %._crit_edge, !llvm.loop !9

.critedge90.preheader:                            ; preds = %46, %._crit_edge
  %20 = phi i32 [ %11, %._crit_edge ], [ %47, %46 ]
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.critedge90, label %.critedge90._crit_edge

.lr.ph105:                                        ; preds = %._crit_edge, %46
  %indvars.iv = phi i64 [ %indvars.iv.next, %46 ], [ 2, %._crit_edge ]
  %22 = add nsw i64 %indvars.iv, -2
  %23 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %22) #7
  %24 = load i32, ptr %23, align 4, !tbaa !11
  %25 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %22) #7
  %26 = getelementptr inbounds i8, ptr %25, i64 4
  %27 = load i32, ptr %26, align 4, !tbaa !14
  %28 = add nsw i64 %indvars.iv, -1
  %29 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %28) #7
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %28) #7
  %32 = getelementptr inbounds i8, ptr %31, i64 4
  %33 = load i32, ptr %32, align 4, !tbaa !14
  %34 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv) #7
  %35 = load i32, ptr %34, align 4, !tbaa !11
  %36 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv) #7
  %.not = icmp eq i32 %24, %30
  %.not79 = icmp eq i32 %30, %35
  %or.cond = select i1 %.not, i1 %.not79, i1 false
  %.not80 = icmp eq i32 %35, %24
  %or.cond88 = select i1 %or.cond, i1 %.not80, i1 false
  br i1 %or.cond88, label %46, label %37

37:                                               ; preds = %.lr.ph105
  %38 = getelementptr inbounds i8, ptr %36, i64 4
  %39 = load i32, ptr %38, align 4, !tbaa !14
  %40 = sub nsw i32 %33, %27
  %41 = sub nsw i32 %35, %24
  %42 = mul nsw i32 %41, %40
  %43 = sub nsw i32 %39, %27
  %44 = sub nsw i32 %30, %24
  %45 = mul nsw i32 %43, %44
  %.not81 = icmp eq i32 %42, %45
  br i1 %.not81, label %46, label %.critedge96.sink.split

46:                                               ; preds = %.lr.ph105, %37
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %.not82 = icmp slt i64 %indvars.iv.next, %48
  br i1 %.not82, label %.lr.ph105, label %.critedge90.preheader, !llvm.loop !15

.critedge90._crit_edge:                           ; preds = %.critedge90, %.critedge90.preheader
  %49 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  %50 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @v) #7
  call void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIS2_IiiEiESt6vectorIS4_SaIS4_EEEEEvT_SA_(ptr %49, ptr %50)
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %.not87108 = icmp sgt i32 %51, 2
  br i1 %.not87108, label %.lr.ph111, label %.critedge96

.critedge90:                                      ; preds = %.critedge90.preheader, %.critedge90
  %indvars.iv125 = phi i64 [ %indvars.iv.next126, %.critedge90 ], [ 0, %.critedge90.preheader ]
  %52 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv125) #7
  %53 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv125) #7
  %54 = getelementptr inbounds i8, ptr %53, i64 4
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %52, ptr noundef nonnull align 4 dereferenceable(4) %54) #7
  %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = icmp slt i64 %indvars.iv.next126, %56
  br i1 %57, label %.critedge90, label %.critedge90._crit_edge, !llvm.loop !16

.lr.ph111:                                        ; preds = %.critedge90._crit_edge, %82
  %indvars.iv128 = phi i64 [ %indvars.iv.next129, %82 ], [ 2, %.critedge90._crit_edge ]
  %58 = add nsw i64 %indvars.iv128, -2
  %59 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %58) #7
  %60 = load i32, ptr %59, align 4, !tbaa !11
  %61 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %58) #7
  %62 = getelementptr inbounds i8, ptr %61, i64 4
  %63 = load i32, ptr %62, align 4, !tbaa !14
  %64 = add nsw i64 %indvars.iv128, -1
  %65 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %64) #7
  %66 = load i32, ptr %65, align 4, !tbaa !11
  %67 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %64) #7
  %68 = getelementptr inbounds i8, ptr %67, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !14
  %70 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv128) #7
  %71 = load i32, ptr %70, align 4, !tbaa !11
  %72 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv128) #7
  %.not83 = icmp eq i32 %60, %66
  %.not84 = icmp eq i32 %66, %71
  %or.cond91 = select i1 %.not83, i1 %.not84, i1 false
  %.not85 = icmp eq i32 %71, %60
  %or.cond92 = select i1 %or.cond91, i1 %.not85, i1 false
  br i1 %or.cond92, label %82, label %73

73:                                               ; preds = %.lr.ph111
  %74 = getelementptr inbounds i8, ptr %72, i64 4
  %75 = load i32, ptr %74, align 4, !tbaa !14
  %76 = sub nsw i32 %69, %63
  %77 = sub nsw i32 %71, %60
  %78 = mul nsw i32 %77, %76
  %79 = sub nsw i32 %75, %63
  %80 = sub nsw i32 %66, %60
  %81 = mul nsw i32 %79, %80
  %.not86 = icmp eq i32 %78, %81
  br i1 %.not86, label %82, label %.critedge96.sink.split

82:                                               ; preds = %.lr.ph111, %73
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %83 = load i32, ptr @n, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %.not87 = icmp slt i64 %indvars.iv.next129, %84
  br i1 %.not87, label %.lr.ph111, label %.critedge96, !llvm.loop !17

.critedge96.sink.split:                           ; preds = %37, %73
  %.lcssa137.sink = phi i64 [ %58, %73 ], [ %22, %37 ]
  %.lcssa135.sink = phi i64 [ %64, %73 ], [ %28, %37 ]
  %indvars.iv.lcssa.sink = phi i64 [ %indvars.iv128, %73 ], [ %indvars.iv, %37 ]
  %85 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %.lcssa137.sink) #7
  %86 = getelementptr inbounds i8, ptr %85, i64 8
  %87 = load i32, ptr %86, align 4, !tbaa !18
  %88 = add nsw i32 %87, 1
  %89 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %.lcssa135.sink) #7
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  %91 = load i32, ptr %90, align 4, !tbaa !18
  %92 = add nsw i32 %91, 1
  %93 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @v, i64 noundef %indvars.iv.lcssa.sink) #7
  %94 = getelementptr inbounds i8, ptr %93, i64 8
  %95 = load i32, ptr %94, align 4, !tbaa !18
  %96 = add nsw i32 %95, 1
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %88, i32 noundef %92, i32 noundef %96)
  br label %.critedge96

.critedge96:                                      ; preds = %82, %.critedge96.sink.split, %.critedge90._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

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

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

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

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

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

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

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

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


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