; LLVM IR from Aryansh-S/USACO :: USACO/2019/Open/Bronze (bucket_brigade_bfs)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::array<int, 3>, std::allocator<std::array<int, 3>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::array<int, 3>, std::allocator<std::array<int, 3>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::array<int, 3>, std::allocator<std::array<int, 3>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::array<int, 3>, std::allocator<std::array<int, 3>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::array" = type { [3 x i32] }
%"class.std::initializer_list" = type { ptr, i64 }

@g = external dso_local global [10 x [10 x i8]], align 16
@vis = external dso_local global [10 x [10 x i8]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z9can_visitii(i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 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 %"class.std::queue", align 8
  %8 = alloca %"struct.std::array", align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::array", align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.std::initializer_list", align 8
  %14 = alloca [3 x i32], align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %"class.std::initializer_list", align 8
  %20 = alloca [3 x i32], align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"struct.std::array", align 4
  store i32 0, ptr %1, align 4
  %25 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %27
  %29 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %28, ptr noundef null)
  %30 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %31 = load ptr, ptr @stdin, align 8, !tbaa !8
  %32 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %31)
  %33 = load ptr, ptr @stdout, align 8, !tbaa !8
  %34 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %33)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #10
  store i32 0, ptr %4, align 4, !tbaa !11
  br label %35

35:                                               ; preds = %69, %0
  %36 = load i32, ptr %4, align 4, !tbaa !11
  %37 = icmp slt i32 %36, 10
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #10
  br label %72

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

40:                                               ; preds = %65, %39
  %41 = load i32, ptr %6, align 4, !tbaa !11
  %42 = icmp slt i32 %41, 10
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %40
  %45 = load i32, ptr %4, align 4, !tbaa !11
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %46
  %48 = load i32, ptr %6, align 4, !tbaa !11
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [10 x i8], ptr %47, i64 0, i64 %49
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %50)
  %52 = load i32, ptr %4, align 4, !tbaa !11
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %53
  %55 = load i32, ptr %6, align 4, !tbaa !11
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [10 x i8], ptr %54, i64 0, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !13
  %59 = sext i8 %58 to i32
  %60 = icmp eq i32 %59, 76
  br i1 %60, label %61, label %64

61:                                               ; preds = %44
  %62 = load i32, ptr %4, align 4, !tbaa !11
  store i32 %62, ptr %2, align 4, !tbaa !11
  %63 = load i32, ptr %6, align 4, !tbaa !11
  store i32 %63, ptr %3, align 4, !tbaa !11
  br label %64

64:                                               ; preds = %61, %44
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %6, align 4, !tbaa !11
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %6, align 4, !tbaa !11
  br label %40, !llvm.loop !14

68:                                               ; preds = %43
  br label %69

69:                                               ; preds = %68
  %70 = load i32, ptr %4, align 4, !tbaa !11
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %4, align 4, !tbaa !11
  br label %35, !llvm.loop !16

72:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 80, ptr %7) #10
  call void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #10
  %73 = getelementptr inbounds %"struct.std::array", ptr %8, i32 0, i32 0
  %74 = load i32, ptr %2, align 4, !tbaa !11
  store i32 %74, ptr %73, align 4, !tbaa !11
  %75 = getelementptr inbounds i32, ptr %73, i64 1
  %76 = load i32, ptr %3, align 4, !tbaa !11
  store i32 %76, ptr %75, align 4, !tbaa !11
  %77 = getelementptr inbounds i32, ptr %73, i64 2
  store i32 0, ptr %77, align 4, !tbaa !11
  invoke void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %78 unwind label %114

78:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #10
  br label %79

79:                                               ; preds = %203, %78
  %80 = invoke noundef i64 @_ZSt4sizeISt5queueISt5arrayIiLm3EESt5dequeIS2_SaIS2_EEEEDTcldtfp_4sizeEERKT_(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %81 unwind label %118

81:                                               ; preds = %79
  %82 = icmp ne i64 %80, 0
  br i1 %82, label %83, label %205

83:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 12, ptr %11) #10
  %84 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %85 unwind label %122

85:                                               ; preds = %83
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %84, i64 12, i1 false), !tbaa.struct !17
  invoke void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %86 unwind label %122

