; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/131 Division 1/Problem A (A)

; 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<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::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 }

@k = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@c = external dso_local global [200 x i32], align 16
@tmp = external dso_local global [200 x i32], align 16
@in = external dso_local global [200 x i32], align 16
@mn = external dso_local global i32, align 4
@adj = external dso_local global [200 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 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 i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca [3 x %"class.std::stack"], align 16
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %32, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %35

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [200 x i32], ptr @c, i64 0, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %25)
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [200 x i32], ptr @c, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr %29, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %22
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !9

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

36:                                               ; preds = %63, %35
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %66

41:                                               ; preds = %36
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @k)
  %43 = load i32, ptr @k, align 4, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [200 x i32], ptr @tmp, i64 0, i64 %45
  store i32 %43, ptr %46, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %59, %41
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = load i32, ptr @k, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %47
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %62

52:                                               ; preds = %47
  %53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @x)
  %54 = load i32, ptr @x, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr @x, align 4, !tbaa !5
  %56 = load i32, ptr @x, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [200 x %"class.std::vector"], ptr @adj, i64 0, i64 %57
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %58, ptr noundef nonnull align 4 dereferenceable(4) %3)
  br label %59

59:                                               ; preds = %52
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %5, align 4, !tbaa !5
  br label %47, !llvm.loop !11

62:                                               ; preds = %51
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %3, align 4, !tbaa !5
  br label %36, !llvm.loop !12

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

67:                                               ; preds = %249, %66
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = icmp slt i32 %68, 3
  br i1 %69, label %71, label %70

70:                                               ; preds = %67
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %262

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 240, ptr %7) #6
  %72 = getelementptr inbounds [3 x %"class.std::stack"], ptr %7, i32 0, i32 0
  %73 = getelementptr inbounds %"class.std::stack", ptr %72, i64 3
  br label %74

74:                                               ; preds = %76, %71
  %75 = phi ptr [ %72, %71 ], [ %77, %76 ]
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %75)
          to label %76 unwind label %85

76:                                               ; preds = %74
  %77 = getelementptr inbounds %"class.std::stack", ptr %75, i64 1
  %78 = icmp eq ptr %77, %73
  br i1 %78, label %79, label %74

79:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %121, %79
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %95, label %84

84:                                               ; preds = %80
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %124

85:                                               ; preds = %74
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %8, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %9, align 4
  %89 = icmp eq ptr %72, %75
  br i1 %89, label %94, label %90

90:                                               ; preds = %90, %85
  %91 = phi ptr [ %75, %85 ], [ %92, %90 ]
  %92 = getelementptr inbounds %"class.std::stack", ptr %91, i64 -1
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %92) #6
  %93 = icmp eq ptr %92, %72
  br i1 %93, label %94, label %90

94:                                               ; preds = %90, %85
  br label %261

95:                                               ; preds = %80
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [200 x i32], ptr @tmp, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [200 x i32], ptr @in, i64 0, i64 %101
  store i32 %99, ptr %102, align 4, !tbaa !5
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [200 x i32], ptr @in, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %108, label %120

108:                                              ; preds = %95
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200 x i32], ptr @c, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [3 x %"class.std::stack"], ptr %7, i64 0, i64 %113
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %114, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %115 unwind label %116

115:                                              ; preds = %108
  br label %120

116:                                              ; preds = %108
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %8, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %253

120:                                              ; preds = %115, %95
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %10, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %10, align 4, !tbaa !5
  br label %80, !llvm.loop !13

124:                                              ; preds = %84
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [3 x %"class.std::stack"], ptr %7, i64 0, i64 %126
  %128 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %127)
          to label %129 unwind label %131

129:                                              ; preds = %124
  br i1 %128, label %130, label %135

130:                                              ; preds = %129
  store i32 13, ptr %4, align 4
  br label %239

131:                                              ; preds = %124
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %8, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %9, align 4
  br label %253

135:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %136 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %136, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %137 = load i32, ptr @n, align 4, !tbaa !5
  %138 = sub nsw i32 %137, 1
  store i32 %138, ptr %14, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %231, %135
  %140 = load i32, ptr %11, align 4, !tbaa !5
  %141 = load i32, ptr @n, align 4, !tbaa !5
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %143, label %235

