; LLVM IR from DionysiosB/CodeForces :: 0100-0199 (181B-NumberOfTriplets)

; 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<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type { i64, i64 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  %16 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  call void @_ZNSaISt4pairIllEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorISt4pairIllESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %16, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %17 unwind label %23

17:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorISt4pairIllEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %36, %17
  %19 = load i64, ptr %7, align 8, !tbaa !5
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = icmp slt i64 %19, %20
  br i1 %21, label %27, label %22

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

23:                                               ; preds = %0
  %24 = landingpad { ptr, i32 }
          cleanup
  %25 = extractvalue { ptr, i32 } %24, 0
  store ptr %25, ptr %5, align 8
  %26 = extractvalue { ptr, i32 } %24, 1
  store i32 %26, ptr %6, align 4
  call void @_ZNSt15__new_allocatorISt4pairIllEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  br label %183

27:                                               ; preds = %18
  %28 = load i64, ptr %7, align 8, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %28) #6
  %30 = getelementptr inbounds %"struct.std::pair", ptr %29, i32 0, i32 0
  %31 = load i64, ptr %7, align 8, !tbaa !5
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %31) #6
  %33 = getelementptr inbounds %"struct.std::pair", ptr %32, i32 0, i32 1
  %34 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %30, ptr noundef %33)
          to label %35 unwind label %39

35:                                               ; preds = %27
  br label %36

36:                                               ; preds = %35
  %37 = load i64, ptr %7, align 8, !tbaa !5
  %38 = add nsw i64 %37, 1
  store i64 %38, ptr %7, align 8, !tbaa !5
  br label %18, !llvm.loop !9

39:                                               ; preds = %27
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %5, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %182

43:                                               ; preds = %22
  %44 = call ptr @_ZNSt6vectorISt4pairIllESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %45 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %44, ptr %45, align 8
  %46 = call ptr @_ZNSt6vectorISt4pairIllESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %47 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %46, ptr %47, align 8
  %48 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8
  %50 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIllESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %49, ptr %51)
          to label %52 unwind label %58

52:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %170, %52
  %54 = load i64, ptr %11, align 8, !tbaa !5
  %55 = load i64, ptr %2, align 8, !tbaa !5
  %56 = icmp slt i64 %54, %55
  br i1 %56, label %62, label %57

57:                                               ; preds = %53
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %173

58:                                               ; preds = %43
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %5, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %6, align 4
  br label %182

62:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %63 = load i64, ptr %11, align 8, !tbaa !5
  %64 = add nsw i64 %63, 1
  store i64 %64, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %65 = load i64, ptr %11, align 8, !tbaa !5
  %66 = add nsw i64 %65, 2
  store i64 %66, ptr %14, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %166, %62
  %68 = load i64, ptr %14, align 8, !tbaa !5
  %69 = load i64, ptr %2, align 8, !tbaa !5
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %169

72:                                               ; preds = %67
  br label %73

73:                                               ; preds = %89, %72
  %74 = load i64, ptr %13, align 8, !tbaa !5
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %74) #6
  %76 = getelementptr inbounds %"struct.std::pair", ptr %75, i32 0, i32 0
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = mul nsw i64 2, %77
  %79 = load i64, ptr %11, align 8, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %79) #6
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 0
  %82 = load i64, ptr %81, align 8, !tbaa !11
  %83 = load i64, ptr %14, align 8, !tbaa !5
  %84 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %83) #6
  %85 = getelementptr inbounds %"struct.std::pair", ptr %84, i32 0, i32 0
  %86 = load i64, ptr %85, align 8, !tbaa !11
  %87 = add nsw i64 %82, %86
  %88 = icmp slt i64 %78, %87
  br i1 %88, label %89, label %92

89:                                               ; preds = %73
  %90 = load i64, ptr %13, align 8, !tbaa !5
  %91 = add nsw i64 %90, 1
  store i64 %91, ptr %13, align 8, !tbaa !5
  br label %73, !llvm.loop !13

92:                                               ; preds = %73
  br label %93

