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

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

@e = external dso_local global %"class.std::vector", align 8
@phi = external dso_local global [1050 x i64], align 16
@dist = external dso_local global [1050 x i64], 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
@_ZL3INF = external hidden constant i64, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11fordBellmanv() #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z8dijkstrav() #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z7minCosti(i32 noundef %0) #2 {
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.edge, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.edge, align 8
  %15 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !9
  call void @_Z11fordBellmanv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %16 = load i32, ptr @s, align 4, !tbaa !5
  store i32 %16, ptr %5, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %30, %1
  %18 = load i32, ptr %5, align 4, !tbaa !5
  %19 = load i32, ptr @t, 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 %5) #5
  br label %33

22:                                               ; preds = %17
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !9
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [1050 x i64], ptr @phi, i64 0, i64 %28
  store i64 %26, ptr %29, align 8, !tbaa !9
  br label %30

30:                                               ; preds = %22
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %5, align 4, !tbaa !5
  br label %17, !llvm.loop !11

33:                                               ; preds = %21
  br label %34

34:                                               ; preds = %147, %33
  br label %35

35:                                               ; preds = %34
  call void @_Z8dijkstrav()
  %36 = load i32, ptr @t, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = icmp eq i64 %39, 1000000000000000
  br i1 %40, label %41, label %43

41:                                               ; preds = %35
  %42 = load i64, ptr %4, align 8, !tbaa !9
  store i64 %42, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %150

43:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %44 = load i32, ptr @s, align 4, !tbaa !5
  store i32 %44, ptr %7, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %65, %43
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = load i32, ptr @t, align 4, !tbaa !5
  %48 = icmp sle i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i32 7, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %68

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1050 x i64], ptr @phi, i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !9
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !9
  %59 = add nsw i64 %54, %58
  store i64 %59, ptr %8, align 8, !tbaa !9
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) @_ZL3INF)
  %61 = load i64, ptr %60, align 8, !tbaa !9
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1050 x i64], ptr @phi, i64 0, i64 %63
  store i64 %61, ptr %64, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %65

65:                                               ; preds = %50
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %7, align 4, !tbaa !5
  br label %45, !llvm.loop !13

68:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %69 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %69, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %70 = load i32, ptr @t, align 4, !tbaa !5
  store i32 %70, ptr %10, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %75, %68
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = load i32, ptr @s, align 4, !tbaa !5
  %74 = icmp ne i32 %72, %73
  br i1 %74, label %75, label %92

75:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %80) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %81, i64 24, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %82 = getelementptr inbounds %struct.edge, ptr %11, i32 0, i32 0
  %83 = load i32, ptr %82, align 8, !tbaa !15
  store i32 %83, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %84 = getelementptr inbounds %struct.edge, ptr %11, i32 0, i32 3
  %85 = load i32, ptr %84, align 4, !tbaa !17
  %86 = getelementptr inbounds %struct.edge, ptr %11, i32 0, i32 2
  %87 = load i32, ptr %86, align 8, !tbaa !18
  %88 = sub nsw i32 %85, %87
  store i32 %88, ptr %13, align 4, !tbaa !5
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %90 = load i32, ptr %89, align 4, !tbaa !5
  store i32 %90, ptr %9, align 4, !tbaa !5
  %91 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %91, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  br label %71, !llvm.loop !19

92:                                               ; preds = %71
  %93 = load i32, ptr %9, align 4, !tbaa !5
  %94 = load i32, ptr %3, align 4, !tbaa !5
  %95 = sub nsw i32 %94, %93
  store i32 %95, ptr %3, align 4, !tbaa !5
  %96 = load i32, ptr @t, align 4, !tbaa !5
  store i32 %96, ptr %10, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %101, %92
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = load i32, ptr @s, align 4, !tbaa !5
  %100 = icmp ne i32 %98, %99
  br i1 %100, label %101, label %140

101:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %106) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %107, i64 24, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %108 = getelementptr inbounds %struct.edge, ptr %14, i32 0, i32 0
  %109 = load i32, ptr %108, align 8, !tbaa !15
  store i32 %109, ptr %15, align 4, !tbaa !5
  %110 = load i32, ptr %9, align 4, !tbaa !5
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %115) #5
  %117 = getelementptr inbounds %struct.edge, ptr %116, i32 0, i32 2
  %118 = load i32, ptr %117, align 8, !tbaa !18
  %119 = add nsw i32 %118, %110
  store i32 %119, ptr %117, align 8, !tbaa !18
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = xor i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %126) #5
  %128 = getelementptr inbounds %struct.edge, ptr %127, i32 0, i32 2
  %129 = load i32, ptr %128, align 8, !tbaa !18
  %130 = sub nsw i32 %129, %120
  store i32 %130, ptr %128, align 8, !tbaa !18
  %131 = load i32, ptr %9, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = mul nsw i64 1, %132
  %134 = getelementptr inbounds %struct.edge, ptr %14, i32 0, i32 4
  %135 = load i64, ptr %134, align 8, !tbaa !20
  %136 = mul nsw i64 %133, %135
  %137 = load i64, ptr %4, align 8, !tbaa !9
  %138 = add nsw i64 %137, %136
  store i64 %138, ptr %4, align 8, !tbaa !9
  %139 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %139, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  br label %97, !llvm.loop !21

