; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ/1026.ll (Z3bfsv)

; 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_ostream" = type { ptr, %"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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<node, std::allocator<node>>::_Deque_impl" }
%"struct.std::_Deque_base<node, std::allocator<node>>::_Deque_impl" = type { %"struct.std::_Deque_base<node, std::allocator<node>>::_Deque_impl_data" }
%"struct.std::_Deque_base<node, std::allocator<node>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.node = type { [1000 x [5 x i32]], i32, i32, i32 }

@Map = external dso_local global [105 x [105 x i8]], align 16
@map2 = external dso_local global [105 x [105 x i32]], align 16
@dir = external dso_local global [4 x [2 x i32]], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [76 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3bfsv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca %struct.node, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %struct.node, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.node, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.node, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 80, ptr %1) #7
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 20012, ptr %2) #7
  %20 = getelementptr inbounds %struct.node, ptr %2, i32 0, i32 1
  store i32 0, ptr %20, align 4, !tbaa !5
  %21 = getelementptr inbounds %struct.node, ptr %2, i32 0, i32 2
  store i32 0, ptr %21, align 4, !tbaa !10
  %22 = getelementptr inbounds %struct.node, ptr %2, i32 0, i32 3
  store i32 0, ptr %22, align 4, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(20012) %2)
          to label %23 unwind label %76

23:                                               ; preds = %0
  br label %24

24:                                               ; preds = %435, %23
  %25 = invoke noundef zeroext i1 @_ZNKSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %26 unwind label %76

26:                                               ; preds = %24
  %27 = xor i1 %25, true
  br i1 %27, label %28, label %438

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 20012, ptr %5) #7
  %29 = invoke noundef nonnull align 4 dereferenceable(20012) ptr @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %30 unwind label %80

30:                                               ; preds = %28
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 4 %29, i64 20012, i1 false), !tbaa.struct !12
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
          to label %31 unwind label %80

31:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %32 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 2
  %33 = load i32, ptr %32, align 4, !tbaa !10
  store i32 %33, ptr %6, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %34 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 3
  %35 = load i32, ptr %34, align 4, !tbaa !11
  store i32 %35, ptr %7, align 4, !tbaa !14
  %36 = load i32, ptr %6, align 4, !tbaa !14
  %37 = load i32, ptr @m, align 4, !tbaa !14
  %38 = sub nsw i32 %37, 1
  %39 = icmp eq i32 %36, %38
  br i1 %39, label %40, label %165

40:                                               ; preds = %31
  %41 = load i32, ptr %7, align 4, !tbaa !14
  %42 = load i32, ptr @n, align 4, !tbaa !14
  %43 = sub nsw i32 %42, 1
  %44 = icmp eq i32 %41, %43
  br i1 %44, label %45, label %165

45:                                               ; preds = %40
  %46 = load i32, ptr %7, align 4, !tbaa !14
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %47
  %49 = load i32, ptr %6, align 4, !tbaa !14
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [105 x i8], ptr %48, i64 0, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !13
  %53 = sext i8 %52 to i32
  %54 = icmp eq i32 %53, 46
  br i1 %54, label %65, label %55

55:                                               ; preds = %45
  %56 = load i32, ptr %7, align 4, !tbaa !14
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %57
  %59 = load i32, ptr %6, align 4, !tbaa !14
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [105 x i8], ptr %58, i64 0, i64 %60
  %62 = load i8, ptr %61, align 1, !tbaa !13
  %63 = sext i8 %62 to i32
  %64 = icmp eq i32 %63, 48
  br i1 %64, label %65, label %165

65:                                               ; preds = %55, %45
  %66 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %67)
          to label %69 unwind label %84

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

70:                                               ; preds = %160, %69
  %71 = load i32, ptr %8, align 4, !tbaa !14
  %72 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp slt i32 %71, %73
  br i1 %74, label %88, label %75

75:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %164

76:                                               ; preds = %440, %438, %24, %0
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %3, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %4, align 4
  br label %444

80:                                               ; preds = %30, %28
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %3, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %4, align 4
  br label %437

84:                                               ; preds = %65
  %85 = landingpad { ptr, i32 }
          cleanup
  %86 = extractvalue { ptr, i32 } %85, 0
  store ptr %86, ptr %3, align 8
  %87 = extractvalue { ptr, i32 } %85, 1
  store i32 %87, ptr %4, align 4
  br label %436

88:                                               ; preds = %70
  %89 = load i32, ptr %8, align 4, !tbaa !14
  %90 = add nsw i32 %89, 1
  %91 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %90)
          to label %92 unwind label %118

92:                                               ; preds = %88
  %93 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %91, ptr noundef @.str.1)
          to label %94 unwind label %118

94:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %95 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 0
  %96 = load i32, ptr %8, align 4, !tbaa !14
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [1000 x [5 x i32]], ptr %95, i64 0, i64 %97
  %99 = getelementptr inbounds [5 x i32], ptr %98, i64 0, i64 0
  %100 = load i32, ptr %99, align 4, !tbaa !14
  store i32 %100, ptr %9, align 4, !tbaa !14
  %101 = load i32, ptr %9, align 4, !tbaa !14
  %102 = icmp eq i32 %101, 2
  br i1 %102, label %103, label %126

103:                                              ; preds = %94
  %104 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 0
  %105 = load i32, ptr %8, align 4, !tbaa !14
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [1000 x [5 x i32]], ptr %104, i64 0, i64 %106
  %108 = getelementptr inbounds [5 x i32], ptr %107, i64 0, i64 2
  %109 = load i32, ptr %108, align 4, !tbaa !14
  %110 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 0
  %111 = load i32, ptr %8, align 4, !tbaa !14
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1000 x [5 x i32]], ptr %110, i64 0, i64 %112
  %114 = getelementptr inbounds [5 x i32], ptr %113, i64 0, i64 1
  %115 = load i32, ptr %114, align 4, !tbaa !14
  %116 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %109, i32 noundef %115)
          to label %117 unwind label %122

