; LLVM IR from Tunghohin/Competitive_Coding :: Luogu/p5836.ll (Z3bfsi)

; 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.edge = type { 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<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@e = external dso_local global [200010 x %struct.edge], align 16
@head = external dso_local global [100010 x i32], align 16
@cow = external dso_local global [100010 x i8], align 16
@depth = external dso_local global [100010 x i32], align 16
@prefix = external dso_local global [100010 x i32], align 16
@f = external dso_local global [100010 x [20 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3bfsi(i32 noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::queue", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, 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
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %3) #5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.memset.p0.i64(ptr align 16 @depth, i8 63, i64 400040, i1 false)
  store i32 0, ptr @depth, align 16, !tbaa !5
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %12
  store i32 1, ptr %13, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [100010 x i8], ptr @cow, i64 0, i64 %15
  %17 = load i8, ptr %16, align 1, !tbaa !9
  %18 = sext i8 %17 to i32
  %19 = icmp eq i32 %18, 72
  br i1 %19, label %20, label %24

20:                                               ; preds = %1
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %22
  store i32 1, ptr %23, align 4, !tbaa !5
  br label %28

24:                                               ; preds = %1
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %26
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %24, %20
  %29 = phi ptr [ %23, %20 ], [ %27, %24 ]
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %30 unwind label %48

30:                                               ; preds = %28
  br label %31

31:                                               ; preds = %153, %30
  %32 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %33 unwind label %48

33:                                               ; preds = %31
  %34 = xor i1 %32, true
  br i1 %34, label %35, label %155

35:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %36 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %37 unwind label %52

37:                                               ; preds = %35
  %38 = load i32, ptr %36, align 4, !tbaa !5
  store i32 %38, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %39 unwind label %52

39:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100010 x i32], ptr @head, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  store i32 %43, ptr %7, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %147, %39
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %56, label %47

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

48:                                               ; preds = %31, %28
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %4, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %5, align 4
  br label %156

52:                                               ; preds = %37, %35
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %4, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %5, align 4
  br label %154

56:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [200010 x %struct.edge], ptr @e, i64 0, i64 %58
  %60 = getelementptr inbounds %struct.edge, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !10
  store i32 %61, ptr %9, align 4, !tbaa !5
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  %71 = icmp sgt i32 %65, %70
  br i1 %71, label %72, label %146

72:                                               ; preds = %56
  %73 = load i32, ptr %6, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %79
  store i32 %77, ptr %80, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %81 unwind label %91

81:                                               ; preds = %72
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %84
  %86 = getelementptr inbounds [20 x i32], ptr %85, i64 0, i64 0
  store i32 %82, ptr %86, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %117, %81
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = icmp sle i32 %88, 15
  br i1 %89, label %95, label %90

90:                                               ; preds = %87
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %120

91:                                               ; preds = %72
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %4, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %154

95:                                               ; preds = %87
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %97
  %99 = load i32, ptr %10, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [20 x i32], ptr %98, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %104
  %106 = load i32, ptr %10, align 4, !tbaa !5
  %107 = sub nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [20 x i32], ptr %105, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %112
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [20 x i32], ptr %113, i64 0, i64 %115
  store i32 %110, ptr %116, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %95
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %10, align 4, !tbaa !5
  br label %87, !llvm.loop !12

120:                                              ; preds = %90
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [100010 x i8], ptr @cow, i64 0, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !9
  %125 = sext i8 %124 to i32
  %126 = icmp eq i32 %125, 72
  br i1 %126, label %127, label %136

127:                                              ; preds = %120
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  %133 = load i32, ptr %9, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %134
  store i32 %132, ptr %135, align 4, !tbaa !5
  br label %144

136:                                              ; preds = %120
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %142
  store i32 %140, ptr %143, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %136, %127
  %145 = phi ptr [ %135, %127 ], [ %143, %136 ]
  br label %146

146:                                              ; preds = %144, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %7, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [200010 x %struct.edge], ptr @e, i64 0, i64 %149
  %151 = getelementptr inbounds %struct.edge, ptr %150, i32 0, i32 1
  %152 = load i32, ptr %151, align 4, !tbaa !14
  store i32 %152, ptr %7, align 4, !tbaa !5
  br label %44, !llvm.loop !15

153:                                              ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %31, !llvm.loop !16

154:                                              ; preds = %91, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %156

155:                                              ; preds = %33
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #5
  ret void

156:                                              ; preds = %154, %48
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #5
  br label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr %4, align 8
  %159 = load i32, ptr %5, align 4
  %160 = insertvalue { ptr, i32 } poison, ptr %158, 0
  %161 = insertvalue { ptr, i32 } %160, i32 %159, 1
  resume { ptr, i32 } %161
}

; 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 @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 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 @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 0}
!11 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!11, !6, i64 4}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}