86:                                               ; preds = %85
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %11, i64 noundef 0) #10
  %88 = load i32, ptr %87, align 4, !tbaa !11
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [10 x [10 x i8]], ptr @vis, i64 0, i64 %89
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %11, i64 noundef 1) #10
  %92 = load i32, ptr %91, align 4, !tbaa !11
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [10 x i8], ptr %90, i64 0, i64 %93
  store i8 1, ptr %94, align 1, !tbaa !18
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %11, i64 noundef 0) #10
  %96 = load i32, ptr %95, align 4, !tbaa !11
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %97
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %11, i64 noundef 1) #10
  %100 = load i32, ptr %99, align 4, !tbaa !11
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [10 x i8], ptr %98, i64 0, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !13
  %104 = sext i8 %103 to i32
  %105 = icmp eq i32 %104, 66
  br i1 %105, label %106, label %126

106:                                              ; preds = %86
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %11, i64 noundef 2) #10
  %108 = load i32, ptr %107, align 4, !tbaa !11
  %109 = sub nsw i32 %108, 1
  %110 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %109)
          to label %111 unwind label %122

111:                                              ; preds = %106
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %110, ptr noundef @.str.4)
          to label %113 unwind label %122

113:                                              ; preds = %111
  call void @exit(i32 noundef 0) #11
  unreachable

114:                                              ; preds = %72
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %9, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #10
  br label %207

118:                                              ; preds = %79
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %9, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %10, align 4
  br label %207

122:                                              ; preds = %111, %106, %85, %83
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %9, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %10, align 4
  br label %204

126:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #10
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #10
  store i32 -1, ptr %14, align 4, !tbaa !11
  %127 = getelementptr inbounds i32, ptr %14, i64 1
  store i32 0, ptr %127, align 4, !tbaa !11
  %128 = getelementptr inbounds i32, ptr %14, i64 2
  store i32 1, ptr %128, align 4, !tbaa !11
  %129 = getelementptr inbounds %"class.std::initializer_list", ptr %13, i32 0, i32 0
  store ptr %14, ptr %129, align 8, !tbaa !20
  %130 = getelementptr inbounds %"class.std::initializer_list", ptr %13, i32 0, i32 1
  store i64 3, ptr %130, align 8, !tbaa !23
  store ptr %13, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  %131 = load ptr, ptr %12, align 8, !tbaa !8
  %132 = call noundef ptr @_ZNKSt16initializer_listIiE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %131) #10
  store ptr %132, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #10
  %133 = load ptr, ptr %12, align 8, !tbaa !8
  %134 = call noundef ptr @_ZNKSt16initializer_listIiE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %133) #10
  store ptr %134, ptr %16, align 8, !tbaa !8
  br label %135

135:                                              ; preds = %200, %126
  %136 = load ptr, ptr %15, align 8, !tbaa !8
  %137 = load ptr, ptr %16, align 8, !tbaa !8
  %138 = icmp ne ptr %136, %137
  br i1 %138, label %140, label %139

139:                                              ; preds = %135
  store i32 10, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  br label %203

140:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  %141 = load ptr, ptr %15, align 8, !tbaa !8
  %142 = load i32, ptr %141, align 4, !tbaa !11
  store i32 %142, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #10
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #10
  store i32 -1, ptr %20, align 4, !tbaa !11
  %143 = getelementptr inbounds i32, ptr %20, i64 1
  store i32 0, ptr %143, align 4, !tbaa !11
  %144 = getelementptr inbounds i32, ptr %20, i64 2
  store i32 1, ptr %144, align 4, !tbaa !11
  %145 = getelementptr inbounds %"class.std::initializer_list", ptr %19, i32 0, i32 0
  store ptr %20, ptr %145, align 8, !tbaa !20
  %146 = getelementptr inbounds %"class.std::initializer_list", ptr %19, i32 0, i32 1
  store i64 3, ptr %146, align 8, !tbaa !23
  store ptr %19, ptr %18, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #10
  %147 = load ptr, ptr %18, align 8, !tbaa !8
  %148 = call noundef ptr @_ZNKSt16initializer_listIiE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %147) #10
  store ptr %148, ptr %21, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %149 = load ptr, ptr %18, align 8, !tbaa !8
  %150 = call noundef ptr @_ZNKSt16initializer_listIiE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %149) #10
  store ptr %150, ptr %22, align 8, !tbaa !8
  br label %151