140:                                              ; preds = %97
  %141 = load i32, ptr %3, align 4, !tbaa !5
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %140
  store i32 6, ptr %6, align 4
  br label %145

144:                                              ; preds = %140
  store i32 0, ptr %6, align 4
  br label %145

145:                                              ; preds = %144, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %146 = load i32, ptr %6, align 4
  switch i32 %146, label %152 [
    i32 0, label %147
    i32 6, label %148
  ]

147:                                              ; preds = %145
  br label %34, !llvm.loop !22

148:                                              ; preds = %145
  %149 = load i64, ptr %4, align 8, !tbaa !9
  store i64 %149, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %150

150:                                              ; preds = %148, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %151 = load i64, ptr %2, align 8
  ret i64 %151

152:                                              ; preds = %145
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

%"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 }

@e = external dso_local global %"class.std::vector", align 8
@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
@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
@_ZL3INF = external hidden constant i64, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z11fordBellmanv() local_unnamed_addr #0

; 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 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
declare dso_local void @_Z8dijkstrav() local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_Z7minCosti(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  tail call void @_Z11fordBellmanv()
  %5 = load i32, ptr @s, align 4, !tbaa !5
  %6 = load i32, ptr @t, align 4, !tbaa !5
  %.not39 = icmp sgt i32 %5, %6
  br i1 %.not39, label %.preheader.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %1
  %7 = sext i32 %5 to i64
  %8 = shl nsw i64 %7, 3
  %scevgep = getelementptr i8, ptr @phi, i64 %8
  %scevgep58 = getelementptr i8, ptr @dist, i64 %8
  %9 = sub i32 %6, %5
  %10 = zext i32 %9 to i64
  %11 = shl nuw nsw i64 %10, 3
  %12 = add nuw nsw i64 %11, 8
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %scevgep, ptr noundef nonnull align 8 dereferenceable(1) %scevgep58, i64 %12, i1 false), !tbaa !9
  br label %.preheader.preheader

.preheader.preheader:                             ; preds = %.lr.ph.preheader, %1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge54
  %.030 = phi i64 [ %.1.lcssa, %._crit_edge54 ], [ 0, %.preheader.preheader ]
  %.029 = phi i32 [ %40, %._crit_edge54 ], [ %0, %.preheader.preheader ]
  call void @_Z8dijkstrav()
  %13 = load i32, ptr @t, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %14
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = icmp eq i64 %16, 1000000000000000
  br i1 %17, label %.loopexit, label %18

18:                                               ; preds = %.preheader
  %19 = load i32, ptr @s, align 4, !tbaa !5
  %.not3641 = icmp sgt i32 %19, %13
  br i1 %.not3641, label %._crit_edge, label %.lr.ph43.preheader

.lr.ph43.preheader:                               ; preds = %18
  %20 = sext i32 %19 to i64
  br label %.lr.ph43

._crit_edge.loopexit:                             ; preds = %.lr.ph43
  %.pre = load i32, ptr @s, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %18
  %21 = phi i32 [ %19, %18 ], [ %.pre, %._crit_edge.loopexit ]
  %.lcssa = phi i32 [ %13, %18 ], [ %29, %._crit_edge.loopexit ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 %.029, ptr %3, align 4, !tbaa !5
  %.not3744 = icmp eq i32 %.lcssa, %21
  br i1 %.not3744, label %._crit_edge54.thread, label %.lr.ph47

._crit_edge54.thread:                             ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %.loopexit

.lr.ph43:                                         ; preds = %.lr.ph43.preheader, %.lr.ph43
  %indvars.iv = phi i64 [ %20, %.lr.ph43.preheader ], [ %indvars.iv.next, %.lr.ph43 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %22 = getelementptr inbounds [1050 x i64], ptr @phi, i64 0, i64 %indvars.iv
  %23 = load i64, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds [1050 x i64], ptr @dist, i64 0, i64 %indvars.iv
  %25 = load i64, ptr %24, align 8, !tbaa !9
  %26 = add nsw i64 %25, %23
  store i64 %26, ptr %2, align 8, !tbaa !9
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) @_ZL3INF)
  %28 = load i64, ptr %27, align 8, !tbaa !9
  store i64 %28, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %29 = load i32, ptr @t, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %.not36.not = icmp slt i64 %indvars.iv, %30
  br i1 %.not36.not, label %.lr.ph43, label %._crit_edge.loopexit, !llvm.loop !11

