; LLVM IR from Tunghohin/Competitive_Coding :: Daimayuan/998.ll (Z4spfaRi)

; 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, 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 [20020 x %struct.edge], align 16
@head = external dso_local global [10010 x i32], align 16
@dist = external dso_local global [10010 x i32], align 16
@vis = external dso_local global [10010 x i8], align 16
@cnt = external dso_local global [10010 x i32], align 16

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

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

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

12:                                               ; preds = %23, %1
  %13 = load i32, ptr %5, align 4, !tbaa !9
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = icmp sle i32 %13, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %30

18:                                               ; preds = %12
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %19 unwind label %26

19:                                               ; preds = %18
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [10010 x i8], ptr @vis, i64 0, i64 %21
  store i8 1, ptr %22, align 1, !tbaa !11
  br label %23

23:                                               ; preds = %19
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %5, align 4, !tbaa !9
  br label %12, !llvm.loop !13

26:                                               ; preds = %18
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %6, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %147

30:                                               ; preds = %17
  br label %31

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

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

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

37:                                               ; preds = %35
  %38 = load i32, ptr %36, align 4, !tbaa !9
  store i32 %38, ptr %8, align 4, !tbaa !9
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [10010 x i8], ptr @vis, i64 0, i64 %40
  store i8 0, ptr %41, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [10010 x i32], ptr @head, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !9
  store i32 %45, ptr %9, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %130, %37
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %58, label %49

49:                                               ; preds = %46
  store i32 7, ptr %10, align 4
  br label %136

50:                                               ; preds = %31
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %6, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %7, align 4
  br label %147

54:                                               ; preds = %138, %35
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %6, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %7, align 4
  br label %143

58:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [20020 x %struct.edge], ptr @e, i64 0, i64 %60
  %62 = getelementptr inbounds %struct.edge, ptr %61, i32 0, i32 0
  %63 = load i32, ptr %62, align 4, !tbaa !15
  store i32 %63, ptr %11, align 4, !tbaa !9
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10010 x i32], ptr @dist, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [10010 x i32], ptr @dist, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [20020 x %struct.edge], ptr @e, i64 0, i64 %73
  %75 = getelementptr inbounds %struct.edge, ptr %74, i32 0, i32 2
  %76 = load i32, ptr %75, align 4, !tbaa !17
  %77 = add nsw i32 %71, %76
  %78 = icmp slt i32 %67, %77
  br i1 %78, label %79, label %126

79:                                               ; preds = %58
  %80 = load i32, ptr %8, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [10010 x i32], ptr @dist, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [20020 x %struct.edge], ptr @e, i64 0, i64 %85
  %87 = getelementptr inbounds %struct.edge, ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 4, !tbaa !17
  %89 = add nsw i32 %83, %88
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [10010 x i32], ptr @dist, i64 0, i64 %91
  store i32 %89, ptr %92, align 4, !tbaa !9
  %93 = load i32, ptr %8, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [10010 x i32], ptr @cnt, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !9
  %97 = add nsw i32 %96, 1
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [10010 x i32], ptr @cnt, i64 0, i64 %99
  store i32 %97, ptr %100, align 4, !tbaa !9
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [10010 x i32], ptr @cnt, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = load i32, ptr %105, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  %108 = icmp sge i32 %104, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %79
  store i1 false, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %127

110:                                              ; preds = %79
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [10010 x i8], ptr @vis, i64 0, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !11, !range !18, !noundef !19
  %115 = trunc i8 %114 to i1
  br i1 %115, label %125, label %116

116:                                              ; preds = %110
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %117 unwind label %121

117:                                              ; preds = %116
  %118 = load i32, ptr %11, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [10010 x i8], ptr @vis, i64 0, i64 %119
  store i8 1, ptr %120, align 1, !tbaa !11
  br label %125

121:                                              ; preds = %116
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %6, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %143

125:                                              ; preds = %117, %110
  br label %126

126:                                              ; preds = %125, %58
  store i32 0, ptr %10, align 4
  br label %127

127:                                              ; preds = %126, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  %128 = load i32, ptr %10, align 4
  switch i32 %128, label %136 [
    i32 0, label %129
  ]

129:                                              ; preds = %127
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [20020 x %struct.edge], ptr @e, i64 0, i64 %132
  %134 = getelementptr inbounds %struct.edge, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !20
  store i32 %135, ptr %9, align 4, !tbaa !9
  br label %46, !llvm.loop !21

136:                                              ; preds = %127, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  %137 = load i32, ptr %10, align 4
  switch i32 %137, label %140 [
    i32 7, label %138
  ]

138:                                              ; preds = %136
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %139 unwind label %54

139:                                              ; preds = %138
  store i32 0, ptr %10, align 4
  br label %140

140:                                              ; preds = %139, %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %141 = load i32, ptr %10, align 4
  switch i32 %141, label %145 [
    i32 0, label %142
  ]

142:                                              ; preds = %140
  br label %31, !llvm.loop !22

143:                                              ; preds = %121, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %147

144:                                              ; preds = %33
  store i1 true, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %145

145:                                              ; preds = %144, %140
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #4
  %146 = load i1, ptr %2, align 1
  ret i1 %146

147:                                              ; preds = %143, %50, %26
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %4) #4
  br label %148

148:                                              ; preds = %147
  %149 = load ptr, ptr %6, align 8
  %150 = load i32, ptr %7, align 4
  %151 = insertvalue { ptr, i32 } poison, ptr %149, 0
  %152 = insertvalue { ptr, i32 } %151, i32 %150, 1
  resume { ptr, i32 } %152
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1 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)) #1 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTS4edge", !10, i64 0, !10, i64 4, !10, i64 8}
!17 = !{!16, !10, i64 8}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!16, !10, i64 4}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}


; 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, 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 [20020 x %struct.edge], align 16
@head = external dso_local local_unnamed_addr global [10010 x i32], align 16
@dist = external dso_local local_unnamed_addr global [10010 x i32], align 16
@vis = external dso_local local_unnamed_addr global [10010 x i8], align 16
@cnt = external dso_local local_unnamed_addr global [10010 x i32], align 16

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z4spfaRi(ptr nocapture noundef nonnull readonly align 4 dereferenceable(4) %0) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::queue", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #4
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  %5 = load i32, ptr %0, align 4, !tbaa !5
  %.not36 = icmp slt i32 %5, 1
  br i1 %.not36, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %7, %1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %6 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %6, label %.critedge32, label %.lr.ph43

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

7:                                                ; preds = %.lr.ph
  %8 = load i32, ptr %3, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [10010 x i8], ptr @vis, i64 0, i64 %9
  store i8 1, ptr %10, align 1, !tbaa !9
  %11 = add nsw i32 %8, 1
  store i32 %11, ptr %3, align 4, !tbaa !5
  %12 = load i32, ptr %0, align 4, !tbaa !5
  %.not.not = icmp slt i32 %8, %12
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

13:                                               ; preds = %.lr.ph
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %54

.critedge33:                                      ; preds = %51, %.lr.ph43
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %15 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %15, label %.critedge32, label %.lr.ph43

.lr.ph43:                                         ; preds = %._crit_edge, %.critedge33
  %16 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [10010 x i8], ptr @vis, i64 0, i64 %18
  store i8 0, ptr %19, align 1, !tbaa !9
  %20 = getelementptr inbounds [10010 x i32], ptr @head, i64 0, i64 %18
  %.01937 = load i32, ptr %20, align 4, !tbaa !5
  %.not2638 = icmp eq i32 %.01937, 0
  br i1 %.not2638, label %.critedge33, label %.lr.ph41

.lr.ph41:                                         ; preds = %.lr.ph43
  %21 = getelementptr inbounds [10010 x i32], ptr @dist, i64 0, i64 %18
  %22 = getelementptr inbounds [10010 x i32], ptr @cnt, i64 0, i64 %18
  br label %23

23:                                               ; preds = %.lr.ph41, %51
  %.01939 = phi i32 [ %.01937, %.lr.ph41 ], [ %.019, %51 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %24 = sext i32 %.01939 to i64
  %25 = getelementptr inbounds [20020 x %struct.edge], ptr @e, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !13
  store i32 %26, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [10010 x i32], ptr @dist, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = load i32, ptr %21, align 4, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %25, i64 8
  %32 = load i32, ptr %31, align 4, !tbaa !15
  %33 = add nsw i32 %32, %30
  %34 = icmp slt i32 %29, %33
  br i1 %34, label %35, label %51

35:                                               ; preds = %23
  store i32 %33, ptr %28, align 4, !tbaa !5
  %36 = load i32, ptr %22, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  %38 = getelementptr inbounds [10010 x i32], ptr @cnt, i64 0, i64 %27
  store i32 %37, ptr %38, align 4, !tbaa !5
  %39 = load i32, ptr %0, align 4, !tbaa !5
  %.not27.not.not = icmp slt i32 %36, %39
  br i1 %.not27.not.not, label %40, label %.critedge

40:                                               ; preds = %35
  %41 = getelementptr inbounds [10010 x i8], ptr @vis, i64 0, i64 %27
  %42 = load i8, ptr %41, align 1, !tbaa !9, !range !16, !noundef !17
  %43 = trunc nuw i8 %42 to i1
  br i1 %43, label %51, label %44

44:                                               ; preds = %40
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %45 unwind label %49

45:                                               ; preds = %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [10010 x i8], ptr @vis, i64 0, i64 %47
  store i8 1, ptr %48, align 1, !tbaa !9
  br label %51

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

51:                                               ; preds = %23, %45, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %52 = getelementptr inbounds i8, ptr %25, i64 4
  %.019 = load i32, ptr %52, align 4, !tbaa !5
  %.not26 = icmp eq i32 %.019, 0
  br i1 %.not26, label %.critedge33, label %23, !llvm.loop !18

.critedge:                                        ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %.critedge32

.critedge32:                                      ; preds = %.critedge33, %._crit_edge, %.critedge
  %53 = phi i1 [ false, %.critedge ], [ true, %._crit_edge ], [ true, %.critedge33 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #4
  ret i1 %53

54:                                               ; preds = %49, %13
  %.pn = phi { ptr, i32 } [ %14, %13 ], [ %50, %49 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4, !6, i64 8}
!15 = !{!14, !6, i64 8}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass