; LLVM IR from DionysiosB/CodeForces :: 0800-0899 (837C-TwoSeals)

; 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 }
%"struct.std::pair" = type { i64, i64 }

@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 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 i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i8, align 1
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #5
  %17 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  call void @_ZNSaISt4pairIllEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNSt6vectorISt4pairIllESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %17, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %18 unwind label %24

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

19:                                               ; preds = %39, %18
  %20 = load i64, ptr %9, align 8, !tbaa !5
  %21 = load i64, ptr %2, align 8, !tbaa !5
  %22 = icmp slt i64 %20, %21
  br i1 %22, label %28, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %46

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

28:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %29 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %10, ptr noundef %11)
          to label %30 unwind label %42

30:                                               ; preds = %28
  %31 = load i64, ptr %10, align 8, !tbaa !5
  %32 = load i64, ptr %9, align 8, !tbaa !5
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %32) #5
  %34 = getelementptr inbounds %"struct.std::pair", ptr %33, i32 0, i32 0
  store i64 %31, ptr %34, align 8, !tbaa !9
  %35 = load i64, ptr %11, align 8, !tbaa !5
  %36 = load i64, ptr %9, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %36) #5
  %38 = getelementptr inbounds %"struct.std::pair", ptr %37, i32 0, i32 1
  store i64 %35, ptr %38, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %39

39:                                               ; preds = %30
  %40 = load i64, ptr %9, align 8, !tbaa !5
  %41 = add nsw i64 %40, 1
  store i64 %41, ptr %9, align 8, !tbaa !5
  br label %19, !llvm.loop !12

42:                                               ; preds = %28
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %7, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %170

46:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  store i8 0, ptr %12, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 0, ptr %13, align 8, !tbaa !5
  br label %47

47:                                               ; preds = %165, %46
  %48 = load i64, ptr %13, align 8, !tbaa !5
  %49 = load i64, ptr %2, align 8, !tbaa !5
  %50 = icmp slt i64 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %168

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %53 = load i64, ptr %13, align 8, !tbaa !5
  %54 = add nsw i64 %53, 1
  store i64 %54, ptr %15, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %161, %52
  %56 = load i64, ptr %15, align 8, !tbaa !5
  %57 = load i64, ptr %2, align 8, !tbaa !5
  %58 = icmp slt i64 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %164

60:                                               ; preds = %55
  %61 = load i64, ptr %13, align 8, !tbaa !5
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %61) #5
  %63 = getelementptr inbounds %"struct.std::pair", ptr %62, i32 0, i32 0
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = load i64, ptr %15, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %65) #5
  %67 = getelementptr inbounds %"struct.std::pair", ptr %66, i32 0, i32 0
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = add nsw i64 %64, %68
  %70 = load i64, ptr %3, align 8, !tbaa !5
  %71 = icmp sle i64 %69, %70
  br i1 %71, label %72, label %85

72:                                               ; preds = %60
  %73 = load i64, ptr %13, align 8, !tbaa !5
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %73) #5
  %75 = getelementptr inbounds %"struct.std::pair", ptr %74, i32 0, i32 1
  %76 = load i64, ptr %75, align 8, !tbaa !11
  %77 = load i64, ptr %15, align 8, !tbaa !5
  %78 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %77) #5
  %79 = getelementptr inbounds %"struct.std::pair", ptr %78, i32 0, i32 1
  %80 = load i64, ptr %79, align 8, !tbaa !11
  %81 = add nsw i64 %76, %80
  %82 = load i64, ptr %4, align 8, !tbaa !5
  %83 = icmp sle i64 %81, %82
  br i1 %83, label %84, label %85

84:                                               ; preds = %72
  store i8 1, ptr %12, align 1, !tbaa !14
  br label %85

85:                                               ; preds = %84, %72, %60
  %86 = load i64, ptr %13, align 8, !tbaa !5
  %87 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %86) #5
  %88 = getelementptr inbounds %"struct.std::pair", ptr %87, i32 0, i32 0
  %89 = load i64, ptr %88, align 8, !tbaa !9
  %90 = load i64, ptr %15, align 8, !tbaa !5
  %91 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %90) #5
  %92 = getelementptr inbounds %"struct.std::pair", ptr %91, i32 0, i32 1
  %93 = load i64, ptr %92, align 8, !tbaa !11
  %94 = add nsw i64 %89, %93
  %95 = load i64, ptr %3, align 8, !tbaa !5
  %96 = icmp sle i64 %94, %95
  br i1 %96, label %97, label %110