93:                                               ; preds = %127, %92
  %94 = load i64, ptr %13, align 8, !tbaa !5
  %95 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %94) #6
  %96 = getelementptr inbounds %"struct.std::pair", ptr %95, i32 0, i32 0
  %97 = load i64, ptr %96, align 8, !tbaa !11
  %98 = mul nsw i64 2, %97
  %99 = load i64, ptr %11, align 8, !tbaa !5
  %100 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %99) #6
  %101 = getelementptr inbounds %"struct.std::pair", ptr %100, i32 0, i32 0
  %102 = load i64, ptr %101, align 8, !tbaa !11
  %103 = load i64, ptr %14, align 8, !tbaa !5
  %104 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %103) #6
  %105 = getelementptr inbounds %"struct.std::pair", ptr %104, i32 0, i32 0
  %106 = load i64, ptr %105, align 8, !tbaa !11
  %107 = add nsw i64 %102, %106
  %108 = icmp eq i64 %98, %107
  br i1 %108, label %109, label %125

109:                                              ; preds = %93
  %110 = load i64, ptr %13, align 8, !tbaa !5
  %111 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %110) #6
  %112 = getelementptr inbounds %"struct.std::pair", ptr %111, i32 0, i32 1
  %113 = load i64, ptr %112, align 8, !tbaa !14
  %114 = mul nsw i64 2, %113
  %115 = load i64, ptr %11, align 8, !tbaa !5
  %116 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %115) #6
  %117 = getelementptr inbounds %"struct.std::pair", ptr %116, i32 0, i32 1
  %118 = load i64, ptr %117, align 8, !tbaa !14
  %119 = load i64, ptr %14, align 8, !tbaa !5
  %120 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %119) #6
  %121 = getelementptr inbounds %"struct.std::pair", ptr %120, i32 0, i32 1
  %122 = load i64, ptr %121, align 8, !tbaa !14
  %123 = add nsw i64 %118, %122
  %124 = icmp slt i64 %114, %123
  br label %125

125:                                              ; preds = %109, %93
  %126 = phi i1 [ false, %93 ], [ %124, %109 ]
  br i1 %126, label %127, label %130

127:                                              ; preds = %125
  %128 = load i64, ptr %13, align 8, !tbaa !5
  %129 = add nsw i64 %128, 1
  store i64 %129, ptr %13, align 8, !tbaa !5
  br label %93, !llvm.loop !15

130:                                              ; preds = %125
  %131 = load i64, ptr %13, align 8, !tbaa !5
  %132 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %131) #6
  %133 = getelementptr inbounds %"struct.std::pair", ptr %132, i32 0, i32 0
  %134 = load i64, ptr %133, align 8, !tbaa !11
  %135 = mul nsw i64 2, %134
  %136 = load i64, ptr %11, align 8, !tbaa !5
  %137 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %136) #6
  %138 = getelementptr inbounds %"struct.std::pair", ptr %137, i32 0, i32 0
  %139 = load i64, ptr %138, align 8, !tbaa !11
  %140 = load i64, ptr %14, align 8, !tbaa !5
  %141 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %140) #6
  %142 = getelementptr inbounds %"struct.std::pair", ptr %141, i32 0, i32 0
  %143 = load i64, ptr %142, align 8, !tbaa !11
  %144 = add nsw i64 %139, %143
  %145 = icmp eq i64 %135, %144
  br i1 %145, label %146, label %165

146:                                              ; preds = %130
  %147 = load i64, ptr %13, align 8, !tbaa !5
  %148 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %147) #6
  %149 = getelementptr inbounds %"struct.std::pair", ptr %148, i32 0, i32 1
  %150 = load i64, ptr %149, align 8, !tbaa !14
  %151 = mul nsw i64 2, %150
  %152 = load i64, ptr %11, align 8, !tbaa !5
  %153 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %152) #6
  %154 = getelementptr inbounds %"struct.std::pair", ptr %153, i32 0, i32 1
  %155 = load i64, ptr %154, align 8, !tbaa !14
  %156 = load i64, ptr %14, align 8, !tbaa !5
  %157 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %156) #6
  %158 = getelementptr inbounds %"struct.std::pair", ptr %157, i32 0, i32 1
  %159 = load i64, ptr %158, align 8, !tbaa !14
  %160 = add nsw i64 %155, %159
  %161 = icmp eq i64 %151, %160
  br i1 %161, label %162, label %165

162:                                              ; preds = %146
  %163 = load i64, ptr %10, align 8, !tbaa !5
  %164 = add nsw i64 %163, 1
  store i64 %164, ptr %10, align 8, !tbaa !5
  br label %165

165:                                              ; preds = %162, %146, %130
  br label %166

166:                                              ; preds = %165
  %167 = load i64, ptr %14, align 8, !tbaa !5
  %168 = add nsw i64 %167, 1
  store i64 %168, ptr %14, align 8, !tbaa !5
  br label %67, !llvm.loop !16

