; LLVM IR from upupming/algorithm :: AdvancedLevel_C++/1091. Acute Stroke (30) .ll (Z3bfsiii)

; 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 }
%"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 }

@t = external dso_local global i32, align 4
@X = external dso_local global [6 x i32], align 16
@Y = external dso_local global [6 x i32], align 16
@Z = external dso_local global [6 x i32], align 16
@visit = external dso_local global [1300 x [130 x [80 x i8]]], align 16

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

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

25:                                               ; preds = %3
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [1300 x [130 x [80 x i8]]], ptr @visit, i64 0, i64 %27
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [130 x [80 x i8]], ptr %28, i64 0, i64 %30
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [80 x i8], ptr %31, i64 0, i64 %33
  store i8 1, ptr %34, align 1, !tbaa !13
  br label %35

35:                                               ; preds = %108, %25
  %36 = invoke noundef zeroext i1 @_ZNKSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %37 unwind label %49

37:                                               ; preds = %35
  %38 = xor i1 %36, true
  br i1 %38, label %39, label %110

39:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #5
  %40 = invoke noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %41 unwind label %53

41:                                               ; preds = %39
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %40, i64 12, i1 false), !tbaa.struct !15
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %42 unwind label %53

42:                                               ; preds = %41
  %43 = load i32, ptr %8, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %105, %42
  %46 = load i32, ptr %14, align 4, !tbaa !5
  %47 = icmp slt i32 %46, 6
  br i1 %47, label %57, label %48

48:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %108

49:                                               ; preds = %35, %3
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %11, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %12, align 4
  br label %119

53:                                               ; preds = %41, %39
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %11, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %12, align 4
  br label %109

57:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %58 = getelementptr inbounds %struct.node, ptr %13, i32 0, i32 0
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %60 = load i32, ptr %14, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [6 x i32], ptr @X, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %59, %63
  store i32 %64, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %65 = getelementptr inbounds %struct.node, ptr %13, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !11
  %67 = load i32, ptr %14, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [6 x i32], ptr @Y, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = add nsw i32 %66, %70
  store i32 %71, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %72 = getelementptr inbounds %struct.node, ptr %13, i32 0, i32 2
  %73 = load i32, ptr %72, align 4, !tbaa !12
  %74 = load i32, ptr %14, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [6 x i32], ptr @Z, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %73, %77
  store i32 %78, ptr %17, align 4, !tbaa !5
  %79 = load i32, ptr %15, align 4, !tbaa !5
  %80 = load i32, ptr %16, align 4, !tbaa !5
  %81 = load i32, ptr %17, align 4, !tbaa !5
  %82 = call noundef zeroext i1 @_Z5judgeiii(i32 noundef %79, i32 noundef %80, i32 noundef %81)
  br i1 %82, label %83, label %104

83:                                               ; preds = %57
  %84 = load i32, ptr %15, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [1300 x [130 x [80 x i8]]], ptr @visit, i64 0, i64 %85
  %87 = load i32, ptr %16, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [130 x [80 x i8]], ptr %86, i64 0, i64 %88
  %90 = load i32, ptr %17, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [80 x i8], ptr %89, i64 0, i64 %91
  store i8 1, ptr %92, align 1, !tbaa !13
  %93 = load i32, ptr %15, align 4, !tbaa !5
  %94 = getelementptr inbounds %struct.node, ptr %9, i32 0, i32 0
  store i32 %93, ptr %94, align 4, !tbaa !9
  %95 = load i32, ptr %16, align 4, !tbaa !5
  %96 = getelementptr inbounds %struct.node, ptr %9, i32 0, i32 1
  store i32 %95, ptr %96, align 4, !tbaa !11
  %97 = load i32, ptr %17, align 4, !tbaa !5
  %98 = getelementptr inbounds %struct.node, ptr %9, i32 0, i32 2
  store i32 %97, ptr %98, align 4, !tbaa !12
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 4 dereferenceable(12) %9)
          to label %99 unwind label %100

99:                                               ; preds = %83
  br label %104

100:                                              ; preds = %83
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %11, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %109

104:                                              ; preds = %99, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %14, align 4, !tbaa !5
  br label %45, !llvm.loop !16

108:                                              ; preds = %48
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #5
  br label %35, !llvm.loop !18

109:                                              ; preds = %100, %53
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #5
  br label %119

110:                                              ; preds = %37
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = load i32, ptr @t, align 4, !tbaa !5
  %113 = icmp sge i32 %111, %112
  br i1 %113, label %114, label %116

114:                                              ; preds = %110
  %115 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %115, ptr %4, align 4
  store i32 1, ptr %18, align 4
  br label %117

116:                                              ; preds = %110
  store i32 0, ptr %4, align 4
  store i32 1, ptr %18, align 4
  br label %117

117:                                              ; preds = %116, %114
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %118 = load i32, ptr %4, align 4
  ret i32 %118

119:                                              ; preds = %109, %49
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %120

