; LLVM IR from Tunghohin/Competitive_Coding :: Luogu/p3379.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 [1000010 x %struct.edge], align 16
@head = external dso_local global [500010 x i32], align 16
@depth = external dso_local global [500010 x i32], align 16
@p = external dso_local global [500010 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.memset.p0.i64(ptr align 16 @depth, i8 63, i64 2000040, 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 [500010 x i32], ptr @depth, i64 0, i64 %12
  store i32 1, ptr %13, 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)
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %14 unwind label %32

14:                                               ; preds = %1
  br label %15

15:                                               ; preds = %112, %14
  %16 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %17 unwind label %32

17:                                               ; preds = %15
  %18 = xor i1 %16, true
  br i1 %18, label %19, label %114

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

21:                                               ; preds = %19
  %22 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %22, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %23 unwind label %36

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %24 = load i32, ptr %6, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [500010 x i32], ptr @head, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  store i32 %27, ptr %7, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %106, %23
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %40, label %31

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

32:                                               ; preds = %15, %1
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %4, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %5, align 4
  br label %115

36:                                               ; preds = %21, %19
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %4, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %5, align 4
  br label %113

40:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [1000010 x %struct.edge], ptr @e, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.edge, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %44, align 8, !tbaa !9
  store i32 %45, ptr %9, align 4, !tbaa !5
  %46 = load i32, ptr %9, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [500010 x i32], ptr @depth, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [500010 x i32], ptr @depth, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = icmp sgt i32 %49, %54
  br i1 %55, label %56, label %105

56:                                               ; preds = %40
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [500010 x i32], ptr @depth, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [500010 x i32], ptr @depth, i64 0, i64 %63
  store i32 %61, ptr %64, 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 %65 unwind label %75

65:                                               ; preds = %56
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %68
  %70 = getelementptr inbounds [20 x i32], ptr %69, i64 0, i64 0
  store i32 %66, ptr %70, 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 %71

71:                                               ; preds = %101, %65
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = icmp sle i32 %72, 15
  br i1 %73, label %79, label %74

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

75:                                               ; preds = %56
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %4, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, 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 %113

79:                                               ; preds = %71
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %81
  %83 = load i32, ptr %10, align 4, !tbaa !5
  %84 = sub nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [20 x i32], ptr %82, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %88
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = sub nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [20 x i32], ptr %89, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %96
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [20 x i32], ptr %97, i64 0, i64 %99
  store i32 %94, ptr %100, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %79
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %10, align 4, !tbaa !5
  br label %71, !llvm.loop !11

104:                                              ; preds = %74
  br label %105

105:                                              ; preds = %104, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [1000010 x %struct.edge], ptr @e, i64 0, i64 %108
  %110 = getelementptr inbounds %struct.edge, ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 4, !tbaa !13
  store i32 %111, ptr %7, align 4, !tbaa !5
  br label %28, !llvm.loop !14

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

113:                                              ; preds = %75, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %115

114:                                              ; preds = %17
  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

115:                                              ; preds = %113, %32
  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 %116

116:                                              ; preds = %115
  %117 = load ptr, ptr %4, align 8
  %118 = load i32, ptr %5, align 4
  %119 = insertvalue { ptr, i32 } poison, ptr %117, 0
  %120 = insertvalue { ptr, i32 } %119, i32 %118, 1
  resume { ptr, i32 } %120
}

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

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

; 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 nounwind willreturn memory(argmem: write) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !6, i64 0}
!10 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 4}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; 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 [1000010 x %struct.edge], align 16
@head = external dso_local local_unnamed_addr global [500010 x i32], align 16
@depth = external dso_local local_unnamed_addr global [500010 x i32], align 16
@p = external dso_local local_unnamed_addr global [500010 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
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2000040) @depth, i8 63, i64 2000040, i1 false)
  store i32 0, ptr @depth, align 16, !tbaa !5
  %5 = sext i32 %0 to i64
  %6 = getelementptr inbounds [500010 x i32], ptr @depth, i64 0, i64 %5
  store i32 1, ptr %6, 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)
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %.preheader unwind label %15

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

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

.lr.ph23:                                         ; preds = %.preheader, %.loopexit18
  %9 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %10 = load i32, ptr %9, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [500010 x i32], ptr @head, i64 0, i64 %11
  %.01320 = load i32, ptr %12, align 4, !tbaa !5
  %.not21 = icmp eq i32 %.01320, 0
  br i1 %.not21, label %.loopexit18, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph23
  %13 = getelementptr inbounds [500010 x i32], ptr @depth, i64 0, i64 %11
  %14 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %11, i64 0
  br label %17