; 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.edge = type { 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<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@e = external dso_local local_unnamed_addr global [200010 x %struct.edge], align 16
@head = external dso_local local_unnamed_addr global [100010 x i32], align 16
@cow = external dso_local local_unnamed_addr global [100010 x i8], align 16
@depth = external dso_local local_unnamed_addr global [100010 x i32], align 16
@prefix = external dso_local local_unnamed_addr global [100010 x i32], align 16
@f = external dso_local local_unnamed_addr global [100010 x [20 x i32]], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3bfsi(i32 noundef %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::queue", align 8
  %4 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400040) @depth, i8 63, i64 400040, i1 false)
  store i32 0, ptr @depth, align 16, !tbaa !5
  %5 = sext i32 %0 to i64
  %6 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %5
  store i32 1, ptr %6, align 4, !tbaa !5
  %7 = getelementptr inbounds [100010 x i8], ptr @cow, i64 0, i64 %5
  %8 = load i8, ptr %7, align 1, !tbaa !9
  %9 = icmp eq i8 %8, 72
  %spec.select = zext i1 %9 to i32
  %10 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %5
  store i32 %spec.select, ptr %10, align 4
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %.preheader unwind label %20

.preheader:                                       ; preds = %1
  %11 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %11, label %._crit_edge, label %.lr.ph24

.loopexit:                                        ; preds = %102, %.lr.ph24
  %12 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %12, label %._crit_edge, label %.lr.ph24, !llvm.loop !10

.lr.ph24:                                         ; preds = %.preheader, %.loopexit
  %13 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %14 = load i32, ptr %13, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [100010 x i32], ptr @head, i64 0, i64 %15
  %.01521 = load i32, ptr %16, align 4, !tbaa !5
  %.not22 = icmp eq i32 %.01521, 0
  br i1 %.not22, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph24
  %17 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %15
  %18 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %15
  %19 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %15, i64 0
  br label %22

20:                                               ; preds = %1
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %104

22:                                               ; preds = %.lr.ph, %102
  %.01523 = phi i32 [ %.01521, %.lr.ph ], [ %.015, %102 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %23 = sext i32 %.01523 to i64
  %24 = getelementptr inbounds [200010 x %struct.edge], ptr @e, i64 0, i64 %23
  %25 = load i32, ptr %24, align 8, !tbaa !12
  store i32 %25, ptr %4, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100010 x i32], ptr @depth, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = load i32, ptr %17, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  %31 = icmp sgt i32 %28, %30
  br i1 %31, label %32, label %102

32:                                               ; preds = %22
  store i32 %30, ptr %27, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %.sink.split unwind label %100

.sink.split:                                      ; preds = %32
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34
  store i32 %14, ptr %35, align 16, !tbaa !5
  %36 = load i32, ptr %19, align 16, !tbaa !5
  %37 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 1
  store i32 %36, ptr %37, align 4, !tbaa !5
  %38 = sext i32 %36 to i64
  %39 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %38, i64 1
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 2
  store i32 %40, ptr %41, align 8, !tbaa !5
  %42 = sext i32 %40 to i64
  %43 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %42, i64 2
  %44 = load i32, ptr %43, align 8, !tbaa !5
  %45 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 3
  store i32 %44, ptr %45, align 4, !tbaa !5
  %46 = sext i32 %44 to i64
  %47 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %46, i64 3
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 4
  store i32 %48, ptr %49, align 16, !tbaa !5
  %50 = sext i32 %48 to i64
  %51 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %50, i64 4
  %52 = load i32, ptr %51, align 16, !tbaa !5
  %53 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 5
  store i32 %52, ptr %53, align 4, !tbaa !5
  %54 = sext i32 %52 to i64
  %55 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %54, i64 5
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 6
  store i32 %56, ptr %57, align 8, !tbaa !5
  %58 = sext i32 %56 to i64
  %59 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %58, i64 6
  %60 = load i32, ptr %59, align 8, !tbaa !5
  %61 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 7
  store i32 %60, ptr %61, align 4, !tbaa !5
  %62 = sext i32 %60 to i64
  %63 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %62, i64 7
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 8
  store i32 %64, ptr %65, align 16, !tbaa !5
  %66 = sext i32 %64 to i64
  %67 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %66, i64 8
  %68 = load i32, ptr %67, align 16, !tbaa !5
  %69 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 9
  store i32 %68, ptr %69, align 4, !tbaa !5
  %70 = sext i32 %68 to i64
  %71 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %70, i64 9
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 10
  store i32 %72, ptr %73, align 8, !tbaa !5
  %74 = sext i32 %72 to i64
  %75 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %74, i64 10
  %76 = load i32, ptr %75, align 8, !tbaa !5
  %77 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 11
  store i32 %76, ptr %77, align 4, !tbaa !5
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %78, i64 11
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 12
  store i32 %80, ptr %81, align 16, !tbaa !5
  %82 = sext i32 %80 to i64
  %83 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %82, i64 12
  %84 = load i32, ptr %83, align 16, !tbaa !5
  %85 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 13
  store i32 %84, ptr %85, align 4, !tbaa !5
  %86 = sext i32 %84 to i64
  %87 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %86, i64 13
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 14
  store i32 %88, ptr %89, align 8, !tbaa !5
  %90 = sext i32 %88 to i64
  %91 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %90, i64 14
  %92 = load i32, ptr %91, align 8, !tbaa !5
  %93 = getelementptr inbounds [100010 x [20 x i32]], ptr @f, i64 0, i64 %34, i64 15
  store i32 %92, ptr %93, align 4, !tbaa !5
  %94 = getelementptr inbounds [100010 x i8], ptr @cow, i64 0, i64 %34
  %95 = load i8, ptr %94, align 1, !tbaa !9
  %96 = icmp eq i8 %95, 72
  %97 = load i32, ptr %18, align 4, !tbaa !5
  %98 = zext i1 %96 to i32
  %.sink = add nsw i32 %97, %98
  %99 = getelementptr inbounds [100010 x i32], ptr @prefix, i64 0, i64 %34
  store i32 %.sink, ptr %99, align 4, !tbaa !5
  br label %102

100:                                              ; preds = %32
  %101 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %104

102:                                              ; preds = %.sink.split, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %103 = getelementptr inbounds i8, ptr %24, i64 4
  %.015 = load i32, ptr %103, align 4, !tbaa !5
  %.not = icmp eq i32 %.015, 0
  br i1 %.not, label %.loopexit, label %22, !llvm.loop !14

._crit_edge:                                      ; preds = %.loopexit, %.preheader
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  ret void

104:                                              ; preds = %100, %20
  %.pn = phi { ptr, i32 } [ %101, %100 ], [ %21, %20 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  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 @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 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 @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4}
!14 = distinct !{!14, !11}


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