; LLVM IR from Mohammed-Shoaib/Coding-Problems :: Codeforces/Solutions/1271D.ll (Z7portalsiiRSt6vectorIiSaIiEES2_S2_S2_)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::priority_queue" = type <{ %"class.std::vector.0", [8 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z7portalsiiRSt6vectorIiSaIiEES2_S2_S2_(i32 noundef %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5) #0 personality ptr @__gxx_personality_v0 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector", align 8
  %16 = alloca %"class.std::vector.0", align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca %"class.std::priority_queue", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca i32, align 4
  store i32 %0, ptr %8, align 4, !tbaa !5
  store i32 %1, ptr %9, align 4, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !9
  store ptr %3, ptr %11, align 8, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #5
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #5
  call void @_ZNSaISt6vectorIiSaIiEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %29, ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %30 unwind label %37

30:                                               ; preds = %6
  call void @_ZNSt15__new_allocatorISt6vectorIiSaIiEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %20)
          to label %31 unwind label %41

31:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %66, %31
  %33 = load i32, ptr %21, align 4, !tbaa !5
  %34 = load i32, ptr %8, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %45, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %69

37:                                               ; preds = %6
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %18, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %19, align 4
  call void @_ZNSt15__new_allocatorISt6vectorIiSaIiEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  br label %193

41:                                               ; preds = %30
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %18, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %19, align 4
  br label %192

45:                                               ; preds = %32
  %46 = load ptr, ptr %13, align 8, !tbaa !9
  %47 = load i32, ptr %21, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %46, i64 noundef %48) #5
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp ne i32 %50, -1
  br i1 %51, label %52, label %65

52:                                               ; preds = %45
  %53 = load ptr, ptr %13, align 8, !tbaa !9
  %54 = load i32, ptr %21, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %55) #5
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %58) #5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %59, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %60 unwind label %61

60:                                               ; preds = %52
  br label %65

61:                                               ; preds = %52
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %18, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %191

65:                                               ; preds = %60, %45
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %21, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %21, align 4, !tbaa !5
  br label %32, !llvm.loop !11

69:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %70

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

74:                                               ; preds = %70
  store i32 5, ptr %23, align 4
  br label %162

75:                                               ; preds = %70
  br label %76

76:                                               ; preds = %91, %75
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = load ptr, ptr %10, align 8, !tbaa !9
  %79 = load i32, ptr %22, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %80) #5
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp slt i32 %77, %82
  br i1 %83, label %84, label %88

84:                                               ; preds = %76
  %85 = invoke noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %20)
          to label %86 unwind label %94

86:                                               ; preds = %84
  %87 = xor i1 %85, true
  br label %88

88:                                               ; preds = %86, %76
  %89 = phi i1 [ false, %76 ], [ %87, %86 ]
  br i1 %89, label %90, label %98

90:                                               ; preds = %88
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %20)
          to label %91 unwind label %94

91:                                               ; preds = %90
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %9, align 4, !tbaa !5
  br label %76, !llvm.loop !13

94:                                               ; preds = %121, %90, %84
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %18, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %19, align 4
  br label %164

98:                                               ; preds = %88
  %99 = load i32, ptr %9, align 4, !tbaa !5
  %100 = load ptr, ptr %10, align 8, !tbaa !9
  %101 = load i32, ptr %22, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef %102) #5
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = icmp slt i32 %99, %104
  br i1 %105, label %106, label %107

106:                                              ; preds = %98
  store i32 -1, ptr %7, align 4
  store i32 1, ptr %23, align 4
  br label %162

107:                                              ; preds = %98
  %108 = load ptr, ptr %11, align 8, !tbaa !9
  %109 = load i32, ptr %22, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %110) #5
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = add nsw i32 %113, %112
  store i32 %114, ptr %9, align 4, !tbaa !5
  %115 = load ptr, ptr %13, align 8, !tbaa !9
  %116 = load i32, ptr %22, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 noundef %117) #5
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = icmp eq i32 %119, -1
  br i1 %120, label %121, label %129