151:                                              ; preds = %196, %140
  %152 = load ptr, ptr %21, align 8, !tbaa !8
  %153 = load ptr, ptr %22, align 8, !tbaa !8
  %154 = icmp ne ptr %152, %153
  br i1 %154, label %156, label %155

155:                                              ; preds = %151
  store i32 12, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  br label %199

156:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #10
  %157 = load ptr, ptr %21, align 8, !tbaa !8
  %158 = load i32, ptr %157, align 4, !tbaa !11
  store i32 %158, ptr %23, align 4, !tbaa !11
  %159 = load i32, ptr %17, align 4, !tbaa !11
  %160 = load i32, ptr %23, align 4, !tbaa !11
  %161 = add nsw i32 %159, %160
  %162 = call i32 @llvm.abs.i32(i32 %161, i1 true)
  %163 = icmp eq i32 %162, 1
  br i1 %163, label %164, label %195

164:                                              ; preds = %156
  %165 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %11, i64 noundef 0) #10
  %166 = load i32, ptr %165, align 4, !tbaa !11
  %167 = load i32, ptr %17, align 4, !tbaa !11
  %168 = add nsw i32 %166, %167
  %169 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %11, i64 noundef 1) #10
  %170 = load i32, ptr %169, align 4, !tbaa !11
  %171 = load i32, ptr %23, align 4, !tbaa !11
  %172 = add nsw i32 %170, %171
  %173 = call noundef zeroext i1 @_Z9can_visitii(i32 noundef %168, i32 noundef %172)
  br i1 %173, label %174, label %194

174:                                              ; preds = %164
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #10
  %175 = getelementptr inbounds %"struct.std::array", ptr %24, i32 0, i32 0
  %176 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %11, i64 noundef 0) #10
  %177 = load i32, ptr %176, align 4, !tbaa !11
  %178 = load i32, ptr %17, align 4, !tbaa !11
  %179 = add nsw i32 %177, %178
  store i32 %179, ptr %175, align 4, !tbaa !11
  %180 = getelementptr inbounds i32, ptr %175, i64 1
  %181 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %11, i64 noundef 1) #10
  %182 = load i32, ptr %181, align 4, !tbaa !11
  %183 = load i32, ptr %23, align 4, !tbaa !11
  %184 = add nsw i32 %182, %183
  store i32 %184, ptr %180, align 4, !tbaa !11
  %185 = getelementptr inbounds i32, ptr %175, i64 2
  %186 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %11, i64 noundef 2) #10
  %187 = load i32, ptr %186, align 4, !tbaa !11
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %185, align 4, !tbaa !11
  invoke void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(12) %24)
          to label %189 unwind label %190

189:                                              ; preds = %174
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #10
  br label %194

190:                                              ; preds = %174
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %9, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  br label %204

194:                                              ; preds = %189, %164
  br label %195

195:                                              ; preds = %194, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  br label %196

196:                                              ; preds = %195
  %197 = load ptr, ptr %21, align 8, !tbaa !8
  %198 = getelementptr inbounds i32, ptr %197, i32 1
  store ptr %198, ptr %21, align 8, !tbaa !8
  br label %151

199:                                              ; preds = %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  br label %200

200:                                              ; preds = %199
  %201 = load ptr, ptr %15, align 8, !tbaa !8
  %202 = getelementptr inbounds i32, ptr %201, i32 1
  store ptr %202, ptr %15, align 8, !tbaa !8
  br label %135

203:                                              ; preds = %139
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #10
  br label %79, !llvm.loop !24

204:                                              ; preds = %190, %122
  call void @llvm.lifetime.end.p0(i64 12, ptr %11) #10
  br label %207

205:                                              ; preds = %81
  call void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #10
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  %206 = load i32, ptr %1, align 4
  ret i32 %206

207:                                              ; preds = %204, %118, %114
  call void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #10
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  br label %208

208:                                              ; preds = %207
  %209 = load ptr, ptr %9, align 8
  %210 = load i32, ptr %10, align 4
  %211 = insertvalue { ptr, i32 } poison, ptr %209, 0
  %212 = insertvalue { ptr, i32 } %211, i32 %210, 1
  resume { ptr, i32 } %212
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #0 align 2

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #2

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) #0 align 2

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #7

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #8

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

attributes #0 = { 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 #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 #10 = { nounwind }
attributes #11 = { noreturn 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = !{!10, !10, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{i64 0, i64 12, !13}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !10, i64 0}
!20 = !{!21, !9, i64 0}
!21 = !{!"_ZTSSt16initializer_listIiE", !9, i64 0, !22, i64 8}
!22 = !{!"long", !10, i64 0}
!23 = !{!21, !22, i64 8}
!24 = distinct !{!24, !15}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::array<int, 3>, std::allocator<std::array<int, 3>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::array<int, 3>, std::allocator<std::array<int, 3>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::array<int, 3>, std::allocator<std::array<int, 3>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::array<int, 3>, std::allocator<std::array<int, 3>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::array" = type { [3 x i32] }
%"class.std::initializer_list" = type { ptr, i64 }

@g = external dso_local global [10 x [10 x i8]], align 16
@vis = external dso_local local_unnamed_addr global [10 x [10 x i8]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z9can_visitii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca %"struct.std::array", align 4
  %3 = alloca %"struct.std::array", align 4
  %4 = alloca %"class.std::initializer_list", align 8
  %5 = alloca [3 x i32], align 4
  %6 = alloca %"class.std::initializer_list", align 8
  %7 = alloca [3 x i32], align 4
  %8 = alloca %"struct.std::array", align 4
  %9 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %10 = getelementptr i8, ptr %9, i64 -24
  %11 = load i64, ptr %10, align 8
  %12 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %11
  %13 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %12, ptr noundef null)
  %14 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = load ptr, ptr @stdin, align 8, !tbaa !8
  %16 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %15)
  %17 = load ptr, ptr @stdout, align 8, !tbaa !8
  %18 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %17)
  br label %.preheader

.preheader:                                       ; preds = %0, %.preheader
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %.preheader ]
  %.053 = phi i32 [ undef, %0 ], [ %spec.select47.9, %.preheader ]
  %.03252 = phi i32 [ undef, %0 ], [ %spec.select.9, %.preheader ]
  %19 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %indvars.iv, i64 0
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %19)
  %21 = load i8, ptr %19, align 2, !tbaa !11
  %22 = icmp eq i8 %21, 76
  %spec.select = select i1 %22, i32 0, i32 %.03252
  %23 = trunc nuw nsw i64 %indvars.iv to i32
  %24 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %indvars.iv, i64 1
  %25 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %24)
  %26 = load i8, ptr %24, align 1, !tbaa !11
  %27 = icmp eq i8 %26, 76
  %spec.select.1 = select i1 %27, i32 1, i32 %spec.select
  %28 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %indvars.iv, i64 2
  %29 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %28)
  %30 = load i8, ptr %28, align 2, !tbaa !11
  %31 = icmp eq i8 %30, 76
  %spec.select.2 = select i1 %31, i32 2, i32 %spec.select.1
  %32 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %indvars.iv, i64 3
  %33 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %32)
  %34 = load i8, ptr %32, align 1, !tbaa !11
  %35 = icmp eq i8 %34, 76
  %spec.select.3 = select i1 %35, i32 3, i32 %spec.select.2
  %36 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %indvars.iv, i64 4
  %37 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %36)
  %38 = load i8, ptr %36, align 2, !tbaa !11
  %39 = icmp eq i8 %38, 76
  %spec.select.4 = select i1 %39, i32 4, i32 %spec.select.3
  %40 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %indvars.iv, i64 5
  %41 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %40)
  %42 = load i8, ptr %40, align 1, !tbaa !11
  %43 = icmp eq i8 %42, 76
  %spec.select.5 = select i1 %43, i32 5, i32 %spec.select.4
  %44 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %indvars.iv, i64 6
  %45 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %44)
  %46 = load i8, ptr %44, align 2, !tbaa !11
  %47 = icmp eq i8 %46, 76
  %spec.select.6 = select i1 %47, i32 6, i32 %spec.select.5
  %48 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %indvars.iv, i64 7
  %49 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %48)
  %50 = load i8, ptr %48, align 1, !tbaa !11
  %51 = icmp eq i8 %50, 76
  %spec.select.7 = select i1 %51, i32 7, i32 %spec.select.6
  %52 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %indvars.iv, i64 8
  %53 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %52)
  %54 = load i8, ptr %52, align 2, !tbaa !11
  %55 = icmp eq i8 %54, 76
  %spec.select.8 = select i1 %55, i32 8, i32 %spec.select.7
  %56 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %indvars.iv, i64 9
  %57 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %56)
  %58 = load i8, ptr %56, align 1, !tbaa !11
  %59 = icmp eq i8 %58, 76
  %spec.select.9 = select i1 %59, i32 9, i32 %spec.select.8
  %60 = select i1 %59, i1 true, i1 %55
  %61 = select i1 %60, i1 true, i1 %51
  %62 = select i1 %61, i1 true, i1 %47
  %63 = select i1 %62, i1 true, i1 %43
  %64 = select i1 %63, i1 true, i1 %39
  %65 = select i1 %64, i1 true, i1 %35
  %66 = select i1 %65, i1 true, i1 %31
  %67 = select i1 %66, i1 true, i1 %27
  %68 = select i1 %67, i1 true, i1 %22
  %spec.select47.9 = select i1 %68, i32 %23, i32 %.053
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 10
  br i1 %exitcond.not, label %69, label %.preheader, !llvm.loop !12

