; LLVM IR from ADJA/algos :: Graphs/MinCostDijkstra.ll (Z8dijkstrav)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl" }
%"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.edge = type { i32, i32, i32, i32, i64 }

@e = external dso_local global %"class.std::vector", align 8
@g = external dso_local global [1050 x %"class.std::vector.0"], align 16
@phi = external dso_local global [1050 x i64], align 16
@dist = external dso_local global [1050 x i64], align 16
@used = external dso_local global [1050 x i8], align 16
@par = external dso_local global [1050 x i32], align 16
@s = external dso_local global i32, align 4
@t = external dso_local global i32, align 4

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z8dijkstrav() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #2
  %10 = load i32, ptr @s, align 4, !tbaa !5
  store i32 %10, ptr %1, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %23, %0
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = load i32, ptr @t, align 4, !tbaa !5
  %14 = icmp sle i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #2
  br label %26

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

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

26:                                               ; preds = %15
  %27 = load i32, ptr @s, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %28
  store i64 0, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #2
  %30 = load i32, ptr @s, align 4, !tbaa !5
  store i32 %30, ptr %2, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %159, %26
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr @t, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #2
  br label %162

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  store i32 -1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  %37 = load i32, ptr @s, align 4, !tbaa !5
  store i32 %37, ptr %5, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %66, %36
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = load i32, ptr @t, align 4, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  br label %69

43:                                               ; preds = %38
  %44 = load i32, ptr %5, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1050 x i8], ptr @used, i64 0, i64 %45
  %47 = load i8, ptr %46, align 1, !tbaa !11, !range !15, !noundef !16
  %48 = trunc i8 %47 to i1
  br i1 %48, label %65, label %49

49:                                               ; preds = %43
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = icmp eq i32 %50, -1
  br i1 %51, label %62, label %52

52:                                               ; preds = %49
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !9
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %61 = icmp slt i64 %56, %60
  br i1 %61, label %62, label %64

62:                                               ; preds = %52, %49
  %63 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %63, ptr %4, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %62, %52
  br label %65

65:                                               ; preds = %64, %43
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %5, align 4, !tbaa !5
  br label %38, !llvm.loop !17

69:                                               ; preds = %42
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [1050 x i8], ptr @used, i64 0, i64 %71
  store i8 1, ptr %72, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %155, %69
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [1050 x %"class.std::vector.0"], ptr @g, i64 0, i64 %76
  %78 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %77) #2
  %79 = trunc i64 %78 to i32
  %80 = icmp slt i32 %74, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %73
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  br label %158

82:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [1050 x %"class.std::vector.0"], ptr @g, i64 0, i64 %84
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %85, i64 noundef %87) #2
  %89 = load i32, ptr %88, align 4, !tbaa !5
  store i32 %89, ptr %7, align 4, !tbaa !5
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %91) #2
  %93 = getelementptr inbounds %struct.edge, ptr %92, i32 0, i32 2
  %94 = load i32, ptr %93, align 8, !tbaa !18
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %96) #2
  %98 = getelementptr inbounds %struct.edge, ptr %97, i32 0, i32 3
  %99 = load i32, ptr %98, align 4, !tbaa !20
  %100 = icmp eq i32 %94, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %82
  store i32 13, ptr %3, align 4
  br label %152

102:                                              ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %104) #2
  %106 = getelementptr inbounds %struct.edge, ptr %105, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !21
  store i32 %107, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %109) #2
  %111 = getelementptr inbounds %struct.edge, ptr %110, i32 0, i32 4
  %112 = load i64, ptr %111, align 8, !tbaa !22
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [1050 x i64], ptr @phi, i64 0, i64 %114
  %116 = load i64, ptr %115, align 8, !tbaa !9
  %117 = add nsw i64 %112, %116
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [1050 x i64], ptr @phi, i64 0, i64 %119
  %121 = load i64, ptr %120, align 8, !tbaa !9
  %122 = sub nsw i64 %117, %121
  %123 = trunc i64 %122 to i32
  store i32 %123, ptr %9, align 4, !tbaa !5
  %124 = load i32, ptr %4, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %125
  %127 = load i64, ptr %126, align 8, !tbaa !9
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = add nsw i64 %127, %129
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %132
  %134 = load i64, ptr %133, align 8, !tbaa !9
  %135 = icmp slt i64 %130, %134
  br i1 %135, label %136, label %151