97:                                               ; preds = %85
  %98 = load i64, ptr %13, align 8, !tbaa !5
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %98) #5
  %100 = getelementptr inbounds %"struct.std::pair", ptr %99, i32 0, i32 1
  %101 = load i64, ptr %100, align 8, !tbaa !11
  %102 = load i64, ptr %15, align 8, !tbaa !5
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %102) #5
  %104 = getelementptr inbounds %"struct.std::pair", ptr %103, i32 0, i32 0
  %105 = load i64, ptr %104, align 8, !tbaa !9
  %106 = add nsw i64 %101, %105
  %107 = load i64, ptr %4, align 8, !tbaa !5
  %108 = icmp sle i64 %106, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %97
  store i8 1, ptr %12, align 1, !tbaa !14
  br label %110

110:                                              ; preds = %109, %97, %85
  %111 = load i64, ptr %13, align 8, !tbaa !5
  %112 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %111) #5
  %113 = getelementptr inbounds %"struct.std::pair", ptr %112, i32 0, i32 1
  %114 = load i64, ptr %113, align 8, !tbaa !11
  %115 = load i64, ptr %15, align 8, !tbaa !5
  %116 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %115) #5
  %117 = getelementptr inbounds %"struct.std::pair", ptr %116, i32 0, i32 0
  %118 = load i64, ptr %117, align 8, !tbaa !9
  %119 = add nsw i64 %114, %118
  %120 = load i64, ptr %3, align 8, !tbaa !5
  %121 = icmp sle i64 %119, %120
  br i1 %121, label %122, label %135

122:                                              ; preds = %110
  %123 = load i64, ptr %13, align 8, !tbaa !5
  %124 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %123) #5
  %125 = getelementptr inbounds %"struct.std::pair", ptr %124, i32 0, i32 0
  %126 = load i64, ptr %125, align 8, !tbaa !9
  %127 = load i64, ptr %15, align 8, !tbaa !5
  %128 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %127) #5
  %129 = getelementptr inbounds %"struct.std::pair", ptr %128, i32 0, i32 1
  %130 = load i64, ptr %129, align 8, !tbaa !11
  %131 = add nsw i64 %126, %130
  %132 = load i64, ptr %4, align 8, !tbaa !5
  %133 = icmp sle i64 %131, %132
  br i1 %133, label %134, label %135

134:                                              ; preds = %122
  store i8 1, ptr %12, align 1, !tbaa !14
  br label %135

135:                                              ; preds = %134, %122, %110
  %136 = load i64, ptr %13, align 8, !tbaa !5
  %137 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %136) #5
  %138 = getelementptr inbounds %"struct.std::pair", ptr %137, i32 0, i32 1
  %139 = load i64, ptr %138, align 8, !tbaa !11
  %140 = load i64, ptr %15, align 8, !tbaa !5
  %141 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %140) #5
  %142 = getelementptr inbounds %"struct.std::pair", ptr %141, i32 0, i32 1
  %143 = load i64, ptr %142, align 8, !tbaa !11
  %144 = add nsw i64 %139, %143
  %145 = load i64, ptr %3, align 8, !tbaa !5
  %146 = icmp sle i64 %144, %145
  br i1 %146, label %147, label %160

147:                                              ; preds = %135
  %148 = load i64, ptr %13, align 8, !tbaa !5
  %149 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %148) #5
  %150 = getelementptr inbounds %"struct.std::pair", ptr %149, i32 0, i32 0
  %151 = load i64, ptr %150, align 8, !tbaa !9
  %152 = load i64, ptr %15, align 8, !tbaa !5
  %153 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %152) #5
  %154 = getelementptr inbounds %"struct.std::pair", ptr %153, i32 0, i32 0
  %155 = load i64, ptr %154, align 8, !tbaa !9
  %156 = add nsw i64 %151, %155
  %157 = load i64, ptr %4, align 8, !tbaa !5
  %158 = icmp sle i64 %156, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %147
  store i8 1, ptr %12, align 1, !tbaa !14
  br label %160

160:                                              ; preds = %159, %147, %135
  br label %161

161:                                              ; preds = %160
  %162 = load i64, ptr %15, align 8, !tbaa !5
  %163 = add nsw i64 %162, 1
  store i64 %163, ptr %15, align 8, !tbaa !5
  br label %55, !llvm.loop !16

164:                                              ; preds = %59
  br label %165

165:                                              ; preds = %164
  %166 = load i64, ptr %13, align 8, !tbaa !5
  %167 = add nsw i64 %166, 1
  store i64 %167, ptr %13, align 8, !tbaa !5
  br label %47, !llvm.loop !17

168:                                              ; preds = %51
  store i32 0, ptr %1, align 4
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %169 = load i32, ptr %1, align 4
  ret i32 %169

170:                                              ; preds = %42, %24
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %171