169:                                              ; preds = %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %170

170:                                              ; preds = %169
  %171 = load i64, ptr %11, align 8, !tbaa !5
  %172 = add nsw i64 %171, 1
  store i64 %172, ptr %11, align 8, !tbaa !5
  br label %53, !llvm.loop !17

173:                                              ; preds = %57
  %174 = load i64, ptr %10, align 8, !tbaa !5
  %175 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %174)
          to label %176 unwind label %178

176:                                              ; preds = %173
  store i32 0, ptr %1, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %177 = load i32, ptr %1, align 4
  ret i32 %177

178:                                              ; preds = %173
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %5, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %182

182:                                              ; preds = %178, %58, %39
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %183

183:                                              ; preds = %182, %23
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %184

184:                                              ; preds = %183
  %185 = load ptr, ptr %5, align 8
  %186 = load i32, ptr %6, align 4
  %187 = insertvalue { ptr, i32 } poison, ptr %185, 0
  %188 = insertvalue { ptr, i32 } %187, i32 %186, 1
  resume { ptr, i32 } %188
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt4pairIllEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt4pairIllEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { 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 = { 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 = { 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 = !{!"long", !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 = !{!"_ZTSSt4pairIllE", !6, i64 0, !6, i64 8}
!13 = distinct !{!13, !10}
!14 = !{!12, !6, i64 8}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long, long>, std::allocator<std::pair<long, long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  %5 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  call void @_ZNSaISt4pairIllEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  invoke void @_ZNSt6vectorISt4pairIllESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %5, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %6 unwind label %13

6:                                                ; preds = %0
  call void @_ZNSt15__new_allocatorISt4pairIllEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = icmp sgt i64 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %6
  %9 = call ptr @_ZNSt6vectorISt4pairIllESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %10 = call ptr @_ZNSt6vectorISt4pairIllESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIllESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %9, ptr %10)
          to label %.preheader42 unwind label %25

.preheader42:                                     ; preds = %._crit_edge
  %11 = load i64, ptr %1, align 8, !tbaa !5
  %12 = icmp sgt i64 %11, 0
  br i1 %12, label %.lr.ph54, label %._crit_edge55

13:                                               ; preds = %0
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt4pairIllEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  br label %101

.lr.ph:                                           ; preds = %6, %.lr.ph
  %.03843 = phi i64 [ %19, %.lr.ph ], [ 0, %6 ]
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03843) #6
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03843) #6
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %15, ptr noundef nonnull %17)
  %19 = add nuw nsw i64 %.03843, 1
  %20 = load i64, ptr %1, align 8, !tbaa !5
  %21 = icmp slt i64 %19, %20
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.loopexit:                                        ; preds = %97, %.lr.ph54
  %22 = phi i64 [ %27, %.lr.ph54 ], [ %99, %97 ]
  %.135.lcssa = phi i64 [ %.03452, %.lr.ph54 ], [ %.236, %97 ]
  %23 = icmp slt i64 %28, %22
  br i1 %23, label %.lr.ph54, label %._crit_edge55, !llvm.loop !11

._crit_edge55:                                    ; preds = %.loopexit, %.preheader42
  %.034.lcssa = phi i64 [ 0, %.preheader42 ], [ %.135.lcssa, %.loopexit ]
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.034.lcssa)
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

25:                                               ; preds = %._crit_edge
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %101

.lr.ph54:                                         ; preds = %.preheader42, %.loopexit
  %27 = phi i64 [ %22, %.loopexit ], [ %11, %.preheader42 ]
  %.03353 = phi i64 [ %28, %.loopexit ], [ 0, %.preheader42 ]
  %.03452 = phi i64 [ %.135.lcssa, %.loopexit ], [ 0, %.preheader42 ]
  %28 = add nuw nsw i64 %.03353, 1
  %29 = add nuw nsw i64 %.03353, 2
  %30 = icmp slt i64 %29, %27
  br i1 %30, label %.preheader41, label %.loopexit

.preheader41:                                     ; preds = %.lr.ph54, %97
  %.050 = phi i64 [ %98, %97 ], [ %29, %.lr.ph54 ]
  %.03249 = phi i64 [ %.2.lcssa, %97 ], [ %28, %.lr.ph54 ]
  %.13548 = phi i64 [ %.236, %97 ], [ %.03452, %.lr.ph54 ]
  br label %31

