; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ/1728.ll (Z3bfs4nodeS_)

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

%struct.node = type { i32, i32, i32, i32 }
%"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 }

@k = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@map = external dso_local global [1110 x [1110 x i8]], align 16
@mark = external dso_local global [1110 x [1110 x i8]], align 16
@dir = external dso_local global [4 x [2 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3bfs4nodeS_(i64 %0, i64 %1, i64 %2, i64 %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca %struct.node, align 4
  %7 = alloca %struct.node, align 4
  %8 = alloca %"class.std::queue", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.node, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.node, align 4
  %15 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 0
  store i64 %0, ptr %15, align 4
  %16 = getelementptr inbounds { i64, i64 }, ptr %6, i32 0, i32 1
  store i64 %1, ptr %16, align 4
  %17 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 0
  store i64 %2, ptr %17, align 4
  %18 = getelementptr inbounds { i64, i64 }, ptr %7, i32 0, i32 1
  store i64 %3, ptr %18, align 4
  %19 = getelementptr inbounds %struct.node, ptr %6, i32 0, i32 2
  store i32 0, ptr %19, align 4, !tbaa !5
  %20 = getelementptr inbounds %struct.node, ptr %6, i32 0, i32 3
  store i32 -1, ptr %20, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #5
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  %21 = getelementptr inbounds %struct.node, ptr %6, i32 0, i32 1
  %22 = load i32, ptr %21, align 4, !tbaa !11
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %23
  %25 = getelementptr inbounds %struct.node, ptr %6, i32 0, i32 0
  %26 = load i32, ptr %25, align 4, !tbaa !12
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [1110 x i8], ptr %24, i64 0, i64 %27
  store i8 0, ptr %28, align 1, !tbaa !13
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(16) %6)
          to label %29 unwind label %55

29:                                               ; preds = %4
  br label %30

30:                                               ; preds = %202, %29
  %31 = invoke noundef zeroext i1 @_ZNKSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %32 unwind label %55

32:                                               ; preds = %30
  %33 = xor i1 %31, true
  br i1 %33, label %34, label %204

34:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %35 = invoke noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %36 unwind label %59

36:                                               ; preds = %34
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %35, i64 16, i1 false), !tbaa.struct !14
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %37 unwind label %59

37:                                               ; preds = %36
  %38 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 0
  %39 = load i32, ptr %38, align 4, !tbaa !12
  %40 = getelementptr inbounds %struct.node, ptr %7, i32 0, i32 0
  %41 = load i32, ptr %40, align 4, !tbaa !12
  %42 = icmp eq i32 %39, %41
  br i1 %42, label %43, label %63

43:                                               ; preds = %37
  %44 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 1
  %45 = load i32, ptr %44, align 4, !tbaa !11
  %46 = getelementptr inbounds %struct.node, ptr %7, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !11
  %48 = icmp eq i32 %45, %47
  br i1 %48, label %49, label %63

49:                                               ; preds = %43
  %50 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 2
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr @k, align 4, !tbaa !15
  %53 = icmp sle i32 %51, %52
  br i1 %53, label %54, label %63

54:                                               ; preds = %49
  store i32 1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %200

55:                                               ; preds = %30, %4
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %10, align 4
  br label %207

59:                                               ; preds = %36, %34
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %9, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %10, align 4
  br label %203

63:                                               ; preds = %49, %43, %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !15
  br label %64

64:                                               ; preds = %194, %63
  %65 = load i32, ptr %13, align 4, !tbaa !15
  %66 = icmp slt i32 %65, 4
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  store i32 4, ptr %12, align 4
  br label %197

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  %69 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 0
  %70 = load i32, ptr %69, align 4, !tbaa !12
  %71 = load i32, ptr %13, align 4, !tbaa !15
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [4 x [2 x i32]], ptr @dir, i64 0, i64 %72
  %74 = getelementptr inbounds [2 x i32], ptr %73, i64 0, i64 0
  %75 = load i32, ptr %74, align 8, !tbaa !15
  %76 = add nsw i32 %70, %75
  %77 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 0
  store i32 %76, ptr %77, align 4, !tbaa !12
  %78 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 1
  %79 = load i32, ptr %78, align 4, !tbaa !11
  %80 = load i32, ptr %13, align 4, !tbaa !15
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [4 x [2 x i32]], ptr @dir, i64 0, i64 %81
  %83 = getelementptr inbounds [2 x i32], ptr %82, i64 0, i64 1
  %84 = load i32, ptr %83, align 4, !tbaa !15
  %85 = add nsw i32 %79, %84
  %86 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 1
  store i32 %85, ptr %86, align 4, !tbaa !11
  %87 = load i32, ptr %13, align 4, !tbaa !15
  %88 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 3
  store i32 %87, ptr %88, align 4, !tbaa !10
  %89 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 3
  %90 = load i32, ptr %89, align 4, !tbaa !10
  %91 = icmp eq i32 %90, -1
  br i1 %91, label %92, label %94

92:                                               ; preds = %68
  %93 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 2
  store i32 0, ptr %93, align 4, !tbaa !5
  br label %110

94:                                               ; preds = %68
  %95 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 3
  %96 = load i32, ptr %95, align 4, !tbaa !10
  %97 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 3
  %98 = load i32, ptr %97, align 4, !tbaa !10
  %99 = icmp eq i32 %96, %98
  br i1 %99, label %100, label %104

100:                                              ; preds = %94
  %101 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 2
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 2
  store i32 %102, ptr %103, align 4, !tbaa !5
  br label %109

104:                                              ; preds = %94
  %105 = getelementptr inbounds %struct.node, ptr %11, i32 0, i32 2
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  %108 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 2
  store i32 %107, ptr %108, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %104, %100
  br label %110

110:                                              ; preds = %109, %92
  %111 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 0
  %112 = load i32, ptr %111, align 4, !tbaa !12
  %113 = icmp sge i32 %112, 1
  br i1 %113, label %114, label %190

114:                                              ; preds = %110
  %115 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !11
  %117 = icmp sge i32 %116, 1
  br i1 %117, label %118, label %190

118:                                              ; preds = %114
  %119 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 0
  %120 = load i32, ptr %119, align 4, !tbaa !12
  %121 = load i32, ptr @n, align 4, !tbaa !15
  %122 = icmp sle i32 %120, %121
  br i1 %122, label %123, label %190

123:                                              ; preds = %118
  %124 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !11
  %126 = load i32, ptr @m, align 4, !tbaa !15
  %127 = icmp sle i32 %125, %126
  br i1 %127, label %128, label %190

128:                                              ; preds = %123
  %129 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 2
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = load i32, ptr @k, align 4, !tbaa !15
  %132 = icmp sle i32 %130, %131
  br i1 %132, label %133, label %190

133:                                              ; preds = %128
  %134 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 2
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 1
  %137 = load i32, ptr %136, align 4, !tbaa !11
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %138
  %140 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 0
  %141 = load i32, ptr %140, align 4, !tbaa !12
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [1110 x i8], ptr %139, i64 0, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !13
  %145 = sext i8 %144 to i32
  %146 = icmp sle i32 %135, %145
  br i1 %146, label %147, label %190

147:                                              ; preds = %133
  %148 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 0
  %149 = load i32, ptr %148, align 4, !tbaa !12
  %150 = getelementptr inbounds %struct.node, ptr %7, i32 0, i32 0
  %151 = load i32, ptr %150, align 4, !tbaa !12
  %152 = icmp eq i32 %149, %151
  br i1 %152, label %153, label %160

153:                                              ; preds = %147
  %154 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 1
  %155 = load i32, ptr %154, align 4, !tbaa !11
  %156 = getelementptr inbounds %struct.node, ptr %7, i32 0, i32 1
  %157 = load i32, ptr %156, align 4, !tbaa !11
  %158 = icmp eq i32 %155, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %153
  store i32 1, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %191

160:                                              ; preds = %153, %147
  %161 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !11
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [1110 x [1110 x i8]], ptr @map, i64 0, i64 %163
  %165 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 0
  %166 = load i32, ptr %165, align 4, !tbaa !12
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [1110 x i8], ptr %164, i64 0, i64 %167
  %169 = load i8, ptr %168, align 1, !tbaa !13
  %170 = sext i8 %169 to i32
  %171 = icmp eq i32 %170, 46
  br i1 %171, label %172, label %189

172:                                              ; preds = %160
  %173 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 2
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = trunc i32 %174 to i8
  %176 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 1
  %177 = load i32, ptr %176, align 4, !tbaa !11
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %178
  %180 = getelementptr inbounds %struct.node, ptr %14, i32 0, i32 0
  %181 = load i32, ptr %180, align 4, !tbaa !12
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [1110 x i8], ptr %179, i64 0, i64 %182
  store i8 %175, ptr %183, align 1, !tbaa !13
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(16) %14)
          to label %184 unwind label %185

