; LLVM IR from Tunghohin/Competitive_Coding :: Poj/poj2240.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.edge = type { double, i32, i32 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@e = external dso_local global [1000010 x %struct.edge], align 16
@head = external dso_local global [32 x i32], align 16
@dist = external dso_local global [32 x double], align 16
@in_que = external dso_local global [32 x i8], align 16
@cnt = external dso_local global [32 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z4spfai(i32 noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca i1, align 1
  %3 = alloca i32, align 4
  %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 i32 %0, ptr %3, align 4, !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 !5
  br label %12

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

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

17:                                               ; preds = %12
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [32 x double], ptr @dist, i64 0, i64 %19
  store double 1.000000e+05, ptr %20, align 8, !tbaa !9
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %21 unwind label %31

21:                                               ; preds = %17
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [32 x i8], ptr @in_que, i64 0, i64 %23
  store i8 1, ptr %24, align 1, !tbaa !11
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [32 x i32], ptr @cnt, i64 0, i64 %26
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %21
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %5, align 4, !tbaa !5
  br label %12, !llvm.loop !13

31:                                               ; preds = %17
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %6, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %150

35:                                               ; preds = %16
  br label %36

36:                                               ; preds = %145, %35
  %37 = invoke noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %38 unwind label %56

38:                                               ; preds = %36
  %39 = xor i1 %37, true
  br i1 %39, label %40, label %147

40:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %41 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %42 unwind label %60

42:                                               ; preds = %40
  %43 = load i32, ptr %41, align 4, !tbaa !5
  store i32 %43, ptr %8, align 4, !tbaa !5
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %4)
          to label %44 unwind label %60

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

52:                                               ; preds = %134, %44
  %53 = load i32, ptr %9, align 4, !tbaa !5
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %64, label %55

55:                                               ; preds = %52
  store i32 7, ptr %10, align 4
  br label %140

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

60:                                               ; preds = %42, %40
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %6, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %7, align 4
  br label %146

64:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [1000010 x %struct.edge], ptr @e, i64 0, i64 %66
  %68 = getelementptr inbounds %struct.edge, ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 8, !tbaa !15
  store i32 %69, ptr %11, align 4, !tbaa !5
  %70 = load i32, ptr %11, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [32 x double], ptr @dist, i64 0, i64 %71
  %73 = load double, ptr %72, align 8, !tbaa !9
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [32 x double], ptr @dist, i64 0, i64 %75
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = load i32, ptr %9, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [1000010 x %struct.edge], ptr @e, i64 0, i64 %79
  %81 = getelementptr inbounds %struct.edge, ptr %80, i32 0, i32 0
  %82 = load double, ptr %81, align 16, !tbaa !17
  %83 = fmul double %77, %82
  %84 = fcmp olt double %73, %83
  br i1 %84, label %85, label %130

85:                                               ; preds = %64
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [32 x double], ptr @dist, i64 0, i64 %87
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1000010 x %struct.edge], ptr @e, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.edge, ptr %92, i32 0, i32 0
  %94 = load double, ptr %93, align 16, !tbaa !17
  %95 = fmul double %89, %94
  %96 = load i32, ptr %11, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [32 x double], ptr @dist, i64 0, i64 %97
  store double %95, ptr %98, align 8, !tbaa !9
  %99 = load i32, ptr %8, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [32 x i32], ptr @cnt, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  %104 = load i32, ptr %11, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [32 x i32], ptr @cnt, i64 0, i64 %105
  store i32 %103, ptr %106, align 4, !tbaa !5
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [32 x i32], ptr @cnt, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr %3, align 4, !tbaa !5
  %112 = icmp sge i32 %110, %111
  br i1 %112, label %113, label %114

113:                                              ; preds = %85
  store i1 true, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %131

114:                                              ; preds = %85
  %115 = load i32, ptr %11, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [32 x i8], ptr @in_que, i64 0, i64 %116
  %118 = load i8, ptr %117, align 1, !tbaa !11, !range !18, !noundef !19
  %119 = trunc i8 %118 to i1
  br i1 %119, label %129, label %120

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

121:                                              ; preds = %120
  %122 = load i32, ptr %11, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [32 x i8], ptr @in_que, i64 0, i64 %123
  store i8 1, ptr %124, align 1, !tbaa !11
  br label %129

125:                                              ; preds = %120
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %6, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, 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 %146

129:                                              ; preds = %121, %114
  br label %130

130:                                              ; preds = %129, %64
  store i32 0, ptr %10, align 4
  br label %131

131:                                              ; preds = %130, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  %132 = load i32, ptr %10, align 4
  switch i32 %132, label %140 [
    i32 0, label %133
  ]

133:                                              ; preds = %131
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [1000010 x %struct.edge], ptr @e, i64 0, i64 %136
  %138 = getelementptr inbounds %struct.edge, ptr %137, i32 0, i32 2
  %139 = load i32, ptr %138, align 4, !tbaa !20
  store i32 %139, ptr %9, align 4, !tbaa !5
  br label %52, !llvm.loop !21

140:                                              ; preds = %131, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  %141 = load i32, ptr %10, align 4
  switch i32 %141, label %143 [
    i32 7, label %142
  ]

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

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

145:                                              ; preds = %143
  br label %36, !llvm.loop !22

146:                                              ; preds = %125, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %150

147:                                              ; preds = %38
  store i1 false, ptr %2, align 1
  store i32 1, ptr %10, align 4
  br label %148

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

150:                                              ; preds = %146, %56, %31
  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 %151

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

; 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: 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) #1

