; LLVM IR from brpapa/algorithms :: solutions/uri (1340)

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

%"struct.std::pair" = type { i32, i32 }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1

; 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 [1001 x %"struct.std::pair"], align 16
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 4
  %11 = alloca %"class.std::stack", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::queue", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"class.std::priority_queue", align 8
  %18 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8008, ptr %5) #6
  %19 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i32 0, i32 0
  %20 = getelementptr inbounds %"struct.std::pair", ptr %19, i64 1001
  br label %21

21:                                               ; preds = %21, %0
  %22 = phi ptr [ %19, %0 ], [ %23, %21 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %22)
  %23 = getelementptr inbounds %"struct.std::pair", ptr %22, i64 1
  %24 = icmp eq ptr %23, %20
  br i1 %24, label %25, label %21

25:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #6
  br label %26

26:                                               ; preds = %251, %25
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  %28 = icmp ne i32 %27, -1
  br i1 %28, label %29, label %257

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

30:                                               ; preds = %42, %29
  %31 = load i32, ptr %9, align 4, !tbaa !5
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %45

35:                                               ; preds = %30
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %37 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %37, ptr %10, align 4
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i64 0, i64 %39
  %41 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %40, ptr noundef nonnull align 4 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %42

42:                                               ; preds = %35
  %43 = load i32, ptr %9, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %9, align 4, !tbaa !5
  br label %30, !llvm.loop !9

45:                                               ; preds = %34
  store i8 1, ptr %6, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 80, ptr %11) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %88, %45
  %47 = load i32, ptr %12, align 4, !tbaa !5
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %50, label %53

50:                                               ; preds = %46
  %51 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %52 = trunc i8 %51 to i1
  br label %53

53:                                               ; preds = %50, %46
  %54 = phi i1 [ false, %46 ], [ %52, %50 ]
  br i1 %54, label %56, label %55

55:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %91

56:                                               ; preds = %53
  %57 = load i32, ptr %12, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i64 0, i64 %58
  %60 = getelementptr inbounds %"struct.std::pair", ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !15
  %62 = icmp eq i32 %61, 1
  br i1 %62, label %63, label %73

63:                                               ; preds = %56
  %64 = load i32, ptr %12, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i64 0, i64 %65
  %67 = getelementptr inbounds %"struct.std::pair", ptr %66, i32 0, i32 1
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %11, ptr noundef nonnull align 4 dereferenceable(4) %67)
          to label %68 unwind label %69

68:                                               ; preds = %63
  br label %87

69:                                               ; preds = %84, %73, %63
  %70 = landingpad { ptr, i32 }
          cleanup
  %71 = extractvalue { ptr, i32 } %70, 0
  store ptr %71, ptr %13, align 8
  %72 = extractvalue { ptr, i32 } %70, 1
  store i32 %72, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %256

73:                                               ; preds = %56
  %74 = load i32, ptr %12, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i64 0, i64 %75
  %77 = getelementptr inbounds %"struct.std::pair", ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 4, !tbaa !17
  %79 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %80 unwind label %69

80:                                               ; preds = %73
  %81 = load i32, ptr %79, align 4, !tbaa !5
  %82 = icmp ne i32 %78, %81
  br i1 %82, label %83, label %84

83:                                               ; preds = %80
  store i8 0, ptr %6, align 1, !tbaa !11
  br label %86

84:                                               ; preds = %80
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %11)
          to label %85 unwind label %69

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85, %83
  br label %87

87:                                               ; preds = %86, %68
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %12, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %12, align 4, !tbaa !5
  br label %46, !llvm.loop !18

91:                                               ; preds = %55
  store i8 1, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 80, ptr %15) #6
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %92 unwind label %103

92:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %139, %92
  %94 = load i32, ptr %16, align 4, !tbaa !5
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %97, label %100

97:                                               ; preds = %93
  %98 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %99 = trunc i8 %98 to i1
  br label %100

100:                                              ; preds = %97, %93
  %101 = phi i1 [ false, %93 ], [ %99, %97 ]
  br i1 %101, label %107, label %102

102:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %142

103:                                              ; preds = %91
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %13, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %14, align 4
  br label %255

107:                                              ; preds = %100
  %108 = load i32, ptr %16, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i64 0, i64 %109
  %111 = getelementptr inbounds %"struct.std::pair", ptr %110, i32 0, i32 0
  %112 = load i32, ptr %111, align 8, !tbaa !15
  %113 = icmp eq i32 %112, 1
  br i1 %113, label %114, label %124

114:                                              ; preds = %107
  %115 = load i32, ptr %16, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i64 0, i64 %116
  %118 = getelementptr inbounds %"struct.std::pair", ptr %117, i32 0, i32 1
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %15, ptr noundef nonnull align 4 dereferenceable(4) %118)
          to label %119 unwind label %120

119:                                              ; preds = %114
  br label %138

120:                                              ; preds = %135, %124, %114
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %13, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %254

124:                                              ; preds = %107
  %125 = load i32, ptr %16, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i64 0, i64 %126
  %128 = getelementptr inbounds %"struct.std::pair", ptr %127, i32 0, i32 1
  %129 = load i32, ptr %128, align 4, !tbaa !17
  %130 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %131 unwind label %120

131:                                              ; preds = %124
  %132 = load i32, ptr %130, align 4, !tbaa !5
  %133 = icmp ne i32 %129, %132
  br i1 %133, label %134, label %135

134:                                              ; preds = %131
  store i8 0, ptr %7, align 1, !tbaa !11
  br label %137

135:                                              ; preds = %131
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %15)
          to label %136 unwind label %120

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136, %134
  br label %138

138:                                              ; preds = %137, %119
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %16, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %16, align 4, !tbaa !5
  br label %93, !llvm.loop !19

142:                                              ; preds = %102
  store i8 1, ptr %8, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #6
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %17)
          to label %143 unwind label %154

143:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %190, %143
  %145 = load i32, ptr %18, align 4, !tbaa !5
  %146 = load i32, ptr %2, align 4, !tbaa !5
  %147 = icmp slt i32 %145, %146
  br i1 %147, label %148, label %151

148:                                              ; preds = %144
  %149 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %150 = trunc i8 %149 to i1
  br label %151

151:                                              ; preds = %148, %144
  %152 = phi i1 [ false, %144 ], [ %150, %148 ]
  br i1 %152, label %158, label %153

153:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %193

154:                                              ; preds = %142
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %13, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %14, align 4
  br label %253

158:                                              ; preds = %151
  %159 = load i32, ptr %18, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i64 0, i64 %160
  %162 = getelementptr inbounds %"struct.std::pair", ptr %161, i32 0, i32 0
  %163 = load i32, ptr %162, align 8, !tbaa !15
  %164 = icmp eq i32 %163, 1
  br i1 %164, label %165, label %175

165:                                              ; preds = %158
  %166 = load i32, ptr %18, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i64 0, i64 %167
  %169 = getelementptr inbounds %"struct.std::pair", ptr %168, i32 0, i32 1
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %17, ptr noundef nonnull align 4 dereferenceable(4) %169)
          to label %170 unwind label %171

170:                                              ; preds = %165
  br label %189

171:                                              ; preds = %186, %175, %165
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %13, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %252

175:                                              ; preds = %158
  %176 = load i32, ptr %18, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %5, i64 0, i64 %177
  %179 = getelementptr inbounds %"struct.std::pair", ptr %178, i32 0, i32 1
  %180 = load i32, ptr %179, align 4, !tbaa !17
  %181 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %17)
          to label %182 unwind label %171

182:                                              ; preds = %175
  %183 = load i32, ptr %181, align 4, !tbaa !5
  %184 = icmp ne i32 %180, %183
  br i1 %184, label %185, label %186

185:                                              ; preds = %182
  store i8 0, ptr %8, align 1, !tbaa !11
  br label %188

186:                                              ; preds = %182
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %17)
          to label %187 unwind label %171

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187, %185
  br label %189

189:                                              ; preds = %188, %170
  br label %190

190:                                              ; preds = %189
  %191 = load i32, ptr %18, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %18, align 4, !tbaa !5
  br label %144, !llvm.loop !20

193:                                              ; preds = %153
  %194 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %195 = trunc i8 %194 to i1
  br i1 %195, label %196, label %209

196:                                              ; preds = %193
  %197 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %198 = trunc i8 %197 to i1
  br i1 %198, label %209, label %199

199:                                              ; preds = %196
  %200 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %201 = trunc i8 %200 to i1
  br i1 %201, label %209, label %202

202:                                              ; preds = %199
  %203 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2)
          to label %204 unwind label %205

204:                                              ; preds = %202
  br label %251

205:                                              ; preds = %245, %242, %230, %218, %202
  %206 = landingpad { ptr, i32 }
          cleanup
  %207 = extractvalue { ptr, i32 } %206, 0
  store ptr %207, ptr %13, align 8
  %208 = extractvalue { ptr, i32 } %206, 1
  store i32 %208, ptr %14, align 4
  br label %252

209:                                              ; preds = %199, %196, %193
  %210 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %211 = trunc i8 %210 to i1
  br i1 %211, label %221, label %212

212:                                              ; preds = %209
  %213 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %214 = trunc i8 %213 to i1
  br i1 %214, label %215, label %221

215:                                              ; preds = %212
  %216 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %217 = trunc i8 %216 to i1
  br i1 %217, label %221, label %218

218:                                              ; preds = %215
  %219 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3)
          to label %220 unwind label %205

220:                                              ; preds = %218
  br label %250

221:                                              ; preds = %215, %212, %209
  %222 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %223 = trunc i8 %222 to i1
  br i1 %223, label %233, label %224

224:                                              ; preds = %221
  %225 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %226 = trunc i8 %225 to i1
  br i1 %226, label %233, label %227

227:                                              ; preds = %224
  %228 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %229 = trunc i8 %228 to i1
  br i1 %229, label %230, label %233

230:                                              ; preds = %227
  %231 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4)
          to label %232 unwind label %205

232:                                              ; preds = %230
  br label %249

233:                                              ; preds = %227, %224, %221
  %234 = load i8, ptr %6, align 1, !tbaa !11, !range !13, !noundef !14
  %235 = trunc i8 %234 to i1
  br i1 %235, label %245, label %236

236:                                              ; preds = %233
  %237 = load i8, ptr %7, align 1, !tbaa !11, !range !13, !noundef !14
  %238 = trunc i8 %237 to i1
  br i1 %238, label %245, label %239

239:                                              ; preds = %236
  %240 = load i8, ptr %8, align 1, !tbaa !11, !range !13, !noundef !14
  %241 = trunc i8 %240 to i1
  br i1 %241, label %245, label %242

242:                                              ; preds = %239
  %243 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5)
          to label %244 unwind label %205

244:                                              ; preds = %242
  br label %248

245:                                              ; preds = %239, %236, %233
  %246 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6)
          to label %247 unwind label %205

247:                                              ; preds = %245
  br label %248

248:                                              ; preds = %247, %244
  br label %249

249:                                              ; preds = %248, %232
  br label %250

250:                                              ; preds = %249, %220
  br label %251

251:                                              ; preds = %250, %204
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %17) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %15) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %11) #6
  br label %26, !llvm.loop !21

252:                                              ; preds = %205, %171
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %17) #6
  br label %253

253:                                              ; preds = %252, %154
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #6
  br label %254

254:                                              ; preds = %253, %120
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %15) #6
  br label %255

255:                                              ; preds = %254, %103
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #6
  br label %256

256:                                              ; preds = %255, %69
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %11) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8008, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %258

257:                                              ; preds = %26
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8008, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0

258:                                              ; preds = %256
  %259 = load ptr, ptr %13, align 8
  %260 = load i32, ptr %14, align 4
  %261 = insertvalue { ptr, i32 } poison, ptr %259, 0
  %262 = insertvalue { ptr, i32 } %261, i32 %260, 1
  resume { ptr, i32 } %262
}

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2 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: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 4}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !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"

%"struct.std::pair" = type { i32, i32 }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [10 x i8], align 1

; 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 [1001 x %"struct.std::pair"], align 16
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"class.std::stack", align 8
  %7 = alloca %"class.std::queue", align 8
  %8 = alloca %"class.std::priority_queue", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8008, ptr nonnull %4) #6
  br label %9

9:                                                ; preds = %9, %0
  %.idx = phi i64 [ 0, %0 ], [ %.add, %9 ]
  %.ptr = getelementptr inbounds i8, ptr %4, i64 %.idx
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %.ptr)
  %.add = add nuw nsw i64 %.idx, 8
  %10 = icmp eq i64 %.add, 8008
  br i1 %10, label %.preheader66, label %9

.preheader66:                                     ; preds = %9
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %.not87 = icmp eq i32 %11, -1
  br i1 %.not87, label %._crit_edge88, label %.preheader65

.preheader65:                                     ; preds = %.preheader66, %78
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader65
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph74, label %._crit_edge75

.lr.ph:                                           ; preds = %.preheader65, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader65 ]
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %3, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %17 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
  store i64 %17, ptr %5, align 8
  %18 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %4, i64 0, i64 %indvars.iv
  %19 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(8) %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge75:                                    ; preds = %32, %37, %._crit_edge
  %.045.lcssa = phi i1 [ true, %._crit_edge ], [ false, %32 ], [ true, %37 ]
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #6
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %.preheader unwind label %43

.preheader:                                       ; preds = %._crit_edge75
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph78, label %._crit_edge79

.lr.ph74:                                         ; preds = %._crit_edge, %37
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %37 ], [ 0, %._crit_edge ]
  %25 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %4, i64 0, i64 %indvars.iv90
  %26 = load i32, ptr %25, align 8, !tbaa !11
  %27 = icmp eq i32 %26, 1
  %28 = getelementptr inbounds i8, ptr %25, i64 4
  br i1 %27, label %29, label %32

29:                                               ; preds = %.lr.ph74
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(4) %28)
          to label %37 unwind label %30

30:                                               ; preds = %29
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %83

32:                                               ; preds = %.lr.ph74
  %33 = load i32, ptr %28, align 4, !tbaa !13
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %.not52 = icmp eq i32 %33, %35
  br i1 %.not52, label %36, label %._crit_edge75

36:                                               ; preds = %32
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br label %37

37:                                               ; preds = %29, %36
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %38 = load i32, ptr %1, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = icmp slt i64 %indvars.iv.next91, %39
  br i1 %40, label %.lr.ph74, label %._crit_edge75, !llvm.loop !14

._crit_edge79:                                    ; preds = %52, %57, %.preheader
  %.043.lcssa = phi i1 [ true, %.preheader ], [ false, %52 ], [ true, %57 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %8)
  %41 = load i32, ptr %1, align 4, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph84, label %.thread109

43:                                               ; preds = %._crit_edge75
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %82

.lr.ph78:                                         ; preds = %.preheader, %57
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %57 ], [ 0, %.preheader ]
  %45 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %4, i64 0, i64 %indvars.iv92
  %46 = load i32, ptr %45, align 8, !tbaa !11
  %47 = icmp eq i32 %46, 1
  %48 = getelementptr inbounds i8, ptr %45, i64 4
  br i1 %47, label %49, label %52