31:                                               ; preds = %31, %.preheader41
  %.1 = phi i64 [ %41, %31 ], [ %.03249, %.preheader41 ]
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.1) #6
  %33 = load i64, ptr %32, align 8, !tbaa !12
  %34 = shl nsw i64 %33, 1
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03353) #6
  %36 = load i64, ptr %35, align 8, !tbaa !12
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.050) #6
  %38 = load i64, ptr %37, align 8, !tbaa !12
  %39 = add nsw i64 %38, %36
  %40 = icmp slt i64 %34, %39
  %41 = add nsw i64 %.1, 1
  br i1 %40, label %31, label %.preheader, !llvm.loop !14

.preheader:                                       ; preds = %31
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.1) #6
  %43 = load i64, ptr %42, align 8, !tbaa !12
  %44 = shl nsw i64 %43, 1
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03353) #6
  %46 = load i64, ptr %45, align 8, !tbaa !12
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.050) #6
  %48 = load i64, ptr %47, align 8, !tbaa !12
  %49 = add nsw i64 %48, %46
  %50 = icmp eq i64 %44, %49
  br i1 %50, label %.lr.ph45, label %.critedge

.lr.ph45:                                         ; preds = %.preheader, %63
  %.244 = phi i64 [ %64, %63 ], [ %.1, %.preheader ]
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.244) #6
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load i64, ptr %52, align 8, !tbaa !15
  %54 = shl nsw i64 %53, 1
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03353) #6
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  %57 = load i64, ptr %56, align 8, !tbaa !15
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.050) #6
  %59 = getelementptr inbounds i8, ptr %58, i64 8
  %60 = load i64, ptr %59, align 8, !tbaa !15
  %61 = add nsw i64 %60, %57
  %62 = icmp slt i64 %54, %61
  br i1 %62, label %63, label %.critedge

63:                                               ; preds = %.lr.ph45
  %64 = add nsw i64 %.244, 1
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %64) #6
  %66 = load i64, ptr %65, align 8, !tbaa !12
  %67 = shl nsw i64 %66, 1
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03353) #6
  %69 = load i64, ptr %68, align 8, !tbaa !12
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.050) #6
  %71 = load i64, ptr %70, align 8, !tbaa !12
  %72 = add nsw i64 %71, %69
  %73 = icmp eq i64 %67, %72
  br i1 %73, label %.lr.ph45, label %.critedge, !llvm.loop !16

.critedge:                                        ; preds = %.lr.ph45, %63, %.preheader
  %.2.lcssa = phi i64 [ %.1, %.preheader ], [ %64, %63 ], [ %.244, %.lr.ph45 ]
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.2.lcssa) #6
  %75 = load i64, ptr %74, align 8, !tbaa !12
  %76 = shl nsw i64 %75, 1
  %77 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03353) #6
  %78 = load i64, ptr %77, align 8, !tbaa !12
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.050) #6
  %80 = load i64, ptr %79, align 8, !tbaa !12
  %81 = add nsw i64 %80, %78
  %82 = icmp eq i64 %76, %81
  br i1 %82, label %83, label %97

83:                                               ; preds = %.critedge
  %84 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.2.lcssa) #6
  %85 = getelementptr inbounds i8, ptr %84, i64 8
  %86 = load i64, ptr %85, align 8, !tbaa !15
  %87 = shl nsw i64 %86, 1
  %88 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.03353) #6
  %89 = getelementptr inbounds i8, ptr %88, i64 8
  %90 = load i64, ptr %89, align 8, !tbaa !15
  %91 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.050) #6
  %92 = getelementptr inbounds i8, ptr %91, i64 8
  %93 = load i64, ptr %92, align 8, !tbaa !15
  %94 = add nsw i64 %93, %90
  %95 = icmp eq i64 %87, %94
  %96 = zext i1 %95 to i64
  %spec.select = add nsw i64 %.13548, %96
  br label %97

97:                                               ; preds = %83, %.critedge
  %.236 = phi i64 [ %.13548, %.critedge ], [ %spec.select, %83 ]
  %98 = add nuw nsw i64 %.050, 1
  %99 = load i64, ptr %1, align 8, !tbaa !5
  %100 = icmp slt i64 %98, %99
  br i1 %100, label %.preheader41, label %.loopexit, !llvm.loop !17

101:                                              ; preds = %25, %13
  %.pn = phi { ptr, i32 } [ %26, %25 ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt4pairIllEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt4pairIllEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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


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