184:                                              ; preds = %172
  br label %189

185:                                              ; preds = %172
  %186 = landingpad { ptr, i32 }
          cleanup
  %187 = extractvalue { ptr, i32 } %186, 0
  store ptr %187, ptr %9, align 8
  %188 = extractvalue { ptr, i32 } %186, 1
  store i32 %188, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %203

189:                                              ; preds = %184, %160
  br label %190

190:                                              ; preds = %189, %133, %128, %123, %118, %114, %110
  store i32 0, ptr %12, align 4
  br label %191

191:                                              ; preds = %190, %159
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  %192 = load i32, ptr %12, align 4
  switch i32 %192, label %197 [
    i32 0, label %193
  ]

193:                                              ; preds = %191
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %13, align 4, !tbaa !15
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %13, align 4, !tbaa !15
  br label %64, !llvm.loop !16

197:                                              ; preds = %191, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %198 = load i32, ptr %12, align 4
  switch i32 %198, label %200 [
    i32 4, label %199
  ]

199:                                              ; preds = %197
  store i32 0, ptr %12, align 4
  br label %200

200:                                              ; preds = %199, %197, %54
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  %201 = load i32, ptr %12, align 4
  switch i32 %201, label %205 [
    i32 0, label %202
  ]

202:                                              ; preds = %200
  br label %30, !llvm.loop !18