49:                                               ; preds = %.lr.ph78
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(4) %48)
          to label %57 unwind label %50

50:                                               ; preds = %49
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %81

52:                                               ; preds = %.lr.ph78
  %53 = load i32, ptr %48, align 4, !tbaa !13
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %.not49 = icmp eq i32 %53, %55
  br i1 %.not49, label %56, label %._crit_edge79

56:                                               ; preds = %52
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  br label %57

57:                                               ; preds = %49, %56
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %58 = load i32, ptr %1, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv.next93, %59
  br i1 %60, label %.lr.ph78, label %._crit_edge79, !llvm.loop !15

._crit_edge85:                                    ; preds = %68
  %.not55 = xor i1 %.045.lcssa, true
  %brmerge = or i1 %.043.lcssa, %.not55
  br i1 %brmerge, label %._crit_edge85.thread115, label %78

.lr.ph84:                                         ; preds = %._crit_edge79, %73
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %73 ], [ 0, %._crit_edge79 ]
  %61 = getelementptr inbounds [1001 x %"struct.std::pair"], ptr %4, i64 0, i64 %indvars.iv94
  %62 = load i32, ptr %61, align 8, !tbaa !11
  %63 = icmp eq i32 %62, 1
  %64 = getelementptr inbounds i8, ptr %61, i64 4
  br i1 %63, label %65, label %68

65:                                               ; preds = %.lr.ph84
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(25) %8, ptr noundef nonnull align 4 dereferenceable(4) %64)
          to label %73 unwind label %66

66:                                               ; preds = %72, %65
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  br label %81

68:                                               ; preds = %.lr.ph84
  %69 = load i32, ptr %64, align 4, !tbaa !13
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %8)
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %.not48 = icmp eq i32 %69, %71
  br i1 %.not48, label %72, label %._crit_edge85

72:                                               ; preds = %68
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %8)
          to label %73 unwind label %66

73:                                               ; preds = %65, %72
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %74 = load i32, ptr %1, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = icmp slt i64 %indvars.iv.next95, %75
  br i1 %76, label %.lr.ph84, label %.thread109, !llvm.loop !16

._crit_edge85.thread115:                          ; preds = %._crit_edge85
  %.not57 = xor i1 %.043.lcssa, true
  %brmerge58 = or i1 %.045.lcssa, %.not57
  br i1 %brmerge58, label %77, label %78

.thread109:                                       ; preds = %73, %._crit_edge79
  %brmerge60 = or i1 %.045.lcssa, %.043.lcssa
  br i1 %brmerge60, label %.thread130, label %78

77:                                               ; preds = %._crit_edge85.thread115
  %brmerge60125 = or i1 %.045.lcssa, %.043.lcssa
  br i1 %brmerge60125, label %.thread130, label %78

.thread130:                                       ; preds = %.thread109, %77
  br label %78

78:                                               ; preds = %77, %.thread109, %._crit_edge85.thread115, %._crit_edge85, %.thread130
  %.str.3.sink = phi ptr [ @.str.6, %.thread130 ], [ @.str.2, %._crit_edge85 ], [ @.str.3, %._crit_edge85.thread115 ], [ @.str.4, %.thread109 ], [ @.str.5, %77 ]
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #6
  %80 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %.not = icmp eq i32 %80, -1
  br i1 %.not, label %._crit_edge88, label %.preheader65, !llvm.loop !17

81:                                               ; preds = %66, %50
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %67, %66 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #6
  br label %82

82:                                               ; preds = %81, %43
  %.pn.pn = phi { ptr, i32 } [ %.pn, %81 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #6
  br label %83

83:                                               ; preds = %82, %30
  %.pn53 = phi { ptr, i32 } [ %31, %30 ], [ %.pn.pn, %82 ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8008, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn53

._crit_edge88:                                    ; preds = %78, %.preheader66
  call void @llvm.lifetime.end.p0(i64 8008, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 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: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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

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

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


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass