; LLVM IR from upupming/algorithm :: kick-start/2019/2019G-C.ll (Z5solvev)

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

@n = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@pointPair = external dso_local global %struct.Pair, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3cmp4PairS_(ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiiRK4PairRSt6vectorIS_SaIS_EE(i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24)) #1

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

; 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
define dso_local noundef i64 @_Z5solvev() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  store i64 0, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #5
  call void @_ZNSt6vectorI4PairSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  call void @_ZNSt6vectorI4PairSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  store i64 0, ptr getelementptr inbounds (%struct.Pair, ptr @pointPair, i32 0, i32 1), align 8, !tbaa !9
  store i64 0, ptr @pointPair, align 8, !tbaa !11
  %17 = load i32, ptr @n, align 4, !tbaa !12
  %18 = sdiv i32 %17, 2
  invoke void @_Z3dfsiiRK4PairRSt6vectorIS_SaIS_EE(i32 noundef 0, i32 noundef %18, ptr noundef nonnull align 8 dereferenceable(16) @pointPair, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %19 unwind label %49

19:                                               ; preds = %0
  %20 = load i32, ptr @n, align 4, !tbaa !12
  %21 = sdiv i32 %20, 2
  %22 = load i32, ptr @n, align 4, !tbaa !12
  invoke void @_Z3dfsiiRK4PairRSt6vectorIS_SaIS_EE(i32 noundef %21, i32 noundef %22, ptr noundef nonnull align 8 dereferenceable(16) @pointPair, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %23 unwind label %49

23:                                               ; preds = %19
  %24 = call ptr @_ZNSt6vectorI4PairSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  %26 = call ptr @_ZNSt6vectorI4PairSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %27 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  store ptr %26, ptr %27, align 8
  %28 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %6, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %7, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS2_SaIS2_EEEEPFiS2_S2_EEvT_SA_T0_(ptr %29, ptr %31, ptr noundef @_Z3cmp4PairS_)
          to label %32 unwind label %49

32:                                               ; preds = %23
  %33 = call ptr @_ZNSt6vectorI4PairSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %34 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  store ptr %33, ptr %34, align 8
  %35 = call ptr @_ZNSt6vectorI4PairSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %36 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %35, ptr %36, align 8
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %8, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8
  %39 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS2_SaIS2_EEEEPFiS2_S2_EEvT_SA_T0_(ptr %38, ptr %40, ptr noundef @_Z3cmp4PairS_)
          to label %41 unwind label %49

41:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %42 = call ptr @_ZNSt6vectorI4PairSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  br label %44

44:                                               ; preds = %114, %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %45 = call ptr @_ZNSt6vectorI4PairSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  %46 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %45, ptr %46, align 8
  %47 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4PairSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br i1 %47, label %53, label %48

48:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %117

49:                                               ; preds = %32, %23, %19, %0
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %4, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %5, align 4
  call void @_ZNSt6vectorI4PairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @_ZNSt6vectorI4PairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  br label %119

53:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 -1, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  store i64 0, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %54 = call noundef i64 @_ZNKSt6vectorI4PairSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %55 = sub i64 %54, 1
  store i64 %55, ptr %14, align 8, !tbaa !5
  br label %56

56:                                               ; preds = %83, %53
  %57 = load i64, ptr %13, align 8, !tbaa !5
  %58 = load i64, ptr %14, align 8, !tbaa !5
  %59 = icmp sle i64 %57, %58
  br i1 %59, label %60, label %84

60:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %61 = load i64, ptr %13, align 8, !tbaa !5
  %62 = load i64, ptr %14, align 8, !tbaa !5
  %63 = add nsw i64 %61, %62
  %64 = sdiv i64 %63, 2
  store i64 %64, ptr %15, align 8, !tbaa !5
  %65 = load i64, ptr %15, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4PairSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %65) #5
  %67 = getelementptr inbounds %struct.Pair, ptr %66, i32 0, i32 0
  %68 = load i64, ptr %67, align 8, !tbaa !11
  %69 = load i32, ptr @h, align 4, !tbaa !12
  %70 = sext i32 %69 to i64
  %71 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %72 = getelementptr inbounds %struct.Pair, ptr %71, i32 0, i32 0
  %73 = load i64, ptr %72, align 8, !tbaa !11
  %74 = sub nsw i64 %70, %73
  %75 = icmp slt i64 %68, %74
  br i1 %75, label %76, label %79

76:                                               ; preds = %60
  %77 = load i64, ptr %15, align 8, !tbaa !5
  %78 = add nsw i64 %77, 1
  store i64 %78, ptr %13, align 8, !tbaa !5
  br label %83

79:                                               ; preds = %60
  %80 = load i64, ptr %15, align 8, !tbaa !5
  store i64 %80, ptr %12, align 8, !tbaa !5
  %81 = load i64, ptr %15, align 8, !tbaa !5
  %82 = sub nsw i64 %81, 1
  store i64 %82, ptr %14, align 8, !tbaa !5
  br label %83

83:                                               ; preds = %79, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %56, !llvm.loop !14

84:                                               ; preds = %56
  br label %85

85:                                               ; preds = %110, %84
  %86 = load i64, ptr %12, align 8, !tbaa !5
  %87 = call noundef i64 @_ZNKSt6vectorI4PairSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %88 = icmp ult i64 %86, %87
  br i1 %88, label %89, label %92

89:                                               ; preds = %85
  %90 = load i64, ptr %12, align 8, !tbaa !5
  %91 = icmp sge i64 %90, 0
  br label %92

92:                                               ; preds = %89, %85
  %93 = phi i1 [ false, %85 ], [ %91, %89 ]
  br i1 %93, label %94, label %113

94:                                               ; preds = %92
  %95 = load i64, ptr %12, align 8, !tbaa !5
  %96 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4PairSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %95) #5
  %97 = getelementptr inbounds %struct.Pair, ptr %96, i32 0, i32 1
  %98 = load i64, ptr %97, align 8, !tbaa !9
  %99 = load i32, ptr @h, align 4, !tbaa !12
  %100 = sext i32 %99 to i64
  %101 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %102 = getelementptr inbounds %struct.Pair, ptr %101, i32 0, i32 1
  %103 = load i64, ptr %102, align 8, !tbaa !9
  %104 = sub nsw i64 %100, %103
  %105 = icmp sge i64 %98, %104
  br i1 %105, label %106, label %109