143:                                              ; preds = %139
  %144 = load i32, ptr %14, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %14, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %230, %143
  %147 = load i32, ptr %12, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [3 x %"class.std::stack"], ptr %7, i64 0, i64 %148
  %150 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %149)
          to label %151 unwind label %175

151:                                              ; preds = %146
  %152 = xor i1 %150, true
  br i1 %152, label %153, label %231

153:                                              ; preds = %151
  %154 = load i32, ptr %12, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [3 x %"class.std::stack"], ptr %7, i64 0, i64 %155
  %157 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %156)
          to label %158 unwind label %175

158:                                              ; preds = %153
  %159 = load i32, ptr %157, align 4, !tbaa !5
  store i32 %159, ptr %13, align 4, !tbaa !5
  %160 = load i32, ptr %12, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [3 x %"class.std::stack"], ptr %7, i64 0, i64 %161
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %162)
          to label %163 unwind label %175

163:                                              ; preds = %158
  %164 = load i32, ptr %11, align 4, !tbaa !5
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %227, %163
  %167 = load i32, ptr %15, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = load i32, ptr %13, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [200 x %"class.std::vector"], ptr @adj, i64 0, i64 %170
  %172 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %171) #6
  %173 = icmp ult i64 %168, %172
  br i1 %173, label %179, label %174

174:                                              ; preds = %166
  store i32 21, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %230

175:                                              ; preds = %235, %158, %153, %146
  %176 = landingpad { ptr, i32 }
          cleanup
  %177 = extractvalue { ptr, i32 } %176, 0
  store ptr %177, ptr %8, align 8
  %178 = extractvalue { ptr, i32 } %176, 1
  store i32 %178, ptr %9, align 4
  br label %252

179:                                              ; preds = %166
  %180 = load i32, ptr %13, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [200 x %"class.std::vector"], ptr @adj, i64 0, i64 %181
  %183 = load i32, ptr %15, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %182, i64 noundef %184) #6
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [200 x i32], ptr @in, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = add nsw i32 %189, -1
  store i32 %190, ptr %188, align 4, !tbaa !5
  %191 = load i32, ptr %13, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [200 x %"class.std::vector"], ptr @adj, i64 0, i64 %192
  %194 = load i32, ptr %15, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %193, i64 noundef %195) #6
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [200 x i32], ptr @in, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = icmp eq i32 %200, 0
  br i1 %201, label %202, label %226

202:                                              ; preds = %179
  %203 = load i32, ptr %13, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [200 x %"class.std::vector"], ptr @adj, i64 0, i64 %204
  %206 = load i32, ptr %15, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %205, i64 noundef %207) #6
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [200 x i32], ptr @c, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [3 x %"class.std::stack"], ptr %7, i64 0, i64 %213
  %215 = load i32, ptr %13, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [200 x %"class.std::vector"], ptr @adj, i64 0, i64 %216
  %218 = load i32, ptr %15, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %217, i64 noundef %219) #6
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %214, ptr noundef nonnull align 4 dereferenceable(4) %220)
          to label %221 unwind label %222

221:                                              ; preds = %202
  br label %226

222:                                              ; preds = %202
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %8, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %252

226:                                              ; preds = %221, %179
  br label %227

227:                                              ; preds = %226
  %228 = load i32, ptr %15, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %15, align 4, !tbaa !5
  br label %166, !llvm.loop !14

230:                                              ; preds = %174
  br label %146, !llvm.loop !15

231:                                              ; preds = %151
  %232 = load i32, ptr %12, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  %234 = srem i32 %233, 3
  store i32 %234, ptr %12, align 4, !tbaa !5
  br label %139, !llvm.loop !16

235:                                              ; preds = %139
  %236 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mn, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %237 unwind label %175

237:                                              ; preds = %235
  %238 = load i32, ptr %236, align 4, !tbaa !5
  store i32 %238, ptr @mn, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  store i32 0, ptr %4, align 4
  br label %239