.lr.ph47:                                         ; preds = %._crit_edge, %.lr.ph47
  %.03445 = phi i32 [ %.sroa.03.0.copyload, %.lr.ph47 ], [ %.lcssa, %._crit_edge ]
  %31 = sext i32 %.03445 to i64
  %32 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %34) #4
  %.sroa.03.0.copyload = load i32, ptr %35, align 8, !tbaa !5
  %.sroa.45.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 8
  %.sroa.45.0.copyload = load i32, ptr %.sroa.45.0..sroa_idx, align 8, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 12
  %.sroa.5.0.copyload = load i32, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %36 = sub nsw i32 %.sroa.5.0.copyload, %.sroa.45.0.copyload
  store i32 %36, ptr %4, align 4, !tbaa !5
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %38 = load i32, ptr %37, align 4, !tbaa !5
  store i32 %38, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %39 = load i32, ptr @s, align 4, !tbaa !5
  %.not37 = icmp eq i32 %.sroa.03.0.copyload, %39
  br i1 %.not37, label %._crit_edge48, label %.lr.ph47, !llvm.loop !13

._crit_edge48:                                    ; preds = %.lr.ph47
  %.pre61 = load i32, ptr @t, align 4, !tbaa !5
  %40 = sub nsw i32 %.029, %38
  %.not3849 = icmp eq i32 %.pre61, %.sroa.03.0.copyload
  br i1 %.not3849, label %._crit_edge54, label %.lr.ph53

.lr.ph53:                                         ; preds = %._crit_edge48, %.lr.ph53
  %.151 = phi i64 [ %64, %.lr.ph53 ], [ %.030, %._crit_edge48 ]
  %.13550 = phi i32 [ %.sroa.0.0.copyload, %.lr.ph53 ], [ %.pre61, %._crit_edge48 ]
  %41 = sext i32 %.13550 to i64
  %42 = getelementptr inbounds [1050 x i32], ptr @par, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %44) #4
  %.sroa.0.0.copyload = load i32, ptr %45, align 8, !tbaa !5
  %.sroa.41.0..sroa_idx = getelementptr inbounds i8, ptr %45, i64 16
  %.sroa.41.0.copyload = load i64, ptr %.sroa.41.0..sroa_idx, align 8, !tbaa !9
  %46 = load i32, ptr %3, align 4, !tbaa !5
  %47 = load i32, ptr %42, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %48) #4
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  %51 = load i32, ptr %50, align 8, !tbaa !14
  %52 = add nsw i32 %51, %46
  store i32 %52, ptr %50, align 8, !tbaa !14
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = load i32, ptr %42, align 4, !tbaa !5
  %55 = xor i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorI4edgeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @e, i64 noundef %56) #4
  %58 = getelementptr inbounds i8, ptr %57, i64 8
  %59 = load i32, ptr %58, align 8, !tbaa !14
  %60 = sub nsw i32 %59, %53
  store i32 %60, ptr %58, align 8, !tbaa !14
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = mul nsw i64 %.sroa.41.0.copyload, %62
  %64 = add nsw i64 %63, %.151
  %65 = load i32, ptr @s, align 4, !tbaa !5
  %.not38 = icmp eq i32 %.sroa.0.0.copyload, %65
  br i1 %.not38, label %._crit_edge54, label %.lr.ph53, !llvm.loop !16

._crit_edge54:                                    ; preds = %.lr.ph53, %._crit_edge48
  %.1.lcssa = phi i64 [ %.030, %._crit_edge48 ], [ %64, %.lr.ph53 ]
  %66 = icmp eq i32 %40, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br i1 %66, label %.loopexit, label %.preheader

.loopexit:                                        ; preds = %._crit_edge54, %.preheader, %._crit_edge54.thread
  %.0 = phi i64 [ %.030, %._crit_edge54.thread ], [ %.1.lcssa, %._crit_edge54 ], [ %.030, %.preheader ]
  ret i64 %.0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !6, i64 8}
!15 = !{!"_ZTS4edge", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !10, i64 16}
!16 = distinct !{!16, !12}


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