117:                                              ; preds = %103
  br label %157

118:                                              ; preds = %92, %88
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %3, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %4, align 4
  br label %163

122:                                              ; preds = %157, %129, %103
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %3, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %163

126:                                              ; preds = %94
  %127 = load i32, ptr %9, align 4, !tbaa !14
  %128 = icmp eq i32 %127, 4
  br i1 %128, label %129, label %156

129:                                              ; preds = %126
  %130 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 0
  %131 = load i32, ptr %8, align 4, !tbaa !14
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1000 x [5 x i32]], ptr %130, i64 0, i64 %132
  %134 = getelementptr inbounds [5 x i32], ptr %133, i64 0, i64 2
  %135 = load i32, ptr %134, align 4, !tbaa !14
  %136 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 0
  %137 = load i32, ptr %8, align 4, !tbaa !14
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1000 x [5 x i32]], ptr %136, i64 0, i64 %138
  %140 = getelementptr inbounds [5 x i32], ptr %139, i64 0, i64 1
  %141 = load i32, ptr %140, align 4, !tbaa !14
  %142 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 0
  %143 = load i32, ptr %8, align 4, !tbaa !14
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [1000 x [5 x i32]], ptr %142, i64 0, i64 %144
  %146 = getelementptr inbounds [5 x i32], ptr %145, i64 0, i64 4
  %147 = load i32, ptr %146, align 4, !tbaa !14
  %148 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 0
  %149 = load i32, ptr %8, align 4, !tbaa !14
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [1000 x [5 x i32]], ptr %148, i64 0, i64 %150
  %152 = getelementptr inbounds [5 x i32], ptr %151, i64 0, i64 3
  %153 = load i32, ptr %152, align 4, !tbaa !14
  %154 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %135, i32 noundef %141, i32 noundef %147, i32 noundef %153)
          to label %155 unwind label %122

155:                                              ; preds = %129
  br label %156

156:                                              ; preds = %155, %126
  br label %157

157:                                              ; preds = %156, %117
  %158 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %159 unwind label %122

159:                                              ; preds = %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %160

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

163:                                              ; preds = %122, %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %436

164:                                              ; preds = %75
  store i32 1, ptr %10, align 4
  br label %433

165:                                              ; preds = %55, %40, %31
  %166 = load i32, ptr %7, align 4, !tbaa !14
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %167
  %169 = load i32, ptr %6, align 4, !tbaa !14
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [105 x i8], ptr %168, i64 0, i64 %170
  %172 = load i8, ptr %171, align 1, !tbaa !13
  %173 = sext i8 %172 to i32
  %174 = icmp ne i32 %173, 46
  br i1 %174, label %175, label %280

175:                                              ; preds = %165
  %176 = load i32, ptr %7, align 4, !tbaa !14
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %177
  %179 = load i32, ptr %6, align 4, !tbaa !14
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [105 x i8], ptr %178, i64 0, i64 %180
  %182 = load i8, ptr %181, align 1, !tbaa !13
  %183 = sext i8 %182 to i32
  %184 = icmp ne i32 %183, 88
  br i1 %184, label %185, label %280

185:                                              ; preds = %175
  %186 = load i32, ptr %7, align 4, !tbaa !14
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %187
  %189 = load i32, ptr %6, align 4, !tbaa !14
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [105 x i8], ptr %188, i64 0, i64 %190
  %192 = load i8, ptr %191, align 1, !tbaa !13
  %193 = sext i8 %192 to i32
  %194 = icmp ne i32 %193, 48
  br i1 %194, label %195, label %280

195:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 20012, ptr %11) #7
  %196 = load i32, ptr %6, align 4, !tbaa !14
  %197 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 2
  store i32 %196, ptr %197, align 4, !tbaa !10
  %198 = load i32, ptr %7, align 4, !tbaa !14
  %199 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 3
  store i32 %198, ptr %199, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !14
  br label %200

200:                                              ; preds = %231, %195
  %201 = load i32, ptr %12, align 4, !tbaa !14
  %202 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %203 = load i32, ptr %202, align 4, !tbaa !5
  %204 = icmp slt i32 %201, %203
  br i1 %204, label %206, label %205

205:                                              ; preds = %200
  store i32 7, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %234

206:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !14
  br label %207

207:                                              ; preds = %227, %206
  %208 = load i32, ptr %13, align 4, !tbaa !14
  %209 = icmp slt i32 %208, 5
  br i1 %209, label %211, label %210

210:                                              ; preds = %207
  store i32 10, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %230

211:                                              ; preds = %207
  %212 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 0
  %213 = load i32, ptr %12, align 4, !tbaa !14
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [1000 x [5 x i32]], ptr %212, i64 0, i64 %214
  %216 = load i32, ptr %13, align 4, !tbaa !14
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [5 x i32], ptr %215, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !14
  %220 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 0
  %221 = load i32, ptr %12, align 4, !tbaa !14
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [1000 x [5 x i32]], ptr %220, i64 0, i64 %222
  %224 = load i32, ptr %13, align 4, !tbaa !14
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [5 x i32], ptr %223, i64 0, i64 %225
  store i32 %219, ptr %226, align 4, !tbaa !14
  br label %227

227:                                              ; preds = %211
  %228 = load i32, ptr %13, align 4, !tbaa !14
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %13, align 4, !tbaa !14
  br label %207, !llvm.loop !17