121:                                              ; preds = %107
  %122 = load ptr, ptr %12, align 8, !tbaa !9
  %123 = load i32, ptr %22, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %122, i64 noundef %124) #5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %20, ptr noundef nonnull align 4 dereferenceable(4) %125)
          to label %126 unwind label %94

126:                                              ; preds = %121
  %127 = load i32, ptr %9, align 4, !tbaa !5
  %128 = add nsw i32 %127, -1
  store i32 %128, ptr %9, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %126, %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %130 = load i32, ptr %22, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %131) #5
  store ptr %132, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %133 = load ptr, ptr %24, align 8, !tbaa !9
  %134 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %133) #5
  %135 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %134, ptr %135, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %136 = load ptr, ptr %24, align 8, !tbaa !9
  %137 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %136) #5
  %138 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %137, ptr %138, align 8
  br label %139

139:                                              ; preds = %152, %129
  %140 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #5
  br i1 %140, label %142, label %141

141:                                              ; preds = %139
  store i32 10, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %158

142:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %143 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  %144 = load i32, ptr %143, align 4, !tbaa !5
  store i32 %144, ptr %27, align 4, !tbaa !5
  %145 = load ptr, ptr %12, align 8, !tbaa !9
  %146 = load i32, ptr %27, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %145, i64 noundef %147) #5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %20, ptr noundef nonnull align 4 dereferenceable(4) %148)
          to label %149 unwind label %154

149:                                              ; preds = %142
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = add nsw i32 %150, -1
  store i32 %151, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %152

152:                                              ; preds = %149
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  br label %139

154:                                              ; preds = %142
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %18, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  br label %164

158:                                              ; preds = %141
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %22, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %22, align 4, !tbaa !5
  br label %70, !llvm.loop !14

162:                                              ; preds = %106, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  %163 = load i32, ptr %23, align 4
  switch i32 %163, label %189 [
    i32 5, label %165
  ]

164:                                              ; preds = %154, %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %191

165:                                              ; preds = %162
  br label %166

166:                                              ; preds = %184, %165
  %167 = invoke noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %20)
          to label %168 unwind label %179

168:                                              ; preds = %166
  %169 = xor i1 %167, true
  br i1 %169, label %170, label %187

170:                                              ; preds = %168
  %171 = load i32, ptr %9, align 4, !tbaa !5
  %172 = icmp sge i32 %171, 0
  br i1 %172, label %173, label %183

173:                                              ; preds = %170
  %174 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %20)
          to label %175 unwind label %179

175:                                              ; preds = %173
  %176 = load i32, ptr %174, align 4, !tbaa !5
  %177 = load i32, ptr %14, align 4, !tbaa !5
  %178 = add nsw i32 %177, %176
  store i32 %178, ptr %14, align 4, !tbaa !5
  br label %183

179:                                              ; preds = %183, %173, %166
  %180 = landingpad { ptr, i32 }
          cleanup
  %181 = extractvalue { ptr, i32 } %180, 0
  store ptr %181, ptr %18, align 8
  %182 = extractvalue { ptr, i32 } %180, 1
  store i32 %182, ptr %19, align 4
  br label %191

183:                                              ; preds = %175, %170
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %20)
          to label %184 unwind label %179

184:                                              ; preds = %183
  %185 = load i32, ptr %9, align 4, !tbaa !5
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %9, align 4, !tbaa !5
  br label %166, !llvm.loop !15

187:                                              ; preds = %168
  %188 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %188, ptr %7, align 4
  store i32 1, ptr %23, align 4
  br label %189

189:                                              ; preds = %187, %162
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  %190 = load i32, ptr %7, align 4
  ret i32 %190

191:                                              ; preds = %179, %164, %61
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %20) #5
  br label %192

192:                                              ; preds = %191, %41
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #5
  br label %193

193:                                              ; preds = %192, %37
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %194

194:                                              ; preds = %193
  %195 = load ptr, ptr %18, align 8
  %196 = load i32, ptr %19, align 4
  %197 = insertvalue { ptr, i32 } poison, ptr %195, 0
  %198 = insertvalue { ptr, i32 } %197, i32 %196, 1
  resume { ptr, i32 } %198
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

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

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

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

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

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

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

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

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

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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<int>, std::allocator<std::vector<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::priority_queue" = type <{ %"class.std::vector.0", [8 x i8] }>
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z7portalsiiRSt6vectorIiSaIiEES2_S2_S2_(i32 noundef %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.std::vector.0", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca %"class.std::priority_queue", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %14 = sext i32 %0 to i64
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %8, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #5
  call void @_ZNSaISt6vectorIiSaIiEEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  invoke void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %14, ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %15 unwind label %17

15:                                               ; preds = %6
  call void @_ZNSt15__new_allocatorISt6vectorIiSaIiEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %10)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  %16 = icmp sgt i32 %0, 0
  br i1 %16, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  br label %.preheader

._crit_edge:                                      ; preds = %31
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  br i1 %16, label %.preheader53.preheader, label %.preheader

.preheader53.preheader:                           ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %0 to i64
  br label %.preheader53

17:                                               ; preds = %6
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt6vectorIiSaIiEEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  br label %87

.lr.ph:                                           ; preds = %15, %31
  %storemerge62 = phi i32 [ %33, %31 ], [ 0, %15 ]
  %19 = sext i32 %storemerge62 to i64
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %19) #5
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %.not49 = icmp eq i32 %21, -1
  br i1 %.not49, label %31, label %22

22:                                               ; preds = %.lr.ph
  %23 = load i32, ptr %11, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %24) #5
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %27) #5
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %31 unwind label %29

29:                                               ; preds = %22
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  br label %86

31:                                               ; preds = %.lr.ph, %22
  %32 = load i32, ptr %11, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %11, align 4, !tbaa !5
  %34 = icmp slt i32 %33, %0
  br i1 %34, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader53:                                     ; preds = %.preheader53.preheader, %._crit_edge72
  %indvars.iv = phi i64 [ 0, %.preheader53.preheader ], [ %indvars.iv.next, %._crit_edge72 ]
  %.not77 = phi i1 [ true, %.preheader53.preheader ], [ %.not, %._crit_edge72 ]
  %.03576 = phi i32 [ %1, %.preheader53.preheader ], [ %.3.lcssa, %._crit_edge72 ]
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #5
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = icmp slt i32 %.03576, %36
  br i1 %37, label %.lr.ph64, label %.critedge

.lr.ph64:                                         ; preds = %.preheader53, %40
  %.13663 = phi i32 [ %41, %40 ], [ %.03576, %.preheader53 ]
  %38 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %10)
  br i1 %38, label %.critedge, label %39

39:                                               ; preds = %.lr.ph64
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %10)
          to label %40 unwind label %.loopexit54

40:                                               ; preds = %39
  %41 = add nsw i32 %.13663, 1
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #5
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = icmp slt i32 %41, %43
  br i1 %44, label %.lr.ph64, label %.critedge, !llvm.loop !11

.loopexit54:                                      ; preds = %39
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %86

.loopexit.split-lp:                               ; preds = %55
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %86

.critedge:                                        ; preds = %.lr.ph64, %40, %.preheader53
  %.136.lcssa = phi i32 [ %.03576, %.preheader53 ], [ %41, %40 ], [ %.13663, %.lr.ph64 ]
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #5
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp slt i32 %.136.lcssa, %46
  br i1 %47, label %.critedge._crit_edge, label %48

48:                                               ; preds = %.critedge
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv) #5
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = add nsw i32 %50, %.136.lcssa
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv) #5
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp eq i32 %53, -1
  br i1 %54, label %55, label %59