69:                                               ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #10
  call void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #10
  store i32 %spec.select47.9, ptr %2, align 4, !tbaa !14
  %70 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 %spec.select.9, ptr %70, align 4, !tbaa !14
  %71 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 0, ptr %71, align 4, !tbaa !14
  invoke void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %2)
          to label %72 unwind label %110

72:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #10
  %73 = getelementptr inbounds i8, ptr %5, i64 4
  %74 = getelementptr inbounds i8, ptr %5, i64 8
  %75 = getelementptr inbounds i8, ptr %4, i64 8
  %76 = getelementptr inbounds i8, ptr %7, i64 4
  %77 = getelementptr inbounds i8, ptr %7, i64 8
  %78 = getelementptr inbounds i8, ptr %6, i64 8
  %79 = getelementptr inbounds i8, ptr %8, i64 4
  %80 = getelementptr inbounds i8, ptr %8, i64 8
  br label %81

81:                                               ; preds = %._crit_edge60, %72
  %82 = invoke noundef i64 @_ZSt4sizeISt5queueISt5arrayIiLm3EESt5dequeIS2_SaIS2_EEEEDTcldtfp_4sizeEERKT_(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %83 unwind label %112

83:                                               ; preds = %81
  %.not = icmp eq i64 %82, 0
  br i1 %.not, label %151, label %84

84:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #10
  %85 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %85, i64 12, i1 false), !tbaa.struct !16
  call void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef 0) #10
  %87 = load i32, ptr %86, align 4, !tbaa !14
  %88 = sext i32 %87 to i64
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef 1) #10
  %90 = load i32, ptr %89, align 4, !tbaa !14
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [10 x [10 x i8]], ptr @vis, i64 0, i64 %88, i64 %91
  store i8 1, ptr %92, align 1, !tbaa !17
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef 0) #10
  %94 = load i32, ptr %93, align 4, !tbaa !14
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef 1) #10
  %97 = load i32, ptr %96, align 4, !tbaa !14
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [10 x [10 x i8]], ptr @g, i64 0, i64 %95, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !11
  %101 = icmp eq i8 %100, 66
  br i1 %101, label %102, label %116

102:                                              ; preds = %84
  %103 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef 2) #10
  %104 = load i32, ptr %103, align 4, !tbaa !14
  %105 = add nsw i32 %104, -1
  %106 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %105)
          to label %107 unwind label %114

107:                                              ; preds = %102
  %108 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef nonnull @.str.4)
          to label %109 unwind label %114

109:                                              ; preds = %107
  call void @exit(i32 noundef 0) #11
  unreachable

110:                                              ; preds = %69
  %111 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #10
  br label %152

112:                                              ; preds = %81
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %152

114:                                              ; preds = %107, %102
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %150

116:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #10
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #10
  store i32 -1, ptr %5, align 4, !tbaa !14
  store i32 0, ptr %73, align 4, !tbaa !14
  store i32 1, ptr %74, align 4, !tbaa !14
  store ptr %5, ptr %4, align 8, !tbaa !19
  store i64 3, ptr %75, align 8, !tbaa !22
  %117 = call noundef ptr @_ZNKSt16initializer_listIiE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #10
  %118 = call noundef ptr @_ZNKSt16initializer_listIiE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #10
  %.not4356 = icmp eq ptr %117, %118
  br i1 %.not4356, label %._crit_edge60, label %.lr.ph59

._crit_edge60:                                    ; preds = %._crit_edge, %116
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #10
  br label %81, !llvm.loop !23

.lr.ph59:                                         ; preds = %116, %._crit_edge
  %.03857 = phi ptr [ %122, %._crit_edge ], [ %117, %116 ]
  %119 = load i32, ptr %.03857, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #10
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #10
  store i32 -1, ptr %7, align 4, !tbaa !14
  store i32 0, ptr %76, align 4, !tbaa !14
  store i32 1, ptr %77, align 4, !tbaa !14
  store ptr %7, ptr %6, align 8, !tbaa !19
  store i64 3, ptr %78, align 8, !tbaa !22
  %120 = call noundef ptr @_ZNKSt16initializer_listIiE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #10
  %121 = call noundef ptr @_ZNKSt16initializer_listIiE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %6) #10
  %.not4454 = icmp eq ptr %120, %121
  br i1 %.not4454, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %148, %.lr.ph59
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #10
  %122 = getelementptr inbounds i8, ptr %.03857, i64 4
  %.not43 = icmp eq ptr %122, %118
  br i1 %.not43, label %._crit_edge60, label %.lr.ph59

.lr.ph:                                           ; preds = %.lr.ph59, %148
  %.03555 = phi ptr [ %149, %148 ], [ %120, %.lr.ph59 ]
  %123 = load i32, ptr %.03555, align 4, !tbaa !14
  %124 = add nsw i32 %123, %119
  %125 = call i32 @llvm.abs.i32(i32 %124, i1 true)
  %126 = icmp eq i32 %125, 1
  br i1 %126, label %127, label %148

127:                                              ; preds = %.lr.ph
  %128 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef 0) #10
  %129 = load i32, ptr %128, align 4, !tbaa !14
  %130 = add nsw i32 %129, %119
  %131 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef 1) #10
  %132 = load i32, ptr %131, align 4, !tbaa !14
  %133 = add nsw i32 %132, %123
  %134 = call noundef zeroext i1 @_Z9can_visitii(i32 noundef %130, i32 noundef %133)
  br i1 %134, label %135, label %148

135:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #10
  %136 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef 0) #10
  %137 = load i32, ptr %136, align 4, !tbaa !14
  %138 = add nsw i32 %137, %119
  store i32 %138, ptr %8, align 4, !tbaa !14
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef 1) #10
  %140 = load i32, ptr %139, align 4, !tbaa !14
  %141 = add nsw i32 %140, %123
  store i32 %141, ptr %79, align 4, !tbaa !14
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12) %3, i64 noundef 2) #10
  %143 = load i32, ptr %142, align 4, !tbaa !14
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %80, align 4, !tbaa !14
  invoke void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(12) %8)
          to label %145 unwind label %146

145:                                              ; preds = %135
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #10
  br label %148

146:                                              ; preds = %135
  %147 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #10
  br label %150

148:                                              ; preds = %127, %145, %.lr.ph
  %149 = getelementptr inbounds i8, ptr %.03555, i64 4
  %.not44 = icmp eq ptr %149, %121
  br i1 %.not44, label %._crit_edge, label %.lr.ph

150:                                              ; preds = %146, %114
  %.pn = phi { ptr, i32 } [ %115, %114 ], [ %147, %146 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #10
  br label %152

151:                                              ; preds = %83
  call void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #10
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #10
  ret i32 0

152:                                              ; preds = %150, %112, %110
  %.pn.pn = phi { ptr, i32 } [ %.pn, %150 ], [ %113, %112 ], [ %111, %110 ]
  call void @_ZNSt5queueISt5arrayIiLm3EESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #10
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #10
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #0 align 2

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

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm3EEixEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) local_unnamed_addr #0 align 2

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #7

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #8

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

attributes #0 = { 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 #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn 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 #8 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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 #10 = { nounwind }
attributes #11 = { noreturn 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!10, !10, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !10, i64 0}
!16 = !{i64 0, i64 12, !11}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !10, i64 0}
!19 = !{!20, !9, i64 0}
!20 = !{!"_ZTSSt16initializer_listIiE", !9, i64 0, !21, i64 8}
!21 = !{!"long", !10, i64 0}
!22 = !{!20, !21, i64 8}
!23 = distinct !{!23, !13}


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