; LLVM IR from DionysiosB/CodeForces :: 0700-0799 (707B-Bakery)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }
%"struct.std::pair" = type { %"struct.std::pair.0", i64 }
%"struct.std::pair.0" = type { i64, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.5" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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 i64, align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca %"struct.std::pair.0", align 8
  %15 = alloca %"class.std::set", align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca %"struct.std::pair.5", align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %25 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #6
  %29 = load i64, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  call void @_ZNSaISt4pairIS_IllElEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEC2EmRKS3_(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %29, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %30 unwind label %36

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

31:                                               ; preds = %57, %30
  %32 = load i64, ptr %9, align 8, !tbaa !5
  %33 = load i64, ptr %3, align 8, !tbaa !5
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %40, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %69

36:                                               ; preds = %0
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %7, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %8, align 4
  call void @_ZNSt15__new_allocatorISt4pairIS0_IllElEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  br label %152

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %41 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %42 unwind label %60

42:                                               ; preds = %40
  %43 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %44 unwind label %60

44:                                               ; preds = %42
  %45 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %46 unwind label %60

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %47 = invoke { i64, i64 } @_ZSt9make_pairIRlS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %48 unwind label %64

48:                                               ; preds = %46
  %49 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 0
  %50 = extractvalue { i64, i64 } %47, 0
  store i64 %50, ptr %49, align 8
  %51 = getelementptr inbounds { i64, i64 }, ptr %14, i32 0, i32 1
  %52 = extractvalue { i64, i64 } %47, 1
  store i64 %52, ptr %51, align 8
  invoke void @_ZSt9make_pairISt4pairIllERlES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind writable sret(%"struct.std::pair") align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %53 unwind label %64

53:                                               ; preds = %48
  %54 = load i64, ptr %9, align 8, !tbaa !5
  %55 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %54) #6
  %56 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt4pairIS_IllElEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %55, ptr noundef nonnull align 8 dereferenceable(24) %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %57

57:                                               ; preds = %53
  %58 = load i64, ptr %9, align 8, !tbaa !5
  %59 = add nsw i64 %58, 1
  store i64 %59, ptr %9, align 8, !tbaa !5
  br label %31, !llvm.loop !9

60:                                               ; preds = %44, %42, %40
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %7, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %8, align 4
  br label %68

64:                                               ; preds = %48, %46
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %7, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #6
  br label %68

68:                                               ; preds = %64, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %151

69:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 48, ptr %15) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !5
  br label %70

70:                                               ; preds = %84, %69
  %71 = load i64, ptr %16, align 8, !tbaa !5
  %72 = load i64, ptr %4, align 8, !tbaa !5
  %73 = icmp slt i64 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %91

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %76 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %77 unwind label %87

77:                                               ; preds = %75
  %78 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %79 unwind label %87

79:                                               ; preds = %77
  %80 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 0
  %81 = extractvalue { ptr, i8 } %78, 0
  store ptr %81, ptr %80, align 8
  %82 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 1
  %83 = extractvalue { ptr, i8 } %78, 1
  store i8 %83, ptr %82, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %84

84:                                               ; preds = %79
  %85 = load i64, ptr %16, align 8, !tbaa !5
  %86 = add nsw i64 %85, 1
  store i64 %86, ptr %16, align 8, !tbaa !5
  br label %70, !llvm.loop !11

87:                                               ; preds = %77, %75
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %7, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  br label %150

91:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 -1, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  store i64 0, ptr %20, align 8, !tbaa !5
  br label %92

92:                                               ; preds = %135, %91
  %93 = load i64, ptr %20, align 8, !tbaa !5
  %94 = call noundef i64 @_ZNKSt6vectorISt4pairIS0_IllElESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %95 = icmp ult i64 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 8, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %138

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %98 = load i64, ptr %20, align 8, !tbaa !5
  %99 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %98) #6
  %100 = getelementptr inbounds %"struct.std::pair", ptr %99, i32 0, i32 0
  %101 = getelementptr inbounds %"struct.std::pair.0", ptr %100, i32 0, i32 0
  %102 = load i64, ptr %101, align 8, !tbaa !12
  store i64 %102, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %103 = load i64, ptr %20, align 8, !tbaa !5
  %104 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, 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 !15
  store i64 %107, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %108 = load i64, ptr %20, align 8, !tbaa !5
  %109 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %108) #6
  %110 = getelementptr inbounds %"struct.std::pair", ptr %109, i32 0, i32 1
  %111 = load i64, ptr %110, align 8, !tbaa !16
  store i64 %111, ptr %24, align 8, !tbaa !5
  %112 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 8 dereferenceable(8) %22)
          to label %113 unwind label %118

