; LLVM IR from Tunghohin/Competitive_Coding :: Luogu/p2868.ll (Z5checkdi)

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

@f = external dso_local global [1010 x i32], align 16
@e = external dso_local global [5050 x %struct.edge], align 16
@head = external dso_local global [1010 x i32], align 16
@vis = external dso_local global [1010 x i8], align 16
@dist = external dso_local global [1010 x double], align 16
@cnt = external dso_local global [1010 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5checkdi(double noundef %0, i32 noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca double, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::queue", align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store double %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 16 @dist, i8 0, i64 8080, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 1010, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @cnt, i8 0, i64 4040, i1 false)
  call void @llvm.lifetime.start.p0(i64 80, ptr %6) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %14

14:                                               ; preds = %24, %2
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = load i32, ptr %5, align 4, !tbaa !9
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %31

19:                                               ; preds = %14
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %20 unwind label %27

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

24:                                               ; preds = %20
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %7, align 4, !tbaa !9
  br label %14, !llvm.loop !13

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

31:                                               ; preds = %18
  br label %32

32:                                               ; preds = %159, %31
  %33 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %34 unwind label %52

34:                                               ; preds = %32
  %35 = xor i1 %33, true
  br i1 %35, label %36, label %161

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

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

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

48:                                               ; preds = %148, %40
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %60, label %51

51:                                               ; preds = %48
  store i32 7, ptr %12, align 4
  br label %154

52:                                               ; preds = %32
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %8, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %9, align 4
  br label %164

56:                                               ; preds = %38, %36
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %8, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %9, align 4
  br label %160

60:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [5050 x %struct.edge], ptr @e, i64 0, i64 %62
  %64 = getelementptr inbounds %struct.edge, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 4, !tbaa !15
  store i32 %65, ptr %13, align 4, !tbaa !9
  %66 = load i32, ptr %13, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1010 x double], ptr @dist, i64 0, i64 %67
  %69 = load double, ptr %68, align 8, !tbaa !5
  %70 = load i32, ptr %10, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [1010 x double], ptr @dist, i64 0, i64 %71
  %73 = load double, ptr %72, align 8, !tbaa !5
  %74 = load i32, ptr %10, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = sitofp i32 %77 to double
  %79 = fadd double %73, %78
  %80 = load double, ptr %4, align 8, !tbaa !5
  %81 = load i32, ptr %11, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [5050 x %struct.edge], ptr @e, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.edge, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !17
  %86 = sitofp i32 %85 to double
  %87 = fneg double %80
  %88 = call double @llvm.fmuladd.f64(double %87, double %86, double %79)
  %89 = fcmp olt double %69, %88
  br i1 %89, label %90, label %144

90:                                               ; preds = %60
  %91 = load i32, ptr %10, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1010 x double], ptr @dist, i64 0, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !9
  %99 = sitofp i32 %98 to double
  %100 = fadd double %94, %99
  %101 = load double, ptr %4, align 8, !tbaa !5
  %102 = load i32, ptr %11, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [5050 x %struct.edge], ptr @e, i64 0, i64 %103
  %105 = getelementptr inbounds %struct.edge, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 4, !tbaa !17
  %107 = sitofp i32 %106 to double
  %108 = fneg double %101
  %109 = call double @llvm.fmuladd.f64(double %108, double %107, double %100)
  %110 = load i32, ptr %13, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1010 x double], ptr @dist, i64 0, i64 %111
  store double %109, ptr %112, align 8, !tbaa !5
  %113 = load i32, ptr %10, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [1010 x i32], ptr @cnt, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  %118 = load i32, ptr %13, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [1010 x i32], ptr @cnt, i64 0, i64 %119
  store i32 %117, ptr %120, align 4, !tbaa !9
  %121 = load i32, ptr %13, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [1010 x i32], ptr @cnt, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !9
  %125 = load i32, ptr %5, align 4, !tbaa !9
  %126 = icmp sge i32 %124, %125
  br i1 %126, label %127, label %128