; 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 = !{!"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 8}
!16 = !{!"_ZTS4edge", !10, i64 0, !6, i64 8, !6, i64 12}
!17 = !{!16, !10, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!16, !6, i64 12}
!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 { double, i32, i32 }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@e = external dso_local local_unnamed_addr global [1000010 x %struct.edge], align 16
@head = external dso_local local_unnamed_addr global [32 x i32], align 16
@dist = external dso_local local_unnamed_addr global [32 x double], align 16
@in_que = external dso_local local_unnamed_addr global [32 x i8], align 16
@cnt = external dso_local local_unnamed_addr global [32 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z4spfai(i32 noundef %0) local_unnamed_addr #0 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
  %.not34 = icmp slt i32 %0, 1
  br i1 %.not34, label %._crit_edge, label %.lr.ph

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

.lr.ph:                                           ; preds = %1, %8
  %storemerge35 = phi i32 [ %13, %8 ], [ 1, %1 ]
  %6 = sext i32 %storemerge35 to i64
  %7 = getelementptr inbounds [32 x double], ptr @dist, i64 0, i64 %6
  store double 1.000000e+05, ptr %7, align 8, !tbaa !9
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %8 unwind label %14

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

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

.critedge31.loopexit:                             ; preds = %51, %.lr.ph42
  %16 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %16, label %.loopexit, label %.lr.ph42

.lr.ph42:                                         ; preds = %._crit_edge, %.critedge31.loopexit
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %18 = load i32, ptr %17, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [32 x i8], ptr @in_que, i64 0, i64 %19
  store i8 0, ptr %20, align 1, !tbaa !11
  %21 = getelementptr inbounds [32 x i32], ptr @head, i64 0, i64 %19
  %.01936 = load i32, ptr %21, align 4, !tbaa !5
  %.not2737 = icmp eq i32 %.01936, 0
  br i1 %.not2737, label %.critedge31.loopexit, label %.lr.ph40

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

24:                                               ; preds = %.lr.ph40, %51
  %.01938 = phi i32 [ %.01936, %.lr.ph40 ], [ %.019, %51 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %25 = sext i32 %.01938 to i64
  %26 = getelementptr inbounds [1000010 x %struct.edge], ptr @e, i64 0, i64 %25
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load i32, ptr %27, align 8, !tbaa !15
  store i32 %28, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [32 x double], ptr @dist, i64 0, i64 %29
  %31 = load double, ptr %30, align 8, !tbaa !9
  %32 = load double, ptr %22, align 8, !tbaa !9
  %33 = load double, ptr %26, align 16, !tbaa !17
  %34 = fmul double %32, %33
  %35 = fcmp olt double %31, %34
  br i1 %35, label %36, label %51

36:                                               ; preds = %24
  store double %34, ptr %30, align 8, !tbaa !9
  %37 = load i32, ptr %23, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  %39 = getelementptr inbounds [32 x i32], ptr @cnt, i64 0, i64 %29
  store i32 %38, ptr %39, align 4, !tbaa !5
  %.not28 = icmp slt i32 %38, %0
  br i1 %.not28, label %40, label %.critedge

40:                                               ; preds = %36
  %41 = getelementptr inbounds [32 x i8], ptr @in_que, i64 0, i64 %29
  %42 = load i8, ptr %41, align 1, !tbaa !11, !range !18, !noundef !19
  %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 [32 x i8], ptr @in_que, i64 0, i64 %47
  store i8 1, ptr %48, align 1, !tbaa !11
  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 %53

51:                                               ; preds = %24, %45, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %52 = getelementptr inbounds i8, ptr %26, i64 12
  %.019 = load i32, ptr %52, align 4, !tbaa !5
  %.not27 = icmp eq i32 %.019, 0
  br i1 %.not27, label %.critedge31.loopexit, label %24, !llvm.loop !20

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

.loopexit:                                        ; preds = %.critedge31.loopexit, %._crit_edge, %.critedge
  %.4 = phi i1 [ true, %.critedge ], [ false, %._crit_edge ], [ false, %.critedge31.loopexit ]
  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 %.4

53:                                               ; preds = %49, %14
  %.pn = phi { ptr, i32 } [ %15, %14 ], [ %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 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 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) #1

; 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 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 = { 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 8}
!16 = !{!"_ZTS4edge", !10, i64 0, !6, i64 8, !6, i64 12}
!17 = !{!16, !10, i64 0}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


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