230:                                              ; preds = %210
  br label %231

231:                                              ; preds = %230
  %232 = load i32, ptr %12, align 4, !tbaa !14
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %12, align 4, !tbaa !14
  br label %200, !llvm.loop !18

234:                                              ; preds = %205
  %235 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 0
  %236 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [1000 x [5 x i32]], ptr %235, i64 0, i64 %238
  %240 = getelementptr inbounds [5 x i32], ptr %239, i64 0, i64 0
  store i32 2, ptr %240, align 4, !tbaa !14
  %241 = load i32, ptr %6, align 4, !tbaa !14
  %242 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 0
  %243 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %244 = load i32, ptr %243, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [1000 x [5 x i32]], ptr %242, i64 0, i64 %245
  %247 = getelementptr inbounds [5 x i32], ptr %246, i64 0, i64 1
  store i32 %241, ptr %247, align 4, !tbaa !14
  %248 = load i32, ptr %7, align 4, !tbaa !14
  %249 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 0
  %250 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [1000 x [5 x i32]], ptr %249, i64 0, i64 %252
  %254 = getelementptr inbounds [5 x i32], ptr %253, i64 0, i64 2
  store i32 %248, ptr %254, align 4, !tbaa !14
  %255 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = add nsw i32 %256, 1
  %258 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 1
  store i32 %257, ptr %258, align 4, !tbaa !5
  %259 = load i32, ptr %7, align 4, !tbaa !14
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %260
  %262 = load i32, ptr %6, align 4, !tbaa !14
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [105 x i8], ptr %261, i64 0, i64 %263
  %265 = load i8, ptr %264, align 1, !tbaa !13
  %266 = sext i8 %265 to i32
  %267 = sub nsw i32 %266, 1
  %268 = trunc i32 %267 to i8
  %269 = load i32, ptr %7, align 4, !tbaa !14
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %270
  %272 = load i32, ptr %6, align 4, !tbaa !14
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [105 x i8], ptr %271, i64 0, i64 %273
  store i8 %268, ptr %274, align 1, !tbaa !13
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(20012) %11)
          to label %275 unwind label %276

275:                                              ; preds = %234
  call void @llvm.lifetime.end.p0(i64 20012, ptr %11) #7
  br label %431

276:                                              ; preds = %234
  %277 = landingpad { ptr, i32 }
          cleanup
  %278 = extractvalue { ptr, i32 } %277, 0
  store ptr %278, ptr %3, align 8
  %279 = extractvalue { ptr, i32 } %277, 1
  store i32 %279, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 20012, ptr %11) #7
  br label %436

280:                                              ; preds = %185, %175, %165
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !14
  br label %281

281:                                              ; preds = %427, %280
  %282 = load i32, ptr %14, align 4, !tbaa !14
  %283 = icmp slt i32 %282, 4
  br i1 %283, label %285, label %284

284:                                              ; preds = %281
  store i32 13, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %430

285:                                              ; preds = %281
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %286 = load i32, ptr %6, align 4, !tbaa !14
  %287 = load i32, ptr %14, align 4, !tbaa !14
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [4 x [2 x i32]], ptr @dir, i64 0, i64 %288
  %290 = getelementptr inbounds [2 x i32], ptr %289, i64 0, i64 0
  %291 = load i32, ptr %290, align 8, !tbaa !14
  %292 = add nsw i32 %286, %291
  store i32 %292, ptr %15, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %293 = load i32, ptr %7, align 4, !tbaa !14
  %294 = load i32, ptr %14, align 4, !tbaa !14
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [4 x [2 x i32]], ptr @dir, i64 0, i64 %295
  %297 = getelementptr inbounds [2 x i32], ptr %296, i64 0, i64 1
  %298 = load i32, ptr %297, align 4, !tbaa !14
  %299 = add nsw i32 %293, %298
  store i32 %299, ptr %16, align 4, !tbaa !14
  %300 = load i32, ptr %15, align 4, !tbaa !14
  %301 = icmp sge i32 %300, 0
  br i1 %301, label %302, label %423

302:                                              ; preds = %285
  %303 = load i32, ptr %15, align 4, !tbaa !14
  %304 = load i32, ptr @m, align 4, !tbaa !14
  %305 = icmp slt i32 %303, %304
  br i1 %305, label %306, label %423

306:                                              ; preds = %302
  %307 = load i32, ptr %16, align 4, !tbaa !14
  %308 = icmp sge i32 %307, 0
  br i1 %308, label %309, label %423

309:                                              ; preds = %306
  %310 = load i32, ptr %16, align 4, !tbaa !14
  %311 = load i32, ptr @n, align 4, !tbaa !14
  %312 = icmp slt i32 %310, %311
  br i1 %312, label %313, label %423

313:                                              ; preds = %309
  %314 = load i32, ptr %16, align 4, !tbaa !14
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [105 x [105 x i32]], ptr @map2, i64 0, i64 %315
  %317 = load i32, ptr %15, align 4, !tbaa !14
  %318 = sext i32 %317 to i64
  %319 = getelementptr inbounds [105 x i32], ptr %316, i64 0, i64 %318
  %320 = load i32, ptr %319, align 4, !tbaa !14
  %321 = icmp eq i32 %320, 0
  br i1 %321, label %322, label %423

322:                                              ; preds = %313
  %323 = load i32, ptr %16, align 4, !tbaa !14
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %324
  %326 = load i32, ptr %15, align 4, !tbaa !14
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds [105 x i8], ptr %325, i64 0, i64 %327
  %329 = load i8, ptr %328, align 1, !tbaa !13
  %330 = sext i8 %329 to i32
  %331 = icmp eq i32 %330, 88
  br i1 %331, label %332, label %333

332:                                              ; preds = %322
  store i32 15, ptr %10, align 4
  br label %424

333:                                              ; preds = %322
  %334 = load i32, ptr %16, align 4, !tbaa !14
  %335 = sext i32 %334 to i64
  %336 = getelementptr inbounds [105 x [105 x i32]], ptr @map2, i64 0, i64 %335
  %337 = load i32, ptr %15, align 4, !tbaa !14
  %338 = sext i32 %337 to i64
  %339 = getelementptr inbounds [105 x i32], ptr %336, i64 0, i64 %338
  store i32 1, ptr %339, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 20012, ptr %17) #7
  %340 = load i32, ptr %15, align 4, !tbaa !14
  %341 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 2
  store i32 %340, ptr %341, align 4, !tbaa !10
  %342 = load i32, ptr %16, align 4, !tbaa !14
  %343 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 3
  store i32 %342, ptr %343, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !14
  br label %344

344:                                              ; preds = %375, %333
  %345 = load i32, ptr %18, align 4, !tbaa !14
  %346 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %347 = load i32, ptr %346, align 4, !tbaa !5
  %348 = icmp slt i32 %345, %347
  br i1 %348, label %350, label %349

349:                                              ; preds = %344
  store i32 16, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %378

350:                                              ; preds = %344
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !14
  br label %351

351:                                              ; preds = %371, %350
  %352 = load i32, ptr %19, align 4, !tbaa !14
  %353 = icmp slt i32 %352, 5
  br i1 %353, label %355, label %354

354:                                              ; preds = %351
  store i32 19, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %374

355:                                              ; preds = %351
  %356 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 0
  %357 = load i32, ptr %18, align 4, !tbaa !14
  %358 = sext i32 %357 to i64
  %359 = getelementptr inbounds [1000 x [5 x i32]], ptr %356, i64 0, i64 %358
  %360 = load i32, ptr %19, align 4, !tbaa !14
  %361 = sext i32 %360 to i64
  %362 = getelementptr inbounds [5 x i32], ptr %359, i64 0, i64 %361
  %363 = load i32, ptr %362, align 4, !tbaa !14
  %364 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 0
  %365 = load i32, ptr %18, align 4, !tbaa !14
  %366 = sext i32 %365 to i64
  %367 = getelementptr inbounds [1000 x [5 x i32]], ptr %364, i64 0, i64 %366
  %368 = load i32, ptr %19, align 4, !tbaa !14
  %369 = sext i32 %368 to i64
  %370 = getelementptr inbounds [5 x i32], ptr %367, i64 0, i64 %369
  store i32 %363, ptr %370, align 4, !tbaa !14
  br label %371

371:                                              ; preds = %355
  %372 = load i32, ptr %19, align 4, !tbaa !14
  %373 = add nsw i32 %372, 1
  store i32 %373, ptr %19, align 4, !tbaa !14
  br label %351, !llvm.loop !19

374:                                              ; preds = %354
  br label %375

375:                                              ; preds = %374
  %376 = load i32, ptr %18, align 4, !tbaa !14
  %377 = add nsw i32 %376, 1
  store i32 %377, ptr %18, align 4, !tbaa !14
  br label %344, !llvm.loop !20

378:                                              ; preds = %349
  %379 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 0
  %380 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %381 = load i32, ptr %380, align 4, !tbaa !5
  %382 = sext i32 %381 to i64
  %383 = getelementptr inbounds [1000 x [5 x i32]], ptr %379, i64 0, i64 %382
  %384 = getelementptr inbounds [5 x i32], ptr %383, i64 0, i64 0
  store i32 4, ptr %384, align 4, !tbaa !14
  %385 = load i32, ptr %6, align 4, !tbaa !14
  %386 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 0
  %387 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %388 = load i32, ptr %387, align 4, !tbaa !5
  %389 = sext i32 %388 to i64
  %390 = getelementptr inbounds [1000 x [5 x i32]], ptr %386, i64 0, i64 %389
  %391 = getelementptr inbounds [5 x i32], ptr %390, i64 0, i64 1
  store i32 %385, ptr %391, align 4, !tbaa !14
  %392 = load i32, ptr %7, align 4, !tbaa !14
  %393 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 0
  %394 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %395 = load i32, ptr %394, align 4, !tbaa !5
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds [1000 x [5 x i32]], ptr %393, i64 0, i64 %396
  %398 = getelementptr inbounds [5 x i32], ptr %397, i64 0, i64 2
  store i32 %392, ptr %398, align 4, !tbaa !14
  %399 = load i32, ptr %15, align 4, !tbaa !14
  %400 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 0
  %401 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %402 = load i32, ptr %401, align 4, !tbaa !5
  %403 = sext i32 %402 to i64
  %404 = getelementptr inbounds [1000 x [5 x i32]], ptr %400, i64 0, i64 %403
  %405 = getelementptr inbounds [5 x i32], ptr %404, i64 0, i64 3
  store i32 %399, ptr %405, align 4, !tbaa !14
  %406 = load i32, ptr %16, align 4, !tbaa !14
  %407 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 0
  %408 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %409 = load i32, ptr %408, align 4, !tbaa !5
  %410 = sext i32 %409 to i64
  %411 = getelementptr inbounds [1000 x [5 x i32]], ptr %407, i64 0, i64 %410
  %412 = getelementptr inbounds [5 x i32], ptr %411, i64 0, i64 4
  store i32 %406, ptr %412, align 4, !tbaa !14
  %413 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 1
  %414 = load i32, ptr %413, align 4, !tbaa !5
  %415 = add nsw i32 %414, 1
  %416 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 1
  store i32 %415, ptr %416, align 4, !tbaa !5
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(20012) %17)
          to label %417 unwind label %418

417:                                              ; preds = %378
  call void @llvm.lifetime.end.p0(i64 20012, ptr %17) #7
  br label %422

418:                                              ; preds = %378
  %419 = landingpad { ptr, i32 }
          cleanup
  %420 = extractvalue { ptr, i32 } %419, 0
  store ptr %420, ptr %3, align 8
  %421 = extractvalue { ptr, i32 } %419, 1
  store i32 %421, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 20012, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %436

422:                                              ; preds = %417
  br label %423

423:                                              ; preds = %422, %313, %309, %306, %302, %285
  store i32 0, ptr %10, align 4
  br label %424

424:                                              ; preds = %423, %332
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  %425 = load i32, ptr %10, align 4
  switch i32 %425, label %450 [
    i32 0, label %426
    i32 15, label %427
  ]

426:                                              ; preds = %424
  br label %427

427:                                              ; preds = %426, %424
  %428 = load i32, ptr %14, align 4, !tbaa !14
  %429 = add nsw i32 %428, 1
  store i32 %429, ptr %14, align 4, !tbaa !14
  br label %281, !llvm.loop !21

430:                                              ; preds = %284
  br label %431

431:                                              ; preds = %430, %275
  br label %432

432:                                              ; preds = %431
  store i32 0, ptr %10, align 4
  br label %433

433:                                              ; preds = %432, %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 20012, ptr %5) #7
  %434 = load i32, ptr %10, align 4
  switch i32 %434, label %443 [
    i32 0, label %435
  ]

435:                                              ; preds = %433
  br label %24, !llvm.loop !22

436:                                              ; preds = %418, %276, %163, %84
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %437

437:                                              ; preds = %436, %80
  call void @llvm.lifetime.end.p0(i64 20012, ptr %5) #7
  br label %444

438:                                              ; preds = %26
  %439 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
          to label %440 unwind label %76

440:                                              ; preds = %438
  %441 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %439, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %442 unwind label %76

442:                                              ; preds = %440
  store i32 1, ptr %10, align 4
  br label %443

443:                                              ; preds = %442, %433
  call void @llvm.lifetime.end.p0(i64 20012, ptr %2) #7
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %1) #7
  ret void

444:                                              ; preds = %437, %76
  call void @llvm.lifetime.end.p0(i64 20012, ptr %2) #7
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %1) #7
  br label %445

445:                                              ; preds = %444
  %446 = load ptr, ptr %3, align 8
  %447 = load i32, ptr %4, align 4
  %448 = insertvalue { ptr, i32 } poison, ptr %446, 0
  %449 = insertvalue { ptr, i32 } %448, i32 %447, 1
  resume { ptr, i32 } %449

450:                                              ; preds = %424
  unreachable
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20012) ptr @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 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) #3

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

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

; 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) #5

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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

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

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


; 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_ostream" = type { ptr, %"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::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<node, std::allocator<node>>::_Deque_impl" }
%"struct.std::_Deque_base<node, std::allocator<node>>::_Deque_impl" = type { %"struct.std::_Deque_base<node, std::allocator<node>>::_Deque_impl_data" }
%"struct.std::_Deque_base<node, std::allocator<node>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%struct.node = type { [1000 x [5 x i32]], i32, i32, i32 }

@Map = external dso_local local_unnamed_addr global [105 x [105 x i8]], align 16
@map2 = external dso_local local_unnamed_addr global [105 x [105 x i32]], align 16
@dir = external dso_local local_unnamed_addr global [4 x [2 x i32]], align 16
@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [76 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3bfsv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::queue", align 8
  %2 = alloca %struct.node, align 4
  %3 = alloca %struct.node, align 4
  %4 = alloca %struct.node, align 4
  %5 = alloca %struct.node, align 4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #9
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 20012, ptr nonnull %2) #9
  %6 = getelementptr inbounds i8, ptr %2, i64 20000
  store i32 0, ptr %6, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %2, i64 20004
  store i32 0, ptr %7, align 4, !tbaa !10
  %8 = getelementptr inbounds i8, ptr %2, i64 20008
  store i32 0, ptr %8, align 4, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(20012) %2)
          to label %.preheader100 unwind label %39

.preheader100:                                    ; preds = %0
  %9 = call noundef zeroext i1 @_ZNKSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %9, label %._crit_edge108, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader100
  %10 = getelementptr inbounds i8, ptr %3, i64 20004
  %11 = getelementptr inbounds i8, ptr %3, i64 20008
  %12 = getelementptr inbounds i8, ptr %5, i64 20004
  %13 = getelementptr inbounds i8, ptr %5, i64 20008
  %14 = getelementptr inbounds i8, ptr %3, i64 20000
  %15 = getelementptr inbounds i8, ptr %5, i64 20000
  %16 = getelementptr inbounds i8, ptr %4, i64 20004
  %17 = getelementptr inbounds i8, ptr %4, i64 20008
  %18 = getelementptr inbounds i8, ptr %4, i64 20000
  br label %19

19:                                               ; preds = %.lr.ph, %.loopexit
  call void @llvm.lifetime.start.p0(i64 20012, ptr nonnull %3) #9
  %20 = call noundef nonnull align 4 dereferenceable(20012) ptr @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20012) %3, ptr noundef nonnull align 4 dereferenceable(20012) %20, i64 20012, i1 false), !tbaa.struct !12
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %21 = load i32, ptr %10, align 4, !tbaa !10
  %22 = load i32, ptr %11, align 4, !tbaa !11
  %23 = load i32, ptr @m, align 4, !tbaa !14
  %24 = add nsw i32 %23, -1
  %25 = icmp eq i32 %21, %24
  br i1 %25, label %26, label %71

26:                                               ; preds = %19
  %27 = load i32, ptr @n, align 4, !tbaa !14
  %28 = add nsw i32 %27, -1
  %29 = icmp eq i32 %22, %28
  br i1 %29, label %30, label %71

30:                                               ; preds = %26
  %31 = sext i32 %22 to i64
  %32 = sext i32 %21 to i64
  %33 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %31, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !13
  switch i8 %34, label %71 [
    i8 46, label %35
    i8 48, label %35
  ]

35:                                               ; preds = %30, %30
  %36 = load i32, ptr %14, align 4, !tbaa !5
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %36)
  %smax = call i32 @llvm.smax.i32(i32 %36, i32 0)
  %wide.trip.count = zext nneg i32 %smax to i64
  br label %38

38:                                               ; preds = %69, %35
  %indvars.iv = phi i64 [ %indvars.iv.next, %69 ], [ 0, %35 ]
  %exitcond.not = icmp eq i64 %indvars.iv, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %41

39:                                               ; preds = %201, %._crit_edge108, %0
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %204

41:                                               ; preds = %38
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = trunc nuw i64 %indvars.iv.next to i32
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %42)
          to label %44 unwind label %55

44:                                               ; preds = %41
  %45 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef nonnull @.str.1)
          to label %46 unwind label %55

46:                                               ; preds = %44
  %47 = getelementptr inbounds [1000 x [5 x i32]], ptr %3, i64 0, i64 %indvars.iv
  %48 = load i32, ptr %47, align 4, !tbaa !14
  switch i32 %48, label %69 [
    i32 2, label %49
    i32 4, label %59
  ]

49:                                               ; preds = %46
  %50 = getelementptr inbounds i8, ptr %47, i64 8
  %51 = load i32, ptr %50, align 4, !tbaa !14
  %52 = getelementptr inbounds i8, ptr %47, i64 4
  %53 = load i32, ptr %52, align 4, !tbaa !14
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %51, i32 noundef %53)
  br label %69

55:                                               ; preds = %44, %41
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %199

57:                                               ; preds = %69
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %199

59:                                               ; preds = %46
  %60 = getelementptr inbounds i8, ptr %47, i64 8
  %61 = load i32, ptr %60, align 4, !tbaa !14
  %62 = getelementptr inbounds i8, ptr %47, i64 4
  %63 = load i32, ptr %62, align 4, !tbaa !14
  %64 = getelementptr inbounds i8, ptr %47, i64 16
  %65 = load i32, ptr %64, align 4, !tbaa !14
  %66 = getelementptr inbounds i8, ptr %47, i64 12
  %67 = load i32, ptr %66, align 4, !tbaa !14
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %61, i32 noundef %63, i32 noundef %65, i32 noundef %67)
  br label %69

69:                                               ; preds = %46, %59, %49
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %38 unwind label %57, !llvm.loop !15

71:                                               ; preds = %30, %26, %19
  %72 = sext i32 %22 to i64
  %73 = sext i32 %21 to i64
  %74 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %72, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !13
  switch i8 %75, label %76 [
    i8 46, label %90
    i8 88, label %90
    i8 48, label %90
  ]

76:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 20012, ptr nonnull %4) #9
  store i32 %21, ptr %16, align 4, !tbaa !10
  store i32 %22, ptr %17, align 4, !tbaa !11
  %77 = load i32, ptr %14, align 4, !tbaa !5
  %78 = icmp sgt i32 %77, 0
  br i1 %78, label %.preheader99.preheader, label %._crit_edge107

.preheader99.preheader:                           ; preds = %76
  %79 = zext nneg i32 %77 to i64
  %80 = mul nuw nsw i64 %79, 20
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %4, ptr nonnull align 4 %3, i64 %80, i1 false), !tbaa !14
  br label %._crit_edge107

._crit_edge107:                                   ; preds = %.preheader99.preheader, %76
  %81 = sext i32 %77 to i64
  %82 = getelementptr inbounds [1000 x [5 x i32]], ptr %4, i64 0, i64 %81
  store i32 2, ptr %82, align 4, !tbaa !14
  %83 = getelementptr inbounds [1000 x [5 x i32]], ptr %4, i64 0, i64 %81, i64 1
  store i32 %21, ptr %83, align 4, !tbaa !14
  %84 = getelementptr inbounds [1000 x [5 x i32]], ptr %4, i64 0, i64 %81, i64 2
  store i32 %22, ptr %84, align 4, !tbaa !14
  %85 = add nsw i32 %77, 1
  store i32 %85, ptr %18, align 4, !tbaa !5
  %86 = add i8 %75, -1
  store i8 %86, ptr %74, align 1, !tbaa !13
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(20012) %4)
          to label %87 unwind label %88

87:                                               ; preds = %._crit_edge107
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %4) #9
  br label %.loopexit

88:                                               ; preds = %._crit_edge107
  %89 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %4) #9
  br label %199

90:                                               ; preds = %71, %71, %71
  %91 = load i32, ptr %14, align 4
  %92 = icmp sgt i32 %91, 0
  %93 = sext i32 %91 to i64
  %94 = getelementptr inbounds [1000 x [5 x i32]], ptr %5, i64 0, i64 %93
  %95 = getelementptr inbounds [1000 x [5 x i32]], ptr %5, i64 0, i64 %93, i64 1
  %96 = getelementptr inbounds [1000 x [5 x i32]], ptr %5, i64 0, i64 %93, i64 2
  %97 = getelementptr inbounds [1000 x [5 x i32]], ptr %5, i64 0, i64 %93, i64 3
  %98 = getelementptr inbounds [1000 x [5 x i32]], ptr %5, i64 0, i64 %93, i64 4
  %99 = add nsw i32 %91, 1
  %100 = zext i32 %91 to i64
  %101 = mul nuw nsw i64 %100, 20
  %102 = load i32, ptr @dir, align 16, !tbaa !14
  %103 = add nsw i32 %102, %21
  %104 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 4), align 4, !tbaa !14
  %105 = add nsw i32 %104, %22
  %106 = icmp sgt i32 %103, -1
  br i1 %106, label %107, label %126

107:                                              ; preds = %90
  %108 = icmp slt i32 %103, %23
  %109 = icmp sgt i32 %105, -1
  %or.cond = select i1 %108, i1 %109, i1 false
  %110 = load i32, ptr @n, align 4
  %111 = icmp slt i32 %105, %110
  %or.cond98 = select i1 %or.cond, i1 %111, i1 false
  br i1 %or.cond98, label %112, label %126

112:                                              ; preds = %107
  %113 = zext nneg i32 %105 to i64
  %114 = zext nneg i32 %103 to i64
  %115 = getelementptr inbounds [105 x [105 x i32]], ptr @map2, i64 0, i64 %113, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !14
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %118, label %126

118:                                              ; preds = %112
  %119 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %113, i64 %114
  %120 = load i8, ptr %119, align 1, !tbaa !13
  %121 = icmp eq i8 %120, 88
  br i1 %121, label %126, label %122

122:                                              ; preds = %118
  store i32 1, ptr %115, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 20012, ptr nonnull %5) #9
  store i32 %103, ptr %12, align 4, !tbaa !10
  store i32 %105, ptr %13, align 4, !tbaa !11
  br i1 %92, label %.preheader.preheader, label %._crit_edge

.preheader.preheader:                             ; preds = %122
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %5, ptr nonnull align 4 %3, i64 %101, i1 false), !tbaa !14
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader.preheader, %122
  store i32 4, ptr %94, align 4, !tbaa !14
  store i32 %21, ptr %95, align 4, !tbaa !14
  store i32 %22, ptr %96, align 4, !tbaa !14
  store i32 %103, ptr %97, align 4, !tbaa !14
  store i32 %105, ptr %98, align 4, !tbaa !14
  store i32 %99, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(20012) %5)
          to label %123 unwind label %124

123:                                              ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %5) #9
  br label %126

124:                                              ; preds = %._crit_edge.3, %._crit_edge.2, %._crit_edge.1, %._crit_edge
  %125 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %5) #9
  br label %199

126:                                              ; preds = %90, %107, %112, %123, %118
  %127 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 8), align 8, !tbaa !14
  %128 = add nsw i32 %127, %21
  %129 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 12), align 4, !tbaa !14
  %130 = add nsw i32 %129, %22
  %131 = icmp sgt i32 %128, -1
  br i1 %131, label %132, label %150

132:                                              ; preds = %126
  %133 = load i32, ptr @m, align 4, !tbaa !14
  %134 = icmp slt i32 %128, %133
  %135 = icmp sgt i32 %130, -1
  %or.cond.1 = select i1 %134, i1 %135, i1 false
  %136 = load i32, ptr @n, align 4
  %137 = icmp slt i32 %130, %136
  %or.cond98.1 = select i1 %or.cond.1, i1 %137, i1 false
  br i1 %or.cond98.1, label %138, label %150

138:                                              ; preds = %132
  %139 = zext nneg i32 %130 to i64
  %140 = zext nneg i32 %128 to i64
  %141 = getelementptr inbounds [105 x [105 x i32]], ptr @map2, i64 0, i64 %139, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !14
  %143 = icmp eq i32 %142, 0
  br i1 %143, label %144, label %150

144:                                              ; preds = %138
  %145 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %139, i64 %140
  %146 = load i8, ptr %145, align 1, !tbaa !13
  %147 = icmp eq i8 %146, 88
  br i1 %147, label %150, label %148

148:                                              ; preds = %144
  store i32 1, ptr %141, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 20012, ptr nonnull %5) #9
  store i32 %128, ptr %12, align 4, !tbaa !10
  store i32 %130, ptr %13, align 4, !tbaa !11
  br i1 %92, label %.preheader.preheader.1, label %._crit_edge.1

.preheader.preheader.1:                           ; preds = %148
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %5, ptr nonnull align 4 %3, i64 %101, i1 false), !tbaa !14
  br label %._crit_edge.1

._crit_edge.1:                                    ; preds = %.preheader.preheader.1, %148
  store i32 4, ptr %94, align 4, !tbaa !14
  store i32 %21, ptr %95, align 4, !tbaa !14
  store i32 %22, ptr %96, align 4, !tbaa !14
  store i32 %128, ptr %97, align 4, !tbaa !14
  store i32 %130, ptr %98, align 4, !tbaa !14
  store i32 %99, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(20012) %5)
          to label %149 unwind label %124

149:                                              ; preds = %._crit_edge.1
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %5) #9
  br label %150

150:                                              ; preds = %149, %144, %138, %132, %126
  %151 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 16), align 16, !tbaa !14
  %152 = add nsw i32 %151, %21
  %153 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 20), align 4, !tbaa !14
  %154 = add nsw i32 %153, %22
  %155 = icmp sgt i32 %152, -1
  br i1 %155, label %156, label %174

156:                                              ; preds = %150
  %157 = load i32, ptr @m, align 4, !tbaa !14
  %158 = icmp slt i32 %152, %157
  %159 = icmp sgt i32 %154, -1
  %or.cond.2 = select i1 %158, i1 %159, i1 false
  %160 = load i32, ptr @n, align 4
  %161 = icmp slt i32 %154, %160
  %or.cond98.2 = select i1 %or.cond.2, i1 %161, i1 false
  br i1 %or.cond98.2, label %162, label %174

162:                                              ; preds = %156
  %163 = zext nneg i32 %154 to i64
  %164 = zext nneg i32 %152 to i64
  %165 = getelementptr inbounds [105 x [105 x i32]], ptr @map2, i64 0, i64 %163, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !14
  %167 = icmp eq i32 %166, 0
  br i1 %167, label %168, label %174

168:                                              ; preds = %162
  %169 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %163, i64 %164
  %170 = load i8, ptr %169, align 1, !tbaa !13
  %171 = icmp eq i8 %170, 88
  br i1 %171, label %174, label %172

172:                                              ; preds = %168
  store i32 1, ptr %165, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 20012, ptr nonnull %5) #9
  store i32 %152, ptr %12, align 4, !tbaa !10
  store i32 %154, ptr %13, align 4, !tbaa !11
  br i1 %92, label %.preheader.preheader.2, label %._crit_edge.2

.preheader.preheader.2:                           ; preds = %172
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %5, ptr nonnull align 4 %3, i64 %101, i1 false), !tbaa !14
  br label %._crit_edge.2

._crit_edge.2:                                    ; preds = %.preheader.preheader.2, %172
  store i32 4, ptr %94, align 4, !tbaa !14
  store i32 %21, ptr %95, align 4, !tbaa !14
  store i32 %22, ptr %96, align 4, !tbaa !14
  store i32 %152, ptr %97, align 4, !tbaa !14
  store i32 %154, ptr %98, align 4, !tbaa !14
  store i32 %99, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(20012) %5)
          to label %173 unwind label %124

173:                                              ; preds = %._crit_edge.2
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %5) #9
  br label %174

174:                                              ; preds = %173, %168, %162, %156, %150
  %175 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 24), align 8, !tbaa !14
  %176 = add nsw i32 %175, %21
  %177 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 28), align 4, !tbaa !14
  %178 = add nsw i32 %177, %22
  %179 = icmp sgt i32 %176, -1
  br i1 %179, label %180, label %.loopexit

180:                                              ; preds = %174
  %181 = load i32, ptr @m, align 4, !tbaa !14
  %182 = icmp slt i32 %176, %181
  %183 = icmp sgt i32 %178, -1
  %or.cond.3 = select i1 %182, i1 %183, i1 false
  %184 = load i32, ptr @n, align 4
  %185 = icmp slt i32 %178, %184
  %or.cond98.3 = select i1 %or.cond.3, i1 %185, i1 false
  br i1 %or.cond98.3, label %186, label %.loopexit

186:                                              ; preds = %180
  %187 = zext nneg i32 %178 to i64
  %188 = zext nneg i32 %176 to i64
  %189 = getelementptr inbounds [105 x [105 x i32]], ptr @map2, i64 0, i64 %187, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !14
  %191 = icmp eq i32 %190, 0
  br i1 %191, label %192, label %.loopexit

192:                                              ; preds = %186
  %193 = getelementptr inbounds [105 x [105 x i8]], ptr @Map, i64 0, i64 %187, i64 %188
  %194 = load i8, ptr %193, align 1, !tbaa !13
  %195 = icmp eq i8 %194, 88
  br i1 %195, label %.loopexit, label %196

196:                                              ; preds = %192
  store i32 1, ptr %189, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 20012, ptr nonnull %5) #9
  store i32 %176, ptr %12, align 4, !tbaa !10
  store i32 %178, ptr %13, align 4, !tbaa !11
  br i1 %92, label %.preheader.preheader.3, label %._crit_edge.3

.preheader.preheader.3:                           ; preds = %196
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %5, ptr nonnull align 4 %3, i64 %101, i1 false), !tbaa !14
  br label %._crit_edge.3

._crit_edge.3:                                    ; preds = %.preheader.preheader.3, %196
  store i32 4, ptr %94, align 4, !tbaa !14
  store i32 %21, ptr %95, align 4, !tbaa !14
  store i32 %22, ptr %96, align 4, !tbaa !14
  store i32 %176, ptr %97, align 4, !tbaa !14
  store i32 %178, ptr %98, align 4, !tbaa !14
  store i32 %99, ptr %15, align 4, !tbaa !5
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(20012) %5)
          to label %197 unwind label %124

197:                                              ; preds = %._crit_edge.3
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %5) #9
  br label %.loopexit

.loopexit:                                        ; preds = %174, %180, %186, %192, %197, %87
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %3) #9
  %198 = call noundef zeroext i1 @_ZNKSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %198, label %._crit_edge108, label %19, !llvm.loop !17

199:                                              ; preds = %55, %57, %124, %88
  %.pn.pn = phi { ptr, i32 } [ %89, %88 ], [ %125, %124 ], [ %58, %57 ], [ %56, %55 ]
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %3) #9
  br label %204

._crit_edge108:                                   ; preds = %.loopexit, %.preheader100
  %200 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
          to label %201 unwind label %39

201:                                              ; preds = %._crit_edge108
  %202 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %200, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %203 unwind label %39

.critedge:                                        ; preds = %38
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %3) #9
  br label %203

203:                                              ; preds = %201, %.critedge
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %2) #9
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #9
  ret void

204:                                              ; preds = %199, %39
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %199 ], [ %40, %39 ]
  call void @llvm.lifetime.end.p0(i64 20012, ptr nonnull %2) #9
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #9
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(20012) ptr @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 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) #3

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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

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


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