127:                                              ; preds = %90
  store i1 true, ptr %3, align 1
  store i32 1, ptr %12, align 4
  br label %145

128:                                              ; preds = %90
  %129 = load i32, ptr %13, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [1010 x i8], ptr @vis, i64 0, i64 %130
  %132 = load i8, ptr %131, align 1, !tbaa !11, !range !18, !noundef !19
  %133 = trunc i8 %132 to i1
  br i1 %133, label %143, label %134

134:                                              ; preds = %128
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %135 unwind label %139

135:                                              ; preds = %134
  %136 = load i32, ptr %13, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [1010 x i8], ptr @vis, i64 0, i64 %137
  store i8 1, ptr %138, align 1, !tbaa !11
  br label %143

139:                                              ; preds = %134
  %140 = landingpad { ptr, i32 }
          cleanup
  %141 = extractvalue { ptr, i32 } %140, 0
  store ptr %141, ptr %8, align 8
  %142 = extractvalue { ptr, i32 } %140, 1
  store i32 %142, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %160

143:                                              ; preds = %135, %128
  br label %144

144:                                              ; preds = %143, %60
  store i32 0, ptr %12, align 4
  br label %145

145:                                              ; preds = %144, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  %146 = load i32, ptr %12, align 4
  switch i32 %146, label %154 [
    i32 0, label %147
  ]

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %11, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [5050 x %struct.edge], ptr @e, i64 0, i64 %150
  %152 = getelementptr inbounds %struct.edge, ptr %151, i32 0, i32 2
  %153 = load i32, ptr %152, align 4, !tbaa !20
  store i32 %153, ptr %11, align 4, !tbaa !9
  br label %48, !llvm.loop !21

154:                                              ; preds = %145, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %155 = load i32, ptr %12, align 4
  switch i32 %155, label %157 [
    i32 7, label %156
  ]

156:                                              ; preds = %154
  store i32 0, ptr %12, align 4
  br label %157

157:                                              ; preds = %156, %154
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %158 = load i32, ptr %12, align 4
  switch i32 %158, label %162 [
    i32 0, label %159
  ]

159:                                              ; preds = %157
  br label %32, !llvm.loop !22

160:                                              ; preds = %139, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %164

161:                                              ; preds = %34
  store i1 false, ptr %3, align 1
  store i32 1, ptr %12, align 4
  br label %162

162:                                              ; preds = %161, %157
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #6
  %163 = load i1, ptr %3, align 1
  ret i1 %163

164:                                              ; preds = %160, %52, %27
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #6
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %8, align 8
  %167 = load i32, ptr %9, align 4
  %168 = insertvalue { ptr, i32 } poison, ptr %166, 0
  %169 = insertvalue { ptr, i32 } %168, i32 %167, 1
  resume { ptr, i32 } %169
}

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

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { 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 = !{!"double", !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 4}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!16, !10, i64 8}
!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 }

@f = external dso_local local_unnamed_addr global [1010 x i32], align 16
@e = external dso_local local_unnamed_addr global [5050 x %struct.edge], align 16
@head = external dso_local local_unnamed_addr global [1010 x i32], align 16
@vis = external dso_local local_unnamed_addr global [1010 x i8], align 16
@dist = external dso_local local_unnamed_addr global [1010 x double], align 16
@cnt = external dso_local local_unnamed_addr global [1010 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5checkdi(double noundef %0, i32 noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::queue", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8080) @dist, i8 0, i64 8080, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1010) @vis, i8 0, i64 1010, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4040) @cnt, i8 0, i64 4040, i1 false)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #6
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  %.not37 = icmp slt i32 %1, 1
  br i1 %.not37, label %._crit_edge, label %.lr.ph

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

.lr.ph44:                                         ; preds = %._crit_edge
  %7 = fneg double %0
  br label %16

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

8:                                                ; preds = %.lr.ph
  %9 = load i32, ptr %4, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [1010 x i8], ptr @vis, i64 0, i64 %10
  store i8 1, ptr %11, align 1, !tbaa !9
  %12 = add nsw i32 %9, 1
  store i32 %12, ptr %4, align 4, !tbaa !5
  %.not.not = icmp slt i32 %9, %1
  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 %4) #6
  br label %58

.critedge34.loopexit:                             ; preds = %56, %16
  %15 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %15, label %.loopexit, label %16

16:                                               ; preds = %.lr.ph44, %.critedge34.loopexit
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %18 = load i32, ptr %17, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [1010 x i8], ptr @vis, i64 0, i64 %19
  store i8 0, ptr %20, align 1, !tbaa !9
  %21 = getelementptr inbounds [1010 x i32], ptr @head, i64 0, i64 %19
  %.02338 = load i32, ptr %21, align 4, !tbaa !5
  %.not3039 = icmp eq i32 %.02338, 0
  br i1 %.not3039, label %.critedge34.loopexit, label %.lr.ph42

.lr.ph42:                                         ; preds = %16
  %22 = getelementptr inbounds [1010 x double], ptr @dist, i64 0, i64 %19
  %23 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %19
  %24 = getelementptr inbounds [1010 x i32], ptr @cnt, i64 0, i64 %19
  br label %25

25:                                               ; preds = %.lr.ph42, %56
  %.02340 = phi i32 [ %.02338, %.lr.ph42 ], [ %.023, %56 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %26 = sext i32 %.02340 to i64
  %27 = getelementptr inbounds [5050 x %struct.edge], ptr @e, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !13
  store i32 %28, ptr %5, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [1010 x double], ptr @dist, i64 0, i64 %29
  %31 = load double, ptr %30, align 8, !tbaa !15
  %32 = load double, ptr %22, align 8, !tbaa !15
  %33 = load i32, ptr %23, align 4, !tbaa !5
  %34 = sitofp i32 %33 to double
  %35 = fadd double %32, %34
  %36 = getelementptr inbounds i8, ptr %27, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !17
  %38 = sitofp i32 %37 to double
  %39 = call double @llvm.fmuladd.f64(double %7, double %38, double %35)
  %40 = fcmp olt double %31, %39
  br i1 %40, label %41, label %56

41:                                               ; preds = %25
  store double %39, ptr %30, align 8, !tbaa !15
  %42 = load i32, ptr %24, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  %44 = getelementptr inbounds [1010 x i32], ptr @cnt, i64 0, i64 %29
  store i32 %43, ptr %44, align 4, !tbaa !5
  %.not31 = icmp slt i32 %43, %1
  br i1 %.not31, label %45, label %.critedge

45:                                               ; preds = %41
  %46 = getelementptr inbounds [1010 x i8], ptr @vis, i64 0, i64 %29
  %47 = load i8, ptr %46, align 1, !tbaa !9, !range !18, !noundef !19
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %56, label %49

49:                                               ; preds = %45
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %50 unwind label %54

50:                                               ; preds = %49
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1010 x i8], ptr @vis, i64 0, i64 %52
  store i8 1, ptr %53, align 1, !tbaa !9
  br label %56

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

56:                                               ; preds = %25, %50, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %57 = getelementptr inbounds i8, ptr %27, i64 8
  %.023 = load i32, ptr %57, align 4, !tbaa !5
  %.not30 = icmp eq i32 %.023, 0
  br i1 %.not30, label %.critedge34.loopexit, label %25, !llvm.loop !20

.critedge:                                        ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  br label %.loopexit, !llvm.loop !21

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

58:                                               ; preds = %54, %13
  %.pn = phi { ptr, i32 } [ %14, %13 ], [ %55, %54 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #6
  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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { 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 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!14, !6, i64 4}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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