136:                                              ; preds = %102
  %137 = load i32, ptr %4, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !9
  %141 = load i32, ptr %9, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = add nsw i64 %140, %142
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %145
  store i64 %143, ptr %146, align 8, !tbaa !9
  %147 = load i32, ptr %7, align 4, !tbaa !5
  %148 = load i32, ptr %8, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %149
  store i32 %147, ptr %150, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %136, %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  store i32 0, ptr %3, align 4
  br label %152

152:                                              ; preds = %151, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  %153 = load i32, ptr %3, align 4
  switch i32 %153, label %163 [
    i32 0, label %154
    i32 13, label %155
  ]

154:                                              ; preds = %152
  br label %155

155:                                              ; preds = %154, %152
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %6, align 4, !tbaa !5
  br label %73, !llvm.loop !23

158:                                              ; preds = %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %2, align 4, !tbaa !5
  br label %31, !llvm.loop !24

162:                                              ; preds = %35
  ret void

163:                                              ; preds = %152
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !14}
!18 = !{!19, !6, i64 8}
!19 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !10, i64 16}
!20 = !{!19, !6, i64 12}
!21 = !{!19, !6, i64 4}
!22 = !{!19, !10, i64 16}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl" }
%"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl" = type { %"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl_data" }
%"struct.std::_Vector_base<edge, std::allocator<edge>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@e = external dso_local global %"class.std::vector", align 8
@g = external dso_local global [1050 x %"class.std::vector.0"], align 16
@phi = external dso_local local_unnamed_addr global [1050 x i64], align 16
@dist = external dso_local local_unnamed_addr global [1050 x i64], align 16
@used = external dso_local local_unnamed_addr global [1050 x i8], align 16
@par = external dso_local local_unnamed_addr global [1050 x i32], align 16
@s = external dso_local local_unnamed_addr global i32, align 4
@t = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z8dijkstrav() local_unnamed_addr #0 {
  %1 = load i32, ptr @s, align 4, !tbaa !5
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %.not40 = icmp sgt i32 %1, %2
  %.pre = sext i32 %1 to i64
  br i1 %.not40, label %._crit_edge.thread, label %.lr.ph.preheader

._crit_edge.thread:                               ; preds = %0
  %3 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %.pre
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %._crit_edge56

.lr.ph.preheader:                                 ; preds = %0
  %scevgep = getelementptr i8, ptr @used, i64 %.pre
  %4 = sub i32 %2, %1
  %5 = zext i32 %4 to i64
  %6 = add nuw nsw i64 %5, 1
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 0, i64 %6, i1 false), !tbaa !11
  %7 = add i32 %2, 1
  %8 = zext i32 %4 to i64
  %9 = add nuw nsw i64 %8, 1
  %min.iters.check = icmp ult i32 %4, 3
  br i1 %min.iters.check, label %.lr.ph.preheader68, label %vector.ph

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

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %9, 8589934588
  %ind.end = add nsw i64 %n.vec, %.pre
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = add i64 %index, %.pre
  %10 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %offset.idx
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  store <2 x i64> <i64 1000000000000000, i64 1000000000000000>, ptr %10, align 8, !tbaa !9
  store <2 x i64> <i64 1000000000000000, i64 1000000000000000>, ptr %11, align 8, !tbaa !9
  %index.next = add nuw i64 %index, 4
  %12 = icmp eq i64 %index.next, %n.vec
  br i1 %12, label %middle.block, label %vector.body, !llvm.loop !13

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

._crit_edge:                                      ; preds = %.lr.ph, %middle.block
  %13 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %.pre
  store i64 0, ptr %13, align 8, !tbaa !9
  br i1 %.not40, label %._crit_edge56, label %.lr.ph55

.lr.ph:                                           ; preds = %.lr.ph.preheader68, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader68 ]
  %14 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %indvars.iv
  store i64 1000000000000000, ptr %14, align 8, !tbaa !9
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %7, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge56:                                    ; preds = %._crit_edge51, %._crit_edge.thread, %._crit_edge
  ret void

.lr.ph55:                                         ; preds = %._crit_edge, %._crit_edge51
  %15 = phi i32 [ %73, %._crit_edge51 ], [ %2, %._crit_edge ]
  %.03353 = phi i32 [ %72, %._crit_edge51 ], [ %1, %._crit_edge ]
  %16 = load i32, ptr @s, align 4, !tbaa !5
  %.not3942 = icmp sgt i32 %16, %15
  br i1 %.not3942, label %._crit_edge47, label %.lr.ph46.preheader

.lr.ph46.preheader:                               ; preds = %.lr.ph55
  %17 = sext i32 %16 to i64
  %18 = add i32 %15, 1
  %19 = sub i32 %18, %16
  %xtraiter = and i32 %19, 1
  %20 = icmp eq i32 %15, %16
  br i1 %20, label %._crit_edge47.loopexit.unr-lcssa, label %.lr.ph46.preheader.new

.lr.ph46.preheader.new:                           ; preds = %.lr.ph46.preheader
  %unroll_iter = and i32 %19, -2
  br label %.lr.ph46

._crit_edge47.loopexit.unr-lcssa:                 ; preds = %71, %.lr.ph46.preheader
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph46.preheader ], [ %.1.1, %71 ]
  %indvars.iv58.unr = phi i64 [ %17, %.lr.ph46.preheader ], [ %indvars.iv.next59.1, %71 ]
  %.03643.unr = phi i32 [ -1, %.lr.ph46.preheader ], [ %.1.1, %71 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge47, label %.lr.ph46.epil

.lr.ph46.epil:                                    ; preds = %._crit_edge47.loopexit.unr-lcssa
  %21 = getelementptr inbounds [1050 x i8], ptr @used, i64 0, i64 %indvars.iv58.unr
  %22 = load i8, ptr %21, align 1, !tbaa !11, !range !18, !noundef !19
  %23 = trunc nuw i8 %22 to i1
  br i1 %23, label %._crit_edge47, label %24

24:                                               ; preds = %.lr.ph46.epil
  %25 = icmp eq i32 %.03643.unr, -1
  br i1 %25, label %33, label %26

26:                                               ; preds = %24
  %27 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %indvars.iv58.unr
  %28 = load i64, ptr %27, align 8, !tbaa !9
  %29 = sext i32 %.03643.unr to i64
  %30 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %29
  %31 = load i64, ptr %30, align 8, !tbaa !9
  %32 = icmp slt i64 %28, %31
  br i1 %32, label %33, label %._crit_edge47

33:                                               ; preds = %26, %24
  %34 = trunc nsw i64 %indvars.iv58.unr to i32
  br label %._crit_edge47

._crit_edge47:                                    ; preds = %._crit_edge47.loopexit.unr-lcssa, %33, %26, %.lr.ph46.epil, %.lr.ph55
  %.036.lcssa = phi i32 [ -1, %.lr.ph55 ], [ %.1.lcssa.ph, %._crit_edge47.loopexit.unr-lcssa ], [ %.03643.unr, %.lr.ph46.epil ], [ %34, %33 ], [ %.03643.unr, %26 ]
  %35 = sext i32 %.036.lcssa to i64
  %36 = getelementptr inbounds [1050 x i8], ptr @used, i64 0, i64 %35
  store i8 1, ptr %36, align 1, !tbaa !11
  %37 = getelementptr inbounds [1050 x %"class.std::vector.0"], ptr @g, i64 0, i64 %35
  %38 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #2
  %39 = trunc i64 %38 to i32
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph50, label %._crit_edge51

.lr.ph50:                                         ; preds = %._crit_edge47
  %41 = getelementptr inbounds [1050 x i64], ptr @phi, i64 0, i64 %35
  %42 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %35
  br label %74

.lr.ph46:                                         ; preds = %71, %.lr.ph46.preheader.new
  %indvars.iv58 = phi i64 [ %17, %.lr.ph46.preheader.new ], [ %indvars.iv.next59.1, %71 ]
  %.03643 = phi i32 [ -1, %.lr.ph46.preheader.new ], [ %.1.1, %71 ]
  %niter = phi i32 [ 0, %.lr.ph46.preheader.new ], [ %niter.next.1, %71 ]
  %43 = getelementptr inbounds [1050 x i8], ptr @used, i64 0, i64 %indvars.iv58
  %44 = load i8, ptr %43, align 1, !tbaa !11, !range !18, !noundef !19
  %45 = trunc nuw i8 %44 to i1
  br i1 %45, label %.lr.ph46.1, label %46

46:                                               ; preds = %.lr.ph46
  %47 = icmp eq i32 %.03643, -1
  br i1 %47, label %55, label %48

48:                                               ; preds = %46
  %49 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %indvars.iv58
  %50 = load i64, ptr %49, align 8, !tbaa !9
  %51 = sext i32 %.03643 to i64
  %52 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !9
  %54 = icmp slt i64 %50, %53
  br i1 %54, label %55, label %.lr.ph46.1

55:                                               ; preds = %48, %46
  %56 = trunc nsw i64 %indvars.iv58 to i32
  br label %.lr.ph46.1

.lr.ph46.1:                                       ; preds = %.lr.ph46, %55, %48
  %.1 = phi i32 [ %.03643, %.lr.ph46 ], [ %56, %55 ], [ %.03643, %48 ]
  %indvars.iv.next59 = add nsw i64 %indvars.iv58, 1
  %57 = getelementptr inbounds [1050 x i8], ptr @used, i64 0, i64 %indvars.iv.next59
  %58 = load i8, ptr %57, align 1, !tbaa !11, !range !18, !noundef !19
  %59 = trunc nuw i8 %58 to i1
  br i1 %59, label %71, label %60

60:                                               ; preds = %.lr.ph46.1
  %61 = icmp eq i32 %.1, -1
  br i1 %61, label %69, label %62

62:                                               ; preds = %60
  %63 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %indvars.iv.next59
  %64 = load i64, ptr %63, align 8, !tbaa !9
  %65 = sext i32 %.1 to i64
  %66 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !9
  %68 = icmp slt i64 %64, %67
  br i1 %68, label %69, label %71

69:                                               ; preds = %62, %60
  %70 = trunc nsw i64 %indvars.iv.next59 to i32
  br label %71

71:                                               ; preds = %69, %62, %.lr.ph46.1
  %.1.1 = phi i32 [ %.1, %.lr.ph46.1 ], [ %70, %69 ], [ %.1, %62 ]
  %indvars.iv.next59.1 = add nsw i64 %indvars.iv58, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge47.loopexit.unr-lcssa, label %.lr.ph46, !llvm.loop !20

._crit_edge51:                                    ; preds = %106, %._crit_edge47
  %72 = add nsw i32 %.03353, 1
  %73 = load i32, ptr @t, align 4, !tbaa !5
  %.not38.not = icmp slt i32 %.03353, %73
  br i1 %.not38.not, label %.lr.ph55, label %._crit_edge56, !llvm.loop !21

74:                                               ; preds = %.lr.ph50, %106
  %indvars.iv63 = phi i64 [ 0, %.lr.ph50 ], [ %indvars.iv.next64, %106 ]
  %75 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef %indvars.iv63) #2
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %77) #2
  %79 = getelementptr inbounds i8, ptr %78, i64 8
  %80 = load i32, ptr %79, align 8, !tbaa !22
  %81 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %77) #2
  %82 = getelementptr inbounds i8, ptr %81, i64 12
  %83 = load i32, ptr %82, align 4, !tbaa !24
  %84 = icmp eq i32 %80, %83
  br i1 %84, label %106, label %85