171:                                              ; preds = %170
  %172 = load ptr, ptr %7, align 8
  %173 = load i32, ptr %8, align 4
  %174 = insertvalue { ptr, i32 } poison, ptr %172, 0
  %175 = insertvalue { ptr, i32 } %174, i32 %173, 1
  resume { ptr, i32 } %175
}

; 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: 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 = { 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 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIllE", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}


; 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 [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 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 i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %9 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #5
  call void @_ZNSaISt4pairIllEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  invoke void @_ZNSt6vectorISt4pairIllESaIS1_EEC2EmRKS2_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %9, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %10 unwind label %14

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

.preheader:                                       ; preds = %.lr.ph
  %13 = icmp sgt i64 %23, 0
  br i1 %13, label %.lr.ph40, label %._crit_edge

14:                                               ; preds = %0
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt4pairIllEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %15

.lr.ph:                                           ; preds = %10, %.lr.ph
  %.02836 = phi i64 [ %22, %.lr.ph ], [ 0, %10 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %17 = load i64, ptr %6, align 8, !tbaa !5
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02836) #5
  store i64 %17, ptr %18, align 8, !tbaa !9
  %19 = load i64, ptr %7, align 8, !tbaa !5
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02836) #5
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  store i64 %19, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %22 = add nuw nsw i64 %.02836, 1
  %23 = load i64, ptr %1, align 8, !tbaa !5
  %24 = icmp slt i64 %22, %23
  br i1 %24, label %.lr.ph, label %.preheader, !llvm.loop !12

.loopexit:                                        ; preds = %73, %.lr.ph40
  %25 = phi i64 [ %27, %.lr.ph40 ], [ %75, %73 ]
  %26 = icmp slt i64 %28, %25
  br i1 %26, label %.lr.ph40, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %.loopexit, %10, %.preheader
  call void @_ZNSt6vectorISt4pairIllESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0

.lr.ph40:                                         ; preds = %.preheader, %.loopexit
  %27 = phi i64 [ %25, %.loopexit ], [ %23, %.preheader ]
  %.02739 = phi i64 [ %28, %.loopexit ], [ 0, %.preheader ]
  %28 = add nuw nsw i64 %.02739, 1
  %29 = icmp slt i64 %28, %27
  br i1 %29, label %.lr.ph38, label %.loopexit

.lr.ph38:                                         ; preds = %.lr.ph40, %73
  %.037 = phi i64 [ %74, %73 ], [ %28, %.lr.ph40 ]
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02739) #5
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.037) #5
  %33 = load i64, ptr %32, align 8, !tbaa !9
  %34 = add nsw i64 %33, %31
  %35 = load i64, ptr %2, align 8, !tbaa !5
  %.not = icmp sgt i64 %34, %35
  br i1 %.not, label %39, label %36

36:                                               ; preds = %.lr.ph38
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02739) #5
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.037) #5
  br label %39

39:                                               ; preds = %36, %.lr.ph38
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02739) #5
  %41 = load i64, ptr %40, align 8, !tbaa !9
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.037) #5
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = load i64, ptr %43, align 8, !tbaa !11
  %45 = add nsw i64 %44, %41
  %46 = load i64, ptr %2, align 8, !tbaa !5
  %.not30 = icmp sgt i64 %45, %46
  br i1 %.not30, label %50, label %47

47:                                               ; preds = %39
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02739) #5
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.037) #5
  br label %50

50:                                               ; preds = %47, %39
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02739) #5
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load i64, ptr %52, align 8, !tbaa !11
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.037) #5
  %55 = load i64, ptr %54, align 8, !tbaa !9
  %56 = add nsw i64 %55, %53
  %57 = load i64, ptr %2, align 8, !tbaa !5
  %.not32 = icmp sgt i64 %56, %57
  br i1 %.not32, label %61, label %58

58:                                               ; preds = %50
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02739) #5
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.037) #5
  br label %61

61:                                               ; preds = %58, %50
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02739) #5
  %63 = getelementptr inbounds i8, ptr %62, i64 8
  %64 = load i64, ptr %63, align 8, !tbaa !11
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.037) #5
  %66 = getelementptr inbounds i8, ptr %65, i64 8
  %67 = load i64, ptr %66, align 8, !tbaa !11
  %68 = add nsw i64 %67, %64
  %69 = load i64, ptr %2, align 8, !tbaa !5
  %.not34 = icmp sgt i64 %68, %69
  br i1 %.not34, label %73, label %70

70:                                               ; preds = %61
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02739) #5
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.037) #5
  br label %73

73:                                               ; preds = %70, %61
  %74 = add nuw nsw i64 %.037, 1
  %75 = load i64, ptr %1, align 8, !tbaa !5
  %76 = icmp slt i64 %74, %75
  br i1 %76, label %.lr.ph38, label %.loopexit, !llvm.loop !15
}

; 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: 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 = { 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 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIllE", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


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