113:                                              ; preds = %97
  %114 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 8 dereferenceable(8) %23)
          to label %115 unwind label %118

115:                                              ; preds = %113
  %116 = icmp eq i64 %112, %114
  br i1 %116, label %117, label %122

117:                                              ; preds = %115
  store i32 10, ptr %21, align 4
  br label %132

118:                                              ; preds = %113, %97
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %7, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %149

122:                                              ; preds = %115
  %123 = load i64, ptr %19, align 8, !tbaa !5
  %124 = icmp slt i64 %123, 0
  br i1 %124, label %129, label %125

125:                                              ; preds = %122
  %126 = load i64, ptr %24, align 8, !tbaa !5
  %127 = load i64, ptr %19, align 8, !tbaa !5
  %128 = icmp slt i64 %126, %127
  br i1 %128, label %129, label %131

129:                                              ; preds = %125, %122
  %130 = load i64, ptr %24, align 8, !tbaa !5
  store i64 %130, ptr %19, align 8, !tbaa !5
  br label %131

131:                                              ; preds = %129, %125
  store i32 0, ptr %21, align 4
  br label %132

132:                                              ; preds = %131, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  %133 = load i32, ptr %21, align 4
  switch i32 %133, label %158 [
    i32 0, label %134
    i32 10, label %135
  ]

134:                                              ; preds = %132
  br label %135

135:                                              ; preds = %134, %132
  %136 = load i64, ptr %20, align 8, !tbaa !5
  %137 = add nsw i64 %136, 1
  store i64 %137, ptr %20, align 8, !tbaa !5
  br label %92, !llvm.loop !17

138:                                              ; preds = %96
  %139 = load i64, ptr %19, align 8, !tbaa !5
  %140 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %139)
          to label %141 unwind label %145

141:                                              ; preds = %138
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %143 unwind label %145

143:                                              ; preds = %141
  store i32 0, ptr %1, align 4
  store i32 1, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #6
  call void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %144 = load i32, ptr %1, align 4
  ret i32 %144

145:                                              ; preds = %141, %138
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %7, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %8, align 4
  br label %149

149:                                              ; preds = %145, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %150

150:                                              ; preds = %149, %87
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #6
  br label %151

151:                                              ; preds = %150, %68
  call void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  br label %152

152:                                              ; preds = %151, %36
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %153

153:                                              ; preds = %152
  %154 = load ptr, ptr %7, align 8
  %155 = load i32, ptr %8, align 4
  %156 = insertvalue { ptr, i32 } poison, ptr %154, 0
  %157 = insertvalue { ptr, i32 } %156, i32 %155, 1
  resume { ptr, i32 } %157

158:                                              ; preds = %132
  unreachable
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt4pairIS_IllElEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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 #3 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 void @_ZSt9make_pairISt4pairIllERlES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt4pairIS0_IllElEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

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


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"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 }
%"struct.std::pair" = type { %"struct.std::pair.0", i64 }
%"struct.std::pair.0" = type { i64, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, long, std::_Identity<long>, std::less<long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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
  %8 = alloca i64, align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca %"struct.std::pair.0", align 8
  %11 = alloca %"class.std::set", align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  %19 = load i64, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSaISt4pairIS_IllElEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEC2EmRKS3_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %20 unwind label %26

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

.lr.ph:                                           ; preds = %20
  %23 = getelementptr inbounds i8, ptr %10, i64 8
  br label %28

._crit_edge:                                      ; preds = %39, %20
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #7
  call void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #7
  %24 = load i64, ptr %3, align 8, !tbaa !5
  %25 = icmp sgt i64 %24, 0
  br i1 %25, label %.lr.ph39, label %.preheader

26:                                               ; preds = %0
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt4pairIS0_IllElEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  br label %88

28:                                               ; preds = %.lr.ph, %39
  %.02736 = phi i64 [ 0, %.lr.ph ], [ %42, %39 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %29 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %30 unwind label %45

30:                                               ; preds = %28
  %31 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %32 unwind label %45

32:                                               ; preds = %30
  %33 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %34 unwind label %45

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

36:                                               ; preds = %34
  %37 = extractvalue { i64, i64 } %35, 0
  store i64 %37, ptr %10, align 8
  %38 = extractvalue { i64, i64 } %35, 1
  store i64 %38, ptr %23, align 8
  invoke void @_ZSt9make_pairISt4pairIllERlES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair") align 8 %9, ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %39 unwind label %47

39:                                               ; preds = %36
  %40 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02736) #7
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt4pairIS_IllElEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  %42 = add nuw nsw i64 %.02736, 1
  %43 = load i64, ptr %2, align 8, !tbaa !5
  %44 = icmp slt i64 %42, %43
  br i1 %44, label %28, label %._crit_edge, !llvm.loop !9

45:                                               ; preds = %32, %30, %28
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %49

47:                                               ; preds = %36, %34
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  br label %49

49:                                               ; preds = %47, %45
  %.pn31 = phi { ptr, i32 } [ %48, %47 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  br label %87

.preheader:                                       ; preds = %54, %._crit_edge
  %50 = call noundef i64 @_ZNKSt6vectorISt4pairIS0_IllElESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %.not = icmp eq i64 %50, 0
  br i1 %.not, label %._crit_edge43, label %.lr.ph42

.lr.ph39:                                         ; preds = %._crit_edge, %54
  %.02637 = phi i64 [ %55, %54 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %51 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %52 unwind label %58

52:                                               ; preds = %.lr.ph39
  %53 = invoke { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
          to label %54 unwind label %58

54:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  %55 = add nuw nsw i64 %.02637, 1
  %56 = load i64, ptr %3, align 8, !tbaa !5
  %57 = icmp slt i64 %55, %56
  br i1 %57, label %.lr.ph39, label %.preheader, !llvm.loop !11

58:                                               ; preds = %52, %.lr.ph39
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  br label %86

._crit_edge43:                                    ; preds = %72, %.preheader
  %.017.lcssa = phi i64 [ -1, %.preheader ], [ %.2, %72 ]
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.017.lcssa)
          to label %81 unwind label %84

.lr.ph42:                                         ; preds = %.preheader, %72
  %.041 = phi i64 [ %76, %72 ], [ 0, %.preheader ]
  %.01740 = phi i64 [ %.2, %72 ], [ -1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %61 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.041) #7
  %62 = load i64, ptr %61, align 8, !tbaa !12
  store i64 %62, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #7
  %63 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.041) #7
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  %65 = load i64, ptr %64, align 8, !tbaa !15
  store i64 %65, ptr %14, align 8, !tbaa !5
  %66 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.041) #7
  %67 = getelementptr inbounds i8, ptr %66, i64 16
  %68 = load i64, ptr %67, align 8, !tbaa !16
  %69 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %70 unwind label %79

70:                                               ; preds = %.lr.ph42
  %71 = invoke noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %72 unwind label %79

72:                                               ; preds = %70
  %73 = icmp eq i64 %69, %71
  %74 = icmp slt i64 %.01740, 0
  %75 = call i64 @llvm.smin.i64(i64 %68, i64 %.01740)
  %.1 = select i1 %74, i64 %68, i64 %75
  %.2 = select i1 %73, i64 %.01740, i64 %.1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  %76 = add nuw nsw i64 %.041, 1
  %77 = call noundef i64 @_ZNKSt6vectorISt4pairIS0_IllElESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %78 = icmp ult i64 %76, %77
  br i1 %78, label %.lr.ph42, label %._crit_edge43, !llvm.loop !17

79:                                               ; preds = %70, %.lr.ph42
  %80 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  br label %86

81:                                               ; preds = %._crit_edge43
  %82 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %83 unwind label %84

83:                                               ; preds = %81
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #7
  call void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  ret i32 0

84:                                               ; preds = %81, %._crit_edge43
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %86

86:                                               ; preds = %79, %84, %58
  %.pn29 = phi { ptr, i32 } [ %59, %58 ], [ %80, %79 ], [ %85, %84 ]
  call void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #7
  br label %87

87:                                               ; preds = %86, %49
  %.pn31.pn = phi { ptr, i32 } [ %.pn31, %49 ], [ %.pn29, %86 ]
  call void @_ZNSt6vectorISt4pairIS0_IllElESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  br label %88

88:                                               ; preds = %87, %26
  %.pn31.pn.pn = phi { ptr, i32 } [ %.pn31.pn, %87 ], [ %27, %26 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn31.pn.pn
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt4pairIS_IllElEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 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 #3 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 void @_ZSt9make_pairISt4pairIllERlES0_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair") align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

; 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 #3

; 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 #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIlSt4lessIlESaIlEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setIlSt4lessIlESaIlEE6insertERKl(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNKSt3setIlSt4lessIlESaIlEE5countERKl(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEl(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3setIlSt4lessIlESaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #4 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6

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

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

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


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