; LLVM IR from DionysiosB/CodeForces :: 0900-0999 (976C-NestedSegments)

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

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

@.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 [9 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z12sortFunctionSt4pairIS_IllElES1_(ptr noundef byval(%"struct.std::pair") align 8, ptr noundef byval(%"struct.std::pair") align 8) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 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 i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"struct.std::pair.0", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  %20 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #6
  call void @_ZNSaISt4pairIS_IllElEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEC2EmRKS3_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %20, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %21 unwind label %27

21:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorISt4pairIS0_IllElEED2Ev(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 %22

22:                                               ; preds = %49, %21
  %23 = load i64, ptr %7, align 8, !tbaa !5
  %24 = load i64, ptr %2, align 8, !tbaa !5
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %31, label %26

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

27:                                               ; preds = %0
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %5, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %6, align 4
  call void @_ZNSt15__new_allocatorISt4pairIS0_IllElEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #6
  br label %135

31:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %32 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %8, ptr noundef %9)
          to label %33 unwind label %52

33:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %34 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
          to label %35 unwind label %56

35:                                               ; preds = %33
  %36 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %37 = extractvalue { i64, i64 } %34, 0
  store i64 %37, ptr %36, align 8
  %38 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %39 = extractvalue { i64, i64 } %34, 1
  store i64 %39, ptr %38, align 8
  %40 = load i64, ptr %7, align 8, !tbaa !5
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %40) #6
  %42 = getelementptr inbounds %"struct.std::pair", ptr %41, i32 0, i32 0
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIllEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 8 dereferenceable(16) %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  %44 = load i64, ptr %7, align 8, !tbaa !5
  %45 = add nsw i64 %44, 1
  %46 = load i64, ptr %7, align 8, !tbaa !5
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %46) #6
  %48 = getelementptr inbounds %"struct.std::pair", ptr %47, i32 0, i32 1
  store i64 %45, ptr %48, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %49

49:                                               ; preds = %35
  %50 = load i64, ptr %7, align 8, !tbaa !5
  %51 = add nsw i64 %50, 1
  store i64 %51, ptr %7, align 8, !tbaa !5
  br label %22, !llvm.loop !12

52:                                               ; preds = %31
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %5, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %6, align 4
  br label %60

56:                                               ; preds = %33
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %5, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  br label %60

60:                                               ; preds = %56, %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %134

61:                                               ; preds = %26
  %62 = call ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %63 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  %64 = call ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %65 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %64, ptr %65, align 8
  %66 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8
  %68 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIS2_IllElESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr %67, ptr %69, ptr noundef @_Z12sortFunctionSt4pairIS_IllElES1_)
          to label %70 unwind label %83

70:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store i64 -1, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 -1, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %71 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %72 = getelementptr inbounds %"struct.std::pair", ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds %"struct.std::pair.0", ptr %72, i32 0, i32 1
  %74 = load i64, ptr %73, align 8, !tbaa !14
  store i64 %74, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %75 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %76 = getelementptr inbounds %"struct.std::pair", ptr %75, i32 0, i32 1
  %77 = load i64, ptr %76, align 8, !tbaa !9
  store i64 %77, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 1, ptr %17, align 8, !tbaa !5
  br label %78

78:                                               ; preds = %120, %70
  %79 = load i64, ptr %17, align 8, !tbaa !5
  %80 = load i64, ptr %2, align 8, !tbaa !5
  %81 = icmp slt i64 %79, %80
  br i1 %81, label %87, label %82

82:                                               ; preds = %78
  store i32 5, ptr %18, align 4
  br label %123

83:                                               ; preds = %61
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %5, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %6, align 4
  br label %134

87:                                               ; preds = %78
  %88 = load i64, ptr %17, align 8, !tbaa !5
  %89 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %88) #6
  %90 = getelementptr inbounds %"struct.std::pair", ptr %89, i32 0, i32 0
  %91 = getelementptr inbounds %"struct.std::pair.0", ptr %90, i32 0, i32 1
  %92 = load i64, ptr %91, align 8, !tbaa !14
  %93 = load i64, ptr %15, align 8, !tbaa !5
  %94 = icmp sle i64 %92, %93
  br i1 %94, label %95, label %101

95:                                               ; preds = %87
  %96 = load i64, ptr %16, align 8, !tbaa !5
  store i64 %96, ptr %14, align 8, !tbaa !5
  %97 = load i64, ptr %17, align 8, !tbaa !5
  %98 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %97) #6
  %99 = getelementptr inbounds %"struct.std::pair", ptr %98, i32 0, i32 1
  %100 = load i64, ptr %99, align 8, !tbaa !9
  store i64 %100, ptr %13, align 8, !tbaa !5
  store i32 5, ptr %18, align 4
  br label %123

101:                                              ; preds = %87
  %102 = load i64, ptr %15, align 8, !tbaa !5
  %103 = load i64, ptr %17, align 8, !tbaa !5
  %104 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_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 = getelementptr inbounds %"struct.std::pair.0", ptr %105, i32 0, i32 1
  %107 = load i64, ptr %106, align 8, !tbaa !14
  %108 = icmp slt i64 %102, %107
  br i1 %108, label %109, label %119

109:                                              ; preds = %101
  %110 = load i64, ptr %17, align 8, !tbaa !5
  %111 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %110) #6
  %112 = getelementptr inbounds %"struct.std::pair", ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %"struct.std::pair.0", ptr %112, i32 0, i32 1
  %114 = load i64, ptr %113, align 8, !tbaa !14
  store i64 %114, ptr %15, align 8, !tbaa !5
  %115 = load i64, ptr %17, align 8, !tbaa !5
  %116 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_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 !9
  store i64 %118, ptr %16, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %109, %101
  br label %120

120:                                              ; preds = %119
  %121 = load i64, ptr %17, align 8, !tbaa !5
  %122 = add nsw i64 %121, 1
  store i64 %122, ptr %17, align 8, !tbaa !5
  br label %78, !llvm.loop !15

123:                                              ; preds = %95, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %124

124:                                              ; preds = %123
  %125 = load i64, ptr %13, align 8, !tbaa !5
  %126 = load i64, ptr %14, align 8, !tbaa !5
  %127 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %125, i64 noundef %126)
          to label %128 unwind label %130

128:                                              ; preds = %124
  store i32 0, ptr %1, align 4
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_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
  %129 = load i32, ptr %1, align 4
  ret i32 %129

130:                                              ; preds = %124
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %5, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %134

134:                                              ; preds = %130, %83, %60
  call void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %135

135:                                              ; preds = %134, %27
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %136

136:                                              ; preds = %135
  %137 = load ptr, ptr %5, align 8
  %138 = load i32, ptr %6, align 4
  %139 = insertvalue { ptr, i32 } poison, ptr %137, 0
  %140 = insertvalue { ptr, i32 } %139, i32 %138, 1
  resume { ptr, i32 } %140
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEC2EmRKS3_(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) #2

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

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

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

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

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

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

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

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

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

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

%"struct.std::pair" = type { %"struct.std::pair.0", i64 }
%"struct.std::pair.0" = type { i64, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::pair<long, long>, long>, std::allocator<std::pair<std::pair<long, long>, long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::pair<long, long>, long>, std::allocator<std::pair<std::pair<long, long>, long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::pair<long, long>, long>, std::allocator<std::pair<std::pair<long, long>, long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::pair<long, long>, long>, std::allocator<std::pair<std::pair<long, 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 [9 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z12sortFunctionSt4pairIS_IllElES1_(ptr noundef byval(%"struct.std::pair") align 8, ptr noundef byval(%"struct.std::pair") align 8) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca %"struct.std::pair.0", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %7 = 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
  %8 = load i64, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  call void @_ZNSaISt4pairIS_IllElEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  invoke void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEC2EmRKS3_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %8, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %9 unwind label %15

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

.lr.ph:                                           ; preds = %9
  %12 = getelementptr inbounds i8, ptr %6, i64 8
  br label %17

._crit_edge:                                      ; preds = %20, %9
  %13 = call ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %14 = call ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIS2_IllElESt6vectorIS4_SaIS4_EEEEPFbS4_S4_EEvT_SC_T0_(ptr %13, ptr %14, ptr noundef nonnull @_Z12sortFunctionSt4pairIS_IllElES1_)
          to label %32 unwind label %41

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

17:                                               ; preds = %.lr.ph, %20
  %.02734 = phi i64 [ 0, %.lr.ph ], [ %25, %20 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %4, ptr noundef nonnull %5)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %19 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %20 unwind label %30

20:                                               ; preds = %17
  %21 = extractvalue { i64, i64 } %19, 0
  store i64 %21, ptr %6, align 8
  %22 = extractvalue { i64, i64 } %19, 1
  store i64 %22, ptr %12, align 8
  %23 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.02734) #6
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIllEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  %25 = add nuw nsw i64 %.02734, 1
  %26 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.02734) #6
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  store i64 %25, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %28 = load i64, ptr %1, align 8, !tbaa !5
  %29 = icmp slt i64 %25, %28
  br i1 %29, label %17, label %._crit_edge, !llvm.loop !12