15:                                               ; preds = %1
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %92

17:                                               ; preds = %.lr.ph, %.loopexit
  %.01322 = phi i32 [ %.01320, %.lr.ph ], [ %.013, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %18 = sext i32 %.01322 to i64
  %19 = getelementptr inbounds [1000010 x %struct.edge], ptr @e, i64 0, i64 %18
  %20 = load i32, ptr %19, align 8, !tbaa !11
  store i32 %20, ptr %4, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [500010 x i32], ptr @depth, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = load i32, ptr %13, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  %26 = icmp sgt i32 %23, %25
  br i1 %26, label %27, label %.loopexit

27:                                               ; preds = %17
  store i32 %25, ptr %22, 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 %.loopexit.loopexit unwind label %89

.loopexit.loopexit:                               ; preds = %27
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29
  store i32 %10, ptr %30, align 16, !tbaa !5
  %31 = load i32, ptr %14, align 16, !tbaa !5
  %32 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 1
  store i32 %31, ptr %32, align 4, !tbaa !5
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %33, i64 1
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 2
  store i32 %35, ptr %36, align 8, !tbaa !5
  %37 = sext i32 %35 to i64
  %38 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %37, i64 2
  %39 = load i32, ptr %38, align 8, !tbaa !5
  %40 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 3
  store i32 %39, ptr %40, align 4, !tbaa !5
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %41, i64 3
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 4
  store i32 %43, ptr %44, align 16, !tbaa !5
  %45 = sext i32 %43 to i64
  %46 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %45, i64 4
  %47 = load i32, ptr %46, align 16, !tbaa !5
  %48 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 5
  store i32 %47, ptr %48, align 4, !tbaa !5
  %49 = sext i32 %47 to i64
  %50 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %49, i64 5
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 6
  store i32 %51, ptr %52, align 8, !tbaa !5
  %53 = sext i32 %51 to i64
  %54 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %53, i64 6
  %55 = load i32, ptr %54, align 8, !tbaa !5
  %56 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 7
  store i32 %55, ptr %56, align 4, !tbaa !5
  %57 = sext i32 %55 to i64
  %58 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %57, i64 7
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 8
  store i32 %59, ptr %60, align 16, !tbaa !5
  %61 = sext i32 %59 to i64
  %62 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %61, i64 8
  %63 = load i32, ptr %62, align 16, !tbaa !5
  %64 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 9
  store i32 %63, ptr %64, align 4, !tbaa !5
  %65 = sext i32 %63 to i64
  %66 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %65, i64 9
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 10
  store i32 %67, ptr %68, align 8, !tbaa !5
  %69 = sext i32 %67 to i64
  %70 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %69, i64 10
  %71 = load i32, ptr %70, align 8, !tbaa !5
  %72 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 11
  store i32 %71, ptr %72, align 4, !tbaa !5
  %73 = sext i32 %71 to i64
  %74 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %73, i64 11
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 12
  store i32 %75, ptr %76, align 16, !tbaa !5
  %77 = sext i32 %75 to i64
  %78 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %77, i64 12
  %79 = load i32, ptr %78, align 16, !tbaa !5
  %80 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 13
  store i32 %79, ptr %80, align 4, !tbaa !5
  %81 = sext i32 %79 to i64
  %82 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %81, i64 13
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 14
  store i32 %83, ptr %84, align 8, !tbaa !5
  %85 = sext i32 %83 to i64
  %86 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %85, i64 14
  %87 = load i32, ptr %86, align 8, !tbaa !5
  %88 = getelementptr inbounds [500010 x [20 x i32]], ptr @p, i64 0, i64 %29, i64 15
  store i32 %87, ptr %88, align 4, !tbaa !5
  br label %.loopexit

89:                                               ; preds = %27
  %90 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %92

.loopexit:                                        ; preds = %.loopexit.loopexit, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %91 = getelementptr inbounds i8, ptr %19, i64 4
  %.013 = load i32, ptr %91, align 4, !tbaa !5
  %.not = icmp eq i32 %.013, 0
  br i1 %.not, label %.loopexit18, label %17, !llvm.loop !13

._crit_edge:                                      ; preds = %.loopexit18, %.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

92:                                               ; preds = %89, %15
  %.pn = phi { ptr, i32 } [ %90, %89 ], [ %16, %15 ]
  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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

; 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 nounwind willreturn memory(argmem: write) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4}
!13 = distinct !{!13, !10}


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