106:                                              ; preds = %94
  %107 = load i64, ptr %1, align 8, !tbaa !5
  %108 = add nsw i64 %107, 1
  store i64 %108, ptr %1, align 8, !tbaa !5
  br label %109

109:                                              ; preds = %106, %94
  br label %110

110:                                              ; preds = %109
  %111 = load i64, ptr %12, align 8, !tbaa !5
  %112 = add nsw i64 %111, 1
  store i64 %112, ptr %12, align 8, !tbaa !5
  br label %85, !llvm.loop !16

113:                                              ; preds = %92
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %114

114:                                              ; preds = %113
  %115 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS1_SaIS1_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef 0) #5
  %116 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %115, ptr %116, align 8
  br label %44, !llvm.loop !17

117:                                              ; preds = %48
  %118 = load i64, ptr %1, align 8, !tbaa !5
  call void @_ZNSt6vectorI4PairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  call void @_ZNSt6vectorI4PairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret i64 %118

119:                                              ; preds = %49
  %120 = load ptr, ptr %4, align 8
  %121 = load i32, ptr %5, align 4
  %122 = insertvalue { ptr, i32 } poison, ptr %120, 0
  %123 = insertvalue { ptr, i32 } %122, i32 %121, 1
  resume { ptr, i32 } %123
}

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIP4PairSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI4PairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) 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 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 = { 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 #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_ZTS4Pair", !6, i64 0, !6, i64 8}
!11 = !{!10, !6, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


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

@n = external dso_local local_unnamed_addr global i32, align 4
@h = external dso_local local_unnamed_addr global i32, align 4
@pointPair = external dso_local global %struct.Pair, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3cmp4PairS_(ptr noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiiRK4PairRSt6vectorIS_SaIS_EE(i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solvev() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #6
  call void @_ZNSt6vectorI4PairSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @_ZNSt6vectorI4PairSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) @pointPair, i8 0, i64 16, i1 false)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = sdiv i32 %5, 2
  invoke void @_Z3dfsiiRK4PairRSt6vectorIS_SaIS_EE(i32 noundef 0, i32 noundef %6, ptr noundef nonnull align 8 dereferenceable(16) @pointPair, ptr noundef nonnull align 8 dereferenceable(24) %1)
          to label %7 unwind label %20

7:                                                ; preds = %0
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = sdiv i32 %8, 2
  invoke void @_Z3dfsiiRK4PairRSt6vectorIS_SaIS_EE(i32 noundef %9, i32 noundef %8, ptr noundef nonnull align 8 dereferenceable(16) @pointPair, ptr noundef nonnull align 8 dereferenceable(24) %2)
          to label %10 unwind label %20

10:                                               ; preds = %7
  %11 = call ptr @_ZNSt6vectorI4PairSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  %12 = call ptr @_ZNSt6vectorI4PairSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS2_SaIS2_EEEEPFiS2_S2_EEvT_SA_T0_(ptr %11, ptr %12, ptr noundef nonnull @_Z3cmp4PairS_)
          to label %13 unwind label %20

13:                                               ; preds = %10
  %14 = call ptr @_ZNSt6vectorI4PairSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %15 = call ptr @_ZNSt6vectorI4PairSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS2_SaIS2_EEEEPFiS2_S2_EEvT_SA_T0_(ptr %14, ptr %15, ptr noundef nonnull @_Z3cmp4PairS_)
          to label %16 unwind label %20

16:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %17 = call ptr @_ZNSt6vectorI4PairSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store ptr %17, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %18 = call ptr @_ZNSt6vectorI4PairSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store ptr %18, ptr %4, align 8
  %19 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4PairSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %19, label %.lr.ph37, label %._crit_edge38

._crit_edge38:                                    ; preds = %._crit_edge, %16
  %.0.lcssa = phi i64 [ 0, %16 ], [ %.1.lcssa, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @_ZNSt6vectorI4PairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @_ZNSt6vectorI4PairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  ret i64 %.0.lcssa

20:                                               ; preds = %13, %10, %7, %0
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorI4PairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @_ZNSt6vectorI4PairSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #6
  resume { ptr, i32 } %21

.lr.ph37:                                         ; preds = %16, %._crit_edge
  %.035 = phi i64 [ %.1.lcssa, %._crit_edge ], [ 0, %16 ]
  %22 = call noundef i64 @_ZNKSt6vectorI4PairSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %23 = add i64 %22, -1
  %.not27 = icmp slt i64 %23, 0
  br i1 %.not27, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %.lr.ph37
  %.019.lcssa = phi i64 [ -1, %.lr.ph37 ], [ %.120, %.lr.ph ]
  %24 = call noundef i64 @_ZNKSt6vectorI4PairSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %25 = icmp ult i64 %.019.lcssa, %24
  %26 = icmp sgt i64 %.019.lcssa, -1
  %27 = and i1 %26, %25
  br i1 %27, label %.lr.ph33, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph37, %.lr.ph
  %.01930 = phi i64 [ %.120, %.lr.ph ], [ -1, %.lr.ph37 ]
  %.02229 = phi i64 [ %.123, %.lr.ph ], [ %23, %.lr.ph37 ]
  %.02428 = phi i64 [ %.125, %.lr.ph ], [ 0, %.lr.ph37 ]
  %28 = add nuw nsw i64 %.02229, %.02428
  %29 = lshr i64 %28, 1
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4PairSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %29) #6
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = load i32, ptr @h, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %35 = load i64, ptr %34, align 8, !tbaa !9
  %36 = sub nsw i64 %33, %35
  %37 = icmp slt i64 %31, %36
  %38 = add nuw nsw i64 %29, 1
  %39 = add nsw i64 %29, -1
  %.125 = select i1 %37, i64 %38, i64 %.02428
  %.123 = select i1 %37, i64 %.02229, i64 %39
  %.120 = select i1 %37, i64 %.01930, i64 %29
  %.not = icmp sgt i64 %.125, %.123
  br i1 %.not, label %.preheader, label %.lr.ph, !llvm.loop !12

.lr.ph33:                                         ; preds = %.preheader, %.lr.ph33
  %.132 = phi i64 [ %spec.select, %.lr.ph33 ], [ %.035, %.preheader ]
  %.22131 = phi i64 [ %50, %.lr.ph33 ], [ %.019.lcssa, %.preheader ]
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4PairSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %.22131) #6
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  %42 = load i64, ptr %41, align 8, !tbaa !14
  %43 = load i32, ptr @h, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %47 = load i64, ptr %46, align 8, !tbaa !14
  %48 = sub nsw i64 %44, %47
  %.not26 = icmp sge i64 %42, %48
  %49 = zext i1 %.not26 to i64
  %spec.select = add nsw i64 %.132, %49
  %50 = add nuw nsw i64 %.22131, 1
  %51 = call noundef i64 @_ZNKSt6vectorI4PairSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #6
  %52 = icmp ult i64 %50, %51
  br i1 %52, label %.lr.ph33, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph33, %.preheader
  %.1.lcssa = phi i64 [ %.035, %.preheader ], [ %spec.select, %.lr.ph33 ]
  %53 = call ptr @_ZN9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS1_SaIS1_EEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef 0) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %54 = call ptr @_ZNSt6vectorI4PairSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #6
  store ptr %54, ptr %4, align 8
  %55 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4PairSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br i1 %55, label %.lr.ph37, label %._crit_edge38, !llvm.loop !16
}

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIP4PairSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(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 i64 @_ZNKSt6vectorI4PairSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4PairSaIS0_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 ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4PairSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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


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