120:                                              ; preds = %119
  %121 = load ptr, ptr %11, align 8
  %122 = load i32, ptr %12, align 4
  %123 = insertvalue { ptr, i32 } poison, ptr %121, 0
  %124 = insertvalue { ptr, i32 } %123, i32 %122, 1
  resume { ptr, i32 } %124
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1 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(12)) #1 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)) #0 align 2

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

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

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

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

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

@t = external dso_local local_unnamed_addr global i32, align 4
@X = external dso_local local_unnamed_addr global [6 x i32], align 16
@Y = external dso_local local_unnamed_addr global [6 x i32], align 16
@Z = external dso_local local_unnamed_addr global [6 x i32], align 16
@visit = external dso_local local_unnamed_addr global [1300 x [130 x [80 x i8]]], align 16

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

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

8:                                                ; preds = %3
  %9 = sext i32 %0 to i64
  %10 = sext i32 %1 to i64
  %11 = sext i32 %2 to i64
  %12 = getelementptr inbounds [1300 x [130 x [80 x i8]]], ptr @visit, i64 0, i64 %9, i64 %10, i64 %11
  store i8 1, ptr %12, align 1, !tbaa !12
  %13 = call noundef zeroext i1 @_ZNKSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %13, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %8, %.loopexit
  %.02532 = phi i32 [ %15, %.loopexit ], [ 0, %8 ]
  %14 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %.sroa.0.0.copyload = load i32, ptr %14, align 4, !tbaa !14
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 4
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !14
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %14, i64 8
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4, !tbaa !14
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %15 = add nuw nsw i32 %.02532, 1
  %16 = load i32, ptr @X, align 16, !tbaa !14
  %17 = add nsw i32 %16, %.sroa.0.0.copyload
  %18 = load i32, ptr @Y, align 16, !tbaa !14
  %19 = add nsw i32 %18, %.sroa.5.0.copyload
  %20 = load i32, ptr @Z, align 16, !tbaa !14
  %21 = add nsw i32 %20, %.sroa.6.0.copyload
  %22 = call noundef zeroext i1 @_Z5judgeiii(i32 noundef %17, i32 noundef %19, i32 noundef %21)
  br i1 %22, label %25, label %32

23:                                               ; preds = %3
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %99

25:                                               ; preds = %.lr.ph
  %26 = sext i32 %17 to i64
  %27 = sext i32 %19 to i64
  %28 = sext i32 %21 to i64
  %29 = getelementptr inbounds [1300 x [130 x [80 x i8]]], ptr @visit, i64 0, i64 %26, i64 %27, i64 %28
  store i8 1, ptr %29, align 1, !tbaa !12
  store i32 %17, ptr %4, align 4, !tbaa !5
  store i32 %19, ptr %6, align 4, !tbaa !10
  store i32 %21, ptr %7, align 4, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %32 unwind label %30

30:                                               ; preds = %92, %79, %66, %53, %40, %25
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %99

32:                                               ; preds = %25, %.lr.ph
  %33 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 4), align 4, !tbaa !14
  %34 = add nsw i32 %33, %.sroa.0.0.copyload
  %35 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 4), align 4, !tbaa !14
  %36 = add nsw i32 %35, %.sroa.5.0.copyload
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @Z, i64 4), align 4, !tbaa !14
  %38 = add nsw i32 %37, %.sroa.6.0.copyload
  %39 = call noundef zeroext i1 @_Z5judgeiii(i32 noundef %34, i32 noundef %36, i32 noundef %38)
  br i1 %39, label %40, label %45

40:                                               ; preds = %32
  %41 = sext i32 %34 to i64
  %42 = sext i32 %36 to i64
  %43 = sext i32 %38 to i64
  %44 = getelementptr inbounds [1300 x [130 x [80 x i8]]], ptr @visit, i64 0, i64 %41, i64 %42, i64 %43
  store i8 1, ptr %44, align 1, !tbaa !12
  store i32 %34, ptr %4, align 4, !tbaa !5
  store i32 %36, ptr %6, align 4, !tbaa !10
  store i32 %38, ptr %7, align 4, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %45 unwind label %30

45:                                               ; preds = %40, %32
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 8), align 8, !tbaa !14
  %47 = add nsw i32 %46, %.sroa.0.0.copyload
  %48 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 8), align 8, !tbaa !14
  %49 = add nsw i32 %48, %.sroa.5.0.copyload
  %50 = load i32, ptr getelementptr inbounds (i8, ptr @Z, i64 8), align 8, !tbaa !14
  %51 = add nsw i32 %50, %.sroa.6.0.copyload
  %52 = call noundef zeroext i1 @_Z5judgeiii(i32 noundef %47, i32 noundef %49, i32 noundef %51)
  br i1 %52, label %53, label %58

53:                                               ; preds = %45
  %54 = sext i32 %47 to i64
  %55 = sext i32 %49 to i64
  %56 = sext i32 %51 to i64
  %57 = getelementptr inbounds [1300 x [130 x [80 x i8]]], ptr @visit, i64 0, i64 %54, i64 %55, i64 %56
  store i8 1, ptr %57, align 1, !tbaa !12
  store i32 %47, ptr %4, align 4, !tbaa !5
  store i32 %49, ptr %6, align 4, !tbaa !10
  store i32 %51, ptr %7, align 4, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %58 unwind label %30

58:                                               ; preds = %53, %45
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 12), align 4, !tbaa !14
  %60 = add nsw i32 %59, %.sroa.0.0.copyload
  %61 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 12), align 4, !tbaa !14
  %62 = add nsw i32 %61, %.sroa.5.0.copyload
  %63 = load i32, ptr getelementptr inbounds (i8, ptr @Z, i64 12), align 4, !tbaa !14
  %64 = add nsw i32 %63, %.sroa.6.0.copyload
  %65 = call noundef zeroext i1 @_Z5judgeiii(i32 noundef %60, i32 noundef %62, i32 noundef %64)
  br i1 %65, label %66, label %71

66:                                               ; preds = %58
  %67 = sext i32 %60 to i64
  %68 = sext i32 %62 to i64
  %69 = sext i32 %64 to i64
  %70 = getelementptr inbounds [1300 x [130 x [80 x i8]]], ptr @visit, i64 0, i64 %67, i64 %68, i64 %69
  store i8 1, ptr %70, align 1, !tbaa !12
  store i32 %60, ptr %4, align 4, !tbaa !5
  store i32 %62, ptr %6, align 4, !tbaa !10
  store i32 %64, ptr %7, align 4, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %71 unwind label %30

71:                                               ; preds = %66, %58
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 16), align 16, !tbaa !14
  %73 = add nsw i32 %72, %.sroa.0.0.copyload
  %74 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 16), align 16, !tbaa !14
  %75 = add nsw i32 %74, %.sroa.5.0.copyload
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @Z, i64 16), align 16, !tbaa !14
  %77 = add nsw i32 %76, %.sroa.6.0.copyload
  %78 = call noundef zeroext i1 @_Z5judgeiii(i32 noundef %73, i32 noundef %75, i32 noundef %77)
  br i1 %78, label %79, label %84

79:                                               ; preds = %71
  %80 = sext i32 %73 to i64
  %81 = sext i32 %75 to i64
  %82 = sext i32 %77 to i64
  %83 = getelementptr inbounds [1300 x [130 x [80 x i8]]], ptr @visit, i64 0, i64 %80, i64 %81, i64 %82
  store i8 1, ptr %83, align 1, !tbaa !12
  store i32 %73, ptr %4, align 4, !tbaa !5
  store i32 %75, ptr %6, align 4, !tbaa !10
  store i32 %77, ptr %7, align 4, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %84 unwind label %30

84:                                               ; preds = %79, %71
  %85 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 20), align 4, !tbaa !14
  %86 = add nsw i32 %85, %.sroa.0.0.copyload
  %87 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 20), align 4, !tbaa !14
  %88 = add nsw i32 %87, %.sroa.5.0.copyload
  %89 = load i32, ptr getelementptr inbounds (i8, ptr @Z, i64 20), align 4, !tbaa !14
  %90 = add nsw i32 %89, %.sroa.6.0.copyload
  %91 = call noundef zeroext i1 @_Z5judgeiii(i32 noundef %86, i32 noundef %88, i32 noundef %90)
  br i1 %91, label %92, label %.loopexit

92:                                               ; preds = %84
  %93 = sext i32 %86 to i64
  %94 = sext i32 %88 to i64
  %95 = sext i32 %90 to i64
  %96 = getelementptr inbounds [1300 x [130 x [80 x i8]]], ptr @visit, i64 0, i64 %93, i64 %94, i64 %95
  store i8 1, ptr %96, align 1, !tbaa !12
  store i32 %86, ptr %4, align 4, !tbaa !5
  store i32 %88, ptr %6, align 4, !tbaa !10
  store i32 %90, ptr %7, align 4, !tbaa !11
  invoke void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(12) %4)
          to label %.loopexit unwind label %30

.loopexit:                                        ; preds = %92, %84
  %97 = call noundef zeroext i1 @_ZNKSt5queueI4nodeSt5dequeIS0_SaIS0_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %97, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %.loopexit, %8
  %.025.lcssa = phi i32 [ 0, %8 ], [ %15, %.loopexit ]
  %98 = load i32, ptr @t, align 4, !tbaa !14
  %.not = icmp slt i32 %.025.lcssa, %98
  %..025 = select i1 %.not, i32 0, i32 %.025.lcssa
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #4
  ret i32 %..025

99:                                               ; preds = %30, %23
  %.pn = phi { ptr, i32 } [ %31, %30 ], [ %24, %23 ]
  call void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #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) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueI4nodeSt5dequeIS0_SaIS0_EEEC2IS3_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1 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(12)) local_unnamed_addr #1 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 #0 align 2

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

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

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

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


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