239:                                              ; preds = %237, %130
  %240 = getelementptr inbounds [3 x %"class.std::stack"], ptr %7, i32 0, i32 0
  %241 = getelementptr inbounds %"class.std::stack", ptr %240, i64 3
  br label %242

242:                                              ; preds = %242, %239
  %243 = phi ptr [ %241, %239 ], [ %244, %242 ]
  %244 = getelementptr inbounds %"class.std::stack", ptr %243, i64 -1
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %244) #6
  %245 = icmp eq ptr %244, %240
  br i1 %245, label %246, label %242

246:                                              ; preds = %242
  call void @llvm.lifetime.end.p0(i64 240, ptr %7) #6
  %247 = load i32, ptr %4, align 4
  switch i32 %247, label %270 [
    i32 0, label %248
    i32 13, label %249
  ]

248:                                              ; preds = %246
  br label %249

249:                                              ; preds = %248, %246
  %250 = load i32, ptr %6, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  store i32 %251, ptr %6, align 4, !tbaa !5
  br label %67, !llvm.loop !17

252:                                              ; preds = %222, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %253

253:                                              ; preds = %252, %131, %116
  %254 = getelementptr inbounds [3 x %"class.std::stack"], ptr %7, i32 0, i32 0
  %255 = getelementptr inbounds %"class.std::stack", ptr %254, i64 3
  br label %256

256:                                              ; preds = %256, %253
  %257 = phi ptr [ %255, %253 ], [ %258, %256 ]
  %258 = getelementptr inbounds %"class.std::stack", ptr %257, i64 -1
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %258) #6
  %259 = icmp eq ptr %258, %254
  br i1 %259, label %260, label %256

260:                                              ; preds = %256
  br label %261

261:                                              ; preds = %260, %94
  call void @llvm.lifetime.end.p0(i64 240, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %265

262:                                              ; preds = %70
  %263 = load i32, ptr @mn, align 4, !tbaa !5
  %264 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %263)
  ret i32 0

265:                                              ; preds = %261
  %266 = load ptr, ptr %8, align 8
  %267 = load i32, ptr %9, align 4
  %268 = insertvalue { ptr, i32 } poison, ptr %266, 0
  %269 = insertvalue { ptr, i32 } %268, i32 %267, 1
  resume { ptr, i32 } %269

270:                                              ; preds = %246
  unreachable
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(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)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #5 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #5 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) #5 align 2

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

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

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


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

%"class.std::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 }
%"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 }

@k = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@c = external dso_local global [200 x i32], align 16
@tmp = external dso_local local_unnamed_addr global [200 x i32], align 16
@in = external dso_local local_unnamed_addr global [200 x i32], align 16
@mn = external dso_local global i32, align 4
@adj = external dso_local global [200 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 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 [3 x %"class.std::stack"], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  br label %._crit_edge61

._crit_edge:                                      ; preds = %.lr.ph
  %8 = icmp sgt i32 %13, 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  br i1 %8, label %.lr.ph60, label %._crit_edge61

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds [200 x i32], ptr @c, i64 0, i64 %indvars.iv
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %9)
  %11 = load i32, ptr %9, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr %9, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = icmp slt i64 %indvars.iv.next, %14
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge61:                                    ; preds = %._crit_edge58, %._crit_edge.thread, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %.ptr.1 = getelementptr inbounds i8, ptr %2, i64 80
  %.ptr.2 = getelementptr inbounds i8, ptr %2, i64 160
  %16 = getelementptr inbounds i8, ptr %2, i64 160
  %17 = getelementptr inbounds i8, ptr %2, i64 80
  br label %39

.lr.ph60:                                         ; preds = %._crit_edge, %._crit_edge58
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @k)
  %19 = load i32, ptr @k, align 4, !tbaa !5
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [200 x i32], ptr @tmp, i64 0, i64 %21
  store i32 %19, ptr %22, align 4, !tbaa !5
  %23 = icmp sgt i32 %19, 0
  br i1 %23, label %.lr.ph57, label %._crit_edge58

._crit_edge58.loopexit:                           ; preds = %.lr.ph57
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %._crit_edge58

