; LLVM IR from lzyrapx/Competitive-Programming :: LibreOJ/119（Spfa）.ll (Z4spfai)

; 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.point = 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<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 }

@edge = external dso_local global [200100 x %struct.point], align 16
@head = external dso_local global [20010 x i32], align 16
@dis = external dso_local global [20010 x i32], align 16
@vis = external dso_local global [20010 x i8], align 16
@n = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4spfai(i32 noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::queue", align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %3) #4
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %22, %1
  %11 = load i32, ptr %4, align 4, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %25

15:                                               ; preds = %10
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %17
  store i32 999999999, ptr %18, align 4, !tbaa !5
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [20010 x i8], ptr @vis, i64 0, i64 %20
  store i8 0, ptr %21, align 1, !tbaa !9
  br label %22

22:                                               ; preds = %15
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %4, align 4, !tbaa !5
  br label %10, !llvm.loop !11

25:                                               ; preds = %14
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %26 unwind label %53

26:                                               ; preds = %25
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %28
  store i32 0, ptr %29, align 4, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [20010 x i8], ptr @vis, i64 0, i64 %31
  store i8 1, ptr %32, align 1, !tbaa !9
  br label %33

33:                                               ; preds = %118, %26
  %34 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %35 unwind label %53

35:                                               ; preds = %33
  %36 = xor i1 %34, true
  br i1 %36, label %37, label %120

37:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %38 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %39 unwind label %57

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

41:                                               ; preds = %39
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [20010 x i8], ptr @vis, i64 0, i64 %43
  store i8 0, ptr %44, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [20010 x i32], ptr @head, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  store i32 %48, ptr %8, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %112, %41
  %50 = load i32, ptr %8, align 4, !tbaa !5
  %51 = icmp ne i32 %50, -1
  br i1 %51, label %61, label %52

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

53:                                               ; preds = %33, %25
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %5, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %6, align 4
  br label %121

57:                                               ; preds = %39, %37
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %5, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %6, align 4
  br label %119

61:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [200100 x %struct.point], ptr @edge, i64 0, i64 %63
  %65 = getelementptr inbounds %struct.point, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 4, !tbaa !13
  store i32 %66, ptr %9, align 4, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [200100 x %struct.point], ptr @edge, i64 0, i64 %76
  %78 = getelementptr inbounds %struct.point, ptr %77, i32 0, i32 2
  %79 = load i32, ptr %78, align 4, !tbaa !15
  %80 = add nsw i32 %74, %79
  %81 = icmp sgt i32 %70, %80
  br i1 %81, label %82, label %111

82:                                               ; preds = %61
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200100 x %struct.point], ptr @edge, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.point, ptr %89, i32 0, i32 2
  %91 = load i32, ptr %90, align 4, !tbaa !15
  %92 = add nsw i32 %86, %91
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %94
  store i32 %92, ptr %95, align 4, !tbaa !5
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [20010 x i8], ptr @vis, i64 0, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !9, !range !16, !noundef !17
  %100 = trunc i8 %99 to i1
  br i1 %100, label %110, label %101

101:                                              ; preds = %82
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [20010 x i8], ptr @vis, i64 0, i64 %103
  store i8 1, ptr %104, align 1, !tbaa !9
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %105 unwind label %106

105:                                              ; preds = %101
  br label %110

106:                                              ; preds = %101
  %107 = landingpad { ptr, i32 }
          cleanup
  %108 = extractvalue { ptr, i32 } %107, 0
  store ptr %108, ptr %5, align 8
  %109 = extractvalue { ptr, i32 } %107, 1
  store i32 %109, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %119

110:                                              ; preds = %105, %82
  br label %111

111:                                              ; preds = %110, %61
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [200100 x %struct.point], ptr @edge, i64 0, i64 %114
  %116 = getelementptr inbounds %struct.point, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 4, !tbaa !18
  store i32 %117, ptr %8, align 4, !tbaa !5
  br label %49, !llvm.loop !19

118:                                              ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %33, !llvm.loop !20

119:                                              ; preds = %106, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %121

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

121:                                              ; preds = %119, %53
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #4
  br label %122

122:                                              ; preds = %121
  %123 = load ptr, ptr %5, align 8
  %124 = load i32, ptr %6, align 4
  %125 = insertvalue { ptr, i32 } poison, ptr %123, 0
  %126 = insertvalue { ptr, i32 } %125, i32 %124, 1
  resume { ptr, i32 } %126
}

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(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 = { 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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS5point", !6, i64 0, !6, i64 4, !6, i64 8}
!15 = !{!14, !6, i64 8}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!14, !6, i64 4}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !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.point = 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<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 }

@edge = external dso_local local_unnamed_addr global [200100 x %struct.point], align 16
@head = external dso_local local_unnamed_addr global [20010 x i32], align 16
@dis = external dso_local local_unnamed_addr global [20010 x i32], align 16
@vis = external dso_local local_unnamed_addr global [20010 x i8], align 16
@n = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z4spfai(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)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not20 = icmp slt i32 %5, 1
  br i1 %.not20, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %1
  %6 = zext nneg i32 %5 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds (i8, ptr @vis, i64 1), i8 0, i64 %6, i1 false), !tbaa !9
  %7 = add nuw i32 %5, 1
  %wide.trip.count = zext i32 %7 to i64
  %8 = zext nneg i32 %5 to i64
  %min.iters.check = icmp ult i32 %5, 8
  br i1 %min.iters.check, label %.lr.ph.preheader31, label %vector.ph

.lr.ph.preheader31:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %8, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %9 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %offset.idx
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  store <4 x i32> <i32 999999999, i32 999999999, i32 999999999, i32 999999999>, ptr %9, align 4, !tbaa !5
  store <4 x i32> <i32 999999999, i32 999999999, i32 999999999, i32 999999999>, ptr %10, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %11 = icmp eq i64 %index.next, %n.vec
  br i1 %11, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %8
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader31

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %1
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %13 unwind label %26

.lr.ph:                                           ; preds = %.lr.ph.preheader31, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader31 ]
  %12 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %indvars.iv
  store i32 999999999, ptr %12, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

13:                                               ; preds = %._crit_edge
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %15
  store i32 0, ptr %16, align 4, !tbaa !5
  %17 = getelementptr inbounds [20010 x i8], ptr @vis, i64 0, i64 %15
  store i8 1, ptr %17, align 1, !tbaa !9
  %18 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %18, label %._crit_edge29, label %.lr.ph28

.loopexit:                                        ; preds = %47, %.lr.ph28
  %19 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %19, label %._crit_edge29, label %.lr.ph28, !llvm.loop !16

.lr.ph28:                                         ; preds = %13, %.loopexit
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %21 = load i32, ptr %20, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [20010 x i8], ptr @vis, i64 0, i64 %22
  store i8 0, ptr %23, align 1, !tbaa !9
  %24 = getelementptr inbounds [20010 x i32], ptr @head, i64 0, i64 %22
  %.022 = load i32, ptr %24, align 4, !tbaa !5
  %.not1823 = icmp eq i32 %.022, -1
  br i1 %.not1823, label %.loopexit, label %.lr.ph26

.lr.ph26:                                         ; preds = %.lr.ph28
  %25 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %22
  br label %28

26:                                               ; preds = %._crit_edge
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %49

28:                                               ; preds = %.lr.ph26, %47
  %.024 = phi i32 [ %.022, %.lr.ph26 ], [ %.0, %47 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %29 = sext i32 %.024 to i64
  %30 = getelementptr inbounds [200100 x %struct.point], ptr @edge, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !17
  store i32 %31, ptr %4, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [20010 x i32], ptr @dis, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = load i32, ptr %25, align 4, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %30, i64 8
  %37 = load i32, ptr %36, align 4, !tbaa !19
  %38 = add nsw i32 %37, %35
  %39 = icmp sgt i32 %34, %38
  br i1 %39, label %40, label %47

40:                                               ; preds = %28
  store i32 %38, ptr %33, align 4, !tbaa !5
  %41 = getelementptr inbounds [20010 x i8], ptr @vis, i64 0, i64 %32
  %42 = load i8, ptr %41, align 1, !tbaa !9, !range !20, !noundef !21
  %43 = trunc nuw i8 %42 to i1
  br i1 %43, label %47, label %44

44:                                               ; preds = %40
  store i8 1, ptr %41, align 1, !tbaa !9
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %47 unwind label %45

45:                                               ; preds = %44
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %49

47:                                               ; preds = %40, %44, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %48 = getelementptr inbounds i8, ptr %30, i64 4
  %.0 = load i32, ptr %48, align 4, !tbaa !5
  %.not18 = icmp eq i32 %.0, -1
  br i1 %.not18, label %.loopexit, label %28, !llvm.loop !22

._crit_edge29:                                    ; preds = %.loopexit, %13
  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

49:                                               ; preds = %45, %26
  %.pn = phi { ptr, i32 } [ %46, %45 ], [ %27, %26 ]
  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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !14, !13}
!16 = distinct !{!16, !12}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTS5point", !6, i64 0, !6, i64 4, !6, i64 8}
!19 = !{!18, !6, i64 8}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !12}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass