; LLVM IR from Tunghohin/Competitive_Coding :: Poj/poj1860.ll (Z4spfaidi)

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

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

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

17:                                               ; preds = %26, %3
  %18 = load i32, ptr %8, align 4, !tbaa !5
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = icmp sle i32 %18, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %17
  %23 = load i32, ptr %8, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [110 x double], ptr @dist, i64 0, i64 %24
  store double -1.000000e+04, ptr %25, align 8, !tbaa !9
  br label %26

26:                                               ; preds = %22
  %27 = load i32, ptr %8, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %8, align 4, !tbaa !5
  br label %17, !llvm.loop !11

29:                                               ; preds = %21
  call void @llvm.memset.p0.i64(ptr align 16 @in_que, i8 0, i64 110, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @cnt, i8 0, i64 440, i1 false)
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %9, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %30 unwind label %55

30:                                               ; preds = %29
  %31 = load double, ptr %6, align 8, !tbaa !9
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [110 x double], ptr @dist, i64 0, i64 %33
  store double %31, ptr %34, align 8, !tbaa !9
  br label %35

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

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

39:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %40 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %41 unwind label %59

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

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

51:                                               ; preds = %134, %43
  %52 = load i32, ptr %13, align 4, !tbaa !5
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %63, label %54

54:                                               ; preds = %51
  store i32 7, ptr %14, align 4
  br label %140

55:                                               ; preds = %35, %29
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %10, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %11, align 4
  br label %150

59:                                               ; preds = %41, %39
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %10, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %11, align 4
  br label %146

63:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %64 = load i32, ptr %13, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [220 x %struct.edge], ptr @e, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.edge, ptr %66, i32 0, i32 0
  %68 = load i32, ptr %67, align 16, !tbaa !15
  store i32 %68, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %69 = load i32, ptr %12, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [110 x double], ptr @dist, i64 0, i64 %70
  %72 = load double, ptr %71, align 8, !tbaa !9
  %73 = load i32, ptr %13, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [220 x %struct.edge], ptr @e, i64 0, i64 %74
  %76 = getelementptr inbounds %struct.edge, ptr %75, i32 0, i32 2
  %77 = load double, ptr %76, align 16, !tbaa !17
  %78 = fsub double %72, %77
  %79 = load i32, ptr %13, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [220 x %struct.edge], ptr @e, i64 0, i64 %80
  %82 = getelementptr inbounds %struct.edge, ptr %81, i32 0, i32 1
  %83 = load double, ptr %82, align 8, !tbaa !18
  %84 = fmul double %78, %83
  store double %84, ptr %16, align 8, !tbaa !9
  %85 = load i32, ptr %15, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [110 x double], ptr @dist, i64 0, i64 %86
  %88 = load double, ptr %87, align 8, !tbaa !9
  %89 = load double, ptr %16, align 8, !tbaa !9
  %90 = fcmp olt double %88, %89
  br i1 %90, label %91, label %130

91:                                               ; preds = %63
  %92 = load double, ptr %16, align 8, !tbaa !9
  %93 = fcmp oge double %92, 0.000000e+00
  br i1 %93, label %94, label %130

94:                                               ; preds = %91
  %95 = load double, ptr %16, align 8, !tbaa !9
  %96 = load i32, ptr %15, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [110 x double], ptr @dist, i64 0, i64 %97
  store double %95, ptr %98, align 8, !tbaa !9
  %99 = load i32, ptr %12, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [110 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 %15, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [110 x i32], ptr @cnt, i64 0, i64 %105
  store i32 %103, ptr %106, align 4, !tbaa !5
  %107 = load i32, ptr %15, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [110 x i32], ptr @cnt, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = icmp sge i32 %110, %111
  br i1 %112, label %113, label %114

113:                                              ; preds = %94
  store i1 true, ptr %4, align 1
  store i32 1, ptr %14, align 4
  br label %131

114:                                              ; preds = %94
  %115 = load i32, ptr %15, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [110 x i8], ptr @in_que, i64 0, i64 %116
  %118 = load i8, ptr %117, align 1, !tbaa !13, !range !19, !noundef !20
  %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) %9, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %121 unwind label %125

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

125:                                              ; preds = %120
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %10, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %146

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

130:                                              ; preds = %129, %91, %63
  store i32 0, ptr %14, align 4
  br label %131

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

133:                                              ; preds = %131
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %13, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [220 x %struct.edge], ptr @e, i64 0, i64 %136
  %138 = getelementptr inbounds %struct.edge, ptr %137, i32 0, i32 3
  %139 = load i32, ptr %138, align 8, !tbaa !21
  store i32 %139, ptr %13, align 4, !tbaa !5
  br label %51, !llvm.loop !22

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

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

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

145:                                              ; preds = %143
  br label %35, !llvm.loop !23

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

147:                                              ; preds = %37
  store i1 false, ptr %4, align 1
  store i32 1, ptr %14, align 4
  br label %148

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

150:                                              ; preds = %146, %55
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #5
  br label %151

151:                                              ; preds = %150
  %152 = load ptr, ptr %10, align 8
  %153 = load i32, ptr %11, 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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: 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTS4edge", !6, i64 0, !10, i64 8, !10, i64 16, !6, i64 24}
!17 = !{!16, !10, i64 16}
!18 = !{!16, !10, i64 8}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!16, !6, i64 24}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.edge = type { i32, double, double, 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 }

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z4spfaidi(i32 noundef %0, double noundef %1, i32 noundef %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::queue", align 8
  %6 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  %.not41 = icmp slt i32 %2, 1
  br i1 %.not41, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %3
  %7 = add nuw i32 %2, 1
  %wide.trip.count = zext i32 %7 to i64
  %8 = zext nneg i32 %2 to i64
  %min.iters.check = icmp ult i32 %2, 4
  br i1 %min.iters.check, label %.lr.ph.preheader54, label %vector.ph

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

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %9 = getelementptr inbounds [110 x double], ptr @dist, i64 0, i64 %offset.idx
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  store <2 x double> <double -1.000000e+04, double -1.000000e+04>, ptr %9, align 8, !tbaa !9
  store <2 x double> <double -1.000000e+04, double -1.000000e+04>, ptr %10, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %11 = icmp eq i64 %index.next, %n.vec
  br i1 %11, label %middle.block, label %vector.body, !llvm.loop !11

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

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %3
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(110) @in_que, i8 0, i64 110, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(440) @cnt, i8 0, i64 440, i1 false)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %13 unwind label %26

.lr.ph:                                           ; preds = %.lr.ph.preheader54, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader54 ]
  %12 = getelementptr inbounds [110 x double], ptr @dist, i64 0, i64 %indvars.iv
  store double -1.000000e+04, ptr %12, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

13:                                               ; preds = %._crit_edge
  %14 = load i32, ptr %4, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [110 x double], ptr @dist, i64 0, i64 %15
  store double %1, ptr %16, align 8, !tbaa !9
  %17 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %17, label %.loopexit, label %.lr.ph49

.critedge38.loopexit:                             ; preds = %59, %.lr.ph49
  %18 = call noundef zeroext i1 @_ZNKSt5queueIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %18, label %.loopexit, label %.lr.ph49

.lr.ph49:                                         ; preds = %13, %.critedge38.loopexit
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5queueIiSt5dequeIiSaIiEEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %20 = load i32, ptr %19, align 4, !tbaa !5
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [110 x i8], ptr @in_que, i64 0, i64 %21
  store i8 0, ptr %22, align 1, !tbaa !16
  %23 = getelementptr inbounds [110 x i32], ptr @head, i64 0, i64 %21
  %.02843 = load i32, ptr %23, align 4, !tbaa !5
  %.not3444 = icmp eq i32 %.02843, 0
  br i1 %.not3444, label %.critedge38.loopexit, label %.lr.ph47

.lr.ph47:                                         ; preds = %.lr.ph49
  %24 = getelementptr inbounds [110 x double], ptr @dist, i64 0, i64 %21
  %25 = getelementptr inbounds [110 x i32], ptr @cnt, i64 0, i64 %21
  br label %28

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

28:                                               ; preds = %.lr.ph47, %59
  %.02845 = phi i32 [ %.02843, %.lr.ph47 ], [ %.028, %59 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %29 = sext i32 %.02845 to i64
  %30 = getelementptr inbounds [220 x %struct.edge], ptr @e, i64 0, i64 %29
  %31 = load i32, ptr %30, align 16, !tbaa !18
  store i32 %31, ptr %6, align 4, !tbaa !5
  %32 = load double, ptr %24, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %30, i64 16
  %34 = load double, ptr %33, align 16, !tbaa !20
  %35 = fsub double %32, %34
  %36 = getelementptr inbounds i8, ptr %30, i64 8
  %37 = load double, ptr %36, align 8, !tbaa !21
  %38 = fmul double %35, %37
  %39 = sext i32 %31 to i64
  %40 = getelementptr inbounds [110 x double], ptr @dist, i64 0, i64 %39
  %41 = load double, ptr %40, align 8, !tbaa !9
  %42 = fcmp olt double %41, %38
  %43 = fcmp oge double %38, 0.000000e+00
  %or.cond = and i1 %42, %43
  br i1 %or.cond, label %44, label %59

44:                                               ; preds = %28
  store double %38, ptr %40, align 8, !tbaa !9
  %45 = load i32, ptr %25, align 4, !tbaa !5
  %46 = add nsw i32 %45, 1
  %47 = getelementptr inbounds [110 x i32], ptr @cnt, i64 0, i64 %39
  store i32 %46, ptr %47, align 4, !tbaa !5
  %.not35 = icmp slt i32 %46, %2
  br i1 %.not35, label %48, label %.critedge

48:                                               ; preds = %44
  %49 = getelementptr inbounds [110 x i8], ptr @in_que, i64 0, i64 %39
  %50 = load i8, ptr %49, align 1, !tbaa !16, !range !22, !noundef !23
  %51 = trunc nuw i8 %50 to i1
  br i1 %51, label %59, label %52

52:                                               ; preds = %48
  invoke void @_ZNSt5queueIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %53 unwind label %57

53:                                               ; preds = %52
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [110 x i8], ptr @in_que, i64 0, i64 %55
  store i8 1, ptr %56, align 1, !tbaa !16
  br label %59

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

59:                                               ; preds = %28, %53, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  %60 = getelementptr inbounds i8, ptr %30, i64 24
  %.028 = load i32, ptr %60, align 8, !tbaa !5
  %.not34 = icmp eq i32 %.028, 0
  br i1 %.not34, label %.critedge38.loopexit, label %28, !llvm.loop !24

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

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

61:                                               ; preds = %57, %26
  %.pn = phi { ptr, i32 } [ %58, %57 ], [ %27, %26 ]
  call void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 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: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"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 = distinct !{!15, !12, !14, !13}
!16 = !{!17, !17, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!19, !6, i64 0}
!19 = !{!"_ZTS4edge", !6, i64 0, !10, i64 8, !10, i64 16, !6, i64 24}
!20 = !{!19, !10, i64 16}
!21 = !{!19, !10, i64 8}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}


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