203:                                              ; preds = %185, %59
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  br label %207

204:                                              ; preds = %32
  store i32 0, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %205

205:                                              ; preds = %204, %200
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #5
  %206 = load i32, ptr %5, align 4
  ret i32 %206

207:                                              ; preds = %203, %55
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #5
  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: 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(16)) #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(16) 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

; 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 #4 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


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

%struct.node = type { i32, i32, i32, i32 }
%"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 }

@k = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local local_unnamed_addr global i32, align 4
@map = external dso_local local_unnamed_addr global [1110 x [1110 x i8]], align 16
@mark = external dso_local local_unnamed_addr global [1110 x [1110 x i8]], align 16
@dir = external dso_local local_unnamed_addr global [4 x [2 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z3bfs4nodeS_(i64 %0, i64 %1, i64 %2, i64 %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.node, align 8
  %6 = alloca %"class.std::queue", align 8
  %7 = alloca %struct.node, align 4
  store i64 %0, ptr %5, align 8
  %8 = getelementptr inbounds i8, ptr %5, i64 8
  %.sroa.018.0.extract.trunc = trunc i64 %2 to i32
  %.sroa.3.0.extract.shift = lshr i64 %2, 32
  %.sroa.3.0.extract.trunc = trunc nuw i64 %.sroa.3.0.extract.shift to i32
  store i32 0, ptr %8, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %5, i64 12
  store i32 -1, ptr %9, align 4, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #4
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %10 = ashr i64 %0, 32
  %sext = shl i64 %0, 32
  %11 = ashr exact i64 %sext, 32
  %12 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %10, i64 %11
  store i8 0, ptr %12, align 1, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(16) %5)
          to label %.preheader49 unwind label %112

.preheader49:                                     ; preds = %4
  %13 = call noundef zeroext i1 @_ZNKSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br i1 %13, label %.thread, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader49
  %14 = getelementptr inbounds i8, ptr %7, i64 4
  %15 = getelementptr inbounds i8, ptr %7, i64 12
  %16 = getelementptr inbounds i8, ptr %7, i64 8
  br label %18

.loopexit:                                        ; preds = %.loopexit.loopexit54, %.loopexit.loopexit
  %17 = call noundef zeroext i1 @_ZNKSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br i1 %17, label %.thread, label %18, !llvm.loop !12

18:                                               ; preds = %.lr.ph, %.loopexit
  %19 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %.sroa.0.0.copyload = load i32, ptr %19, align 4, !tbaa !14
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 4
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !14
  %.sroa.8.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 8
  %.sroa.8.0.copyload = load i32, ptr %.sroa.8.0..sroa_idx, align 4, !tbaa !14
  %.sroa.11.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 12
  %.sroa.11.0.copyload = load i32, ptr %.sroa.11.0..sroa_idx, align 4, !tbaa !14
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  %20 = icmp ne i32 %.sroa.0.0.copyload, %.sroa.018.0.extract.trunc
  %21 = icmp ne i32 %.sroa.6.0.copyload, %.sroa.3.0.extract.trunc
  %or.cond36.not45 = select i1 %20, i1 true, i1 %21
  %22 = load i32, ptr @k, align 4
  %.not = icmp sgt i32 %.sroa.8.0.copyload, %22
  %or.cond37 = select i1 %or.cond36.not45, i1 true, i1 %.not
  br i1 %or.cond37, label %.preheader, label %.thread

.preheader:                                       ; preds = %18
  %23 = add nsw i32 %.sroa.8.0.copyload, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %24 = load i32, ptr @dir, align 16, !tbaa !14
  %25 = add nsw i32 %24, %.sroa.0.0.copyload
  store i32 %25, ptr %7, align 4, !tbaa !15
  %26 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 4), align 4, !tbaa !14
  %27 = add nsw i32 %26, %.sroa.6.0.copyload
  store i32 %27, ptr %14, align 4, !tbaa !16
  store i32 0, ptr %15, align 4, !tbaa !10
  switch i32 %.sroa.11.0.copyload, label %114 [
    i32 -1, label %.preheader.split.us.preheader
    i32 0, label %115
  ]

.preheader.split.us.preheader:                    ; preds = %.preheader
  store i32 0, ptr %16, align 4, !tbaa !5
  %28 = icmp slt i32 %25, 1
  %29 = icmp slt i32 %27, 1
  %or.cond.not48.us = select i1 %28, i1 true, i1 %29
  %30 = load i32, ptr @n, align 4
  %.not31.us = icmp sgt i32 %25, %30
  %or.cond38.us = select i1 %or.cond.not48.us, i1 true, i1 %.not31.us
  %31 = load i32, ptr @m, align 4
  %.not32.us = icmp sgt i32 %27, %31
  %or.cond39.us = select i1 %or.cond38.us, i1 true, i1 %.not32.us
  %.not33.us = icmp slt i32 %22, 0
  %or.cond = select i1 %or.cond39.us, i1 true, i1 %.not33.us
  br i1 %or.cond, label %.preheader.split.us.1, label %32

32:                                               ; preds = %.preheader.split.us.preheader
  %33 = zext nneg i32 %27 to i64
  %34 = zext nneg i32 %25 to i64
  %35 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %33, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %.not34.us = icmp slt i8 %36, 0
  br i1 %.not34.us, label %.preheader.split.us.1, label %37

37:                                               ; preds = %32
  %38 = icmp eq i32 %25, %.sroa.018.0.extract.trunc
  %39 = icmp eq i32 %27, %.sroa.3.0.extract.trunc
  %or.cond40.us = select i1 %38, i1 %39, i1 false
  br i1 %or.cond40.us, label %.critedge, label %40

40:                                               ; preds = %37
  %41 = getelementptr inbounds [1110 x [1110 x i8]], ptr @map, i64 0, i64 %33, i64 %34
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = icmp eq i8 %42, 46
  br i1 %43, label %44, label %.preheader.split.us.1

44:                                               ; preds = %40
  store i8 0, ptr %35, align 1, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %..preheader.split.us.1_crit_edge unwind label %.split.us

..preheader.split.us.1_crit_edge:                 ; preds = %44
  %.pre = load i32, ptr @n, align 4
  %.pre57 = load i32, ptr @m, align 4
  br label %.preheader.split.us.1

.preheader.split.us.1:                            ; preds = %..preheader.split.us.1_crit_edge, %40, %32, %.preheader.split.us.preheader
  %45 = phi i32 [ %.pre57, %..preheader.split.us.1_crit_edge ], [ %31, %40 ], [ %31, %32 ], [ %31, %.preheader.split.us.preheader ]
  %46 = phi i32 [ %.pre, %..preheader.split.us.1_crit_edge ], [ %30, %40 ], [ %30, %32 ], [ %30, %.preheader.split.us.preheader ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 8), align 8, !tbaa !14
  %48 = add nsw i32 %47, %.sroa.0.0.copyload
  store i32 %48, ptr %7, align 4, !tbaa !15
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 12), align 4, !tbaa !14
  %50 = add nsw i32 %49, %.sroa.6.0.copyload
  store i32 %50, ptr %14, align 4, !tbaa !16
  store i32 1, ptr %15, align 4, !tbaa !10
  store i32 0, ptr %16, align 4, !tbaa !5
  %51 = icmp slt i32 %48, 1
  %52 = icmp slt i32 %50, 1
  %or.cond.not48.us.1 = select i1 %51, i1 true, i1 %52
  %.not31.us.1 = icmp sgt i32 %48, %46
  %or.cond38.us.1 = select i1 %or.cond.not48.us.1, i1 true, i1 %.not31.us.1
  %.not32.us.1 = icmp sgt i32 %50, %45
  %or.cond39.us.1 = select i1 %or.cond38.us.1, i1 true, i1 %.not32.us.1
  %53 = load i32, ptr @k, align 4
  %.not33.us.1 = icmp slt i32 %53, 0
  %or.cond65 = select i1 %or.cond39.us.1, i1 true, i1 %.not33.us.1
  br i1 %or.cond65, label %.preheader.split.us.2, label %54

54:                                               ; preds = %.preheader.split.us.1
  %55 = zext nneg i32 %50 to i64
  %56 = zext nneg i32 %48 to i64
  %57 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %55, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !11
  %.not34.us.1 = icmp slt i8 %58, 0
  br i1 %.not34.us.1, label %.preheader.split.us.2, label %59

59:                                               ; preds = %54
  %60 = icmp eq i32 %48, %.sroa.018.0.extract.trunc
  %61 = icmp eq i32 %50, %.sroa.3.0.extract.trunc
  %or.cond40.us.1 = select i1 %60, i1 %61, i1 false
  br i1 %or.cond40.us.1, label %.critedge, label %62

62:                                               ; preds = %59
  %63 = getelementptr inbounds [1110 x [1110 x i8]], ptr @map, i64 0, i64 %55, i64 %56
  %64 = load i8, ptr %63, align 1, !tbaa !11
  %65 = icmp eq i8 %64, 46
  br i1 %65, label %66, label %.preheader.split.us.2

66:                                               ; preds = %62
  store i8 0, ptr %57, align 1, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %..preheader.split.us.2_crit_edge unwind label %.split.us

..preheader.split.us.2_crit_edge:                 ; preds = %66
  %.pre58 = load i32, ptr @n, align 4
  %.pre59 = load i32, ptr @m, align 4
  br label %.preheader.split.us.2

.preheader.split.us.2:                            ; preds = %..preheader.split.us.2_crit_edge, %62, %54, %.preheader.split.us.1
  %67 = phi i32 [ %.pre59, %..preheader.split.us.2_crit_edge ], [ %45, %62 ], [ %45, %54 ], [ %45, %.preheader.split.us.1 ]
  %68 = phi i32 [ %.pre58, %..preheader.split.us.2_crit_edge ], [ %46, %62 ], [ %46, %54 ], [ %46, %.preheader.split.us.1 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 16), align 16, !tbaa !14
  %70 = add nsw i32 %69, %.sroa.0.0.copyload
  store i32 %70, ptr %7, align 4, !tbaa !15
  %71 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 20), align 4, !tbaa !14
  %72 = add nsw i32 %71, %.sroa.6.0.copyload
  store i32 %72, ptr %14, align 4, !tbaa !16
  store i32 2, ptr %15, align 4, !tbaa !10
  store i32 0, ptr %16, align 4, !tbaa !5
  %73 = icmp slt i32 %70, 1
  %74 = icmp slt i32 %72, 1
  %or.cond.not48.us.2 = select i1 %73, i1 true, i1 %74
  %.not31.us.2 = icmp sgt i32 %70, %68
  %or.cond38.us.2 = select i1 %or.cond.not48.us.2, i1 true, i1 %.not31.us.2
  %.not32.us.2 = icmp sgt i32 %72, %67
  %or.cond39.us.2 = select i1 %or.cond38.us.2, i1 true, i1 %.not32.us.2
  %75 = load i32, ptr @k, align 4
  %.not33.us.2 = icmp slt i32 %75, 0
  %or.cond66 = select i1 %or.cond39.us.2, i1 true, i1 %.not33.us.2
  br i1 %or.cond66, label %.preheader.split.us.3, label %76

76:                                               ; preds = %.preheader.split.us.2
  %77 = zext nneg i32 %72 to i64
  %78 = zext nneg i32 %70 to i64
  %79 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %77, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !11
  %.not34.us.2 = icmp slt i8 %80, 0
  br i1 %.not34.us.2, label %.preheader.split.us.3, label %81

81:                                               ; preds = %76
  %82 = icmp eq i32 %70, %.sroa.018.0.extract.trunc
  %83 = icmp eq i32 %72, %.sroa.3.0.extract.trunc
  %or.cond40.us.2 = select i1 %82, i1 %83, i1 false
  br i1 %or.cond40.us.2, label %.critedge, label %84

84:                                               ; preds = %81
  %85 = getelementptr inbounds [1110 x [1110 x i8]], ptr @map, i64 0, i64 %77, i64 %78
  %86 = load i8, ptr %85, align 1, !tbaa !11
  %87 = icmp eq i8 %86, 46
  br i1 %87, label %88, label %.preheader.split.us.3

88:                                               ; preds = %84
  store i8 0, ptr %79, align 1, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %..preheader.split.us.3_crit_edge unwind label %.split.us

..preheader.split.us.3_crit_edge:                 ; preds = %88
  %.pre60 = load i32, ptr @n, align 4
  %.pre61 = load i32, ptr @m, align 4
  br label %.preheader.split.us.3

.preheader.split.us.3:                            ; preds = %..preheader.split.us.3_crit_edge, %84, %76, %.preheader.split.us.2
  %89 = phi i32 [ %.pre61, %..preheader.split.us.3_crit_edge ], [ %67, %84 ], [ %67, %76 ], [ %67, %.preheader.split.us.2 ]
  %90 = phi i32 [ %.pre60, %..preheader.split.us.3_crit_edge ], [ %68, %84 ], [ %68, %76 ], [ %68, %.preheader.split.us.2 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %91 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 24), align 8, !tbaa !14
  %92 = add nsw i32 %91, %.sroa.0.0.copyload
  store i32 %92, ptr %7, align 4, !tbaa !15
  %93 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 28), align 4, !tbaa !14
  %94 = add nsw i32 %93, %.sroa.6.0.copyload
  store i32 %94, ptr %14, align 4, !tbaa !16
  store i32 3, ptr %15, align 4, !tbaa !10
  store i32 0, ptr %16, align 4, !tbaa !5
  %95 = icmp slt i32 %92, 1
  %96 = icmp slt i32 %94, 1
  %or.cond.not48.us.3 = select i1 %95, i1 true, i1 %96
  %.not31.us.3 = icmp sgt i32 %92, %90
  %or.cond38.us.3 = select i1 %or.cond.not48.us.3, i1 true, i1 %.not31.us.3
  %.not32.us.3 = icmp sgt i32 %94, %89
  %or.cond39.us.3 = select i1 %or.cond38.us.3, i1 true, i1 %.not32.us.3
  %97 = load i32, ptr @k, align 4
  %.not33.us.3 = icmp slt i32 %97, 0
  %or.cond67 = select i1 %or.cond39.us.3, i1 true, i1 %.not33.us.3
  br i1 %or.cond67, label %.loopexit.loopexit, label %98

98:                                               ; preds = %.preheader.split.us.3
  %99 = zext nneg i32 %94 to i64
  %100 = zext nneg i32 %92 to i64
  %101 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %99, i64 %100
  %102 = load i8, ptr %101, align 1, !tbaa !11
  %.not34.us.3 = icmp slt i8 %102, 0
  br i1 %.not34.us.3, label %.loopexit.loopexit, label %103

103:                                              ; preds = %98
  %104 = icmp eq i32 %92, %.sroa.018.0.extract.trunc
  %105 = icmp eq i32 %94, %.sroa.3.0.extract.trunc
  %or.cond40.us.3 = select i1 %104, i1 %105, i1 false
  br i1 %or.cond40.us.3, label %.critedge, label %106

106:                                              ; preds = %103
  %107 = getelementptr inbounds [1110 x [1110 x i8]], ptr @map, i64 0, i64 %99, i64 %100
  %108 = load i8, ptr %107, align 1, !tbaa !11
  %109 = icmp eq i8 %108, 46
  br i1 %109, label %110, label %.loopexit.loopexit

110:                                              ; preds = %106
  store i8 0, ptr %101, align 1, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %.loopexit.loopexit unwind label %.split.us

.loopexit.loopexit:                               ; preds = %110, %106, %98, %.preheader.split.us.3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %.loopexit

.split.us:                                        ; preds = %110, %88, %66, %44
  %111 = landingpad { ptr, i32 }
          cleanup
  br label %136

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

114:                                              ; preds = %.preheader
  br label %115

115:                                              ; preds = %.preheader, %114
  %storemerge = phi i32 [ %23, %114 ], [ %.sroa.8.0.copyload, %.preheader ]
  store i32 %storemerge, ptr %16, align 4, !tbaa !5
  %116 = icmp slt i32 %25, 1
  %117 = icmp slt i32 %27, 1
  %or.cond.not48 = select i1 %116, i1 true, i1 %117
  %118 = load i32, ptr @n, align 4
  %.not31 = icmp sgt i32 %25, %118
  %or.cond38 = select i1 %or.cond.not48, i1 true, i1 %.not31
  %119 = load i32, ptr @m, align 4
  %.not32 = icmp sgt i32 %27, %119
  %or.cond39 = select i1 %or.cond38, i1 true, i1 %.not32
  %.not33 = icmp sgt i32 %storemerge, %22
  %or.cond68 = select i1 %or.cond39, i1 true, i1 %.not33
  br i1 %or.cond68, label %.preheader.split.1, label %120

120:                                              ; preds = %115
  %121 = zext nneg i32 %27 to i64
  %122 = zext nneg i32 %25 to i64
  %123 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %121, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !11
  %125 = sext i8 %124 to i32
  %.not34 = icmp sgt i32 %storemerge, %125
  br i1 %.not34, label %.preheader.split.1, label %126

126:                                              ; preds = %120
  %127 = icmp eq i32 %25, %.sroa.018.0.extract.trunc
  %128 = icmp eq i32 %27, %.sroa.3.0.extract.trunc
  %or.cond40 = select i1 %127, i1 %128, i1 false
  br i1 %or.cond40, label %.critedge, label %129

129:                                              ; preds = %126
  %130 = getelementptr inbounds [1110 x [1110 x i8]], ptr @map, i64 0, i64 %121, i64 %122
  %131 = load i8, ptr %130, align 1, !tbaa !11
  %132 = icmp eq i8 %131, 46
  br i1 %132, label %133, label %.preheader.split.1

133:                                              ; preds = %129
  %134 = trunc i32 %storemerge to i8
  store i8 %134, ptr %123, align 1, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %.preheader.split.1 unwind label %.split

.split:                                           ; preds = %210, %185, %160, %133
  %135 = landingpad { ptr, i32 }
          cleanup
  br label %136

136:                                              ; preds = %.split.us, %.split
  %.us-phi = phi { ptr, i32 } [ %135, %.split ], [ %111, %.split.us ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %212

.preheader.split.1:                               ; preds = %115, %120, %133, %129
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %137 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 8), align 8, !tbaa !14
  %138 = add nsw i32 %137, %.sroa.0.0.copyload
  store i32 %138, ptr %7, align 4, !tbaa !15
  %139 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 12), align 4, !tbaa !14
  %140 = add nsw i32 %139, %.sroa.6.0.copyload
  store i32 %140, ptr %14, align 4, !tbaa !16
  store i32 1, ptr %15, align 4, !tbaa !10
  %141 = icmp eq i32 %.sroa.11.0.copyload, 1
  %spec.select = select i1 %141, i32 %.sroa.8.0.copyload, i32 %23
  store i32 %spec.select, ptr %16, align 4, !tbaa !5
  %142 = icmp slt i32 %138, 1
  %143 = icmp slt i32 %140, 1
  %or.cond.not48.1 = select i1 %142, i1 true, i1 %143
  %144 = load i32, ptr @n, align 4
  %.not31.1 = icmp sgt i32 %138, %144
  %or.cond38.1 = select i1 %or.cond.not48.1, i1 true, i1 %.not31.1
  %145 = load i32, ptr @m, align 4
  %.not32.1 = icmp sgt i32 %140, %145
  %or.cond39.1 = select i1 %or.cond38.1, i1 true, i1 %.not32.1
  %146 = load i32, ptr @k, align 4
  %.not33.1 = icmp sgt i32 %spec.select, %146
  %or.cond69 = select i1 %or.cond39.1, i1 true, i1 %.not33.1
  br i1 %or.cond69, label %.preheader.split.2, label %147

147:                                              ; preds = %.preheader.split.1
  %148 = zext nneg i32 %140 to i64
  %149 = zext nneg i32 %138 to i64
  %150 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %148, i64 %149
  %151 = load i8, ptr %150, align 1, !tbaa !11
  %152 = sext i8 %151 to i32
  %.not34.1 = icmp sgt i32 %spec.select, %152
  br i1 %.not34.1, label %.preheader.split.2, label %153

153:                                              ; preds = %147
  %154 = icmp eq i32 %138, %.sroa.018.0.extract.trunc
  %155 = icmp eq i32 %140, %.sroa.3.0.extract.trunc
  %or.cond40.1 = select i1 %154, i1 %155, i1 false
  br i1 %or.cond40.1, label %.critedge, label %156

156:                                              ; preds = %153
  %157 = getelementptr inbounds [1110 x [1110 x i8]], ptr @map, i64 0, i64 %148, i64 %149
  %158 = load i8, ptr %157, align 1, !tbaa !11
  %159 = icmp eq i8 %158, 46
  br i1 %159, label %160, label %.preheader.split.2

160:                                              ; preds = %156
  %161 = trunc i32 %spec.select to i8
  store i8 %161, ptr %150, align 1, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %.preheader.split.2 unwind label %.split

.preheader.split.2:                               ; preds = %160, %156, %147, %.preheader.split.1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %162 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 16), align 16, !tbaa !14
  %163 = add nsw i32 %162, %.sroa.0.0.copyload
  store i32 %163, ptr %7, align 4, !tbaa !15
  %164 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 20), align 4, !tbaa !14
  %165 = add nsw i32 %164, %.sroa.6.0.copyload
  store i32 %165, ptr %14, align 4, !tbaa !16
  store i32 2, ptr %15, align 4, !tbaa !10
  %166 = icmp eq i32 %.sroa.11.0.copyload, 2
  %spec.select70 = select i1 %166, i32 %.sroa.8.0.copyload, i32 %23
  store i32 %spec.select70, ptr %16, align 4, !tbaa !5
  %167 = icmp slt i32 %163, 1
  %168 = icmp slt i32 %165, 1
  %or.cond.not48.2 = select i1 %167, i1 true, i1 %168
  %169 = load i32, ptr @n, align 4
  %.not31.2 = icmp sgt i32 %163, %169
  %or.cond38.2 = select i1 %or.cond.not48.2, i1 true, i1 %.not31.2
  %170 = load i32, ptr @m, align 4
  %.not32.2 = icmp sgt i32 %165, %170
  %or.cond39.2 = select i1 %or.cond38.2, i1 true, i1 %.not32.2
  %171 = load i32, ptr @k, align 4
  %.not33.2 = icmp sgt i32 %spec.select70, %171
  %or.cond71 = select i1 %or.cond39.2, i1 true, i1 %.not33.2
  br i1 %or.cond71, label %.preheader.split.3, label %172

172:                                              ; preds = %.preheader.split.2
  %173 = zext nneg i32 %165 to i64
  %174 = zext nneg i32 %163 to i64
  %175 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %173, i64 %174
  %176 = load i8, ptr %175, align 1, !tbaa !11
  %177 = sext i8 %176 to i32
  %.not34.2 = icmp sgt i32 %spec.select70, %177
  br i1 %.not34.2, label %.preheader.split.3, label %178

178:                                              ; preds = %172
  %179 = icmp eq i32 %163, %.sroa.018.0.extract.trunc
  %180 = icmp eq i32 %165, %.sroa.3.0.extract.trunc
  %or.cond40.2 = select i1 %179, i1 %180, i1 false
  br i1 %or.cond40.2, label %.critedge, label %181

181:                                              ; preds = %178
  %182 = getelementptr inbounds [1110 x [1110 x i8]], ptr @map, i64 0, i64 %173, i64 %174
  %183 = load i8, ptr %182, align 1, !tbaa !11
  %184 = icmp eq i8 %183, 46
  br i1 %184, label %185, label %.preheader.split.3

185:                                              ; preds = %181
  %186 = trunc i32 %spec.select70 to i8
  store i8 %186, ptr %175, align 1, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %.preheader.split.3 unwind label %.split

.preheader.split.3:                               ; preds = %185, %181, %172, %.preheader.split.2
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #4
  %187 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 24), align 8, !tbaa !14
  %188 = add nsw i32 %187, %.sroa.0.0.copyload
  store i32 %188, ptr %7, align 4, !tbaa !15
  %189 = load i32, ptr getelementptr inbounds (i8, ptr @dir, i64 28), align 4, !tbaa !14
  %190 = add nsw i32 %189, %.sroa.6.0.copyload
  store i32 %190, ptr %14, align 4, !tbaa !16
  store i32 3, ptr %15, align 4, !tbaa !10
  %191 = icmp eq i32 %.sroa.11.0.copyload, 3
  %spec.select72 = select i1 %191, i32 %.sroa.8.0.copyload, i32 %23
  store i32 %spec.select72, ptr %16, align 4, !tbaa !5
  %192 = icmp slt i32 %188, 1
  %193 = icmp slt i32 %190, 1
  %or.cond.not48.3 = select i1 %192, i1 true, i1 %193
  %194 = load i32, ptr @n, align 4
  %.not31.3 = icmp sgt i32 %188, %194
  %or.cond38.3 = select i1 %or.cond.not48.3, i1 true, i1 %.not31.3
  %195 = load i32, ptr @m, align 4
  %.not32.3 = icmp sgt i32 %190, %195
  %or.cond39.3 = select i1 %or.cond38.3, i1 true, i1 %.not32.3
  %196 = load i32, ptr @k, align 4
  %.not33.3 = icmp sgt i32 %spec.select72, %196
  %or.cond73 = select i1 %or.cond39.3, i1 true, i1 %.not33.3
  br i1 %or.cond73, label %.loopexit.loopexit54, label %197

197:                                              ; preds = %.preheader.split.3
  %198 = zext nneg i32 %190 to i64
  %199 = zext nneg i32 %188 to i64
  %200 = getelementptr inbounds [1110 x [1110 x i8]], ptr @mark, i64 0, i64 %198, i64 %199
  %201 = load i8, ptr %200, align 1, !tbaa !11
  %202 = sext i8 %201 to i32
  %.not34.3 = icmp sgt i32 %spec.select72, %202
  br i1 %.not34.3, label %.loopexit.loopexit54, label %203

203:                                              ; preds = %197
  %204 = icmp eq i32 %188, %.sroa.018.0.extract.trunc
  %205 = icmp eq i32 %190, %.sroa.3.0.extract.trunc
  %or.cond40.3 = select i1 %204, i1 %205, i1 false
  br i1 %or.cond40.3, label %.critedge, label %206

206:                                              ; preds = %203
  %207 = getelementptr inbounds [1110 x [1110 x i8]], ptr @map, i64 0, i64 %198, i64 %199
  %208 = load i8, ptr %207, align 1, !tbaa !11
  %209 = icmp eq i8 %208, 46
  br i1 %209, label %210, label %.loopexit.loopexit54

210:                                              ; preds = %206
  %211 = trunc i32 %spec.select72 to i8
  store i8 %211, ptr %200, align 1, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(16) %7)
          to label %.loopexit.loopexit54 unwind label %.split

.loopexit.loopexit54:                             ; preds = %210, %206, %197, %.preheader.split.3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %.loopexit

.critedge:                                        ; preds = %126, %153, %178, %203, %37, %59, %81, %103
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #4
  br label %.thread

.thread:                                          ; preds = %.loopexit, %18, %.preheader49, %.critedge
  %.5 = phi i32 [ 1, %.critedge ], [ 0, %.preheader49 ], [ 0, %.loopexit ], [ 1, %18 ]
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #4
  ret i32 %.5

212:                                              ; preds = %136, %112
  %.pn = phi { ptr, i32 } [ %.us-phi, %136 ], [ %113, %112 ]
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #4
  resume { ptr, i32 } %.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(16)) 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(16) ptr @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass