; LLVM IR from Tunghohin/Competitive_Coding :: Poj/poj2502.ll (Z4spfav)

; 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, double }
%"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 [4000010 x %struct.edge], align 16
@head = external dso_local global [400 x i32], align 16
@dist = external dso_local global [400 x double], align 16
@in_que = external dso_local global [400 x i8], 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 void @_Z4spfav() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::queue", align 8
  %3 = alloca i32, align 4
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %20, %0
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = icmp slt i32 %10, 400
  br i1 %11, label %13, label %12

12:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %23

13:                                               ; preds = %9
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [400 x double], ptr @dist, i64 0, i64 %15
  store double 1.000000e+18, ptr %16, align 8, !tbaa !9
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [400 x i8], ptr @in_que, i64 0, i64 %18
  store i8 0, ptr %19, align 1, !tbaa !11
  br label %20

20:                                               ; preds = %13
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %1, align 4, !tbaa !5
  br label %9, !llvm.loop !13

23:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 80, ptr %2) #4
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %24 unwind label %45

24:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  store i8 1, ptr @in_que, align 16, !tbaa !11
  store double 0.000000e+00, ptr @dist, align 16, !tbaa !9
  br label %25

25:                                               ; preds = %114, %24
  %26 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %27 unwind label %49

27:                                               ; preds = %25
  %28 = xor i1 %26, true
  br i1 %28, label %29, label %116

29:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %30 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %31 unwind label %53

31:                                               ; preds = %29
  %32 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %32, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
          to label %33 unwind label %53

33:                                               ; preds = %31
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [400 x i8], ptr @in_que, i64 0, i64 %35
  store i8 0, ptr %36, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [400 x i32], ptr @head, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  store i32 %40, ptr %7, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %108, %33
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %57, label %44

44:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %114

45:                                               ; preds = %23
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %4, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %117

49:                                               ; preds = %25
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %4, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %5, align 4
  br label %117

53:                                               ; preds = %31, %29
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %4, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %5, align 4
  br label %115

57:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [4000010 x %struct.edge], ptr @e, i64 0, i64 %59
  %61 = getelementptr inbounds %struct.edge, ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 16, !tbaa !15
  store i32 %62, ptr %8, align 4, !tbaa !5
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [400 x double], ptr @dist, i64 0, i64 %64
  %66 = load double, ptr %65, align 8, !tbaa !9
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [400 x double], ptr @dist, i64 0, i64 %68
  %70 = load double, ptr %69, align 8, !tbaa !9
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [4000010 x %struct.edge], ptr @e, i64 0, i64 %72
  %74 = getelementptr inbounds %struct.edge, ptr %73, i32 0, i32 2
  %75 = load double, ptr %74, align 8, !tbaa !17
  %76 = fadd double %70, %75
  %77 = fcmp ogt double %66, %76
  br i1 %77, label %78, label %107

78:                                               ; preds = %57
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [400 x double], ptr @dist, i64 0, i64 %80
  %82 = load double, ptr %81, align 8, !tbaa !9
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [4000010 x %struct.edge], ptr @e, i64 0, i64 %84
  %86 = getelementptr inbounds %struct.edge, ptr %85, i32 0, i32 2
  %87 = load double, ptr %86, align 8, !tbaa !17
  %88 = fadd double %82, %87
  %89 = load i32, ptr %8, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [400 x double], ptr @dist, i64 0, i64 %90
  store double %88, ptr %91, align 8, !tbaa !9
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [400 x i8], ptr @in_que, i64 0, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !11, !range !18, !noundef !19
  %96 = trunc i8 %95 to i1
  br i1 %96, label %106, label %97

97:                                               ; preds = %78
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %98 unwind label %102

98:                                               ; preds = %97
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [400 x i8], ptr @in_que, i64 0, i64 %100
  store i8 1, ptr %101, align 1, !tbaa !11
  br label %106

102:                                              ; preds = %97
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %4, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %115

106:                                              ; preds = %98, %78
  br label %107

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

108:                                              ; preds = %107
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [4000010 x %struct.edge], ptr @e, i64 0, i64 %110
  %112 = getelementptr inbounds %struct.edge, ptr %111, i32 0, i32 1
  %113 = load i32, ptr %112, align 4, !tbaa !20
  store i32 %113, ptr %7, align 4, !tbaa !5
  br label %41, !llvm.loop !21

114:                                              ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %25, !llvm.loop !22

115:                                              ; preds = %102, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %117

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

117:                                              ; preds = %115, %49, %45
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %2) #4
  br label %118

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

; 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 @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(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: mustprogress uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #1 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4, !10, i64 8}
!17 = !{!16, !10, i64 8}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!16, !6, 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, double }
%"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 [4000010 x %struct.edge], align 16
@head = external dso_local local_unnamed_addr global [400 x i32], align 16
@dist = external dso_local local_unnamed_addr global [400 x double], align 16
@in_que = external dso_local local_unnamed_addr global [400 x i8], 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 void @_Z4spfav() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
vector.ph:
  %0 = alloca %"class.std::queue", align 8
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(399) getelementptr inbounds (i8, ptr @in_que, i64 1), i8 0, i64 399, i1 false), !tbaa !5
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next.2, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %3 = getelementptr inbounds [400 x double], ptr @dist, i64 0, i64 %offset.idx
  %4 = getelementptr inbounds i8, ptr %3, i64 16
  store <2 x double> <double 1.000000e+18, double 1.000000e+18>, ptr %3, align 8, !tbaa !9
  store <2 x double> <double 1.000000e+18, double 1.000000e+18>, ptr %4, align 8, !tbaa !9
  %offset.idx.1 = add nuw nsw i64 %index, 5
  %5 = getelementptr inbounds [400 x double], ptr @dist, i64 0, i64 %offset.idx.1
  %6 = getelementptr inbounds i8, ptr %5, i64 16
  store <2 x double> <double 1.000000e+18, double 1.000000e+18>, ptr %5, align 8, !tbaa !9
  store <2 x double> <double 1.000000e+18, double 1.000000e+18>, ptr %6, align 8, !tbaa !9
  %offset.idx.2 = add nuw nsw i64 %index, 9
  %7 = getelementptr inbounds [400 x double], ptr @dist, i64 0, i64 %offset.idx.2
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  store <2 x double> <double 1.000000e+18, double 1.000000e+18>, ptr %7, align 8, !tbaa !9
  store <2 x double> <double 1.000000e+18, double 1.000000e+18>, ptr %8, align 8, !tbaa !9
  %index.next.2 = add nuw nsw i64 %index, 12
  %9 = icmp eq i64 %index.next.2, 396
  br i1 %9, label %scalar.ph, label %vector.body, !llvm.loop !11

scalar.ph:                                        ; preds = %vector.body
  store double 1.000000e+18, ptr getelementptr inbounds (i8, ptr @dist, i64 3176), align 8, !tbaa !9
  store double 1.000000e+18, ptr getelementptr inbounds (i8, ptr @dist, i64 3184), align 16, !tbaa !9
  store double 1.000000e+18, ptr getelementptr inbounds (i8, ptr @dist, i64 3192), align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %0) #5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  store i32 0, ptr %1, align 4, !tbaa !15
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 4 dereferenceable(4) %1)
          to label %10 unwind label %19

10:                                               ; preds = %scalar.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  store i8 1, ptr @in_que, align 16, !tbaa !5
  store double 0.000000e+00, ptr @dist, align 16, !tbaa !9
  %11 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  br i1 %11, label %._crit_edge, label %.lr.ph23

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

.lr.ph23:                                         ; preds = %10, %.loopexit
  %13 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %14 = load i32, ptr %13, align 4, !tbaa !15
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %0)
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [400 x i8], ptr @in_que, i64 0, i64 %15
  store i8 0, ptr %16, align 1, !tbaa !5
  %17 = getelementptr inbounds [400 x i32], ptr @head, i64 0, i64 %15
  %.020 = load i32, ptr %17, align 4, !tbaa !15
  %.not21 = icmp eq i32 %.020, 0
  br i1 %.not21, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph23
  %18 = getelementptr inbounds [400 x double], ptr @dist, i64 0, i64 %15
  br label %21

19:                                               ; preds = %scalar.ph
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  br label %46

21:                                               ; preds = %.lr.ph, %44
  %.022 = phi i32 [ %.020, %.lr.ph ], [ %.0, %44 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %22 = sext i32 %.022 to i64
  %23 = getelementptr inbounds [4000010 x %struct.edge], ptr @e, i64 0, i64 %22
  %24 = load i32, ptr %23, align 16, !tbaa !18
  store i32 %24, ptr %2, align 4, !tbaa !15
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [400 x double], ptr @dist, i64 0, i64 %25
  %27 = load double, ptr %26, align 8, !tbaa !9
  %28 = load double, ptr %18, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %23, i64 8
  %30 = load double, ptr %29, align 8, !tbaa !20
  %31 = fadd double %28, %30
  %32 = fcmp ogt double %27, %31
  br i1 %32, label %33, label %44

33:                                               ; preds = %21
  store double %31, ptr %26, align 8, !tbaa !9
  %34 = getelementptr inbounds [400 x i8], ptr @in_que, i64 0, i64 %25
  %35 = load i8, ptr %34, align 1, !tbaa !5, !range !21, !noundef !22
  %36 = trunc nuw i8 %35 to i1
  br i1 %36, label %44, label %37

37:                                               ; preds = %33
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %0, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %38 unwind label %42

38:                                               ; preds = %37
  %39 = load i32, ptr %2, align 4, !tbaa !15
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [400 x i8], ptr @in_que, i64 0, i64 %40
  store i8 1, ptr %41, align 1, !tbaa !5
  br label %44

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

44:                                               ; preds = %33, %38, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %45 = getelementptr inbounds i8, ptr %23, i64 4
  %.0 = load i32, ptr %45, align 4, !tbaa !15
  %.not = icmp eq i32 %.0, 0
  br i1 %.not, label %.loopexit, label %21, !llvm.loop !23

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

46:                                               ; preds = %42, %19
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %20, %19 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %0) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %0) #5
  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 @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushEOi(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: 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

; 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 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 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !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 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = distinct !{!17, !12}
!18 = !{!19, !16, i64 0}
!19 = !{!"_ZTS4edge", !16, i64 0, !16, i64 4, !10, i64 8}
!20 = !{!19, !10, i64 8}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !12}


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