55:                                               ; preds = %48
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %indvars.iv) #5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %10, ptr noundef nonnull align 4 dereferenceable(4) %56)
          to label %57 unwind label %.loopexit.split-lp

57:                                               ; preds = %55
  %58 = add nsw i32 %51, -1
  br label %59

59:                                               ; preds = %57, %48
  %.2 = phi i32 [ %58, %57 ], [ %51, %48 ]
  %60 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_IiSaIiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %indvars.iv) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %61 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #5
  store ptr %61, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %62 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %60) #5
  store ptr %62, ptr %13, align 8
  %63 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br i1 %63, label %.lr.ph71, label %._crit_edge72

._crit_edge72:                                    ; preds = %68, %59
  %.3.lcssa = phi i32 [ %.2, %59 ], [ %69, %68 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not = icmp slt i64 %indvars.iv.next, %14
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge._crit_edge, label %.preheader53, !llvm.loop !12

.lr.ph71:                                         ; preds = %59, %68
  %.369 = phi i32 [ %69, %68 ], [ %.2, %59 ]
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %66) #5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %10, ptr noundef nonnull align 4 dereferenceable(4) %67)
          to label %68 unwind label %72

68:                                               ; preds = %.lr.ph71
  %69 = add nsw i32 %.369, -1
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %71 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br i1 %71, label %.lr.ph71, label %._crit_edge72

72:                                               ; preds = %.lr.ph71
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  br label %86

.critedge._crit_edge:                             ; preds = %._crit_edge72, %.critedge
  %.not.lcssa = phi i1 [ %.not, %._crit_edge72 ], [ %.not77, %.critedge ]
  %.4 = phi i32 [ %.3.lcssa, %._crit_edge72 ], [ %.136.lcssa, %.critedge ]
  br i1 %.not.lcssa, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %._crit_edge.thread, %._crit_edge, %.critedge._crit_edge
  %.490 = phi i32 [ %.4, %.critedge._crit_edge ], [ %1, %._crit_edge ], [ %1, %._crit_edge.thread ]
  %74 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %10)
  br i1 %74, label %.loopexit, label %.lr.ph85

.lr.ph85:                                         ; preds = %.preheader, %83
  %.584 = phi i32 [ %84, %83 ], [ %.490, %.preheader ]
  %.04583 = phi i32 [ %.146, %83 ], [ 0, %.preheader ]
  %75 = icmp sgt i32 %.584, -1
  br i1 %75, label %76, label %82

76:                                               ; preds = %.lr.ph85
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %10)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add nsw i32 %78, %.04583
  br label %82

80:                                               ; preds = %82
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %86

82:                                               ; preds = %76, %.lr.ph85
  %.146 = phi i32 [ %79, %76 ], [ %.04583, %.lr.ph85 ]
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %10)
          to label %83 unwind label %80

83:                                               ; preds = %82
  %84 = add nsw i32 %.584, 1
  %85 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %10)
  br i1 %85, label %.loopexit, label %.lr.ph85, !llvm.loop !13

.loopexit:                                        ; preds = %83, %.preheader, %.critedge._crit_edge
  %.1 = phi i32 [ -1, %.critedge._crit_edge ], [ 0, %.preheader ], [ %.146, %83 ]
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  ret i32 %.1

86:                                               ; preds = %.loopexit54, %.loopexit.split-lp, %72, %80, %29
  %.pn50 = phi { ptr, i32 } [ %30, %29 ], [ %81, %80 ], [ %73, %72 ], [ %lpad.loopexit, %.loopexit54 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  br label %87

87:                                               ; preds = %86, %17
  %.pn50.pn = phi { ptr, i32 } [ %.pn50, %86 ], [ %18, %17 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  resume { ptr, i32 } %.pn50.pn
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIS_IiSaIiEESaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt7greaterIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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