30:                                               ; preds = %17
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %66

32:                                               ; preds = %._crit_edge
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #6
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = load i64, ptr %34, align 8, !tbaa !14
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #6
  %37 = load i64, ptr %1, align 8, !tbaa !5
  %38 = icmp sgt i64 %37, 1
  br i1 %38, label %.lr.ph39.preheader, label %.loopexit

.lr.ph39.preheader:                               ; preds = %32
  %39 = getelementptr inbounds i8, ptr %36, i64 16
  %40 = load i64, ptr %39, align 8, !tbaa !9
  br label %.lr.ph39

41:                                               ; preds = %._crit_edge
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %66

.lr.ph39:                                         ; preds = %.lr.ph39.preheader, %61
  %.037 = phi i64 [ %62, %61 ], [ 1, %.lr.ph39.preheader ]
  %.02036 = phi i64 [ %.1, %61 ], [ %40, %.lr.ph39.preheader ]
  %.02135 = phi i64 [ %.122, %61 ], [ %35, %.lr.ph39.preheader ]
  %43 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.037) #6
  %44 = getelementptr inbounds i8, ptr %43, i64 8
  %45 = load i64, ptr %44, align 8, !tbaa !14
  %.not = icmp sgt i64 %45, %.02135
  %46 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.037) #6
  br i1 %.not, label %50, label %47

47:                                               ; preds = %.lr.ph39
  %48 = getelementptr inbounds i8, ptr %46, i64 16
  %49 = load i64, ptr %48, align 8, !tbaa !9
  br label %.loopexit

50:                                               ; preds = %.lr.ph39
  %51 = getelementptr inbounds i8, ptr %46, i64 8
  %52 = load i64, ptr %51, align 8, !tbaa !14
  %53 = icmp slt i64 %.02135, %52
  br i1 %53, label %54, label %61

54:                                               ; preds = %50
  %55 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.037) #6
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  %57 = load i64, ptr %56, align 8, !tbaa !14
  %58 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.037) #6
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %60 = load i64, ptr %59, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %50, %54
  %.122 = phi i64 [ %57, %54 ], [ %.02135, %50 ]
  %.1 = phi i64 [ %60, %54 ], [ %.02036, %50 ]
  %62 = add nuw nsw i64 %.037, 1
  %63 = load i64, ptr %1, align 8, !tbaa !5
  %64 = icmp slt i64 %62, %63
  br i1 %64, label %.lr.ph39, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %61, %32, %47
  %.024 = phi i64 [ %49, %47 ], [ -1, %32 ], [ -1, %61 ]
  %.023 = phi i64 [ %.02036, %47 ], [ -1, %32 ], [ -1, %61 ]
  %65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.024, i64 noundef %.023)
  call void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_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

66:                                               ; preds = %41, %30
  %.pn = phi { ptr, i32 } [ %31, %30 ], [ %42, %41 ]
  call void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  br label %67

67:                                               ; preds = %66, %15
  %.pn.pn = phi { ptr, i32 } [ %.pn, %66 ], [ %16, %15 ]
  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.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEC2EmRKS3_(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) #2

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

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

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

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

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

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

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

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

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = !{!10, !6, i64 16}
!10 = !{!"_ZTSSt4pairIS_IllElE", !11, i64 0, !6, i64 16}
!11 = !{!"_ZTSSt4pairIllE", !6, i64 0, !6, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!10, !6, i64 8}
!15 = distinct !{!15, !13}


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