; LLVM IR from sachuverma/DataStructures-Algorithms :: DSA Crack Sheet/solutions (Kth smallest number again)

; 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<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, long long>, std::allocator<std::pair<long long, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i64, i64 }
%"class.__gnu_cxx::__normal_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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", 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
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %21

21:                                               ; preds = %184, %0
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %2, align 4, !tbaa !5
  %24 = icmp ne i32 %22, 0
  br i1 %24, label %25, label %187

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #7
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %40, %25
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %52

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %34 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %35 unwind label %43

35:                                               ; preds = %33
  %36 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %37 unwind label %43

37:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  invoke void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %38 unwind label %47

38:                                               ; preds = %37
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %39 unwind label %47

39:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %6, align 4, !tbaa !5
  br label %28, !llvm.loop !9

43:                                               ; preds = %35, %33
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %9, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %10, align 4
  br label %51

47:                                               ; preds = %38, %37
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %9, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %51

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

52:                                               ; preds = %32
  %53 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %54 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %53, ptr %54, align 8
  %55 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %56 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %55, ptr %56, align 8
  %57 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8
  %59 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %58, ptr %60)
          to label %61 unwind label %67

61:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 1, ptr %15, align 8, !tbaa !11
  br label %62

62:                                               ; preds = %108, %61
  %63 = load i64, ptr %15, align 8, !tbaa !11
  %64 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  %65 = icmp ult i64 %63, %64
  br i1 %65, label %71, label %66

66:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %111

67:                                               ; preds = %52
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %9, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %10, align 4
  br label %186

71:                                               ; preds = %62
  %72 = load i64, ptr %14, align 8, !tbaa !11
  %73 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %72) #7
  %74 = getelementptr inbounds %"struct.std::pair", ptr %73, i32 0, i32 1
  %75 = load i64, ptr %74, align 8, !tbaa !13
  %76 = load i64, ptr %15, align 8, !tbaa !11
  %77 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %76) #7
  %78 = getelementptr inbounds %"struct.std::pair", ptr %77, i32 0, i32 0
  %79 = load i64, ptr %78, align 8, !tbaa !15
  %80 = icmp sge i64 %75, %79
  br i1 %80, label %81, label %98

81:                                               ; preds = %71
  %82 = load i64, ptr %14, align 8, !tbaa !11
  %83 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %82) #7
  %84 = getelementptr inbounds %"struct.std::pair", ptr %83, i32 0, i32 1
  %85 = load i64, ptr %15, align 8, !tbaa !11
  %86 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %85) #7
  %87 = getelementptr inbounds %"struct.std::pair", ptr %86, i32 0, i32 1
  %88 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull align 8 dereferenceable(8) %87)
          to label %89 unwind label %94

89:                                               ; preds = %81
  %90 = load i64, ptr %88, align 8, !tbaa !11
  %91 = load i64, ptr %14, align 8, !tbaa !11
  %92 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %91) #7
  %93 = getelementptr inbounds %"struct.std::pair", ptr %92, i32 0, i32 1
  store i64 %90, ptr %93, align 8, !tbaa !13
  br label %107

94:                                               ; preds = %98, %81
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %9, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %185

98:                                               ; preds = %71
  %99 = load i64, ptr %14, align 8, !tbaa !11
  %100 = add nsw i64 %99, 1
  store i64 %100, ptr %14, align 8, !tbaa !11
  %101 = load i64, ptr %15, align 8, !tbaa !11
  %102 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %101) #7
  %103 = load i64, ptr %14, align 8, !tbaa !11
  %104 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %103) #7
  %105 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %104, ptr noundef nonnull align 8 dereferenceable(16) %102)
          to label %106 unwind label %94

106:                                              ; preds = %98
  br label %107

107:                                              ; preds = %106, %89
  br label %108

108:                                              ; preds = %107
  %109 = load i64, ptr %15, align 8, !tbaa !11
  %110 = add nsw i64 %109, 1
  store i64 %110, ptr %15, align 8, !tbaa !11
  br label %62, !llvm.loop !16

111:                                              ; preds = %66
  br label %112

112:                                              ; preds = %178, %111
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = add nsw i32 %113, -1
  store i32 %114, ptr %4, align 4, !tbaa !5
  %115 = icmp ne i32 %113, 0
  br i1 %115, label %116, label %184

116:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %117 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %16)
          to label %118 unwind label %125

118:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 -1, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %169, %118
  %120 = load i32, ptr %18, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = load i64, ptr %14, align 8, !tbaa !11
  %123 = icmp sle i64 %121, %122
  br i1 %123, label %129, label %124

124:                                              ; preds = %119
  store i32 12, ptr %19, align 4
  br label %172

125:                                              ; preds = %116
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %9, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %10, align 4
  br label %183

129:                                              ; preds = %119
  %130 = load i32, ptr %18, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %131) #7
  %133 = getelementptr inbounds %"struct.std::pair", ptr %132, i32 0, i32 1
  %134 = load i64, ptr %133, align 8, !tbaa !13
  %135 = load i32, ptr %18, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %136) #7
  %138 = getelementptr inbounds %"struct.std::pair", ptr %137, i32 0, i32 0
  %139 = load i64, ptr %138, align 8, !tbaa !15
  %140 = sub nsw i64 %134, %139
  %141 = add nsw i64 %140, 1
  %142 = load i64, ptr %16, align 8, !tbaa !11
  %143 = icmp sge i64 %141, %142
  br i1 %143, label %144, label %153

144:                                              ; preds = %129
  %145 = load i32, ptr %18, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %146) #7
  %148 = getelementptr inbounds %"struct.std::pair", ptr %147, i32 0, i32 0
  %149 = load i64, ptr %148, align 8, !tbaa !15
  %150 = load i64, ptr %16, align 8, !tbaa !11
  %151 = add nsw i64 %149, %150
  %152 = sub nsw i64 %151, 1
  store i64 %152, ptr %17, align 8, !tbaa !11
  store i32 12, ptr %19, align 4
  br label %172

153:                                              ; preds = %129
  %154 = load i64, ptr %16, align 8, !tbaa !11
  %155 = load i32, ptr %18, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %156) #7
  %158 = getelementptr inbounds %"struct.std::pair", ptr %157, i32 0, i32 1
  %159 = load i64, ptr %158, align 8, !tbaa !13
  %160 = load i32, ptr %18, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %161) #7
  %163 = getelementptr inbounds %"struct.std::pair", ptr %162, i32 0, i32 0
  %164 = load i64, ptr %163, align 8, !tbaa !15
  %165 = sub nsw i64 %159, %164
  %166 = add nsw i64 %165, 1
  %167 = sub nsw i64 %154, %166
  store i64 %167, ptr %16, align 8, !tbaa !11
  br label %168

168:                                              ; preds = %153
  br label %169

169:                                              ; preds = %168
  %170 = load i32, ptr %18, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %18, align 4, !tbaa !5
  br label %119, !llvm.loop !17

172:                                              ; preds = %144, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %173

173:                                              ; preds = %172
  %174 = load i64, ptr %17, align 8, !tbaa !11
  %175 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %174)
          to label %176 unwind label %179

176:                                              ; preds = %173
  %177 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %175, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %178 unwind label %179

178:                                              ; preds = %176
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %112, !llvm.loop !18

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

183:                                              ; preds = %179, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %185

184:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %21, !llvm.loop !19

185:                                              ; preds = %183, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %186

186:                                              ; preds = %185, %67, %51
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %189

187:                                              ; preds = %21
  store i32 0, ptr %1, align 4
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %188 = load i32, ptr %1, align 4
  ret i32 %188

189:                                              ; preds = %186
  %190 = load ptr, ptr %9, align 8
  %191 = load i32, ptr %10, align 4
  %192 = insertvalue { ptr, i32 } poison, ptr %190, 0
  %193 = insertvalue { ptr, i32 } %192, i32 %191, 1
  resume { ptr, i32 } %193
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #6

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 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) #4 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 @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

@_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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr %1, align 4, !tbaa !5
  %.not60 = icmp eq i32 %10, 0
  br i1 %.not60, label %._crit_edge63, label %.lr.ph62

.lr.ph62:                                         ; preds = %0, %._crit_edge56
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #7
  call void @_ZNSt6vectorISt4pairIxxESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %24, %.lr.ph62
  %16 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %17 = call ptr @_ZNSt6vectorISt4pairIxxESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt4pairIxxESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %16, ptr %17)
          to label %.preheader45 unwind label %44

.preheader45:                                     ; preds = %._crit_edge
  %18 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %19 = icmp ugt i64 %18, 1
  br i1 %19, label %.lr.ph50, label %.preheader44

.lr.ph:                                           ; preds = %.lr.ph62, %24
  %.02747 = phi i32 [ %25, %24 ], [ 0, %.lr.ph62 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %20 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %21 unwind label %28

21:                                               ; preds = %.lr.ph
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %23 unwind label %28

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @_ZNSt4pairIxxEC2IRxS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  invoke void @_ZNSt6vectorISt4pairIxxESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %24 unwind label %30

24:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %25 = add nuw nsw i32 %.02747, 1
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !9

28:                                               ; preds = %21, %.lr.ph
  %29 = landingpad { ptr, i32 }
          cleanup
  br label %32

30:                                               ; preds = %23
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  br label %32

32:                                               ; preds = %30, %28
  %.pn40 = phi { ptr, i32 } [ %31, %30 ], [ %29, %28 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  br label %102

.preheader44:                                     ; preds = %65, %.preheader45
  %.026.lcssa = phi i64 [ 0, %.preheader45 ], [ %.1, %65 ]
  %.026.lcssa.fr = freeze i64 %.026.lcssa
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %3, align 4, !tbaa !5
  %.not3554 = icmp eq i32 %33, 0
  br i1 %.not3554, label %._crit_edge56, label %.lr.ph55

.lr.ph55:                                         ; preds = %.preheader44
  %.not3651 = icmp slt i64 %.026.lcssa.fr, 0
  br i1 %.not3651, label %.lr.ph55.split.us, label %.lr.ph55.split

.lr.ph55.split.us:                                ; preds = %.lr.ph55, %38
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %35 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %.preheader.us unwind label %.split.us

36:                                               ; preds = %.preheader.us
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %38 unwind label %.split58.us

38:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %3, align 4, !tbaa !5
  %.not35.us = icmp eq i32 %39, 0
  br i1 %.not35.us, label %._crit_edge56, label %.lr.ph55.split.us, !llvm.loop !11

.preheader.us:                                    ; preds = %.lr.ph55.split.us
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef -1)
          to label %36 unwind label %.split58.us

.split.us:                                        ; preds = %.lr.ph55.split.us
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %99

.split58.us:                                      ; preds = %36, %.preheader.us
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %99

44:                                               ; preds = %._crit_edge
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %102

.lr.ph50:                                         ; preds = %.preheader45, %65
  %.02549 = phi i64 [ %66, %65 ], [ 1, %.preheader45 ]
  %.02648 = phi i64 [ %.1, %65 ], [ 0, %.preheader45 ]
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02648) #7
  %47 = getelementptr inbounds i8, ptr %46, i64 8
  %48 = load i64, ptr %47, align 8, !tbaa !12
  %49 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02549) #7
  %50 = load i64, ptr %49, align 8, !tbaa !15
  %.not39 = icmp slt i64 %48, %50
  br i1 %.not39, label %60, label %51

51:                                               ; preds = %.lr.ph50
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02648) #7
  %53 = getelementptr inbounds i8, ptr %52, i64 8
  %54 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02549) #7
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull align 8 dereferenceable(8) %55)
  %57 = load i64, ptr %56, align 8, !tbaa !16
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02648) #7
  %59 = getelementptr inbounds i8, ptr %58, i64 8
  store i64 %57, ptr %59, align 8, !tbaa !12
  br label %65

60:                                               ; preds = %.lr.ph50
  %61 = add nsw i64 %.02648, 1
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %.02549) #7
  %63 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %61) #7
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIxxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %63, ptr noundef nonnull align 8 dereferenceable(16) %62)
  br label %65

65:                                               ; preds = %51, %60
  %.1 = phi i64 [ %.02648, %51 ], [ %61, %60 ]
  %66 = add nuw nsw i64 %.02549, 1
  %67 = call noundef i64 @_ZNKSt6vectorISt4pairIxxESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  %68 = icmp ult i64 %66, %67
  br i1 %68, label %.lr.ph50, label %.preheader44, !llvm.loop !17

.lr.ph55.split:                                   ; preds = %.lr.ph55, %95
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %69 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %8)
          to label %.preheader unwind label %.split

.split:                                           ; preds = %.lr.ph55.split
  %70 = landingpad { ptr, i32 }
          cleanup
  br label %99

.preheader:                                       ; preds = %.lr.ph55.split, %85
  %indvars.iv = phi i64 [ %indvars.iv.next, %85 ], [ 0, %.lr.ph55.split ]
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #7
  %72 = getelementptr inbounds i8, ptr %71, i64 8
  %73 = load i64, ptr %72, align 8, !tbaa !12
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #7
  %75 = load i64, ptr %74, align 8, !tbaa !15
  %76 = add i64 %73, 1
  %77 = sub i64 %76, %75
  %78 = load i64, ptr %8, align 8, !tbaa !16
  %.not37 = icmp slt i64 %77, %78
  %79 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #7
  br i1 %.not37, label %85, label %80

80:                                               ; preds = %.preheader
  %81 = load i64, ptr %79, align 8, !tbaa !15
  %82 = load i64, ptr %8, align 8, !tbaa !16
  %83 = add i64 %81, -1
  %84 = add i64 %83, %82
  br label %..loopexit_crit_edge

85:                                               ; preds = %.preheader
  %86 = getelementptr inbounds i8, ptr %79, i64 8
  %87 = load i64, ptr %86, align 8, !tbaa !12
  %88 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIxxESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #7
  %89 = load i64, ptr %88, align 8, !tbaa !15
  %90 = xor i64 %87, -1
  %.neg = add i64 %78, %90
  %91 = add i64 %.neg, %89
  store i64 %91, ptr %8, align 8, !tbaa !16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not36.not = icmp sgt i64 %.026.lcssa.fr, %indvars.iv
  br i1 %.not36.not, label %.preheader, label %..loopexit_crit_edge, !llvm.loop !18

..loopexit_crit_edge:                             ; preds = %85, %80
  %.024 = phi i64 [ %84, %80 ], [ -1, %85 ]
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.024)
          to label %93 unwind label %.split58

93:                                               ; preds = %..loopexit_crit_edge
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %92, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %95 unwind label %.split58

95:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  %96 = load i32, ptr %3, align 4, !tbaa !5
  %97 = add nsw i32 %96, -1
  store i32 %97, ptr %3, align 4, !tbaa !5
  %.not35 = icmp eq i32 %96, 0
  br i1 %.not35, label %._crit_edge56, label %.lr.ph55.split, !llvm.loop !11

.split58:                                         ; preds = %93, %..loopexit_crit_edge
  %98 = landingpad { ptr, i32 }
          cleanup
  br label %99

99:                                               ; preds = %.split58, %.split58.us, %.split, %.split.us
  %.pn = phi { ptr, i32 } [ %70, %.split ], [ %42, %.split.us ], [ %98, %.split58 ], [ %43, %.split58.us ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %102

._crit_edge56:                                    ; preds = %95, %38, %.preheader44
  call void @_ZNSt6vectorISt4pairIxxESaIS1_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 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %100 = load i32, ptr %1, align 4, !tbaa !5
  %101 = add nsw i32 %100, -1
  store i32 %101, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %100, 0
  br i1 %.not, label %._crit_edge63, label %.lr.ph62, !llvm.loop !19

102:                                              ; preds = %99, %44, %32
  %.pn40.pn = phi { ptr, i32 } [ %.pn40, %32 ], [ %.pn, %99 ], [ %45, %44 ]
  call void @_ZNSt6vectorISt4pairIxxESaIS1_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 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn40.pn

._crit_edge63:                                    ; preds = %._crit_edge56, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #6

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #4 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 #4 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 @_ZNSt6vectorISt4pairIxxESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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


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