._crit_edge58:                                    ; preds = %._crit_edge58.loopexit, %.lr.ph60
  %24 = phi i32 [ %.pre, %._crit_edge58.loopexit ], [ %20, %.lr.ph60 ]
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %1, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %.lr.ph60, label %._crit_edge61, !llvm.loop !11

.lr.ph57:                                         ; preds = %.lr.ph60, %.lr.ph57
  %.03655 = phi i32 [ %33, %.lr.ph57 ], [ 0, %.lr.ph60 ]
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x)
  %29 = load i32, ptr @x, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr @x, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [200 x %"class.std::vector"], ptr @adj, i64 0, i64 %31
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %33 = add nuw nsw i32 %.03655, 1
  %34 = load i32, ptr @k, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %.lr.ph57, label %._crit_edge58.loopexit, !llvm.loop !12

36:                                               ; preds = %116
  %37 = load i32, ptr @mn, align 4, !tbaa !5
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %37)
  ret i32 0

39:                                               ; preds = %._crit_edge61, %116
  %indvars.iv88 = phi i64 [ 0, %._crit_edge61 ], [ %indvars.iv.next89, %116 ]
  call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %2) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.1)
          to label %40 unwind label %.preheader.preheader

40:                                               ; preds = %39
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %.ptr.2)
          to label %41 unwind label %.preheader.preheader

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %.lr.ph64, label %._crit_edge65

._crit_edge65:                                    ; preds = %62, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %44 = getelementptr inbounds [3 x %"class.std::stack"], ptr %2, i64 0, i64 %indvars.iv88
  %45 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %44)
  br i1 %45, label %116, label %67

.preheader.preheader:                             ; preds = %39, %40
  %.ptr.lcssa.ph = phi ptr [ %.ptr.2, %40 ], [ %.ptr.1, %39 ]
  %lpad.thr_comm = landingpad { ptr, i32 }
          cleanup
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %46 = phi ptr [ %47, %.preheader ], [ %.ptr.lcssa.ph, %.preheader.preheader ]
  %47 = getelementptr inbounds i8, ptr %46, i64 -80
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %47) #6
  %48 = icmp eq ptr %47, %2
  br i1 %48, label %.loopexit, label %.preheader

.lr.ph64:                                         ; preds = %41, %62
  %49 = phi i32 [ %63, %62 ], [ %42, %41 ]
  %storemerge4462 = phi i32 [ %65, %62 ], [ 0, %41 ]
  %50 = sext i32 %storemerge4462 to i64
  %51 = getelementptr inbounds [200 x i32], ptr @tmp, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = getelementptr inbounds [200 x i32], ptr @in, i64 0, i64 %50
  store i32 %52, ptr %53, align 4, !tbaa !5
  %54 = icmp eq i32 %52, 0
  br i1 %54, label %55, label %62

55:                                               ; preds = %.lr.ph64
  %56 = getelementptr inbounds [200 x i32], ptr @c, i64 0, i64 %50
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [3 x %"class.std::stack"], ptr %2, i64 0, i64 %58
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %59, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %._crit_edge91 unwind label %60

._crit_edge91:                                    ; preds = %55
  %.pre92 = load i32, ptr %3, align 4, !tbaa !5
  %.pre93 = load i32, ptr @n, align 4, !tbaa !5
  br label %62

60:                                               ; preds = %55
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br label %.loopexit.loopexit

62:                                               ; preds = %._crit_edge91, %.lr.ph64
  %63 = phi i32 [ %.pre93, %._crit_edge91 ], [ %49, %.lr.ph64 ]
  %64 = phi i32 [ %.pre92, %._crit_edge91 ], [ %storemerge4462, %.lr.ph64 ]
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %3, align 4, !tbaa !5
  %66 = icmp slt i32 %65, %63
  br i1 %66, label %.lr.ph64, label %._crit_edge65, !llvm.loop !13

67:                                               ; preds = %._crit_edge65
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = add nsw i32 %68, -1
  store i32 %69, ptr %4, align 4, !tbaa !5
  %70 = icmp sgt i32 %68, 0
  br i1 %70, label %.lr.ph76.preheader, label %._crit_edge77

.lr.ph76.preheader:                               ; preds = %67
  %71 = trunc nuw nsw i64 %indvars.iv88 to i32
  br label %.lr.ph76

.lr.ph76:                                         ; preds = %.lr.ph76.preheader, %._crit_edge72
  %.02974 = phi i32 [ %111, %._crit_edge72 ], [ %71, %.lr.ph76.preheader ]
  %.03073 = phi i32 [ %.1.lcssa, %._crit_edge72 ], [ 0, %.lr.ph76.preheader ]
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %4, align 4, !tbaa !5
  %74 = sext i32 %.02974 to i64
  %75 = getelementptr inbounds [3 x %"class.std::stack"], ptr %2, i64 0, i64 %74
  %76 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %75)
  br i1 %76, label %._crit_edge72, label %.lr.ph71

.loopexit48:                                      ; preds = %107, %.lr.ph71
  %77 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %75)
  br i1 %77, label %._crit_edge72, label %.lr.ph71, !llvm.loop !14

.lr.ph71:                                         ; preds = %.lr.ph76, %.loopexit48
  %.169 = phi i32 [ %80, %.loopexit48 ], [ %.03073, %.lr.ph76 ]
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %75)
  %79 = load i32, ptr %78, align 4, !tbaa !5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %75)
  %80 = add nsw i32 %.169, 1
  %81 = sext i32 %79 to i64
  %82 = getelementptr inbounds [200 x %"class.std::vector"], ptr @adj, i64 0, i64 %81
  %83 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %82) #6
  %.not = icmp eq i64 %83, 0
  br i1 %.not, label %.loopexit48, label %.lr.ph68

.lr.ph68:                                         ; preds = %.lr.ph71, %107
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %107 ], [ 0, %.lr.ph71 ]
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv85) #6
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [200 x i32], ptr @in, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = add nsw i32 %88, -1
  store i32 %89, ptr %87, align 4, !tbaa !5
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv85) #6
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [200 x i32], ptr @in, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp eq i32 %94, 0
  br i1 %95, label %96, label %107

96:                                               ; preds = %.lr.ph68
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv85) #6
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [200 x i32], ptr @c, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [3 x %"class.std::stack"], ptr %2, i64 0, i64 %102
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %indvars.iv85) #6
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %103, ptr noundef nonnull align 4 dereferenceable(4) %104)
          to label %107 unwind label %105

105:                                              ; preds = %96
  %106 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %.loopexit.loopexit

107:                                              ; preds = %.lr.ph68, %96
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %108 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %82) #6
  %109 = icmp ugt i64 %108, %indvars.iv.next86
  br i1 %109, label %.lr.ph68, label %.loopexit48, !llvm.loop !15

._crit_edge72:                                    ; preds = %.loopexit48, %.lr.ph76
  %.1.lcssa = phi i32 [ %.03073, %.lr.ph76 ], [ %80, %.loopexit48 ]
  %110 = add nsw i32 %.02974, 1
  %111 = srem i32 %110, 3
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = icmp slt i32 %.1.lcssa, %112
  br i1 %113, label %.lr.ph76, label %._crit_edge77, !llvm.loop !16

._crit_edge77:                                    ; preds = %._crit_edge72, %67
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mn, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %115 = load i32, ptr %114, align 4, !tbaa !5
  store i32 %115, ptr @mn, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %116

116:                                              ; preds = %._crit_edge65, %._crit_edge77
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %16) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %17) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %2) #6
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next89, 3
  br i1 %exitcond.not, label %36, label %39, !llvm.loop !17

.loopexit.loopexit:                               ; preds = %105, %60
  %.pn = phi { ptr, i32 } [ %61, %60 ], [ %106, %105 ]
  %117 = getelementptr inbounds i8, ptr %2, i64 160
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %117) #6
  %118 = getelementptr inbounds i8, ptr %2, i64 80
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %118) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  br label %.loopexit

.loopexit:                                        ; preds = %.preheader, %.loopexit.loopexit
  %.pn.pn = phi { ptr, i32 } [ %.pn, %.loopexit.loopexit ], [ %lpad.thr_comm, %.preheader ]
  call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn.pn
}

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(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 #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #5 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 #5 align 2

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

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

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


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