85:                                               ; preds = %74
  %86 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %77) #2
  %87 = getelementptr inbounds i8, ptr %86, i64 4
  %88 = load i32, ptr %87, align 4, !tbaa !25
  %89 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %77) #2
  %90 = getelementptr inbounds i8, ptr %89, i64 16
  %91 = load i64, ptr %90, align 8, !tbaa !26
  %92 = load i64, ptr %41, align 8, !tbaa !9
  %93 = add nsw i64 %92, %91
  %94 = sext i32 %88 to i64
  %95 = getelementptr inbounds [1050 x i64], ptr @phi, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !9
  %97 = sub i64 %93, %96
  %98 = load i64, ptr %42, align 8, !tbaa !9
  %sext = shl i64 %97, 32
  %99 = ashr exact i64 %sext, 32
  %100 = add nsw i64 %99, %98
  %101 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %94
  %102 = load i64, ptr %101, align 8, !tbaa !9
  %103 = icmp slt i64 %100, %102
  br i1 %103, label %104, label %106

104:                                              ; preds = %85
  store i64 %100, ptr %101, align 8, !tbaa !9
  %105 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %94
  store i32 %76, ptr %105, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %85, %104, %74
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %107 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #2
  %sext66 = shl i64 %107, 32
  %108 = ashr exact i64 %sext66, 32
  %109 = icmp slt i64 %indvars.iv.next64, %108
  br i1 %109, label %74, label %._crit_edge51, !llvm.loop !27
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14, !16, !15}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = !{!23, !6, i64 8}
!23 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !10, i64 16}
!24 = !{!23, !6, i64 12}
!25 = !{!23, !6, i64 4}
!26 = !{!23, !10, i64 16}
!27 = distinct !{!27, !14}


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